196 if (k0 <= key && key <= k9) {
205 if (k0 <= key && key <= k9) {
215 item = (cOsdItem *) Get(Current());
216 state = cOsdMenu::ProcessKey(key);
246 m_path = cVideoDirectory::Name();
250 m_path = cPlugin::ConfigDirectory(
"softhddevice-drm-gles");
259 if (strcasestr(item->Text(),
"[..]")) {
260 std::string newPath =
m_path.substr(0 ,
m_path.find_last_of(
"/"));
279 std::string newPath =
m_path +
"/" + item->Text();
281 if (stat(newPath.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
299 m_path = cPlugin::ConfigDirectory(
"softhddevice-drm-gles");
309 Interface->Confirm(tr(
"New Playlist"), 1,
true);
321 Interface->Confirm(tr(
"Added to Playlist"), 1,
true);
325 state = osStopReplay;
374 struct dirent **dirList;
377 if ((n = scandir(cPlugin::ConfigDirectory(
"softhddevice-drm-gles"), &dirList, NULL, alphasort)) == -1) {
378 LOGERROR(
"mediaplayer: %s: searching PL in %s failed (%d): %m", __FUNCTION__,
379 cPlugin::ConfigDirectory(
"softhddevice-drm-gles"), errno);
384 for (i = 0; i < n; i++) {
385 if (dirList[i]->d_name[0] !=
'.' && (strcasestr(dirList[i]->d_name,
".M3U"))) {
386 Add(
new cOsdItem(dirList[i]->d_name));
389 SetHelp(
"Play PL", NULL, NULL, NULL);
401 struct dirent **dirList;
405 if (!searchPath.size())
408 sp = searchPath.c_str();
412 if (searchPath.size())
413 Add(
new cOsdItem(
"[..]"));
416 if ((n = scandir(sp, &dirList, NULL, alphasort)) == -1) {
417 LOGERROR(
"mediaplayer: %s: scanning directory %s failed (%d): %m", __FUNCTION__, sp, errno);
419 struct stat fileAttributs;
420 for (i = 0; i < n; i++) {
421 std::string str = searchPath +
"/" + dirList[i]->d_name;
422 if (stat(str.c_str(), &fileAttributs) == -1) {
423 LOGERROR(
"mediaplayer: %s: stat on %s failed (%d): %m", __FUNCTION__, str.c_str(), errno);
425 if (S_ISDIR(fileAttributs.st_mode) && dirList[i]->d_name[0] !=
'.') {
429 Add(
new cOsdItem(dirList[i]->d_name),
435 for (i = 0; i < n; i++) {
436 std::string str = searchPath +
"/" + dirList[i]->d_name;
437 if (stat(str.c_str(), &fileAttributs) == -1) {
438 LOGERROR(
"mediaplayer: %s: stat on %s failed (%d): %m", __FUNCTION__, str.c_str(), errno);
440 if (S_ISREG(fileAttributs.st_mode) && dirList[i]->d_name[0] !=
'.') {
443 fprintf(playlist,
"%s/%s\n", searchPath.c_str(),
446 Add(
new cOsdItem(dirList[i]->d_name));
454 SetHelp(
m_playlist.empty() ?
"Play File" :
"Play PL",
"New PL",
"Add to PL", NULL);
std::string OsdItemString(void)
Compose a full-path-string for the OSD entry.
cPlaylistEntry * GetNextEntry(void)