ADTF  3.18.2
player_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <adtf_base.h>
10 #include <adtf_ucom3.h>
11 
12 #include <map>
13 
14 #ifdef WIN32
15 #undef GetObject
16 #undef GetCurrentTime
17 #endif
18 
19 namespace adtf
20 {
21 namespace services
22 {
23 namespace ant
24 {
25 
37 
48 
58 {
59  public:
61  ADTF_IID(IPlayer, "player.ant.services.adtf.iid");
62 
63  public:
64  enum tState : uint32_t
65  {
67  Closed = 0,
69  Paused = 1,
71  Streaming = 2,
72  };
73 
75  struct tEvent
76  {
77  enum tEventIds: uint32_t
78  {
83 
86 
90  };
91 
93  uint32_t nEventId;
95  const void* pEventData;
98  };
99 
102  {
103  public:
110  virtual tResult HandleStream(uint16_t ui16StreamId, const char* strStreamName) = 0;
111  };
112 
123  virtual tResult Open(const char* strFileNames, bool bLoadReferencedFiles) = 0;
131  virtual tResult Close() = 0;
132 
142  virtual tResult GetTimeRange(tTimeStamp& tmFirstItem, tTimeStamp& tmLastItem) const = 0;
143 
150  virtual uint64_t GetChunkCount() const = 0;
151 
160  virtual tResult GetCurrentFileNames(base::ant::IString&& strFileNames) const = 0;
161 
169  virtual tTimeStamp GetCurrentTime() const = 0;
170 
177  virtual IPlayer::tState GetCurrentState() const = 0;
178 
183  virtual tResult Play() = 0;
184 
189  virtual tResult Pause() = 0;
190 
195  virtual tResult Reset() = 0;
196 
201  virtual tResult SeekToTime(tTimeStamp tmTime) = 0;
202 
207  virtual tResult SeekToChunkIndex(uint64_t ui64ChunkIndex) = 0;
208 
213  virtual tResult SeekToStreamIndex(uint16_t ui16StreamId, uint64_t ui64StreamIndex) = 0;
214 
219  virtual tResult ListStreams(IListStreamCallback& oCallback) = 0;
220 };
221 
229 {
230  return _runtime->GetObject(pPlayer);
231 }
232 
237  public std::map<adtf::util::cString, uint16_t>
238 {
239  public:
240  tResult HandleStream(uint16_t ui16StreamId, const char* strStreamName) override
241  {
242  insert({strStreamName, ui16StreamId});
244  }
245 };
246 
247 }
248 
249 namespace bat
250 {
251 
256 {
257 public:
259  ADTF_IID(IPlayer, "player.bat.services.adtf.iid");
260 
261 public:
262 
269  virtual tResult GetMarkers(adtf::base::ant::IString&& strMarkers) const = 0;
270 
278  virtual tResult ExtractAttachedFiles(const char* strAdtfDatFileNames,
279  const char* strDestinationDirectory) = 0;
280 };
281 
286 {
287  return _runtime->GetObject(pPlayer);
288 }
289 
290 }
291 
292 namespace elasto
293 {
294 
299 {
300 public:
301  ADTF_IID(IPlayer, "player.elasto.remote.adtf");
302 
303 public:
304  enum class tLoopMode: uint32_t
305  {
307  DontLoop = 0,
309  SeekToStart,
312  };
313 
314  enum class tStepDirection: uint32_t
315  {
317  Forward,
319  Backward
320  };
321 
322  enum class tStepItems: uint32_t
323  {
325  Any,
327  Samples,
329  StreamTypes,
331  Triggers
332  };
333 
339  virtual tResult SetLoopMode(const tLoopMode& eLoopMode) = 0;
340 
345  virtual tLoopMode GetLoopMode() const = 0;
346 
352  virtual tResult SetPlaybackSpeed(float fPlaybackSpeed) = 0;
353 
358  virtual float GetPlaybackSpeed() const = 0;
359 
368  virtual tResult Step(uint64_t nSteps, tStepDirection eDirection, tStepItems eItems, bool bWait) = 0;
369 
370 };
371 
376 {
377  return _runtime->GetObject(pPlayer);
378 }
379 
380 } // namespace elasto
381 
382 namespace quiet
383 {
388 {
389 public:
391  ADTF_IID(IPlayer, "player.quiet.services.adtf.iid");
392 
393  using elasto::IPlayer::Open;
406  virtual tResult Open(const char* strFilenames,
407  bool bLoadReferencedFiles,
408  const char* strReaderId,
409  const adtf::base::ant::IProperties* pReaderProperties = nullptr) = 0;
410 
418  virtual bool IsSeekable() const = 0;
419 };
420 
425 {
426  return _runtime->GetObject(pPlayer);
427 }
428 
429 }
430 
431 using quiet::IPlayer;
432 using quiet::get_player;
433 using ant::cPlayerStreams;
434 
435 } // namespace services
436 } // namespace adtf
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Defintion of a property set container interface.
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition: string_intf.h:28
virtual tResult HandleStream(uint16_t ui16StreamId, const char *strStreamName)=0
Called for every available stream.
ADTF Playback Service Control interface to control the ADTF Player.
Definition: player_intf.h:58
ADTF_IID(IPlayer, "player.ant.services.adtf.iid")
Interface ID for the playback service interface.
virtual tResult Open(const char *strFileNames, bool bLoadReferencedFiles)=0
Opens one or more adtfdat files.
virtual tResult SeekToChunkIndex(uint64_t ui64ChunkIndex)=0
Control interface to seek to the given (Chunk) Index.
virtual tResult GetCurrentFileNames(base::ant::IString &&strFileNames) const =0
Information interface to get the time range of the current opened file.
virtual tResult ListStreams(IListStreamCallback &oCallback)=0
List all available streams.
virtual tResult Reset()=0
Control interface to Reset the streaming.
virtual tTimeStamp GetCurrentTime() const =0
Information interface to get the current time position of the current opened files.
@ Streaming
file is opened and streaming
Definition: player_intf.h:71
@ Closed
no file is loaded
Definition: player_intf.h:67
@ Paused
file is opened and playback has been paused
Definition: player_intf.h:69
virtual tResult GetTimeRange(tTimeStamp &tmFirstItem, tTimeStamp &tmLastItem) const =0
Information interface to get the time range of the currently opened files.
virtual tResult SeekToTime(tTimeStamp tmTime)=0
Control interface to seek to the given (Chunk) Time.
virtual IPlayer::tState GetCurrentState() const =0
Information interface to get the current state of the Player.
virtual tResult Close()=0
Closes the current loaded files.
virtual tResult Pause()=0
Control interface to pause streaming.
virtual tResult SeekToStreamIndex(uint16_t ui16StreamId, uint64_t ui64StreamIndex)=0
Control interface to seek to the given (Stream) Index of the given stream.
virtual uint64_t GetChunkCount() const =0
Information interface to get the chunk count of the current opened files.
virtual tResult Play()=0
Control interface to start streaming.
Helper class that stores all streams from a player.
Definition: player_intf.h:238
tResult HandleStream(uint16_t ui16StreamId, const char *strStreamName) override
Called for every available stream.
Definition: player_intf.h:240
ADTF Playback Service Control interface to control the ADTF Player.
Definition: player_intf.h:256
ADTF_IID(IPlayer, "player.bat.services.adtf.iid")
Interface ID for the playback service interface.
virtual tResult GetMarkers(adtf::base::ant::IString &&strMarkers) const =0
Get Markers.
virtual tResult ExtractAttachedFiles(const char *strAdtfDatFileNames, const char *strDestinationDirectory)=0
Extracts all attached files from the given ADTF DAT files.
ADTF Playback Service Control interface to control the ADTF Player.
Definition: player_intf.h:299
virtual tLoopMode GetLoopMode() const =0
Retrieves the loop mode of the player.
virtual tResult SetPlaybackSpeed(float fPlaybackSpeed)=0
Sets the playback speed of the player.
virtual tResult Step(uint64_t nSteps, tStepDirection eDirection, tStepItems eItems, bool bWait)=0
Steps n items in given direction.
@ StreamTypes
only stream types samples are considered
@ Triggers
only triggers are considered
@ Samples
only samples are considered
@ Any
each stream item is considered
@ ChangeRunlevel
loop via a runlevel change sequence
virtual float GetPlaybackSpeed() const =0
Retrieves the current playback speed of the player.
virtual tResult SetLoopMode(const tLoopMode &eLoopMode)=0
Sets the loop mode of the player.
ADTF Playback Service Control interface to control the ADTF Player.
Definition: player_intf.h:388
ADTF_IID(IPlayer, "player.quiet.services.adtf.iid")
Interface ID for the playback service interface.
virtual tResult Open(const char *strFilenames, bool bLoadReferencedFiles, const char *strReaderId, const adtf::base::ant::IProperties *pReaderProperties=nullptr)=0
Opens one or more given file with the given reader_id.
virtual bool IsSeekable() const =0
Indicates the players current capability of seeking.
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
virtual tResult GetObject(iobject_ptr< IObject > &pObject, const char *strNameOID) const =0
Get registered object from object registry.
Object pointer implementation used for reference counting on objects of type IObject.
Definition: object_ptr.h:163
tResult get_player(ucom::object_ptr< IPlayer > &pPlayer)
Gets the current registered player instance.
Definition: player_intf.h:228
tResult get_player(ucom::object_ptr< IPlayer > &pPlayer)
Gets the current registered player instance.
Definition: player_intf.h:285
tResult get_player(adtf::ucom::object_ptr< IPlayer > &pPlayer)
Gets the current registered player instance.
Definition: player_intf.h:375
tResult get_player(adtf::ucom::object_ptr< IPlayer > &pPlayer)
Gets the current registered player instance.
Definition: player_intf.h:424
Namespace for entire ADTF SDK.
adtf::ucom::IRuntime * _runtime
Global Runtime Pointer to reference to the current runtime.
Layout of the events emitted by the playback service.
Definition: player_intf.h:76
@ StartedPlaybackOfFile
The playback of a file has started The pEventData member points to a 0-terminated string that contain...
Definition: player_intf.h:82
@ MarkerReached
A marker has been reached pEventData points to a string containing an XML representation of the marke...
Definition: player_intf.h:89
@ EndOfStreams
The end of all streams has been reached.
Definition: player_intf.h:85
size_t nEventDataSize
size of the event specific data.
Definition: player_intf.h:97
const void * pEventData
pointer to the event specific data.
Definition: player_intf.h:95
uint32_t nEventId
the event id.
Definition: player_intf.h:93