Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] [REVISED PATCH] vcd plugin for 1.3.18



Helmut Auer wrote:
Hi,
I do not understand too much of the audio streams, but the function SetAudioTrack within the VCD plugin should look something like that:

void cVcdPlayer::SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
{
if (IS_AUDIO_TRACK(Type)) {
if ((audioTrack == 0xC0) != (Type <= ttAudioFirst)) {
audioTrack = (Type > ttAudioFirst) ? 0xC1 : 0xC0;
Empty();
}
}
}


Thank you very much for your input.. I have replaced this function with the existing one and changed the virtual define. Now all of my plugins build successfully with NO warnings. :) This was the last one I needed.

Thanks everyone for helping me get through this little plugin ordeal. :)



diff -ru vcd-0.0.6c/vcd.c vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd.c
--- vcd-0.0.6c/vcd.c	2003-11-24 10:48:28.000000000 -0800
+++ vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd.c	2004-05-16 11:14:40.000000000 -0700
@@ -175,7 +175,11 @@
               }
            }
         else
-           Interface->Info(tr("No VideoCD detected"));
+#if VDRVERSNUM >= 10307
+					Skins.Message(mtInfo, tr("No VideoCD detected"));
+#else
+					Interface->Info(tr("No VideoCD detected"));
+#endif
         }
      else {
         if (VcdSetupData.PlaySequenceReplay && psd_size) {
@@ -186,7 +190,11 @@
         }
      }
   else
-     Interface->Info(tr("No disc inserted"));
+#if VDRVERSNUM >= 10307
+		Skins.Message(mtInfo, tr("No disc inserted"));
+#else
+		Interface->Info(tr("No disc inserted"));
+#endif
 
   return NULL;
 }
Only in vdr-1.3.18/PLUGINS/src/vcd-0.0.6c: vcd.c.orig
diff -ru vcd-0.0.6c/vcd_menu_control.c vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_menu_control.c
--- vcd-0.0.6c/vcd_menu_control.c	2003-11-01 05:19:38.000000000 -0800
+++ vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_menu_control.c	2005-01-12 21:03:36.000000000 -0800
@@ -33,6 +33,9 @@
 cMenuSpiControl::cMenuSpiControl(void)
 : cVcdViewerControl(spi, vcd)
 {
+#if VDRVERSNUM >= 10307
+	display = NULL;
+#endif
   visible = modeOnly = false;
 }
 
@@ -61,7 +64,11 @@
 void cMenuSpiControl::Hide(void)
 {
   if (visible) {
+#if VDRVERSNUM >= 10307
+		 delete display;
+#else
      Interface->Close();
+#endif
      needsFastResponse = visible = false;
      modeOnly = false;
      }
@@ -106,7 +113,7 @@
 class cVcdProgressBar : public cBitmap {
  protected:
     int total;
-    int Pos(int p) { return p * width / total; }
+    int Pos(int p) { return p * cBitmap::Width() / total; }
  public:
     cVcdProgressBar(int Width, int Height, int Current, int Total);
 };
@@ -114,12 +121,14 @@
 cVcdProgressBar::cVcdProgressBar(int Width, int Height, int Current, int Total)
 :cBitmap(Width, Height, 2)
 {
+#if VDRVERSNUM < 10307
   total = Total;
   if (total > 0) {
      int p = Pos(Current);
      Fill(0, 0, p, Height - 1, clrGreen);
      Fill(p + 1, 0, Width - 1, Height - 1, clrWhite);
   }
+#endif
 }
 
 
@@ -133,6 +142,9 @@
 cMenuVcdControl::cMenuVcdControl(void)
 : cVcdPlayerControl(track, vcd)
 {
+#if VDRVERSNUM >= 10307
+	display = NULL;
+#endif
   visible = modeOnly = shown = displayFrames = false;
   timeoutShow = 0;
   timeSearchActive = false;
@@ -170,20 +182,24 @@
   return track;
 }
 
-void cMenuVcdControl::Show(int Seconds)
+void cMenuVcdControl::Show(void)
 {
   if (modeOnly)
      Hide();
   if (!visible) {
      shown = ShowProgress(true);
-     timeoutShow = (shown && Seconds>0) ? time(0) + Seconds : 0;
+     timeoutShow = 0;
      }
 }
 
 void cMenuVcdControl::Hide(void)
 {
   if (visible) {
+#if VDRVERSNUM >= 10307
+		 delete display;
+#else
      Interface->Close();
+#endif
      needsFastResponse = visible = false;
      modeOnly = false;
      }
@@ -191,6 +207,7 @@
 
 void cMenuVcdControl::DisplayAtBottom(const char *s)
 {
+#if VDRVERSNUM < 10307
   if (s) {
      int w = cOsd::WidthInCells(s);
      int d = max(Width() - w, 0) / 2;
@@ -201,6 +218,7 @@
      }
   else
      Interface->Fill(12, 2, Width() - 22, 1, clrBackground);
+#endif
 }
 
 void cMenuVcdControl::ShowMode(void)
@@ -219,7 +237,11 @@
            Interface->Open(9, -1);
            Interface->Clear();
            XXX*/
+#if VDRVERSNUM >= 10307
+					 display = Skins.Current()->DisplayReplay(false);
+#else
            Interface->Open(0, -1); //XXX remove when displaying replay mode differently
+#endif
            visible = modeOnly = true;
            }
 
@@ -235,9 +257,13 @@
         if (p)
            *p = Speed > 0 ? '1' + Speed - 1 : ' ';
 
+#if VDRVERSNUM >= 10307
+				display->SetMode(Play, Forward, Speed);
+#else
         eDvbFont OldFont = Interface->SetFont(fontFix);
         DisplayAtBottom(buf);
         Interface->SetFont(OldFont);
+#endif
         }
      }
 }
