30#include <vdr/interface.h>
31#include <vdr/player.h>
32#include <vdr/plugin.h>
33#include <vdr/videodir.h>
42#include <libavcodec/avcodec.h>
43#include <libavformat/avformat.h>
60 int c0,
int c1,
int c2,
int c3,
int c4)
61:cOsdMenu(title, c0, c1, c2, c3, c4)
69 LOGDEBUG2(
L_MEDIA,
"mediaplayer: %s: pointer to cSoftHdControl exist.", __FUNCTION__);
91 return new cOsdItem(cString::sprintf(
"%s:", label), osUnknown,
false);
101 return new cOsdItem(
" ", osUnknown,
false);
116 Add(
new cOsdItem(hk(tr(
" Toggle")), osUser1));
117 Add(
new cOsdItem(hk(tr(
" Channel +")), osUser2));
118 Add(
new cOsdItem(hk(tr(
" Channel -")), osUser3));
119 Add(
new cOsdItem(hk(tr(
" Swap Channel")), osUser4));
120 Add(
new cOsdItem(hk(tr(
" Swap Position")), osUser5));
126 Add(
new cOsdItem(hk(tr(
" play file / make play list")), osUser6));
127 Add(
new cOsdItem(hk(tr(
" select play list")), osUser7));
129 SetCurrent(Get(current));
185 if (k0 <= key && key <= k9) {
195 item = (cOsdItem *) Get(Current());
196 state = cOsdMenu::ProcessKey(key);
218 m_path = cVideoDirectory::Name();
222 m_path = cPlugin::ConfigDirectory(
"softhddevice-drm-gles");
231 if (strcasestr(item->Text(),
"[..]")) {
232 string newPath =
m_path.substr(0 ,
m_path.find_last_of(
"/"));
251 string newPath =
m_path +
"/" + item->Text();
253 if (stat(newPath.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
271 m_path = cPlugin::ConfigDirectory(
"softhddevice-drm-gles");
281 Interface->Confirm(tr(
"New Playlist"), 1,
true);
293 Interface->Confirm(tr(
"Added to Playlist"), 1,
true);
297 state = osStopReplay;
324 string p_string = entry->
Folder
326 +
" - " + entry->
File;
336 "Jump -1 min",
"Jump +1 min",
"End player");
345 struct dirent **dirList;
348 if ((n = scandir(cPlugin::ConfigDirectory(
"softhddevice-drm-gles"), &dirList, NULL, alphasort)) == -1) {
349 LOGERROR(
"mediaplayer: %s: searching PL in %s failed (%d): %m", __FUNCTION__,
350 cPlugin::ConfigDirectory(
"softhddevice-drm-gles"), errno);
353 for (i = 0; i < n; i++) {
354 if (dirList[i]->d_name[0] !=
'.' && (strcasestr(dirList[i]->d_name,
".M3U"))) {
355 Add(
new cOsdItem(dirList[i]->d_name));
358 SetHelp(
"Play PL", NULL, NULL, NULL);
371 struct dirent **dirList;
375 if (!searchPath.size())
377 else sp = searchPath.c_str();
381 if (searchPath.size())
382 Add(
new cOsdItem(
"[..]"));
385 if ((n = scandir(sp, &dirList, NULL, alphasort)) == -1) {
386 LOGERROR(
"mediaplayer: %s: scanning directory %s failed (%d): %m", __FUNCTION__, sp, errno);
388 struct stat fileAttributs;
389 for (i = 0; i < n; i++) {
390 string str = searchPath +
"/" + dirList[i]->d_name;
391 if (stat(str.c_str(), &fileAttributs) == -1) {
392 LOGERROR(
"mediaplayer: %s: stat on %s failed (%d): %m", __FUNCTION__, str.c_str(), errno);
394 if (S_ISDIR(fileAttributs.st_mode) && dirList[i]->d_name[0] !=
'.') {
398 Add(
new cOsdItem(dirList[i]->d_name),
404 for (i = 0; i < n; i++) {
405 string str = searchPath +
"/" + dirList[i]->d_name;
406 if (stat(str.c_str(), &fileAttributs) == -1) {
407 LOGERROR(
"mediaplayer: %s: stat on %s failed (%d): %m", __FUNCTION__, str.c_str(), errno);
409 if (S_ISREG(fileAttributs.st_mode) && dirList[i]->d_name[0] !=
'.') {
412 fprintf(playlist,
"%s/%s\n", searchPath.c_str(),
415 Add(
new cOsdItem(dirList[i]->d_name));
423 SetHelp(
m_playlist.empty() ?
"Play File" :
"Play PL",
"New PL",
"Add to PL", NULL);
441 string plPath = cPlugin::ConfigDirectory(
"softhddevice-drm-gles");
443 FILE *playlist = fopen(plPath.c_str(), mode);
445 if (playlist != NULL) {
447 fprintf(playlist,
"%s/%s\n",
m_path.c_str(), target);
449 string str =
m_path +
"/" + target;
463 string aim =
m_path +
"/" + name;
467 LOGERROR(
"mediaplayer: %s: can't start %s", __FUNCTION__, aim.c_str());
479 if (strcasestr(name,
".MP3"))
481 if (strcasestr(name,
".MP4"))
483 if (strcasestr(name,
".MKV"))
485 if (strcasestr(name,
".MPG"))
487 if (strcasestr(name,
".AVI"))
489 if (strcasestr(name,
".M2TS"))
491 if (strcasestr(name,
".MPEG"))
493 if (strcasestr(name,
".M3U"))
495 if (strcasestr(name,
".TS"))
Audio and alsa module header file.
static cSoftHdControl * Control()
static cSoftHdPlayer * Player()
void PipSwapPosition(void)
Swap pip between normal and alternative position.
void PipToggle(void)
Toggle picture-in-picture.
void PipChannelSwap(void)
Swap the pip channel with main live channel.
void PipChannelChange(int)
Change the pip channel.
struct PLEntry * FirstEntry
struct PLEntry * CurrentEntry
Logger class header file.
Misc function header file.
Device class header file.
struct PLEntry * NextEntry
Videostream class header file.