//	Album List for Winamp
//	Copyright (C) 1999-2001 Safai Ma
//
//	This program is free software; you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation; either version 2 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program; if not, write to the Free Software
//	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef __WINAMPALBUMLIST_H__
#define __WINAMPALBUMLIST_H__

#include "albumlist.h"
#include <shellapi.h>
#include "Pages.h"

// SnapTo
#define CORNER_SNAP_LEN			4

// Winamp.exe (2.50e) cursor IDs
#define WINAMP_CURSOR_MOVE		205
#define WINAMP_CURSOR_SIZE_H	206
#define WINAMP_CURSOR_CLOSE		207
#define WINAMP_CURSOR_ARROW		208
#define WINAMP_CURSOR_SIZE_V	209
#define WINAMP_CURSOR_RESIZE	210

// Docking macros
#define GETDOCKTOP(a)		(HIBYTE(HIWORD(a)))
#define GETDOCKLEFT(a)		(LOBYTE(HIWORD(a)))
#define GETDOCKBOTTOM(a)	(HIBYTE(LOWORD(a)))
#define GETDOCKRIGHT(a)		(LOBYTE(LOWORD(a)))

#define SETDOCKTOP(a,b)		((a&0x00FFFFFF)|(b<<24))
#define SETDOCKLEFT(a,b)	((a&0xFF00FFFF)|(b<<16))
#define SETDOCKBOTTOM(a,b)	((a&0xFFFF00FF)|(b<<8))
#define SETDOCKRIGHT(a,b)	((a&0xFFFFFF00)|b)

#define PANEL_AL	0		// Album List
#define PANEL_PE	1		// Playlist Editor
#define PANEL_EQ	2		// Equalizer
#define PANEL_MB	3		// Minibrowser
#define PANEL_MN	4		// Main Window

///////////////////////////////////////////////////

typedef struct _TAGLANGINFO
{
	char filename[MAX_PATH];	// filename of the language file
	char pathname[MAX_PATH];	// full path of the language file
	char language[MAX_PATH];	// language name

}	LANGINFO, *LPLANGINFO;

//////////////////////////////////////////////////////////////////
// CPictureArray class

typedef struct _TAGPICTUREINFO
{
	char file[MAX_PATH*2];		// full path of the track
	int  nType;					// type of file, 0 - back, 

}	PICTUREINFO, *LPPICTUREINFO;

class CPictureArray : public CPtrArray
{
public:
	CPictureArray();
	virtual ~CPictureArray();

public:
	int Add(LPPICTUREINFO pPicInfo);

	LPPICTUREINFO operator[](int nIndex);

	void Sort();
	static int Compare(const void *elem1, const void *elem2);
};

///////////////////////////////////////////////////

class CWinampUIFunction
{
public:
	CWinampUIFunction()
	{
		m_bClicked = FALSE;
		m_bIsActive = FALSE;
	}

	virtual ~CWinampUIFunction()
	{
	}

	void Init(int left, int top, int right, int bottom)
	{
		SetRect(&m_rcArea, left, top, right, bottom);
	}

	BOOL PtInFunction(POINT point, LPRECT lpRect)
	{
		RECT rcTemp;

		rcTemp.left   = ((m_rcArea.left   >= 0) ? lpRect->left : lpRect->right)  + m_rcArea.left;
		rcTemp.top    = ((m_rcArea.top    >= 0) ? lpRect->top  : lpRect->bottom) + m_rcArea.top;
		rcTemp.right  = ((m_rcArea.right  >= 0) ? lpRect->left : lpRect->right)  + m_rcArea.right;
		rcTemp.bottom = ((m_rcArea.bottom >= 0) ? lpRect->top  : lpRect->bottom) + m_rcArea.bottom;

		BOOL bRet = PtInRect(&rcTemp, point);

		m_bIsActive = (bRet && m_bClicked);

		return bRet;
	}

	void Clicked(POINT point)
	{
		m_ptDown = point;
		m_bClicked = TRUE;
		m_bIsActive = TRUE;
	}

	void Release()
	{
		m_bClicked = FALSE;
		m_bIsActive = FALSE;
	}

	BOOL IsClicked()
	{
		return m_bClicked;
	}

	BOOL IsActive()
	{
		return m_bIsActive;
	}

