
/*	Copyright (C) G. Jespersen
	See Licence.txt.*/

#if !defined(AFX_CONTROLSBAR_H__FC5CBE09_3D5E_42A0_91D0_12596F4F9348__INCLUDED_)
#define AFX_CONTROLSBAR_H__FC5CBE09_3D5E_42A0_91D0_12596F4F9348__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// ControlsBar.h : header file

#include "resource.h"	// 7/22 for IDD = IDD_CONTROLS_BAR below - unknown why

// Foreward
class CPlayer;				// 7/22 for GetPlayer

/////////////////////////////////////////////////////////////////////////////
// CControlsBar dialog

class CControlsBar : public CDialogBar
{
// Construction
public:
	CControlsBar();   // standard constructor
	~CControlsBar();
	BOOL Create( CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle,
				 UINT nID);
	virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode);

// Dialog Data
	//{{AFX_DATA(CControlsBar)
	enum { IDD = IDD_CONTROLS_BAR };
	CStatic		m_ctrlStaticVol;
	CStatic		m_ctrlStaticTime;
	CSliderCtrl	m_ctrlVol;
	CSliderCtrl	m_ctrlVid;
	CButton		m_ctrlStop;
	CButton		m_ctrlPause;
	CButton		m_ctrlMute;
	CButton		m_ctrlLeftPane;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CControlsBar)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CControlsBar)
	afx_msg void OnMute();
	afx_msg void OnPlayPause();
	afx_msg void OnStop();
	afx_msg void OnReleasedcaptureSliderVid(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnReleasedcaptureSliderVol(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnHideLeftPane();
	//}}AFX_MSG
	afx_msg LONG OnInitDialog(UINT, LONG);					// 8/22-7 moved up - ok no change
	DECLARE_MESSAGE_MAP()

	//public:	// public for direct calls
	//LONG OnInitDialog(UINT, LONG);							// new

	// Notifications from View.
	LRESULT OnVidStart(WPARAM wParam, LPARAM lParam);		// WM_USER_BAR_START
	LRESULT OnVidStopped(WPARAM wParam, LPARAM lParam);		// WM_USER_BAR_STOP
	LRESULT OnVidPause(WPARAM wParam, LPARAM lParam);		// WM_USER_BAR_PAUSE
	LRESULT OnVidTimeChange(WPARAM wParam, LPARAM lParam);	// WM_USER_BAR_TIME
	LRESULT OnVidVolChange(WPARAM wParam, LPARAM lParam);	// WM_USER_BAR_VOL
	LRESULT OnVidMute(WPARAM wParam, LPARAM lParam);			// WM_USER_BAR_MUTE

	// Update handlers needed for MFC hook up.
	void OnUpdatePlayPause(CCmdUI* pCmdUI); 
	void OnUpdateStop(CCmdUI* pCmdUI); 
	void OnUpdateMute(CCmdUI* pCmdUI); 
	void OnUpdateProgress(CCmdUI* pCmdUI); 
	void OnUpdateVolume(CCmdUI* pCmdUI); 
	void OnUpdateHideLeft(CCmdUI* pCmdUI); 

	// Get CPlayer ptr. 7/22
	CPlayer * GetPlayer();

	// Sliders
	void	SetVideoTimeString(int sec);
	BOOL		m_draggingThumb;

	// Special slider handling if muted or paused. See OnHScroll()
	int		m_lastVol;
	int		m_lastTime;

	// Control Wrap.
	BOOL	CalcLayout(CRect & frmRect);
	CRect	m_r1, m_r2, m_r3, m_r4, m_r5, m_r6, m_r7, m_r8; // control rects 
	CSize	m_sizeDocked;
	CSize	m_sizeFloating;
	BOOL		m_bChangeDockedSize;		// Indicates whether to keep
									// a default size for docking
	// Mouse Wheel 7/22
	BOOL		m_bMouseWheel;
	BOOL		m_bEnterKey;

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CONTROLSBAR_H__FC5CBE09_3D5E_42A0_91D0_12596F4F9348__INCLUDED_)
