Click here to Skip to main content
15,885,855 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.8K   5.8K   12  
A sample C++ project that uses DES to combine two or more AVI files.
#include <stdafx.h>

#include "InputFile.h"

namespace DESCombineLib {

/*
	=====================================================================
	=====================================================================
	InputFile
	=====================================================================
	=====================================================================
*/
/*
	=====================================================================
	=====================================================================
*/
InputFile::InputFile()
: startTime( 0 )
, endTime( 0 )
{
}
/*
	=====================================================================
	=====================================================================
*/
InputFile::InputFile(
	const std::wstring& mediaFilename,
	double startTime,
	double endTime
){
	this->mediaFilename = mediaFilename;
	this->startTime = startTime;
	this->endTime = endTime;
}
/*
	=====================================================================
	=====================================================================
*/
InputFile::InputFile(
	const std::wstring& mediaFilename,
	const std::wstring& startTime,
	const std::wstring& endTime
){
	this->mediaFilename = mediaFilename;

	std::wostringstream os;
	os << startTime << L" " << endTime;
	ASSERT( os.good() );

	std::wistringstream is( os.str() );
	ASSERT( is.good() );
	double startTime2, endTime2;
	is >> startTime2 >> endTime2;
	ASSERT( is.good() );

	ASSERT( startTime2 <= endTime2 );
	this->startTime = startTime2 * UNITS;
	this->endTime = endTime2 * UNITS;
}
/*
	=====================================================================
	=====================================================================
*/
InputFile& InputFile::operator=( const InputFile& src )
{
	if( this != &src ) {
		mediaFilename = src.mediaFilename;
		startTime = src.startTime;
		endTime = src.endTime;
	}

	return *this;
}

} // namespace DESCombineLib {

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