@@ -248,19 +274,35 @@
 
   if (GetIndex(Current, Total) && Total > 0) {
      if (!visible) {
+#if VDRVERSNUM >= 10307
+			  display = Skins.Current()->DisplayReplay(false);
+#else
         Interface->Open(Setup.OSDwidth, -3);
+#endif
         needsFastResponse = visible = true;
         }
      if (Initial) {
+#if VDRVERSNUM < 10307
         Interface->Clear();
+#endif
         lastCurrent = lastTotal = -1;
         }
      if (title) 
+#if VDRVERSNUM >= 10307
+				display->SetTitle(title);
+#else
         Interface->Write(0, 0, title);
+#endif
      if (Total != lastTotal) {
+#if VDRVERSNUM >= 10307
+				display->SetTotal(IndexToHMSF(Total));
+        if (!Initial)
+					Skins.Flush();
+#else
         Interface->Write(-7, 2, IndexToHMSF(Total));
         if (!Initial)
            Interface->Flush();
+#endif
         }
      if (Current != lastCurrent || Total != lastTotal) {
 #ifdef DEBUG_OSD
@@ -268,13 +310,24 @@
         Interface->Fill(0, 1, p, 1, clrGreen);
         Interface->Fill(p, 1, Width() - p, 1, clrWhite);
 #else
+#if VDRVERSNUM >= 10307
+				display->SetProgress(Current, Total);
+        if (!Initial)
+					Skins.Flush();
+#else
         cVcdProgressBar ProgressBar(Width() * cOsd::CellWidth(), cOsd::LineHeight(), Current, Total);
         Interface->SetBitmap(0, cOsd::LineHeight(), ProgressBar);
         if (!Initial)
            Interface->Flush();
 #endif
+#endif
+#if VDRVERSNUM >= 10307
+				display->SetCurrent(IndexToHMSF(Current, displayFrames));
+				Skins.Flush();
+#else
         Interface->Write(0, 2, IndexToHMSF(Current, displayFrames));
         Interface->Flush();
+#endif
         lastCurrent = Current;
         }
      lastTotal = Total;
@@ -298,7 +351,11 @@
   char cm10 = timeSearchPos > 1 ? m10 : '-';
   char cm1  = timeSearchPos > 0 ? m1  : '-';
   sprintf(buf + len, "%c%c:%c%c", ch10, ch1, cm10, cm1);
+#if VDRVERSNUM >= 10307
+	display->SetJump(buf);
+#else
   DisplayAtBottom(buf);
+#endif
 }
 
 void cMenuVcdControl::TimeSearchProcess(eKeys Key)
@@ -451,8 +508,10 @@
      }
   if (DoShowMode)
      ShowMode();
+#if VDRVERSNUM < 10307
   if (DisplayedFrames && !displayFrames)
      Interface->Fill(0, 2, 11, 1, clrBackground);
+#endif
   return osContinue;
 }
 
Only in vdr-1.3.18/PLUGINS/src/vcd-0.0.6c: vcd_menu_control.c.orig
diff -ru vcd-0.0.6c/vcd_menu_control.h vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_menu_control.h
--- vcd-0.0.6c/vcd_menu_control.h	2003-10-21 13:01:57.000000000 -0700
+++ vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_menu_control.h	2005-01-12 21:03:36.000000000 -0800
@@ -18,6 +18,9 @@
 
 class cMenuSpiControl : public cVcdViewerControl {
 private:
+#if VDRVERSNUM >= 10307
+	cSkinDisplayReplay *display;
+#endif
   bool visible, modeOnly;
   static int spi;
   static cVcd *vcd;
@@ -34,6 +37,9 @@
 
 class cMenuVcdControl : public cVcdPlayerControl {
 private:
+#if VDRVERSNUM >= 10307
+	cSkinDisplayReplay *display;
+#endif
   bool visible, modeOnly, shown, displayFrames;
   time_t timeoutShow;
   bool timeSearchActive, timeSearchHide;
@@ -42,7 +48,6 @@
   static int track;
   static cVcd *vcd;
   static char *title;
-  void Show(int Seconds = 0);
   void DisplayAtBottom(const char *s = NULL);
   void ShowMode(void);
   bool ShowProgress(bool Initial);
@@ -57,5 +62,6 @@
   bool Visible(void) { return visible; }
   static void SetTrack(int Track, cVcd *Vcd);
   static const int LastReplayed(void);
+  void Show(void);
   };
 
Only in vdr-1.3.18/PLUGINS/src/vcd-0.0.6c: vcd_menu_control.h.orig
diff -ru vcd-0.0.6c/vcd_player.c vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_player.c
--- vcd-0.0.6c/vcd_player.c	2003-11-16 07:16:52.000000000 -0800
+++ vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_player.c	2005-01-13 06:44:49.000000000 -0800
@@ -92,7 +92,7 @@
   virtual bool GetReplayMode(bool &Play, bool &Forward, int &Sped);
   virtual int NumAudioTracks(void) const;
   virtual const char **GetAudioTracks(int *CurrentTrack = NULL) const;
-  virtual void SetAudioTrack(int Index);
+  virtual void SetAudioTrack(eTrackType Type, const tTrackId *TrackId);
   const char *DeviceName(void) { return vcd->DeviceName(); }
   };
 
@@ -525,7 +525,7 @@
 
         if (playFrame && autoWait<0) {
            StripAudioPackets((uchar *)playFrame->Data(), playFrame->Count(), (playMode == pmFast || playMode == pmSlow) ? 0x00 : audioTrack);
-           int w = PlayVideo(p, pc);
+           int w = PlayPes(p, pc);
            if (w > 0) {
               running = true;
               p += w;
@@ -822,14 +822,17 @@
   return NULL;
 }
 
-void cVcdPlayer::SetAudioTrack(int Index)
+void cVcdPlayer::SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
 {
-  if ((audioTrack == 0xC0) != (Index == 0)) {
-     audioTrack = (Index == 1) ? 0xC1 : 0xC0;
-     Empty();
-     }
+  if (IS_AUDIO_TRACK(Type)) {
+     if ((audioTrack == 0xC0) != (Type <= ttAudioFirst)) {
+       audioTrack = (Type > ttAudioFirst) ? 0xC1 : 0xC0;
+       Empty();
+       }
+  }
 }
 
+
 // --- cVcdPlayerControl -----------------------------------------------------
 
 cVcdPlayerControl::cVcdPlayerControl(int Track, cVcd *Vcd)
diff -ru vcd-0.0.6c/vcd_psd.h vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_psd.h
--- vcd-0.0.6c/vcd_psd.h	2003-10-22 04:21:17.000000000 -0700
+++ vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_psd.h	2004-05-16 11:14:43.000000000 -0700
@@ -14,7 +14,12 @@
 #define __VCD_PSD_H
 
 
+#include <vdr/config.h>
+#if VDRVERSNUM >= 10307
+#include <vdr/osdbase.h>
+#else
 #include <vdr/osd.h>
+#endif
 #include "vcd_func.h"
 
 
Only in vdr-1.3.18/PLUGINS/src/vcd-0.0.6c: vcd_psd.h.orig
diff -ru vcd-0.0.6c/vcd_viewer.c vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_viewer.c
--- vcd-0.0.6c/vcd_viewer.c	2003-11-17 10:59:48.000000000 -0800
+++ vdr-1.3.18/PLUGINS/src/vcd-0.0.6c/vcd_viewer.c	2005-01-12 21:03:36.000000000 -0800
@@ -211,7 +211,7 @@
 //            running = false;
 //         }
         if (playItem) {
-           int w = PlayVideo(p, pc);
+           int w = PlayPes(p, pc);
            if (w>0) {
               running = true;
               p += w;

Home | Main Index | Thread Index