ADTF  v2.14.3
Harddisk Player - Events received and emitted

The Harddisk Player receives and emits several Events during the playback of a file.

The following table shows a typical sequence of events when playing DAT files, a single one or several (e.g. split DAT files) without errors, supposing that the configuration is in a runlevel lower than ucom::IRuntime::RL_Application (meaning deinitialized).

Event Explanation Use Case
After changing to runlevel ucom::IRuntime::RL_Application.
IEvent::EC_PlayPreFileOpen The player opens the file to be played. You will get this event whenever a file will be opened, also if Referenced Files are in use. (UseCase) Retrieve information from the player by event
IEvent::EC_PlayPostFileOpen
IEvent::EC_PlaybackFileChanged The file opened before is used for playback now. This Event must not correspond with the EC_PlayPreFileOpen and EC_PlayPostFileOpen event. It will not be called for every DAT File within the Referenced Files This can also be retrieved via (UseCase) Retrieve information from the player by ISampleStream interface
After changing to runlevel ucom::IRuntime::RL_Running.
IEvent::EC_PlayPreFileClose The player closes the file after playback to play the next file (File out of Referenced Files). (UseCase) Retrieve information from the player by event
IEvent::EC_PlayPostFileClose
IEvent::EC_PlayPreFileOpen The player opens the next file to be played. (UseCase) Retrieve information from the player by event
IEvent::EC_PlayPostFileOpen
IEvent::EC_EndOfStream The end of the (last) file has been reached and the playback will be stopped.
After changing below runlevel ucom::IRuntime::RL_Application.
IEvent::EC_PlayPreFileClose The player closes the file after playback. (UseCase) Retrieve information from the player by event
IEvent::EC_PlayPostFileClose

(UseCase) Retrieve information from the player by event


By receiving the following event it is possible to retrieve the information with the help of ucom::IScriptable in


The ucom::IScriptable interface can be retrieved from the sEventInfo.pSource member on reception of a Harddisk Player event.

To retrieve the filename use following code:

// ...
tResult cMyFilter::Run(tInt nActivationCode,
const tVoid* pvUserData,
tInt szUserData,
__exception)
{
// process a event
if (nActivationCode == IRunnable::RUN_SIGNAL && pvUserData != NULL)
{
const tSignalEventInfo* pEventInfo = (const tSignalEventInfo*) pvUserData;
if (pEventInfo->i32EventClass == IEvent::CLASS_APPLICATION &&
pEventInfo->i32EventCode == IEvent::EC_PlayPreFileOpen)
{
if (pEventInfo->pSource)
{
ucom::cException oLocalException;
ucom::IScriptable* pScriptOfPlayer = static_cast<ucom::IScriptable*>(pEventInfo->pSource);
tChar strPlayerFilename[512];
(tVoid*)strPlayerFilename,
512,
&oLocalException);
if (IS_OK(nRes))
{
LOG_INFO(adtf_util::cString::Format("Filename is %s", strPlayerFilename).GetPtr());
}
else
{
__catch_exception(oLocalException)
{
//retrieve more information on the error
}
}
}
}
}
else
{
return cFilter::Run(nActivationCode, pvUserData, szUserData, __exception_ptr);
}
}

(UseCase) Retrieve information from the player by ISampleStream interface

Use the ISampleStream interface to retrieve the currently played filename in a asynchronously way. To do so call the ISampleStream::GetUrl function.

References:
See also: Accessing the Sample Stream Interface..

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)