	void Draw(LPRECT lpRect)
	{
	}

public:
	POINT	m_ptDown;

protected:
	RECT	m_rcArea;
	BOOL	m_bClicked;
	BOOL	m_bIsActive;
};

///////////////////////////////////////////////////

class CWinampUIAlbumList : public CWinampUIFunction
{
public:
	CWinampUIAlbumList() : CWinampUIFunction()
	{
	};
	virtual ~CWinampUIAlbumList() {};

	int GetIndex(POINT point, LPRECT lpRect, int nTextHeight)
	{
		RECT rcTemp;

		rcTemp.left   = ((m_rcArea.left   >= 0) ? lpRect->left : lpRect->right)  + m_rcArea.left;
		rcTemp.top    = ((m_rcArea.top    >= 0) ? lpRect->top  : lpRect->bottom) + m_rcArea.top;
		rcTemp.right  = ((m_rcArea.right  >= 0) ? lpRect->left : lpRect->right)  + m_rcArea.right;
		rcTemp.bottom = ((m_rcArea.bottom >= 0) ? lpRect->top  : lpRect->bottom) + m_rcArea.bottom;

		int nNumSel = (rcTemp.bottom - rcTemp.top) / nTextHeight;
		int nCurSel = (point.y - rcTemp.top) / nTextHeight;

		if (nCurSel >= nNumSel) return -1;

		return nCurSel;
	}
};

///////////////////////////////////////////////////

class CWinampUISlider : public CWinampUIFunction
{
public:
	CWinampUISlider() : CWinampUIFunction()
	{
		m_nSliderValue = 0;
		m_nSliderSteps = 0;
	};
	virtual ~CWinampUISlider() {};

	void Init2(int left, int top, int right, int bottom)
	{
		SetRect(&m_rcHit, left, top, right, bottom);
	}

	int GetValue()
	{
		return m_nSliderValue;
	}

	int GetSteps()
	{
		return m_nSliderSteps;
	}

	void SetValue(int nValue)
	{
		m_nSliderValue = nValue;
	}

	void SetSteps(int nSteps)
	{
		m_nSliderSteps = nSteps;
	}

	BOOL PtInFunction(POINT point, LPRECT lpRect)
	{
		RECT rcTemp, rcTemp2;

		rcTemp.left   = ((m_rcArea.left   >= 0) ? lpRect->left : lpRect->right)  + m_rcArea.left;
		rcTemp.top    = ((m_rcArea.top    >= 0) ? lpRect->top  : lpRect->bottom) + m_rcArea.top;
		rcTemp.right  = ((m_rcArea.right  >= 0) ? lpRect->left : lpRect->right)  + m_rcArea.right;
		rcTemp.bottom = ((m_rcArea.bottom >= 0) ? lpRect->top  : lpRect->bottom) + m_rcArea.bottom;

		rcTemp2.left   = ((m_rcHit.left   >= 0) ? lpRect->left : lpRect->right)  + m_rcHit.left;
		rcTemp2.top    = ((m_rcHit.top    >= 0) ? lpRect->top  : lpRect->bottom) + m_rcHit.top;
		rcTemp2.right  = ((m_rcHit.right  >= 0) ? lpRect->left : lpRect->right)  + m_rcHit.right;
		rcTemp2.bottom = ((m_rcHit.bottom >= 0) ? lpRect->top  : lpRect->bottom) + m_rcHit.bottom;

		int nHeight = rcTemp.bottom - rcTemp.top;
		int nRange = rcTemp2.bottom - rcTemp2.top - nHeight;
		if (m_nSliderSteps != 0) rcTemp.top += (m_nSliderValue * nRange) / m_nSliderSteps;
		rcTemp.bottom = rcTemp.top + nHeight;

		BOOL bRet = PtInRect(&rcTemp, point);

		m_bIsActive = (bRet && m_bClicked);

		return bRet;
	}

	BOOL PtInHitRegion(POINT point, LPRECT lpRect)
	{
		RECT rcTemp;

		rcTemp.left   = ((m_rcHit.left   >= 0) ? lpRect->left : lpRect->right)  + m_rcHit.left;
		rcTemp.top    = ((m_rcHit.top    >= 0) ? lpRect->top  : lpRect->bottom) + m_rcHit.top;
		rcTemp.right  = ((m_rcHit.right  >= 0) ? lpRect->left : lpRect->right)  + m_rcHit.right;
		rcTemp.bottom = ((m_rcHit.bottom >= 0) ? lpRect->top  : lpRect->bottom) + m_rcHit.bottom;

		BOOL bRet = PtInRect(&rcTemp, point);

		m_bIsActive = (bRet && m_bClicked);

		return bRet;
	}

