Click here to Skip to main content
12,076,216 members (37,679 online)
Click here to Skip to main content

Stats

200.1K views
10.8K downloads
105 bookmarked
Posted

A Basic Media Player

, 10 Jan 2013 GPL3
Using MCIWnd wrapper class to write a simple media player
// PrefDlg.cpp : implementation file
//

#include "stdafx.h"
#include "mci.h"
#include "PrefDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPrefDlg dialog


CPrefDlg::CPrefDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CPrefDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPrefDlg)
	m_AutoStart = FALSE;
	m_Loop = FALSE;
	m_Rew = FALSE;
	//}}AFX_DATA_INIT
}


void CPrefDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPrefDlg)
	DDX_Check(pDX, IDC_AUTOSTART, m_AutoStart);
	DDX_Check(pDX, IDC_LOOP, m_Loop);
	DDX_Check(pDX, IDC_REW, m_Rew);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPrefDlg, CDialog)
	//{{AFX_MSG_MAP(CPrefDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPrefDlg message handlers

BOOL CPrefDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_AutoStart=rs.GetPlayAutoStart();
	m_Loop=rs.GetPlayLoop();
	m_Rew=rs.GetPlayRewind();

	UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CPrefDlg::OnOK() 
{
	UpdateData(TRUE);

	rs.SetPlayAutoStart(m_AutoStart);
	rs.SetPlayRewind(m_Rew);
	rs.SetPlayLoop(m_Loop);
	
	CDialog::OnOK();
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

M. Bonvari
Other
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.160208.1 | Last Updated 10 Jan 2013
Article Copyright 2003 by M. Bonvari
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid