vdr-plugin-softhddevice-drm-gles 1.5.9-20e15de
cSoftHdPlayer Class Reference

#include <mediaplayer.h>

Public Member Functions

 cSoftHdPlayer (const char *, cSoftHdDevice *)
 Create a new player for a file or playlist.
 
virtual ~cSoftHdPlayer ()
 
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)
 
cPlaylistEntryGetFirstPlaylistEntry (void)
 
cPlaylistEntryGetCurrentPlaylistEntry (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

cPlaylistEntrym_pFirstEntry = nullptr
 
cPlaylistEntrym_pCurrentEntry = nullptr
 
char * m_pSource
 
int m_entries
 
cSoftHdDevicem_pDevice
 
cSoftHdAudiom_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

Definition at line 59 of file mediaplayer.h.

Constructor & Destructor Documentation

◆ cSoftHdPlayer()

cSoftHdPlayer::cSoftHdPlayer ( const char *  url,
cSoftHdDevice device 
)

Create a new player for a file or playlist.

Parameters
urlfile or playlist to be played
devicepointer to device

Definition at line 92 of file mediaplayer.cpp.

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

◆ ~cSoftHdPlayer()

cSoftHdPlayer::~cSoftHdPlayer ( )
virtual

Member Function Documentation

◆ Action()

◆ Activate()

void cSoftHdPlayer::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 131 of file mediaplayer.cpp.

References L_MEDIA, and LOGDEBUG2.

◆ GetCurrentPlaylistEntry()

cPlaylistEntry * cSoftHdPlayer::GetCurrentPlaylistEntry ( void  )
inline

Definition at line 77 of file mediaplayer.h.

References m_pCurrentEntry.

Referenced by cSoftHdMenu::PlayListMenu(), and cSoftHdControl::ShowProgress().

◆ GetCurrentTime()

int cSoftHdPlayer::GetCurrentTime ( void  )
inline

Definition at line 74 of file mediaplayer.h.

References m_currentTime.

Referenced by cSoftHdControl::ShowProgress().

◆ GetDuration()

int cSoftHdPlayer::GetDuration ( void  )
inline

Definition at line 75 of file mediaplayer.h.

References m_duration.

Referenced by cSoftHdControl::ShowProgress().

◆ GetFirstPlaylistEntry()

cPlaylistEntry * cSoftHdPlayer::GetFirstPlaylistEntry ( void  )
inline

Definition at line 76 of file mediaplayer.h.

References m_pFirstEntry.

Referenced by cSoftHdMenu::PlayListMenu().

◆ GetSource()

const char * cSoftHdPlayer::GetSource ( void  )
inline

Definition at line 66 of file mediaplayer.h.

References m_pSource.

Referenced by cSoftHdControl::ShowProgress().

◆ IsPaused()

bool cSoftHdPlayer::IsPaused ( void  )
inline

Definition at line 70 of file mediaplayer.h.

References m_paused.

Referenced by cSoftHdControl::ProcessKey().

◆ IsRandomPlayActive()

bool cSoftHdPlayer::IsRandomPlayActive ( void  )
inline

Definition at line 73 of file mediaplayer.h.

References m_random.

◆ JumpSec()

void cSoftHdPlayer::JumpSec ( int  seconds)
inline

Definition at line 68 of file mediaplayer.h.

References m_jumpSec.

Referenced by cSoftHdControl::ProcessKey(), and cSoftHdMenu::ProcessKey().

◆ Pause()

void cSoftHdPlayer::Pause ( bool  pause)
inline

Definition at line 69 of file mediaplayer.h.

References m_paused.

Referenced by cSoftHdControl::ProcessKey().

◆ Play()

◆ ReadPlaylist()

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

Read the playlist file.

Definition at line 177 of file mediaplayer.cpp.

References LOGERROR, m_entries, m_pFirstEntry, and cPlaylistEntry::SetNextEntry().

Referenced by cSoftHdPlayer().

◆ SetEntry()

void cSoftHdPlayer::SetEntry ( int  index)

Set the current entry to play.

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

Definition at line 213 of file mediaplayer.cpp.

References cPlaylistEntry::GetNextEntry(), m_noModify, m_pCurrentEntry, m_pFirstEntry, and m_stopped.

Referenced by Action(), and cSoftHdMenu::ProcessKey().

◆ Stop()

void cSoftHdPlayer::Stop ( void  )
inline

Definition at line 71 of file mediaplayer.h.

References m_stopped.

Referenced by cSoftHdControl::ProcessKey(), and cSoftHdMenu::ProcessKey().

◆ ToggleRandomPlay()

void cSoftHdPlayer::ToggleRandomPlay ( void  )
inline

Definition at line 72 of file mediaplayer.h.

References m_random.

Referenced by cSoftHdMenu::ProcessKey().

Member Data Documentation

◆ m_currentTime

int cSoftHdPlayer::m_currentTime = 0
private

Definition at line 99 of file mediaplayer.h.

Referenced by GetCurrentTime(), and Play().

◆ m_duration

int cSoftHdPlayer::m_duration = 0
private

Definition at line 100 of file mediaplayer.h.

Referenced by GetDuration(), and Play().

◆ m_entries

int cSoftHdPlayer::m_entries
private

Definition at line 91 of file mediaplayer.h.

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

◆ m_jumpSec

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

Definition at line 94 of file mediaplayer.h.

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

◆ m_noModify

bool cSoftHdPlayer::m_noModify = false
private

Definition at line 98 of file mediaplayer.h.

Referenced by Action(), and SetEntry().

◆ m_pAudio

cSoftHdAudio* cSoftHdPlayer::m_pAudio
private

Definition at line 93 of file mediaplayer.h.

Referenced by Action(), and Play().

◆ m_paused

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

Definition at line 95 of file mediaplayer.h.

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

◆ m_pCurrentEntry

cPlaylistEntry* cSoftHdPlayer::m_pCurrentEntry = nullptr
private

Definition at line 88 of file mediaplayer.h.

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

◆ m_pDevice

cSoftHdDevice* cSoftHdPlayer::m_pDevice
private

Definition at line 92 of file mediaplayer.h.

Referenced by Play().

◆ m_pFirstEntry

cPlaylistEntry* cSoftHdPlayer::m_pFirstEntry = nullptr
private

◆ m_pSource

char* cSoftHdPlayer::m_pSource
private

Definition at line 90 of file mediaplayer.h.

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

◆ m_random

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

Definition at line 97 of file mediaplayer.h.

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

◆ m_stopped

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

Definition at line 96 of file mediaplayer.h.

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


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