vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
cSoftHdPlayer Class Reference

Media Player. More...

#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 charGetSource (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
 
charm_pSource
 
int m_entries
 
cSoftHdDevicem_pDevice
 
cSoftHdAudiom_pAudio
 
std::atomic< intm_jumpSec = 0
 
std::atomic< boolm_paused = false
 
std::atomic< boolm_stopped = false
 
std::atomic< boolm_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

◆ 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 94 of file mediaplayer.cpp.

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

◆ ~cSoftHdPlayer()

cSoftHdPlayer::~cSoftHdPlayer ( )
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 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 133 of file mediaplayer.cpp.

References L_MEDIA, and LOGDEBUG2.

◆ GetCurrentPlaylistEntry()

cPlaylistEntry * cSoftHdPlayer::GetCurrentPlaylistEntry ( void  )
inline

Definition at line 74 of file mediaplayer.h.

References m_pCurrentEntry.

◆ GetCurrentTime()

int cSoftHdPlayer::GetCurrentTime ( void  )
inline

Definition at line 71 of file mediaplayer.h.

References m_currentTime.

◆ GetDuration()

int cSoftHdPlayer::GetDuration ( void  )
inline

Definition at line 72 of file mediaplayer.h.

References m_duration.

◆ GetFirstPlaylistEntry()

cPlaylistEntry * cSoftHdPlayer::GetFirstPlaylistEntry ( void  )
inline

Definition at line 73 of file mediaplayer.h.

References m_pFirstEntry.

◆ GetSource()

const char * cSoftHdPlayer::GetSource ( void  )
inline

Definition at line 63 of file mediaplayer.h.

References m_pSource.

◆ IsPaused()

bool cSoftHdPlayer::IsPaused ( void  )
inline

Definition at line 67 of file mediaplayer.h.

References m_paused.

◆ IsRandomPlayActive()

bool cSoftHdPlayer::IsRandomPlayActive ( void  )
inline

Definition at line 70 of file mediaplayer.h.

References m_random.

◆ JumpSec()

void cSoftHdPlayer::JumpSec ( int  seconds)
inline

Definition at line 65 of file mediaplayer.h.

References m_jumpSec.

◆ Pause()

void cSoftHdPlayer::Pause ( bool  pause)
inline

Definition at line 66 of file mediaplayer.h.

References m_paused.

◆ Play()

◆ ReadPlaylist()

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

References m_noModify, m_pCurrentEntry, m_pFirstEntry, and m_stopped.

Referenced by Action().

◆ Stop()

void cSoftHdPlayer::Stop ( void  )
inline

Definition at line 68 of file mediaplayer.h.

References m_stopped.

◆ ToggleRandomPlay()

void cSoftHdPlayer::ToggleRandomPlay ( void  )
inline

Definition at line 69 of file mediaplayer.h.

References m_random.

Member Data Documentation

◆ m_currentTime

int cSoftHdPlayer::m_currentTime = 0
private

Definition at line 96 of file mediaplayer.h.

Referenced by GetCurrentTime(), and Play().

◆ m_duration

int cSoftHdPlayer::m_duration = 0
private

Definition at line 97 of file mediaplayer.h.

Referenced by GetDuration(), and Play().

◆ m_entries

int cSoftHdPlayer::m_entries
private

Definition at line 88 of file mediaplayer.h.

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

◆ m_jumpSec

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

Definition at line 91 of file mediaplayer.h.

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

◆ m_noModify

bool cSoftHdPlayer::m_noModify = false
private

Definition at line 95 of file mediaplayer.h.

Referenced by Action(), and SetEntry().

◆ m_pAudio

cSoftHdAudio* cSoftHdPlayer::m_pAudio
private

Definition at line 90 of file mediaplayer.h.

Referenced by Action(), and Play().

◆ m_paused

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

Definition at line 92 of file mediaplayer.h.

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

◆ m_pCurrentEntry

cPlaylistEntry* cSoftHdPlayer::m_pCurrentEntry = nullptr
private

Definition at line 85 of file mediaplayer.h.

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

◆ m_pDevice

cSoftHdDevice* cSoftHdPlayer::m_pDevice
private

Definition at line 89 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 87 of file mediaplayer.h.

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

◆ m_random

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

Definition at line 94 of file mediaplayer.h.

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

◆ m_stopped

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

Definition at line 93 of file mediaplayer.h.

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


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