	void UpdateArea(int X, int Y)
	{
		int dx = X - m_rcArea.left;
		int dy = Y - m_rcArea.top;

		OffsetRect(&m_rcArea, dx, dy);
	}

protected:
	int	m_nSliderValue;
	int	m_nSliderSteps;
	RECT m_rcHit;
};

///////////////////////////////////////////////////

class CWinampAlbumList;
class CWinampUI
{
public:
	CWinampUI()
	{
		m_pWinampAL = NULL;
		m_pAlbumList = NULL;
		m_hBmp = m_hBmpText = NULL;
		m_hWnd = NULL;
		m_hWinamp = m_hWinampPE = m_hWinampMB = m_hWinampEQ = NULL;
		m_hCursorMove = m_hCursorSizeH = m_hCursorClose = m_hCursorArrow = m_hCursorSizeV = m_hCursorResize = m_hCursorStyle = NULL;
	}

	virtual ~CWinampUI()
	{
		if (m_hBmp) DeleteObject(m_hBmp);
	}

	void Init(CWinampAlbumList *pWinampAL, HWND hWnd, HBITMAP hBitmap, HBITMAP hBitmapText);
	void InitCursors(HCURSOR hMove, HCURSOR	hSizeH, HCURSOR	hClose, HCURSOR	hArrow, HCURSOR	hSizeV, HCURSOR	hResize, HCURSOR hStyle);

	virtual void Refresh()
	{
		m_nCurrentSelection = -1;
	}

	virtual void RefreshFont();

	int DrawTextUnicode(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat);

public:	// functions
	virtual void ChooseCursor	(POINT point);
	virtual void DrawInterface	(HDC hDC = NULL) = 0;
	virtual BOOL LButtonDown	(UINT nFlags, POINT point);
	virtual BOOL LButtonUp		(UINT nFlags, POINT point);
	virtual BOOL LButtonDblClk	(UINT nFlags, POINT point);
	virtual BOOL RButtonUp		(UINT nFlags, POINT point);
	virtual BOOL MouseMove		(UINT nFlags, POINT point);
	virtual void MouseWheel		(WORD fwKeys, short zDelta, POINT point);
	virtual void HScroll		(int nScrollCode, short int nPos, HWND hwndScrollBar);
	virtual BOOL ContextMenu	(HWND hWnd, POINT point);
	virtual void NextAlbum		();
	virtual void PrevAlbum		();
	virtual void WinshadeMode	(BOOL bOn);
	virtual void SelectAlbum	(int nIndex = -1);
	virtual void EnqueueAlbum	(int nIndex = -1);
	virtual void EndAlbum		();
	virtual void HomeAlbum		();
	virtual void PageUpAlbum	();
	virtual void PageDownAlbum	();
	virtual void PlayNextAlbum	();
	virtual void PlayNextArtist	();
	virtual void PlayPrevAlbum	();
	virtual void PlayPrevArtist	();
	virtual void ExportList		();
	virtual void MoveUp			();
	virtual void MoveDown		();
	virtual void Sort			();
	virtual void Close			()
	{
		PostMessage(m_hWinamp, WM_CLOSE, 0, 0);
	}
	virtual void NextWindow		(int nPanel);
	virtual void PlayAllAlbums	();
	virtual void ShowAlbumInMiniBrowser(int index);

	virtual void MakeSelectionVisible()
	{
	}

	virtual void UpdateTimeDisplay()
	{
	}

protected:
	virtual BOOL SnapDesktop	(POINT point, LPRECT lprcWnd);
	virtual BOOL SnapWindow		(HWND hwndTarget, LPRECT lprcWnd);

