vdr-plugin-drmdevice 2.0.0-46418f1
cDrmDevicePlayer Class Reference

Media Player. More...

#include <mediaplayer.h>

Public Member Functions

 cDrmDevicePlayer (const char *, cOutputDevice *)
 Create a new player for a file or playlist.
 
virtual ~cDrmDevicePlayer ()
 
void SetEntry (int)
 Set the current entry to play.
 
const char * GetSource (void)
 
void JumpSec (int seconds)
 
void Pause (bool pause)
 
bool IsPaused (void)
 
void Stop (void)
 
void ToggleRandomPlay (void)
 
bool IsRandomPlayActive (void)
 
int GetCurrentTime (void)
 
int GetDuration (void)
 
cPlaylistEntry * GetFirstPlaylistEntry (void)
 
cPlaylistEntry * GetCurrentPlaylistEntry (void)
 

Protected Member Functions

virtual void Activate (bool On)
 Start player thread.
 
virtual void Action (void)
 Main thread action which invokes replay start.
 

Private Member Functions

void Play (const char *)
 Play a file.
 
void ReadPlaylist (const char *)
 Read the playlist file.
 

Private Attributes

cPlaylistEntry * m_pFirstEntry = nullptr
 
cPlaylistEntry * m_pCurrentEntry = nullptr
 
char * m_pSource
 
int m_entries
 
cOutputDevice * m_pDevice
 
cAudioStream * m_pAudio
 
std::atomic< int > m_jumpSec = 0
 
std::atomic< bool > m_paused = false
 
std::atomic< bool > m_stopped = false
 
std::atomic< bool > m_random = false
 
bool m_noModify = false
 
int m_currentTime = 0
 
int m_duration = 0
 

Detailed Description

Media Player.

player for mediaplayer mode

Definition at line 57 of file mediaplayer.h.

Constructor & Destructor Documentation

◆ cDrmDevicePlayer()

cDrmDevicePlayer::cDrmDevicePlayer ( const char *  url,
cOutputDevice *  device 
)

Create a new player for a file or playlist.

Parameters
urlfile or playlist to be played
devicepointer to device

Definition at line 94 of file mediaplayer.cpp.

References IsM3UPlaylist(), L_MEDIA, LOGDEBUG2, m_pCurrentEntry, m_pFirstEntry, m_pSource, and ReadPlaylist().

◆ ~cDrmDevicePlayer()

cDrmDevicePlayer::~cDrmDevicePlayer ( )
virtual

Definition at line 111 of file mediaplayer.cpp.

References L_MEDIA, LOGDEBUG2, m_entries, m_pFirstEntry, m_pSource, and m_stopped.

Member Function Documentation

◆ Action()

◆ Activate()

void cDrmDevicePlayer::Activate ( bool  on)
protectedvirtual

Start player thread.

Called right after the player has been attached

Parameters
ontrue starts the player, false does nothing

Definition at line 133 of file mediaplayer.cpp.

References L_MEDIA, and LOGDEBUG2.

◆ GetCurrentPlaylistEntry()

cPlaylistEntry * cDrmDevicePlayer::GetCurrentPlaylistEntry ( void  )
inline

Definition at line 74 of file mediaplayer.h.

References m_pCurrentEntry.

◆ GetCurrentTime()

int cDrmDevicePlayer::GetCurrentTime ( void  )
inline

Definition at line 71 of file mediaplayer.h.

References m_currentTime.

◆ GetDuration()

int cDrmDevicePlayer::GetDuration ( void  )
inline

Definition at line 72 of file mediaplayer.h.

References m_duration.

◆ GetFirstPlaylistEntry()

cPlaylistEntry * cDrmDevicePlayer::GetFirstPlaylistEntry ( void  )
inline

Definition at line 73 of file mediaplayer.h.

References m_pFirstEntry.

◆ GetSource()

const char * cDrmDevicePlayer::GetSource ( void  )
inline

Definition at line 63 of file mediaplayer.h.

References m_pSource.

◆ IsPaused()

bool cDrmDevicePlayer::IsPaused ( void  )
inline

Definition at line 67 of file mediaplayer.h.

References m_paused.

◆ IsRandomPlayActive()

bool cDrmDevicePlayer::IsRandomPlayActive ( void  )
inline

