Click here to Skip to main content
13,357,363 members (66,472 online)
Click here to Skip to main content

Stats

218.8K views
11.7K downloads
105 bookmarked
Posted 8 Dec 2003

A Basic Media Player

, 10 Jan 2013
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

Mehdi Bonvari
Chief Technology Officer
Iran (Islamic Republic of) Iran (Islamic Republic of)
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 10 Jan 2013
Article Copyright 2003 by Mehdi Bonvari
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid