2 * MP3/MPlayer plugin to VDR (C++)
4 * (C) 2001-2009 Stefan Huelswitt <s.huelswitt@gmx.de>
6 * This code is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This code is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
29 #include <vdr/menuitems.h>
30 #include <vdr/status.h>
31 #include <vdr/plugin.h>
32 #include <vdr/interface.h>
33 #include <vdr/skins.h>
36 #include "setup-mp3.h"
39 #include "player-mp3.h"
41 #include "menu-async.h"
51 const char *sourcesSub=0;
52 cFileSources MP3Sources;
54 static const char *plugin_name=0;
55 const char *i18n_name=0;
57 // --- cMenuSetupMP3 --------------------------------------------------------
59 class cMenuSetupMP3 : public cMenuSetupPage {
63 const char *cddb[3], *disp[2], *scan[3], *bgr[3];
64 const char *aout[AUDIOOUTMODES];
65 int amode, amodes[AUDIOOUTMODES];
67 virtual void Store(void);
72 cMenuSetupMP3::cMenuSetupMP3(void)
74 static const char allowed[] = { "abcdefghijklmnopqrstuvwxyz0123456789-_" };
76 aout[numModes]=trVDR("DVB"); amodes[numModes]=AUDIOOUTMODE_DVB; numModes++;
78 aout[numModes]=tr("OSS"); amodes[numModes]=AUDIOOUTMODE_OSS; numModes++;
82 for(int i=0; i<numModes; i++)
83 if(amodes[i]==data.AudioOutMode) { amode=i; break; }
85 SetSection(tr("MP3"));
86 Add(new cMenuEditStraItem(tr("Setup.MP3$Audio output mode"), &amode,numModes,aout));
87 Add(new cMenuEditBoolItem(tr("Setup.MP3$Audio mode"), &data.AudioMode, tr("Round"), tr("Dither")));
88 Add(new cMenuEditBoolItem(tr("Setup.MP3$Use 48kHz mode only"), &data.Only48kHz));
89 disp[0]=tr("classic");
90 disp[1]=tr("via skin");
91 Add(new cMenuEditStraItem(tr("Setup.MP3$Replay display"), &data.ReplayDisplay, 2, disp));
92 Add(new cMenuEditIntItem( tr("Setup.MP3$Display mode"), &data.DisplayMode, 1, 3));
96 Add(new cMenuEditStraItem(tr("Setup.MP3$Background mode"), &data.BackgrMode, 3, bgr));
97 Add(new cMenuEditBoolItem(tr("Setup.MP3$Initial loop mode"), &data.InitLoopMode));
98 Add(new cMenuEditBoolItem(tr("Setup.MP3$Initial shuffle mode"), &data.InitShuffleMode));
99 Add(new cMenuEditBoolItem(tr("Setup.MP3$Abort player at end of list"),&data.AbortAtEOL));
100 scan[0]=tr("disabled");
101 scan[1]=tr("ID3 only");
102 scan[2]=tr("ID3 & Level");
103 Add(new cMenuEditStraItem(tr("Setup.MP3$Background scan"), &data.BgrScan, 3, scan));
104 Add(new cMenuEditBoolItem(tr("Setup.MP3$Editor display mode"), &data.EditorMode, tr("Filenames"), tr("ID3 names")));
105 Add(new cMenuEditBoolItem(tr("Setup.MP3$Mainmenu mode"), &data.MenuMode, tr("Playlists"), tr("Browser")));
106 Add(new cMenuEditBoolItem(tr("Setup.MP3$Keep selection menu"), &data.KeepSelect));
107 Add(new cMenuEditBoolItem(tr("Setup.MP3$Title/Artist order"), &data.TitleArtistOrder, tr("Normal"), tr("Reversed")));
108 Add(new cMenuEditBoolItem(tr("Hide mainmenu entry"), &data.HideMainMenu));
109 Add(new cMenuEditIntItem( tr("Setup.MP3$Normalizer level"), &data.TargetLevel, 0, MAX_TARGET_LEVEL));
110 Add(new cMenuEditIntItem( tr("Setup.MP3$Limiter level"), &data.LimiterLevel, MIN_LIMITER_LEVEL, 100));
111 Add(new cMenuEditBoolItem(tr("Setup.MP3$Use HTTP proxy"), &data.UseProxy));
112 Add(new cMenuEditStrItem( tr("Setup.MP3$HTTP proxy host"), data.ProxyHost,MAX_HOSTNAME,allowed));
113 Add(new cMenuEditIntItem( tr("Setup.MP3$HTTP proxy port"), &data.ProxyPort,1,65535));
114 cddb[0]=tr("disabled");
115 cddb[1]=tr("local only");
116 cddb[2]=tr("local&remote");
117 Add(new cMenuEditStraItem(tr("Setup.MP3$CDDB for CD-Audio"), &data.UseCddb,3,cddb));
118 Add(new cMenuEditStrItem( tr("Setup.MP3$CDDB server"), data.CddbHost,MAX_HOSTNAME,allowed));
119 Add(new cMenuEditIntItem( tr("Setup.MP3$CDDB port"), &data.CddbPort,1,65535));
122 void cMenuSetupMP3::Store(void)
124 data.AudioOutMode=amodes[amode];
127 SetupStore("InitLoopMode", MP3Setup.InitLoopMode );
128 SetupStore("InitShuffleMode", MP3Setup.InitShuffleMode);
129 SetupStore("AudioMode", MP3Setup.AudioMode );
130 SetupStore("AudioOutMode", MP3Setup.AudioOutMode );
131 SetupStore("BgrScan", MP3Setup.BgrScan );
132 SetupStore("EditorMode", MP3Setup.EditorMode );
133 SetupStore("DisplayMode", MP3Setup.DisplayMode );
134 SetupStore("BackgrMode", MP3Setup.BackgrMode );
135 SetupStore("MenuMode", MP3Setup.MenuMode );
136 SetupStore("TargetLevel", MP3Setup.TargetLevel );
137 SetupStore("LimiterLevel", MP3Setup.LimiterLevel );
138 SetupStore("Only48kHz", MP3Setup.Only48kHz );
139 SetupStore("UseProxy", MP3Setup.UseProxy );
140 SetupStore("ProxyHost", MP3Setup.ProxyHost );
141 SetupStore("ProxyPort", MP3Setup.ProxyPort );
142 SetupStore("UseCddb", MP3Setup.UseCddb );
143 SetupStore("CddbHost", MP3Setup.CddbHost );
144 SetupStore("CddbPort", MP3Setup.CddbPort );
145 SetupStore("AbortAtEOL", MP3Setup.AbortAtEOL );
146 SetupStore("ReplayDisplay", MP3Setup.ReplayDisplay );
147 SetupStore("HideMainMenu", MP3Setup.HideMainMenu );
148 SetupStore("KeepSelect", MP3Setup.KeepSelect );
149 SetupStore("TitleArtistOrder", MP3Setup.TitleArtistOrder);
152 // --- cAsyncStatus ------------------------------------------------------------
154 cAsyncStatus asyncStatus;
156 cAsyncStatus::cAsyncStatus(void)
162 cAsyncStatus::~cAsyncStatus()
167 void cAsyncStatus::Set(const char *Text)
171 text=Text ? strdup(Text) : 0;
176 const char *cAsyncStatus::Begin(void)
182 void cAsyncStatus::Finish(void)
188 // --- --------------------------------------------------------------------
190 static cString TitleArtist(const char *title, const char *artist)
193 if(artist && artist[0]) {
194 if(MP3Setup.TitleArtistOrder) fmt="%2$s - %1$s";
198 return cString::sprintf(fmt,title,artist);
201 // --- cMP3Control --------------------------------------------------------
205 class cMP3Control : public cControl {
209 cSkinDisplayReplay *disp;
210 int bw, bh, bwc, fw, fh;
213 bool visible, shown, bigwin, statusActive;
214 time_t timeoutShow, greentime, oktime;
219 cMP3PlayInfo *lastMode;
220 time_t fliptime, listtime;
221 int hashlist[MAXROWS];
222 int flip, flipint, top, rows;
223 int lastIndex, lastTotal, lastTop;
226 bool jumpactive, jumphide, jumpsecs;
229 void ShowTimed(int Seconds=0);
230 void ShowProgress(bool open=false, bool bigWin=false);
231 void ShowStatus(bool force);
232 void HideStatus(void);
233 void DisplayInfo(const char *s=0);
234 void JumpDisplay(void);
235 void JumpProcess(eKeys Key);
238 void Write(int x, int y, int w, const char *text, int fg=clrWhite, int bg=clrGray50);
239 void Fill(int x, int y, int w, int h, int fg);
240 inline void Flush(void);
243 virtual ~cMP3Control();
244 virtual eOSState ProcessKey(eKeys Key);
245 virtual void Show(void) { ShowTimed(); }
246 virtual void Hide(void);
247 bool Visible(void) { return visible; }
248 static bool SetPlayList(cPlayList *plist);
251 cMP3Control::cMP3Control(void)
252 :cControl(player=new cMP3Player)
254 visible=shown=bigwin=selecting=jumpactive=jumphide=statusActive=false;
255 timeoutShow=greentime=oktime=0;
258 framesPerSecond=SecondsToFrames(1);
260 font=cFont::GetFont(fontOsd);
261 cStatus::MsgReplaying(this,"MP3",0,true);
264 cMP3Control::~cMP3Control()
271 void cMP3Control::Stop(void)
273 cStatus::MsgReplaying(this,0,0,false);
274 delete player; player=0;
276 mgr->Flush(); //XXX remove later
279 bool cMP3Control::SetPlayList(cPlayList *plist)
282 cControl *control=cControl::Control();
283 // is there a running MP3 player?
284 if(control && typeid(*control)==typeid(cMP3Control)) {
285 // add songs to running playlist
292 cControl::Launch(new cMP3Control);
299 void cMP3Control::ShowTimed(int Seconds)
303 timeoutShow=(Seconds>0) ? time(0)+Seconds : 0;
307 void cMP3Control::Hide(void)
314 visible=bigwin=false;
315 #if APIVERSNUM >= 10500
316 SetNeedsFastResponse(false);
318 needsFastResponse=false;
323 void cMP3Control::ShowStatus(bool force)
325 if((asyncStatus.Changed() || (force && !statusActive)) && !jumpactive) {
326 const char *text=asyncStatus.Begin();
328 if(MP3Setup.ReplayDisplay || !osd) {
329 if(statusActive) Skins.Message(mtStatus,0);
330 Skins.Message(mtStatus,text);
333 if(!statusActive) osd->SaveRegion(0,bh-2*fh,bw-1,bh-fh-1);
334 osd->DrawText(0,bh-2*fh,text,clrBlack,clrCyan,font,bw,fh,taCenter);
341 asyncStatus.Finish();
345 void cMP3Control::HideStatus(void)
348 if(MP3Setup.ReplayDisplay || !osd)
349 Skins.Message(mtStatus,0);
351 osd->RestoreRegion();
358 #define CTAB 11 // some tabbing values for the progress display
361 void cMP3Control::Write(int x, int y, int w, const char *text, int fg, int bg)
364 x*=fw; if(x<0) x+=bw;
365 y*=fh; if(y<0) y+=bh;
366 osd->DrawText(x,y,text,fg,bg,font,w*fw);
370 void cMP3Control::Fill(int x, int y, int w, int h, int fg)
373 x*=fw; if(x<0) x+=bw;
374 y*=fh; if(y<0) y+=bh;
375 osd->DrawRectangle(x,y,x+w*fw-1,y+h*fh-1,fg);
379 void cMP3Control::Flush(void)
381 if(MP3Setup.ReplayDisplay) Skins.Flush();
382 else if(osd) osd->Flush();
385 void cMP3Control::ShowProgress(bool open, bool bigWin)
389 if(player->GetIndex(index,total) && total>=0) {
390 if(!visible && open) {
392 if(MP3Setup.ReplayDisplay) {
393 disp=Skins.Current()->DisplayReplay(false);
399 fw=font->Width(' ')*2;
406 rows=(bh-bp-fh/3)/fh;
411 bt=Setup.OSDHeight-bh;
415 //d(printf("mp3: bw=%d bh=%d bt=%d bp=%d bwc=%d rows=%d fw=%d fh=%d\n",
416 // bw,bh,bt,bp,bwc,rows,fw,fh))
417 osd=cOsdProvider::NewOsd(Setup.OSDLeft,Setup.OSDTop+bt);
420 tArea Areas[] = { { 0,0,bw-1,bh-bp-1,2 }, { 0,bh-bp,bw-1,bh-1,4 } };
421 osd->SetAreas(Areas,sizeof(Areas)/sizeof(tArea));
424 tArea Areas[] = { { 0,0,bw-1,bh-1,4 } };
425 osd->SetAreas(Areas,sizeof(Areas)/sizeof(tArea));
427 osd->DrawRectangle(0,0,bw-1,bh-1,clrGray50);
433 #if APIVERSNUM >= 10500
434 SetNeedsFastResponse(true);
436 needsFastResponse=true;
438 fliptime=listtime=0; flipint=0; flip=-1; top=lastTop=-1; lastIndex=lastTotal=-1;
439 delete lastMode; lastMode=0;
442 cMP3PlayInfo *mode=new cMP3PlayInfo;
443 bool valid=mgr->Info(-1,mode);
444 bool changed=(!lastMode || mode->Hash!=lastMode->Hash);
445 if(changed) { d(printf("mp3-ctrl: mode change detected\n")) }
447 if(valid) { // send progress to status monitor
448 if(changed || mode->Loop!=lastMode->Loop || mode->Shuffle!=lastMode->Shuffle)
449 cStatus::MsgReplaying(this,cString::sprintf("[%c%c] (%d/%d) %s",mode->Loop?'L':'.',mode->Shuffle?'S':'.',mode->Num,mode->MaxNum,*TitleArtist(mode->Title,mode->Artist)),mode->Filename[0]?mode->Filename:0,true);
452 if(visible) { // refresh the OSD progress display
455 if(MP3Setup.ReplayDisplay) {
457 if(total>0) disp->SetProgress(index,total);
458 disp->SetCurrent(IndexToHMSF(index));
459 disp->SetTotal(IndexToHMSF(total));
462 if(GetReplayMode(Play,Forward,Speed))
463 disp->SetMode(Play, Forward, Speed);
468 if(!selecting && changed && !statusActive) {
469 Write(0,-2,CTAB,cString::sprintf("(%d/%d)",mode->Num,mode->MaxNum));
473 if(!lastMode || mode->Loop!=lastMode->Loop) {
474 if(mode->Loop) Write(-4,-1,0,"L",clrBlack,clrYellow);
475 else Fill(-4,-1,2,1,clrGray50);
478 if(!lastMode || mode->Shuffle!=lastMode->Shuffle) {
479 if(mode->Shuffle) Write(-2,-1,0,"S",clrWhite,clrRed);
480 else Fill(-2,-1,2,1,clrGray50);
484 index/=framesPerSecond; total/=framesPerSecond;
485 if(index!=lastIndex || total!=lastTotal) {
487 cProgressBar ProgressBar(bw-(CTAB+CTAB2)*fw,fh,index,total);
488 osd->DrawBitmap(CTAB*fw,bh-fh,ProgressBar);
490 Write(0,-1,11,cString::sprintf(total?"%02d:%02d/%02d:%02d":"%02d:%02d",index/60,index%60,total/60,total%60));
497 if(MP3Setup.ReplayDisplay && (!lastMode || mode->Loop!=lastMode->Loop || mode->Shuffle!=lastMode->Shuffle))
499 if(!valid || changed) {
500 fliptime=time(0); flip=0;
503 else if(time(0)>fliptime+flipint) {
505 flip++; if(flip>=MP3Setup.DisplayMode) flip=0;
515 buff=TitleArtist(mode->Title,mode->Artist);
520 buff=cString::sprintf(mode->Year>0?"from: %s (%d)":"from: %s",mode->Album,mode->Year);
527 if(mode->MaxBitrate>0)
528 buff=cString::sprintf("%.1f kHz, %d-%d kbps, %s",mode->SampleFreq/1000.0,mode->Bitrate/1000,mode->MaxBitrate/1000,mode->SMode);
530 buff=cString::sprintf("%.1f kHz, %d kbps, %s",mode->SampleFreq/1000.0,mode->Bitrate/1000,mode->SMode);
534 if(MP3Setup.ReplayDisplay) {
535 disp->SetTitle(cString::sprintf("[%c%c] (%d/%d) %s",mode->Loop?'L':'.',mode->Shuffle?'S':'.',mode->Num,mode->MaxNum,*buff));
543 else { d(printf("mp3-ctrl: display info skip due to status active\n")) }
549 bool all=(top!=lastTop || changed);
550 if(all || time(0)>listtime+2) {
551 int num=(top>0 && mode->Num==lastMode->Num) ? top : mode->Num - rows/2;
552 if(num+rows>mode->MaxNum) num=mode->MaxNum-rows+1;
555 for(int i=0 ; i<rows && i<MAXROWS && num<=mode->MaxNum ; i++,num++) {
557 mgr->Info(num,&pi); if(!pi.Title[0]) break;
558 cString buff=cString::sprintf("%d.\t%s",num,*TitleArtist(pi.Title,pi.Artist));
559 int fg=clrWhite, bg=clrGray50;
560 int hash=MakeHash(buff);
561 if(num==mode->Num) { fg=clrBlack; bg=clrCyan; hash=(hash^77) + 23; }
562 if(all || hash!=hashlist[i]) {
563 char *s=rindex(buff,'\t');
566 Write(0,i,5,buff,fg,bg);
567 Write(5,i,bwc-5,s,fg,bg);
570 Write(0,i,bwc,buff,fg,bg);
575 listtime=time(0); lastTop=top;
582 lastIndex=index; lastTotal=total;
583 delete lastMode; lastMode=mode;
587 void cMP3Control::DisplayInfo(const char *s)
589 if(s) Write(CTAB,-2,bwc-CTAB,s);
590 else Fill(CTAB,-2,bwc-CTAB,1,clrGray50);
593 void cMP3Control::JumpDisplay(void)
596 const char *j=trVDR("Jump: "), u=jumpsecs?'s':'m';
597 if(!jumpmm) sprintf(buf,"%s- %c", j,u);
598 else sprintf(buf,"%s%d- %c",j,jumpmm,u);
599 if(MP3Setup.ReplayDisplay) {
607 void cMP3Control::JumpProcess(eKeys Key)
609 int n=Key-k0, d=jumpsecs?1:60;
612 if(jumpmm*10+n <= lastTotal/d) jumpmm=jumpmm*10+n;
627 player->SkipSeconds(jumpmm*d * ((Key==kLeft || Key==kFastRew) ? -1:1));
636 else if(MP3Setup.ReplayDisplay) disp->SetJump(0);
640 void cMP3Control::Jump(void)
642 jumpmm=0; jumphide=jumpsecs=false;
644 ShowTimed(); if(!visible) return;
648 jumpactive=true; fliptime=0; flip=-1;
651 eOSState cMP3Control::ProcessKey(eKeys Key)
653 if(!player->Active()) return osEnd;
655 if(timeoutShow && time(0)>timeoutShow) Hide();
657 ShowStatus(Key==kNone && !Skins.IsOpen());
659 if(jumpactive && Key!=kNone) { JumpProcess(Key); return osContinue; }
666 mgr->Next(); player->Play();
672 if(!player->PrevCheck()) mgr->Prev();
678 if(top>0) { top-=rows; if(top<1) top=1; }
683 case kFastRew|k_Repeat:
684 if(!player->IsStream()) player->SkipSeconds(-JUMPSIZE);
687 case kRight|k_Repeat:
694 case kFastFwd|k_Repeat:
695 if(!player->IsStream()) player->SkipSeconds(JUMPSIZE);
698 if(!player->IsStream()) Jump();
702 if(time(0)>greentime) {
703 if(lastMode->Loop || (!lastMode->Loop && !lastMode->Shuffle)) mgr->ToggleLoop();
704 if(lastMode->Shuffle) mgr->ToggleShuffle();
707 if(!lastMode->Loop) mgr->ToggleLoop();
708 else if(!lastMode->Shuffle) mgr->ToggleShuffle();
709 else mgr->ToggleLoop();
711 greentime=time(0)+MULTI_TIMEOUT;
719 if(!player->IsStream()) player->Pause();
728 cRemote::CallPlugin(plugin_name);
732 number=number*10+Key-k0;
733 if(lastMode && number>0 && number<=lastMode->MaxNum) {
734 if(!visible) ShowTimed(SELECTHIDE_TIMEOUT);
735 else if(timeoutShow>0) timeoutShow=time(0)+SELECTHIDE_TIMEOUT;
736 selecting=true; lastkeytime.Set(SELECT_TIMEOUT);
738 if(MP3Setup.ReplayDisplay) {
739 snprintf(buf,sizeof(buf),"%s%d-/%d",trVDR("Jump: "),number,lastMode->MaxNum);
743 snprintf(buf,sizeof(buf),"(%d-/%d)",number,lastMode->MaxNum);
744 Write(0,-2,CTAB,buf);
749 number=0; lastkeytime.Set();
752 if(selecting && lastkeytime.TimedOut()) {
753 if(number>0) { mgr->Goto(number); player->Play(); }
754 if(lastMode) lastMode->Hash=-1;
755 number=0; selecting=false;
756 if(MP3Setup.ReplayDisplay && disp) disp->SetJump(0);
760 if(time(0)>oktime || MP3Setup.ReplayDisplay) {
761 visible ? Hide() : ShowTimed();
764 if(visible && !bigwin) { Hide(); ShowProgress(true,true); }
765 else { Hide(); ShowTimed(); }
767 oktime=time(0)+MULTI_TIMEOUT;
776 // --- cMenuID3Info ------------------------------------------------------------
778 class cMenuID3Info : public cOsdMenu {
780 cOsdItem *Item(const char *name, const char *text);
781 cOsdItem *Item(const char *name, const char *format, const float num);
782 void Build(cSongInfo *info, const char *name);
784 cMenuID3Info(cSong *song);
785 cMenuID3Info(cSongInfo *si, const char *name);
786 virtual eOSState ProcessKey(eKeys Key);
789 cMenuID3Info::cMenuID3Info(cSong *song)
790 :cOsdMenu(tr("ID3 information"),12)
792 Build(song->Info(),song->Name());
795 cMenuID3Info::cMenuID3Info(cSongInfo *si, const char *name)
796 :cOsdMenu(tr("ID3 information"),12)
801 void cMenuID3Info::Build(cSongInfo *si, const char *name)
804 Item(tr("Filename"),name);
805 if(si->HasInfo() && si->Total>0) {
807 asprintf(&buf,"%02d:%02d",si->Total/60,si->Total%60);
808 Item(tr("Length"),buf);
810 Item(tr("Title"),si->Title);
811 Item(tr("Artist"),si->Artist);
812 Item(tr("Album"),si->Album);
813 Item(tr("Year"),0,(float)si->Year);
814 Item(tr("Samplerate"),"%.1f kHz",si->SampleFreq/1000.0);
815 Item(tr("Bitrate"),"%.f kbit/s",si->Bitrate/1000.0);
816 Item(trVDR("Channels"),0,(float)si->Channels);
822 cOsdItem *cMenuID3Info::Item(const char *name, const char *format, const float num)
827 asprintf(&buf,format?format:"%.f",num);
831 else item=Item(name,"");
835 cOsdItem *cMenuID3Info::Item(const char *name, const char *text)
838 asprintf(&buf,"%s:\t%s",name,text?text:"");
839 cOsdItem *item = new cOsdItem(buf,osBack);
840 item->SetSelectable(false);
842 Add(item); return item;
845 eOSState cMenuID3Info::ProcessKey(eKeys Key)
847 eOSState state = cOsdMenu::ProcessKey(Key);
849 if(state==osUnknown) {
854 case kBlue: return osContinue;
855 case kMenu: return osEnd;
862 // --- cMenuInstantBrowse -------------------------------------------------------
864 class cMenuInstantBrowse : public cMenuBrowse {
866 const char *selecttext, *alltext;
867 virtual void SetButtons(void);
868 virtual eOSState ID3Info(void);
870 cMenuInstantBrowse(cFileSource *Source, const char *Selecttext, const char *Alltext);
871 virtual eOSState ProcessKey(eKeys Key);
874 cMenuInstantBrowse::cMenuInstantBrowse(cFileSource *Source, const char *Selecttext, const char *Alltext)
875 :cMenuBrowse(Source,true,true,tr("Directory browser"),excl_br)
877 selecttext=Selecttext; alltext=Alltext;
881 void cMenuInstantBrowse::SetButtons(void)
883 SetHelp(selecttext, currentdir?tr("Parent"):0, currentdir?0:alltext, tr("ID3 info"));
887 eOSState cMenuInstantBrowse::ID3Info(void)
889 cFileObj *item=CurrentItem();
890 if(item && item->Type()==otFile) {
891 cSong *song=new cSong(item);
893 if(song && (si=song->Info())) {
894 AddSubMenu(new cMenuID3Info(si,item->Path()));
901 eOSState cMenuInstantBrowse::ProcessKey(eKeys Key)
903 eOSState state=cOsdMenu::ProcessKey(Key);
904 if(state==osUnknown) {
906 case kYellow: lastselect=new cFileObj(source,0,0,otBase);
911 if(state==osUnknown) state=cMenuBrowse::ProcessStdKey(Key,state);
915 // --- cMenuPlayListItem -------------------------------------------------------
917 class cMenuPlayListItem : public cOsdItem {
922 cMenuPlayListItem(cSong *Song, bool showid3);
923 cSong *Song(void) { return song; }
924 virtual void Set(void);
925 void Set(bool showid3);
928 cMenuPlayListItem::cMenuPlayListItem(cSong *Song, bool showid3)
934 void cMenuPlayListItem::Set(bool showid3)
940 void cMenuPlayListItem::Set(void)
943 cSongInfo *si=song->Info(false);
944 if(showID3 && !si) si=song->Info();
945 if(showID3 && si && si->Title)
946 asprintf(&buffer, "%d.\t%s",song->Index()+1,*TitleArtist(si->Title,si->Artist));
948 asprintf(&buffer, "%d.\t<%s>",song->Index()+1,song->Name());
949 SetText(buffer,false);
952 // --- cMenuPlayList ------------------------------------------------------
954 class cMenuPlayList : public cOsdMenu {
957 bool browsing, showid3;
959 void Refresh(bool all = false);
961 virtual void Move(int From, int To);
962 eOSState Remove(void);
963 eOSState ShowID3(void);
964 eOSState ID3Info(void);
966 cMenuPlayList(cPlayList *Playlist);
967 virtual eOSState ProcessKey(eKeys Key);
970 cMenuPlayList::cMenuPlayList(cPlayList *Playlist)
971 :cOsdMenu(tr("Playlist editor"),4)
973 browsing=showid3=false;
975 if(MP3Setup.EditorMode) showid3=true;
977 cSong *mp3 = playlist->First();
979 cOsdMenu::Add(new cMenuPlayListItem(mp3,showid3));
980 mp3 = playlist->cList<cSong>::Next(mp3);
982 Buttons(); Display();
985 void cMenuPlayList::Buttons(void)
987 SetHelp(tr("Add"), showid3?tr("Filenames"):tr("ID3 names"), tr("Remove"), trVDR("Button$Mark"));
990 void cMenuPlayList::Refresh(bool all)
992 cMenuPlayListItem *cur=(cMenuPlayListItem *)((all || Count()<2) ? First() : Get(Current()));
995 cur=(cMenuPlayListItem *)Next(cur);
999 void cMenuPlayList::Add(void)
1001 cFileObj *item=cMenuInstantBrowse::GetSelected();
1003 Status(tr("Scanning directory..."));
1004 cInstantPlayList *newpl=new cInstantPlayList(item);
1006 if(newpl->Count()) {
1007 if(newpl->Count()==1 || Interface->Confirm(tr("Add recursivly?"))) {
1008 cSong *mp3=newpl->First();
1010 cSong *n=new cSong(mp3);
1012 cMenuPlayListItem *current=(cMenuPlayListItem *)Get(Current());
1013 playlist->Add(n,current->Song());
1014 cOsdMenu::Add(new cMenuPlayListItem(n,showid3),true,current);
1018 cOsdMenu::Add(new cMenuPlayListItem(n,showid3),true);
1020 mp3=newpl->cList<cSong>::Next(mp3);
1023 Refresh(); Display();
1026 else Error(tr("Empty directory!"));
1028 else Error(tr("Error scanning directory!"));
1034 void cMenuPlayList::Move(int From, int To)
1036 playlist->Move(From,To); playlist->Save();
1037 cOsdMenu::Move(From,To);
1038 Refresh(true); Display();
1041 eOSState cMenuPlayList::ShowID3(void)
1044 Buttons(); Refresh(true); Display();
1048 eOSState cMenuPlayList::ID3Info(void)
1051 cMenuPlayListItem *current = (cMenuPlayListItem *)Get(Current());
1052 AddSubMenu(new cMenuID3Info(current->Song()));
1057 eOSState cMenuPlayList::Remove(void)
1060 cMenuPlayListItem *current = (cMenuPlayListItem *)Get(Current());
1061 if(Interface->Confirm(tr("Remove entry?"))) {
1062 playlist->Del(current->Song()); playlist->Save();
1063 cOsdMenu::Del(Current());
1064 Refresh(); Display();
1070 eOSState cMenuPlayList::ProcessKey(eKeys Key)
1072 eOSState state = cOsdMenu::ProcessKey(Key);
1074 if(browsing && !HasSubMenu() && state==osContinue) { Add(); browsing=false; }
1076 if(state==osUnknown) {
1078 case kOk: return ID3Info();
1079 case kRed: browsing=true;
1080 return AddSubMenu(new cMenuInstantBrowse(MP3Sources.GetSource(),tr("Add"),tr("Add all")));
1081 case kGreen: return ShowID3();
1082 case kYellow: return Remove();
1083 case kBlue: Mark(); return osContinue;
1084 case kMenu: return osEnd;
1091 // --- cPlaylistRename --------------------------------------------------------
1093 class cPlaylistRename : public cOsdMenu {
1095 static char *newname;
1096 const char *oldname;
1099 cPlaylistRename(const char *Oldname);
1100 virtual eOSState ProcessKey(eKeys Key);
1101 static const char *GetNewname(void) { return newname; }
1104 char *cPlaylistRename::newname = NULL;
1106 cPlaylistRename::cPlaylistRename(const char *Oldname)
1107 :cOsdMenu(tr("Rename playlist"), 15)
1109 free(newname); newname=0;
1113 asprintf(&buf,"%s\t%s",tr("Old name:"),oldname);
1114 cOsdItem *old = new cOsdItem(buf,osContinue);
1115 old->SetSelectable(false);
1120 Add(new cMenuEditStrItem( tr("New name"), data, sizeof(data)-1, tr(FileNameChars)),true);
1123 eOSState cPlaylistRename::ProcessKey(eKeys Key)
1125 eOSState state = cOsdMenu::ProcessKey(Key);
1127 if (state == osUnknown) {
1129 case kOk: if(data[0] && strcmp(data,oldname)) newname=strdup(data);
1134 case kBlue: return osContinue;
1141 // --- cMenuMP3Item -----------------------------------------------------
1143 class cMenuMP3Item : public cOsdItem {
1145 cPlayList *playlist;
1146 virtual void Set(void);
1148 cMenuMP3Item(cPlayList *PlayList);
1149 cPlayList *List(void) { return playlist; }
1152 cMenuMP3Item::cMenuMP3Item(cPlayList *PlayList)
1158 void cMenuMP3Item::Set(void)
1161 asprintf(&buffer," %s",playlist->BaseName());
1162 SetText(buffer,false);
1165 // --- cMenuMP3 --------------------------------------------------------
1167 class cMenuMP3 : public cOsdMenu {
1170 bool renaming, sourcing, instanting;
1172 eOSState Play(void);
1173 eOSState Edit(void);
1175 eOSState Delete(void);
1176 eOSState Rename(bool second);
1177 eOSState Source(bool second);
1178 eOSState Instant(bool second);
1179 void ScanLists(void);
1180 eOSState SetButtons(int num);
1184 virtual eOSState ProcessKey(eKeys Key);
1187 cMenuMP3::cMenuMP3(void)
1188 :cOsdMenu(tr("MP3"))
1190 renaming=sourcing=instanting=false;
1191 lists=new cPlayLists;
1192 ScanLists(); SetButtons(1);
1193 if(MP3Setup.MenuMode) Instant(false);
1196 cMenuMP3::~cMenuMP3(void)
1201 eOSState cMenuMP3::SetButtons(int num)
1205 SetHelp(trVDR("Button$Edit"), tr("Source"), tr("Browse"), ">>");
1208 SetHelp("<<", trVDR("Button$New"), trVDR("Button$Delete"), tr("Rename"));
1211 buttonnum=num; Display();
1215 void cMenuMP3::ScanLists(void)
1218 Status(tr("Scanning playlists..."));
1219 bool res=lists->Load(MP3Sources.GetSource());
1222 cPlayList *plist=lists->First();
1224 Add(new cMenuMP3Item(plist));
1225 plist=lists->Next(plist);
1228 else Error(tr("Error scanning playlists!"));
1231 eOSState cMenuMP3::Delete(void)
1234 if(Interface->Confirm(tr("Delete playlist?")) &&
1235 Interface->Confirm(tr("Are you sure?")) ) {
1236 cPlayList *plist = ((cMenuMP3Item *)Get(Current()))->List();
1237 if(plist->Delete()) {
1239 cOsdMenu::Del(Current());
1242 else Error(tr("Error deleting playlist!"));
1248 eOSState cMenuMP3::New(void)
1250 cPlayList *plist=new cPlayList(MP3Sources.GetSource(),0,0);
1254 if(i) sprintf(name,"%s%d",tr("unnamed"),i++);
1255 else { strcpy(name,tr("unnamed")); i++; }
1256 } while(plist->TestName(name));
1258 if(plist->Create(name)) {
1260 Add(new cMenuMP3Item(plist), true);
1262 isyslog("MP3: playlist %s added", plist->Name());
1263 return AddSubMenu(new cMenuPlayList(plist));
1265 Error(tr("Error creating playlist!"));
1270 eOSState cMenuMP3::Rename(bool second)
1272 if(HasSubMenu() || Count() == 0) return osContinue;
1274 cPlayList *plist = ((cMenuMP3Item *)Get(Current()))->List();
1277 return AddSubMenu(new cPlaylistRename(plist->BaseName()));
1280 const char *newname=cPlaylistRename::GetNewname();
1282 if(plist->Rename(newname)) {
1284 DisplayCurrent(true);
1286 else Error(tr("Error renaming playlist!"));
1291 eOSState cMenuMP3::Edit(void)
1293 if(HasSubMenu() || Count() == 0) return osContinue;
1295 cPlayList *plist = ((cMenuMP3Item *)Get(Current()))->List();
1296 if(!plist->Load()) Error(tr("Error loading playlist!"));
1297 else if(!plist->IsWinAmp()) {
1298 isyslog("MP3: editing playlist %s", plist->Name());
1299 return AddSubMenu(new cMenuPlayList(plist));
1301 else Error(tr("Can't edit a WinAmp playlist!"));
1305 eOSState cMenuMP3::Play(void)
1307 if(HasSubMenu() || Count() == 0) return osContinue;
1309 Status(tr("Loading playlist..."));
1310 cPlayList *newpl=new cPlayList(((cMenuMP3Item *)Get(Current()))->List());
1311 if(newpl->Load() && newpl->Count()) {
1312 isyslog("mp3: playback started with playlist %s", newpl->Name());
1313 cMP3Control::SetPlayList(newpl);
1314 if(MP3Setup.KeepSelect) { Status(0); return osContinue; }
1319 Error(tr("Error loading playlist!"));
1323 eOSState cMenuMP3::Source(bool second)
1325 if(HasSubMenu()) return osContinue;
1329 return AddSubMenu(new cMenuSource(&MP3Sources,tr("MP3 source")));
1332 cFileSource *src=cMenuSource::GetSelected();
1334 MP3Sources.SetSource(src);
1341 eOSState cMenuMP3::Instant(bool second)
1343 if(HasSubMenu()) return osContinue;
1347 return AddSubMenu(new cMenuInstantBrowse(MP3Sources.GetSource(),trVDR("Button$Play"),tr("Play all")));
1350 cFileObj *item=cMenuInstantBrowse::GetSelected();
1352 Status(tr("Building playlist..."));
1353 cInstantPlayList *newpl = new cInstantPlayList(item);
1354 if(newpl->Load() && newpl->Count()) {
1355 isyslog("mp3: playback started with instant playlist %s", newpl->Name());
1356 cMP3Control::SetPlayList(newpl);
1357 if(MP3Setup.KeepSelect) { Status(0); return Instant(false); }
1362 Error(tr("Error building playlist!"));
1367 eOSState cMenuMP3::ProcessKey(eKeys Key)
1369 eOSState state = cOsdMenu::ProcessKey(Key);
1371 if(!HasSubMenu() && state==osContinue) { // eval the return value from submenus
1372 if(renaming) return Rename(true);
1373 if(sourcing) return Source(true);
1374 if(instanting) return Instant(true);
1377 if(state == osUnknown) {
1379 case kOk: return Play();
1380 case kRed: return (buttonnum==1 ? Edit() : SetButtons(1));
1381 case kGreen: return (buttonnum==1 ? Source(false) : New());
1382 case kYellow: return (buttonnum==1 ? Instant(false) : Delete());
1383 case kBlue: return (buttonnum==1 ? SetButtons(2) : Rename(false));
1384 case kMenu: return osEnd;
1391 // --- PropagateImage ----------------------------------------------------------
1393 void PropagateImage(const char *image)
1395 cPlugin *graphtft=cPluginManager::GetPlugin("graphtft");
1396 if(graphtft) graphtft->SetupParse("CoverImage",image ? image:"");
1399 // --- cPluginMP3 --------------------------------------------------------------
1401 static const char *DESCRIPTION = trNOOP("A versatile audio player");
1402 static const char *MAINMENUENTRY = "MP3";
1404 class cPluginMp3 : public cPlugin {
1406 bool ExternalPlay(const char *path, bool test);
1409 virtual ~cPluginMp3();
1410 virtual const char *Version(void) { return PluginVersion; }
1411 virtual const char *Description(void) { return tr(DESCRIPTION); }
1412 virtual const char *CommandLineHelp(void);
1413 virtual bool ProcessArgs(int argc, char *argv[]);
1414 virtual bool Initialize(void);
1415 virtual void Housekeeping(void);
1416 virtual const char *MainMenuEntry(void);
1417 virtual cOsdObject *MainMenuAction(void);
1418 virtual cMenuSetupPage *SetupMenu(void);
1419 virtual bool SetupParse(const char *Name, const char *Value);
1420 virtual bool Service(const char *Id, void *Data);
1421 virtual const char **SVDRPHelpPages(void);
1422 virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
1425 cPluginMp3::cPluginMp3(void)
1427 // Initialize any member varaiables here.
1428 // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
1429 // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
1432 cPluginMp3::~cPluginMp3()
1434 InfoCache.Shutdown();
1438 const char *cPluginMp3::CommandLineHelp(void)
1440 static char *help_str=0;
1442 free(help_str); // for easier orientation, this is column 80|
1443 asprintf(&help_str," -m CMD, --mount=CMD use CMD to mount/unmount/eject mp3 sources\n"
1445 " -n CMD, --network=CMD execute CMD before & after network access\n"
1447 " -C DIR, --cache=DIR store ID3 cache file in DIR\n"
1449 " -B DIR, --cddb=DIR search CDDB files in DIR\n"
1451 " -D DEV, --dsp=DEV device for OSS output\n"
1453 " -i CMD, --iconv=CMD use CMD to convert background images\n"
1455 " -I IMG, --defimage=IMG use IMG as default background image\n"
1456 " (default: none)\n"
1457 " -c DIR, --icache=DIR cache converted images in DIR\n"
1459 " -S SUB, --sources=SUB search sources config in SUB subdirectory\n"
1463 netscript ? netscript:"none",
1464 cachedir ? cachedir:"video dir",
1477 sourcesSub ? sourcesSub:"empty"
1482 bool cPluginMp3::ProcessArgs(int argc, char *argv[])
1484 static struct option long_options[] = {
1485 { "mount", required_argument, NULL, 'm' },
1486 { "network", required_argument, NULL, 'n' },
1487 { "cddb", required_argument, NULL, 'B' },
1488 { "dsp", required_argument, NULL, 'D' },
1489 { "cache", required_argument, NULL, 'C' },
1490 { "icache", required_argument, NULL, 'c' },
1491 { "iconv", required_argument, NULL, 'i' },
1492 { "defimage", required_argument, NULL, 'I' },
1493 { "sources", required_argument, NULL, 'S' },
1497 int c, option_index = 0;
1498 while((c=getopt_long(argc,argv,"c:i:m:n:B:C:D:S:",long_options,&option_index))!=-1) {
1500 case 'i': imageconv=optarg; break;
1501 case 'c': imagecache=optarg; break;
1502 case 'm': mountscript=optarg; break;
1503 case 'n': netscript=optarg; break;
1504 case 'C': cachedir=optarg; break;
1505 case 'I': def_usr_img=optarg; break;
1506 case 'S': sourcesSub=optarg; break;
1509 cddbpath=optarg; break;
1511 fprintf(stderr, "mp3: libsndfile support has not been compiled in!\n"); return false;
1515 dspdevice=optarg; break;
1517 fprintf(stderr, "mp3: OSS output has not been compiled in!\n"); return false;
1519 default: return false;
1525 bool cPluginMp3::Initialize(void)
1527 if(!CheckVDRVersion(1,4,5,"mp3")) return false;
1529 #if APIVERSNUM < 10507
1532 i18n_name="vdr-mp3";
1534 MP3Sources.Load(AddDirectory(ConfigDirectory(sourcesSub),"mp3sources.conf"));
1535 if(MP3Sources.Count()<1) {
1536 esyslog("ERROR: you should have defined at least one source in mp3sources.conf");
1537 fprintf(stderr,"No source(s) defined in mp3sources.conf\n");
1541 #if APIVERSNUM < 10507
1542 RegisterI18n(Phrases);
1544 #if APIVERSNUM < 10503
1545 cCharSetConv::SetSystemCharacterTableX(I18nCharSets()[Setup.OSDLanguage]);
1547 mgr=new cPlayManager;
1549 esyslog("ERROR: creating playmanager failed");
1550 fprintf(stderr,"Creating playmanager failed\n");
1553 d(printf("mp3: using %s\n",mad_version))
1554 d(printf("mp3: compiled with %s\n",MAD_VERSION))
1558 void cPluginMp3::Housekeeping(void)
1563 const char *cPluginMp3::MainMenuEntry(void)
1565 return MP3Setup.HideMainMenu ? 0 : tr(MAINMENUENTRY);
1568 cOsdObject *cPluginMp3::MainMenuAction(void)
1570 return new cMenuMP3;
1573 cMenuSetupPage *cPluginMp3::SetupMenu(void)
1575 return new cMenuSetupMP3;
1578 bool cPluginMp3::SetupParse(const char *Name, const char *Value)
1580 if (!strcasecmp(Name, "InitLoopMode")) MP3Setup.InitLoopMode = atoi(Value);
1581 else if (!strcasecmp(Name, "InitShuffleMode")) MP3Setup.InitShuffleMode = atoi(Value);
1582 else if (!strcasecmp(Name, "AudioMode")) MP3Setup.AudioMode = atoi(Value);
1583 else if (!strcasecmp(Name, "BgrScan")) MP3Setup.BgrScan = atoi(Value);
1584 else if (!strcasecmp(Name, "EditorMode")) MP3Setup.EditorMode = atoi(Value);
1585 else if (!strcasecmp(Name, "DisplayMode")) MP3Setup.DisplayMode = atoi(Value);
1586 else if (!strcasecmp(Name, "BackgrMode")) MP3Setup.BackgrMode = atoi(Value);
1587 else if (!strcasecmp(Name, "MenuMode")) MP3Setup.MenuMode = atoi(Value);
1588 else if (!strcasecmp(Name, "TargetLevel")) MP3Setup.TargetLevel = atoi(Value);
1589 else if (!strcasecmp(Name, "LimiterLevel")) MP3Setup.LimiterLevel = atoi(Value);
1590 else if (!strcasecmp(Name, "Only48kHz")) MP3Setup.Only48kHz = atoi(Value);
1591 else if (!strcasecmp(Name, "UseProxy")) MP3Setup.UseProxy = atoi(Value);
1592 else if (!strcasecmp(Name, "ProxyHost")) strn0cpy(MP3Setup.ProxyHost,Value,MAX_HOSTNAME);
1593 else if (!strcasecmp(Name, "ProxyPort")) MP3Setup.ProxyPort = atoi(Value);
1594 else if (!strcasecmp(Name, "UseCddb")) MP3Setup.UseCddb = atoi(Value);
1595 else if (!strcasecmp(Name, "CddbHost")) strn0cpy(MP3Setup.CddbHost,Value,MAX_HOSTNAME);
1596 else if (!strcasecmp(Name, "CddbPort")) MP3Setup.CddbPort = atoi(Value);
1597 else if (!strcasecmp(Name, "AbortAtEOL")) MP3Setup.AbortAtEOL = atoi(Value);
1598 else if (!strcasecmp(Name, "AudioOutMode")) {
1599 MP3Setup.AudioOutMode = atoi(Value);
1601 if(MP3Setup.AudioOutMode==AUDIOOUTMODE_OSS) {
1602 esyslog("WARNING: AudioOutMode OSS not supported, falling back to DVB");
1603 MP3Setup.AudioOutMode=AUDIOOUTMODE_DVB;
1607 else if (!strcasecmp(Name, "ReplayDisplay")) MP3Setup.ReplayDisplay = atoi(Value);
1608 else if (!strcasecmp(Name, "HideMainMenu")) MP3Setup.HideMainMenu = atoi(Value);
1609 else if (!strcasecmp(Name, "KeepSelect")) MP3Setup.KeepSelect = atoi(Value);
1610 else if (!strcasecmp(Name, "TitleArtistOrder")) MP3Setup.TitleArtistOrder = atoi(Value);
1615 bool cPluginMp3::ExternalPlay(const char *path, bool test)
1617 char real[PATH_MAX+1];
1618 if(realpath(path,real)) {
1619 cFileSource *src=MP3Sources.FindSource(real);
1621 cFileObj *item=new cFileObj(src,0,0,otFile);
1623 item->SplitAndSet(real);
1624 if(item->GuessType()) {
1625 if(item->Exists()) {
1626 cInstantPlayList *pl=new cInstantPlayList(item);
1627 if(pl && pl->Load() && pl->Count()) {
1628 if(!test) cMP3Control::SetPlayList(pl);
1633 else dsyslog("MP3 service: error building playlist");
1636 else dsyslog("MP3 service: cannot play '%s'",path);
1638 else dsyslog("MP3 service: GuessType() failed for '%s'",path);
1642 else dsyslog("MP3 service: cannot find source for '%s', real '%s'",path,real);
1644 else if(errno!=ENOENT && errno!=ENOTDIR)
1645 esyslog("ERROR: realpath: %s: %s",path,strerror(errno));
1649 bool cPluginMp3::Service(const char *Id, void *Data)
1651 if(!strcasecmp(Id,"MP3-Play-v1")) {
1653 struct MPlayerServiceData *msd=(struct MPlayerServiceData *)Data;
1654 msd->result=ExternalPlay(msd->data.filename,false);
1658 else if(!strcasecmp(Id,"MP3-Test-v1")) {
1660 struct MPlayerServiceData *msd=(struct MPlayerServiceData *)Data;
1661 msd->result=ExternalPlay(msd->data.filename,true);
1668 const char **cPluginMp3::SVDRPHelpPages(void)
1670 static const char *HelpPages[] = {
1672 " Triggers playback of file 'filename'.",
1674 " Tests is playback of file 'filename' is possible.",
1676 " Returns filename of song currently being replayed.",
1682 cString cPluginMp3::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
1684 if(!strcasecmp(Command,"PLAY")) {
1686 if(ExternalPlay(Option,false)) return "Playback triggered";
1687 else { ReplyCode=550; return "Playback failed"; }
1689 else { ReplyCode=501; return "Missing filename"; }
1691 else if(!strcasecmp(Command,"TEST")) {
1693 if(ExternalPlay(Option,true)) return "Playback possible";
1694 else { ReplyCode=550; return "Playback not possible"; }
1696 else { ReplyCode=501; return "Missing filename"; }
1698 else if(!strcasecmp(Command,"CURR")) {
1699 cControl *control=cControl::Control();
1700 if(control && typeid(*control)==typeid(cMP3Control)) {
1702 if(mgr->Info(-1,&mode)) return mode.Filename;
1703 else return "<unknown>";
1705 else { ReplyCode=550; return "No running playback"; }
1710 VDRPLUGINCREATOR(cPluginMp3); // Don't touch this!