	void AddEndEllipsis			(HDC hdc, WCHAR *str, int width);
	void TextOutUnicode			(HDC hdc, RECT *lprc, int cp, char *szAlbum, char *szTime, char *szTimeFormat);
	void DrawBitmapFont			(HDC hdc, RECT rcTemp, const char *str, BOOL bLeftAligned = TRUE, BOOL bFill = FALSE);
	void FixTitles				(char *str);

protected:
	CWinampAlbumList   *m_pWinampAL;
	CAlbumList		   *m_pAlbumList;
	HBITMAP				m_hBmp;
	HBITMAP				m_hBmpText;
	HCURSOR				m_hCursorMove;
	HCURSOR				m_hCursorSizeH;
	HCURSOR				m_hCursorClose;
	HCURSOR				m_hCursorArrow;
	HCURSOR				m_hCursorSizeV;
	HCURSOR				m_hCursorResize;
	HCURSOR				m_hCursorStyle;
	HFONT				m_hFont;
	HFONT				m_hFontPE;

public:
	static int			m_nCurrentSelection;
	static int			m_nTextHeight;

public:
	HWND				m_hWnd;
	HWND				m_hWinamp;
	HWND				m_hWinampPE;
	HWND				m_hWinampMB;
	HWND				m_hWinampEQ;

private:
//	CPtrArray			m_WAWindows;

protected:
	CWinampUIFunction m_wafClose;
	CWinampUIFunction m_wafWinshade;
	CWinampUIFunction m_wafDrag;
};

///////////////////////////////////////////////////

class CWinampNormal : public CWinampUI
{
public:
	CWinampNormal()
	{
		m_wafClose.Init(-10, 3, -3, 10);
		m_wafWinshade.Init(-20, 3, -13, 10);
		m_wafResize.Init(-20, -20, -1, -1);
		m_wafAlbumList.Init(12, 22, -24, -38);
		m_wafSlider.Init(-16, 20, -8, 37);
		m_wafSlider.Init2(-16, 20, -8, -38);
		m_wafDrag.Init(0, 0, -20, 14);
		m_wafPrevTrack.Init(-145, -15, -139, -9);
		m_wafPlay.Init(-136, -15, -128, -9);
		m_wafPause.Init(-126, -15, -118, -9);
		m_wafStop.Init(-116, -15, -109, -9);
		m_wafNextTrack.Init(-107, -15, -101, -9);
		m_wafLoadFile.Init(-98, -15, -91, -9);
		m_wafScrollUp.Init(-15, -36, -7, -32);
		m_wafScrollDown.Init(-15, -30, -7, -26);

		m_zWheelDelta = 0;
		m_hFont = NULL;
		m_nLastSelection = -1;
	}

	virtual ~CWinampNormal()
	{
		if (m_hFont) DeleteObject(m_hFont);
	}

	virtual void Refresh()
	{
		m_wafSlider.SetSteps(0);
		m_wafSlider.SetValue(0);
		CWinampUI::Refresh();
	}

public:
	virtual void ChooseCursor	(POINT point);
	virtual void DrawInterface	(HDC hDC = NULL);
	virtual BOOL LButtonDown	(UINT nFlags, POINT point);
	virtual BOOL LButtonUp		(UINT nFlags, POINT point);
	virtual BOOL LButtonDblClk	(UINT nFlags, POINT point);
	virtual BOOL RButtonUp		(UINT nFlags, POINT point);
	virtual BOOL MouseMove		(UINT nFlags, POINT point);
	virtual void MouseWheel		(WORD fwKeys, short zDelta, POINT point);
	virtual BOOL ContextMenu	(HWND hWnd, POINT point);
	virtual void SelectAlbum	(int nIndex = -1);
	virtual void EnqueueAlbum	(int nIndex = -1);
	virtual void EndAlbum		();
	virtual void HomeAlbum		();
	virtual void NextAlbum		();
	virtual void PrevAlbum		();
	virtual void PageUpAlbum	();
	virtual void PageDownAlbum	();
	virtual void PlayNextAlbum	();
	virtual void PlayNextArtist	();
	virtual void PlayPrevAlbum	();
	virtual void PlayPrevArtist	();
	virtual void MoveUp			();
	virtual void MoveDown		();
	virtual void MakeSelectionVisible();
	virtual void UpdateTimeDisplay();

private:
	void RefreshAlbum			();

	void SetSelection			(int nSel);
	void SetSelectionRange		(int nSel1, int nSel2);
	void ToggleSelection		(int nSel);
	void ClearSelection			();
	BOOL IsSelection			(int nSel);

private:
	CWinampUIFunction	m_wafResize;
	CWinampUIAlbumList	m_wafAlbumList;
	CWinampUISlider		m_wafSlider;
	CWinampUIFunction	m_wafPrevTrack;
	CWinampUIFunction	m_wafPlay;
	CWinampUIFunction	m_wafPause;
	CWinampUIFunction	m_wafStop;
	CWinampUIFunction	m_wafNextTrack;
	CWinampUIFunction	m_wafLoadFile;
	CWinampUIFunction	m_wafScrollUp;
	CWinampUIFunction	m_wafScrollDown;

	short				m_zWheelDelta;

	CDWordArray			m_SelectionSet;
	int					m_nLastSelection;
};

///////////////////////////////////////////////////

class CWinampWinshade : public CWinampUI
{
public:
	CWinampWinshade()
	{
		m_wafClose.Init(-10, 3, -3, 10);
		m_wafWinshade.Init(-20, 3, -13, 10);
		m_wafResize.Init(-30, 3, -23, 10);
		m_wafDrag.Init(0, 0, -30, 14);

		m_zWheelDelta = 0;
	}

	virtual ~CWinampWinshade()	{}

public:
	virtual void ChooseCursor	(POINT point);
	virtual void DrawInterface	(HDC hDC = NULL);
	virtual BOOL LButtonDown	(UINT nFlags, POINT point);
	virtual BOOL LButtonUp		(UINT nFlags, POINT point);
	virtual BOOL LButtonDblClk	(UINT nFlags, POINT point);
	virtual BOOL MouseMove		(UINT nFlags, POINT point);
	virtual void MouseWheel		(WORD fwKeys, short zDelta, POINT point);

private:
	CWinampUIFunction	m_wafResize;

	short				m_zWheelDelta;
};

///////////////////////////////////////////////////

class CWinampAlbumList
{
	friend class CWinampUI;
	friend DWORD WINAPI TimeThreadProc(LPVOID lpParameter);

	// Jump To Album dialog friends
	friend void OnInitDialogJumpToAlbum(HWND hwndDlg);
	friend void OnChangeSearchText(HWND hwndDlg);
	friend void OnDblClkAlbumList(HWND hwndDlg);

public:
	CWinampAlbumList();
	virtual ~CWinampAlbumList();

	BOOL Create(HWND hwndParent);
	BOOL IsWindowVisible() { return ::IsWindowVisible(m_hWnd); }
	void ShowWindow(int nCmdShow);
	HWND GetSafeHwnd() { return m_hWnd; }
	void Config();
	void Shutdown();

	void InitDocking(int nPanel);
	BOOL IsDocked();
	void MoveDocking(int nPanel);
	void Redraw() { DrawInterface(); }
	void RefreshSkin();
	void RefreshFont();
	void Resort() { m_pWinampUI->Sort(); }
	void RefreshAlbums(BOOL bQuick = FALSE);
	void ShuffleAlbums() { m_AlbumList.ShuffleAlbums(); }
	void KeepOnScreen();
	void NextWindow(int nPanel);
	void WriteAlbumList() { m_AlbumList.WriteAlbumList(); }
	BOOL ReadAlbumList() { return m_AlbumList.ReadAlbumList(); }
	void SelectAlbum(int nIndex)
	{
		m_pWinampUI->SelectAlbum(nIndex);
		m_pWinampUI->MakeSelectionVisible();
	}
	void EnqueueAlbum(int nIndex)
	{
		m_pWinampUI->EnqueueAlbum(nIndex);
		m_pWinampUI->MakeSelectionVisible();
	}

	LPALBUMINFO GetCurrentAlbum() { return m_AlbumList.GetAlbum(m_pWinampUI->m_nCurrentSelection); }

	int DrawTextUnicode(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat)
	{
		if (m_pWinampUI)
			return m_pWinampUI->DrawTextUnicode(hDC, lpString, nCount, lpRect, uFormat);
		else
			return 0;
	}

	operator HWND() const
	{
		return m_hWnd;
	}

	// alpha blending parameters
	HBITMAP			m_hBmpBackground;
	int				m_nCurrentTime;
	BOOL			m_bUsePLBitmap;

	CPtrArray		m_LangArray;

public:
	static LRESULT CALLBACK DefWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

private:
	HWND			m_hWnd;
	HBITMAP			m_hBmp;
	HBITMAP			m_hBmpText;
	HCURSOR			m_hCursorMove;
	HCURSOR			m_hCursorSizeH;
	HCURSOR			m_hCursorClose;
	HCURSOR			m_hCursorArrow;
	HCURSOR			m_hCursorSizeV;
	HCURSOR			m_hCursorResize;
	HCURSOR			m_hCursorStyle;
	HACCEL			m_hAccTable;
	HACCEL			m_hAccTableMain;

	BOOL			m_bMinimized;

	CAlbumList		m_AlbumList;

	// mouse wheel
	UINT			m_msgMouseWheel;

	// user interface 
	CWinampNormal	m_waNormal;
	CWinampWinshade m_waWinshade;
	CWinampUI	   *m_pWinampUI;

	// setup pages
	CTreePropertySheet m_TreePS;

	CSearchPathPage	m_SearchPathPage;
	COptionsPage	m_OptionsPage;
	CAlbumNamingPage	m_AlbumNamingPage;
	CSkinsPage		m_SkinsPage;
	CAboutPage		m_AboutPage;
	CReadmePage		m_ReadmePage;

	// docking
	BOOL			m_bConnected;
	DWORD			m_dwDocked[5];
	HWND			m_hWndDock[5];
	BOOL			m_bChecking[5];
	int				m_nDockingOffsetX[5];
	int				m_nDockingOffsetY[5];

private:	// window messages
	void OnClose();
	void OnPaint();
	void OnLButtonDown	(UINT nFlags, POINT point);
	void OnLButtonUp	(UINT nFlags, POINT point);
	void OnLButtonDblClk(UINT nFlags, POINT point);
	void OnRButtonUp	(UINT nFlags, POINT point);
	void OnMouseMove	(UINT nFlags, POINT point);
	BOOL OnEraseBkgnd	(HDC hDC);
	void OnSize			(UINT nType, int cx, int cy);
	void OnDestroy		();
	void OnSetFocus		(HWND hWnd);
	void OnKillFocus	(HWND hWnd);
	BOOL OnDeviceChange	(UINT nEventType, DWORD dwData);
	void OnContextMenu	(HWND hWnd, POINT point);
	void OnMouseWheel	(WORD fwKeys, short zDelta, POINT point);
	void OnAccelerator	(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	BOOL OnCommand		(WPARAM wParam, LPARAM lParam);
	void OnWindowPosChanging	(LPWINDOWPOS lpwp);
	void OnDropFiles	(HDROP hDropInfo);
	LRESULT OnFrontEnd	(WPARAM wParam, LPARAM lParam);
	void OnHScroll		(int nScrollCode, short int nPos, HWND hwndScrollBar);
	BOOL OnEndSession	(BOOL fEndSession);
	void OnShowWindow	(BOOL bShow, UINT nStatus);

private:	// support functions
	void ChooseCursor	(POINT point);
	void DrawInterface	(HDC hDC = NULL);
	void InitPanel		(int nWnd);
	BOOL IsConnected	(int nStart, int nEnd);
	BOOL IsConnected2	(int nStart, int nEnd);
	void MoveOtherPanels(int xOffset, int yOffset);
	void GetTranslations();

	// IPC functions
	DWORD IPC_GetVersion	();
	BOOL IPC_PlayAlbum		(DWORD index);
	BOOL IPC_EnqueueAlbum	(DWORD index);
	DWORD IPC_GetAlbumSize	();
	BOOL IPC_PlayRandomAlbum();
	BOOL IPC_PlayPreviousAlbum();
	BOOL IPC_PlayNextAlbum	();
	BOOL IPC_PlayAllAlbums	();
	char *IPC_GetAlbumName	(DWORD index);
	int IPC_GetAlbumIndex	();
	int IPC_GetAlbumYear	(DWORD index);
	char *IPC_GetAlbumTitle	(DWORD index);
	char *IPC_GetAlbumArtist(DWORD index);

protected:	// CWnd functions (helpers)
	void GetWindowRect	(LPRECT lpRect) { ::GetWindowRect(m_hWnd, lpRect); }
	void GetClientRect	(LPRECT lpRect) { ::GetClientRect(m_hWnd, lpRect); }
	BOOL SetWindowPos	(HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) { return ::SetWindowPos(m_hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags); }
};

#endif /* __WINAMPALBUMLIST_H__ */
