Click here to Skip to main content
15,886,806 members
Articles / Desktop Programming / MFC

DirectShow Editing Services (DES) and combining AVI files

Rate me:
Please Sign up or sign in to vote.
4.64/5 (4 votes)
9 Sep 2011CPOL5 min read 35.9K   5.8K   12  
A sample C++ project that uses DES to combine two or more AVI files.
// AddFilesDLG.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"

#include "AddFilesDLG.h"

IMPLEMENT_DYNAMIC(CAddFilesDLG, CDialog)

BEGIN_MESSAGE_MAP(CAddFilesDLG, CDialog)
END_MESSAGE_MAP()

/*
	=====================================================================
	=====================================================================
	CAddFilesDLG
	=====================================================================
	=====================================================================
*/
/*
	=====================================================================
	=====================================================================
*/
CAddFilesDLG::CAddFilesDLG(CWnd* pParent /*=NULL*/)
: CDialog(CAddFilesDLG::IDD, pParent)
, _startTime(0)
, _endTime(-1)
{
}
/*
	=====================================================================
	=====================================================================
*/
CAddFilesDLG::~CAddFilesDLG()
{
}
/*
	=====================================================================
	=====================================================================
*/
void CAddFilesDLG::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_StartTime, _startTime);
	DDX_Text(pDX, IDC_EndTime, _endTime);
}
/*
	=====================================================================
	=====================================================================
*/
void CAddFilesDLG::OnBnClicked_Browse()
{
	UpdateData( FALSE );
}
/*
	=====================================================================
	=====================================================================
*/
void CAddFilesDLG::get( double& startTime, double& endTime )
{
	startTime = _startTime;
	endTime = _endTime;
}
/*
	=====================================================================
	=====================================================================
*/
BOOL CAddFilesDLG::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
/*
	=====================================================================
	=====================================================================
*/
void CAddFilesDLG::OnOK()
{
	if( !_validateData() )
		CDialog::OnOK();
}
/*
	=====================================================================
	=====================================================================
*/
void CAddFilesDLG::set( double startTime, double endTime )
{
	_startTime = startTime;
	_endTime = endTime;
}

/*
	=====================================================================
	=====================================================================
	CAddFilesDLG - private functions
	=====================================================================
	=====================================================================
*/
/*
	=====================================================================
	=====================================================================
*/
int CAddFilesDLG::_validateData()
{
	UpdateData();

	if( 0 <= _endTime  &&  _startTime > _endTime ) {
		MessageBox( _T("The start time must be less than the end time") );
		return 1;
	}

	return 0;
}


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 Code Project Open License (CPOL)


Written By
Retired
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions