DigiGuide Programmes On Now

Copyright ©1999, 2000 GipsyMedia Limited. All rights reserved.
Please read our open source licence agreement.


Detail

DigiGuide has an internal one minute timer, when the timer fires DigiGuide checks for all shows currently being broadcast and notifies your Add-In, passing a list of DGE_PROGRAMME's and the number of programmes in the list.

Example

#include <windows.h>
#include <TCHAR.h>
#include "DGAddins.h"

extern "C" _declspec( dllexport )
void OnProgrammesOnNowA( const DGE_PROGRAMME* const arrProgramme, UINT uProgrammesCount,  HWND /*hwndParent*/ )
{
	OutputDebugString( _T("Addin OnProgrammeOnNow:\r\n") );

	//
	//	NOTE:	We can't use the DGE_PROGRAMME pointer (array) directly because DigiGuide
	//	may be sending us a different structure size than we were compiled with. If we did
	//	use it and then if DG adds some extra data to the structure we won't iterate to the next
	//	element correctly and things will go Very Bad.

	LPBYTE pbyte = ( LPBYTE )arrProgramme;

	//
	//	Iterate over all of the programmes passed in.
	for( UINT u = 0; u < uProgrammesCount; u++ )
	{
		TCHAR szBuffer[ 2048 ];
		const DGE_PROGRAMME *pProgramme = (DGE_PROGRAMME *)pbyte;
		wsprintf( szBuffer, _T("\t%s %s at %d:%d\r\n")
					, pProgramme->pcszChannelName
					, pProgramme->pcszName
					, pProgramme->stTimeStart.wHour
					, pProgramme->stTimeStart.wMinute
					);

		pbyte += pProgramme->uStructSize;
		OutputDebugString( szBuffer );
	}
}

See Also