Definition at line 70 of file mediaplayer.h.

References m_random.

◆ JumpSec()

void cDrmDevicePlayer::JumpSec ( int  seconds)
inline

Definition at line 65 of file mediaplayer.h.

References m_jumpSec.

◆ Pause()

void cDrmDevicePlayer::Pause ( bool  pause)
inline

Definition at line 66 of file mediaplayer.h.

References m_paused.

◆ Play()

◆ ReadPlaylist()

void cDrmDevicePlayer::ReadPlaylist ( const char *  playlist)
private

Read the playlist file.

Parameters
playlistfull path to the playlist

Definition at line 181 of file mediaplayer.cpp.

References LOGERROR, m_entries, and m_pFirstEntry.

Referenced by cDrmDevicePlayer().

◆ SetEntry()

void cDrmDevicePlayer::SetEntry ( int  index)

Set the current entry to play.

Parameters
indexlist index (in random mode) or menu item index cOsdMenu::Current()

Definition at line 217 of file mediaplayer.cpp.

References m_noModify, m_pCurrentEntry, m_pFirstEntry, and m_stopped.

Referenced by Action().

◆ Stop()

void cDrmDevicePlayer::Stop ( void  )
inline

Definition at line 68 of file mediaplayer.h.

References m_stopped.

◆ ToggleRandomPlay()

void cDrmDevicePlayer::ToggleRandomPlay ( void  )
inline

Definition at line 69 of file mediaplayer.h.

References m_random.

Member Data Documentation

◆ m_currentTime

int cDrmDevicePlayer::m_currentTime = 0
private

Definition at line 96 of file mediaplayer.h.

Referenced by GetCurrentTime(), and Play().

◆ m_duration

int cDrmDevicePlayer::m_duration = 0
private

Definition at line 97 of file mediaplayer.h.

Referenced by GetDuration(), and Play().

◆ m_entries

int cDrmDevicePlayer::m_entries
private

Definition at line 88 of file mediaplayer.h.

Referenced by Action(), ReadPlaylist(), and ~cDrmDevicePlayer().

◆ m_jumpSec

std::atomic<int> cDrmDevicePlayer::m_jumpSec = 0
private

Definition at line 91 of file mediaplayer.h.

Referenced by Action(), JumpSec(), and Play().

◆ m_noModify

bool cDrmDevicePlayer::m_noModify = false
private

Definition at line 95 of file mediaplayer.h.

Referenced by Action(), and SetEntry().

◆ m_pAudio

cAudioStream* cDrmDevicePlayer::m_pAudio
private

Definition at line 90 of file mediaplayer.h.

Referenced by Action(), and Play().

◆ m_paused

std::atomic<bool> cDrmDevicePlayer::m_paused = false
private

Definition at line 92 of file mediaplayer.h.

Referenced by IsPaused(), Pause(), and Play().

◆ m_pCurrentEntry

cPlaylistEntry* cDrmDevicePlayer::m_pCurrentEntry = nullptr
private

Definition at line 85 of file mediaplayer.h.

Referenced by Action(), cDrmDevicePlayer(), GetCurrentPlaylistEntry(), and SetEntry().

◆ m_pDevice

cOutputDevice* cDrmDevicePlayer::m_pDevice
private

Definition at line 89 of file mediaplayer.h.

Referenced by Play().

◆ m_pFirstEntry

cPlaylistEntry* cDrmDevicePlayer::m_pFirstEntry = nullptr
private

◆ m_pSource

char* cDrmDevicePlayer::m_pSource
private

Definition at line 87 of file mediaplayer.h.

Referenced by Action(), cDrmDevicePlayer(), GetSource(), and ~cDrmDevicePlayer().

◆ m_random

std::atomic<bool> cDrmDevicePlayer::m_random = false
private

Definition at line 94 of file mediaplayer.h.

Referenced by Action(), IsRandomPlayActive(), and ToggleRandomPlay().

◆ m_stopped

std::atomic<bool> cDrmDevicePlayer::m_stopped = false
private

Definition at line 93 of file mediaplayer.h.

Referenced by Play(), SetEntry(), Stop(), and ~cDrmDevicePlayer().


The documentation for this class was generated from the following files: