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

Plugin Main Menu. More...

#include <menu.h>

Public Member Functions

 cDeviceMenu (const char *, cOutputDevice *, int=0, int=0, int=0, int=0, int=0)
 Build main or playlist menu.
 
virtual ~cDeviceMenu ()
 
void PlayListMenu (void)
 Create mediaplayer playlist menu.
 
virtual eOSState ProcessKey (eKeys)
 Handle key event.
 

Static Public Member Functions

static cDeviceMenu * Menu ()
 

Static Public Attributes

static cDeviceMenu * pMenu = NULL
 Main Menu Instance.
 

Private Member Functions

void HandleHotKey (int)
 Handle a key code which was compose by hotkey handling in ProcessKey()
 
void MainMenu (void)
 Create main menu.
 
void SelectPlaylistMenu (void)
 Create mediaplayer select playlist menu.
 
void FindFileMenu (std::string, FILE *)
 Create mediaplayer sub menu find file or make a play list.
 
void MakePlayList (const char *, const char *)
 Make a play list.
 
bool IsValidMediaFile (const char *)
 Test if it's a media file - at least if it has the right file extension...
 
void PlayMedia (const char *)
 Play media file.
 

Private Attributes

cOutputDevice * m_pDevice
 
HotkeyState m_hotkeyState = HotkeyState::Initial
 
std::string m_path
 
std::string m_lastItem
 
std::string m_playlist
 

Detailed Description

Plugin Main Menu.

Definition at line 43 of file menu.h.

Constructor & Destructor Documentation

◆ cDeviceMenu()

cDeviceMenu::cDeviceMenu ( const char *  title,
cOutputDevice *  device,
int  c0 = 0,
int  c1 = 0,
int  c2 = 0,
int  c3 = 0,
int  c4 = 0 
)

Build main or playlist menu.

Definition at line 28 of file menu.cpp.

References cDrmDeviceControl::Control(), L_MEDIA, LOGDEBUG2, m_playlist, MainMenu(), PlayListMenu(), and pMenu.

◆ ~cDeviceMenu()

cDeviceMenu::~cDeviceMenu ( )
virtual

Definition at line 44 of file menu.cpp.

References pMenu.

Member Function Documentation

◆ FindFileMenu()

void cDeviceMenu::FindFileMenu ( std::string  searchPath,
FILE *  playlist 
)
private

Create mediaplayer sub menu find file or make a play list.

Parameters
searchPathpath to start search mediafile
playlistif there is a play list write to play list else make a new menu

Definition at line 395 of file menu.cpp.

References FindFileMenu(), IsValidMediaFile(), LOGERROR, m_lastItem, and m_playlist.

Referenced by FindFileMenu(), MakePlayList(), and ProcessKey().

◆ HandleHotKey()

void cDeviceMenu::HandleHotKey ( int  code)
private

◆ IsValidMediaFile()

bool cDeviceMenu::IsValidMediaFile ( const char *  name)
private

Test if it's a media file - at least if it has the right file extension...

Parameters
namefile name
Returns
true if it's a media file

Definition at line 506 of file menu.cpp.

Referenced by FindFileMenu(), MakePlayList(), and ProcessKey().

◆ MainMenu()

void cDeviceMenu::MainMenu ( void  )
private

Create main menu.

Definition at line 76 of file menu.cpp.

References m_pDevice, SeparatorName(), SeparatorSpace(), and cOutputDevice::UsePip().

Referenced by cDeviceMenu().

◆ MakePlayList()

void cDeviceMenu::MakePlayList ( const char *  target,
const char *  mode 
)
private

Make a play list.

Parameters
targetpath to start search mediafiles
modeopen file mode

Definition at line 463 of file menu.cpp.

References FindFileMenu(), IsValidMediaFile(), m_path, and m_playlist.

Referenced by ProcessKey().

◆ Menu()

static cDeviceMenu * cDeviceMenu::Menu ( )
inlinestatic

Definition at line 48 of file menu.h.

References pMenu.

Referenced by cDrmDevicePlayer::Action().

◆ PlayListMenu()

void cDeviceMenu::PlayListMenu ( void  )

Create mediaplayer playlist menu.

Definition at line 347 of file menu.cpp.

References cDrmDeviceControl::Control().

Referenced by cDeviceMenu(), and ProcessKey().

◆ PlayMedia()

void cDeviceMenu::PlayMedia ( const char *  name)
private

Play media file.

Parameters
namefile name

Definition at line 490 of file menu.cpp.

References cDrmDeviceControl::Control(), LOGERROR, m_path, and m_pDevice.

Referenced by ProcessKey().

◆ ProcessKey()

◆ SelectPlaylistMenu()

void cDeviceMenu::SelectPlaylistMenu ( void  )
private

Create mediaplayer select playlist menu.

Definition at line 368 of file menu.cpp.

References LOGERROR.

Referenced by ProcessKey().

Member Data Documentation

◆ m_hotkeyState

HotkeyState cDeviceMenu::m_hotkeyState = HotkeyState::Initial
private

Definition at line 57 of file menu.h.

Referenced by ProcessKey().

◆ m_lastItem

std::string cDeviceMenu::m_lastItem
private

Definition at line 68 of file menu.h.

Referenced by FindFileMenu(), and ProcessKey().

◆ m_path

std::string cDeviceMenu::m_path
private

Definition at line 67 of file menu.h.

Referenced by MakePlayList(), PlayMedia(), and ProcessKey().

◆ m_pDevice

cOutputDevice* cDeviceMenu::m_pDevice
private

Definition at line 55 of file menu.h.

Referenced by HandleHotKey(), MainMenu(), PlayMedia(), and ProcessKey().

◆ m_playlist

std::string cDeviceMenu::m_playlist
private

Definition at line 69 of file menu.h.

Referenced by cDeviceMenu(), FindFileMenu(), MakePlayList(), and ProcessKey().


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