]> git.vomp.tv Git - vompclient.git/commitdiff
A couple of files were missing in git now added
authorMarten Richter <marten.richter@freenet.de>
Tue, 14 Oct 2014 18:00:39 +0000 (20:00 +0200)
committerMarten Richter <marten.richter@freenet.de>
Tue, 14 Oct 2014 18:00:39 +0000 (20:00 +0200)
13 files changed:
osdvector.cc
osdvector.h
other/properties.png [new file with mode: 0644]
other/radio.png [new file with mode: 0644]
other/recordings.png [new file with mode: 0644]
other/restart.png [new file with mode: 0644]
other/timers.png [new file with mode: 0644]
other/tv.png [new file with mode: 0644]
other/vdrhires.png [new file with mode: 0644]
vrecordinglistadvanced.cc [new file with mode: 0644]
vrecordinglistadvanced.h [new file with mode: 0644]
vrecordinglistclassic.cc [new file with mode: 0644]
vrecordinglistclassic.h [new file with mode: 0644]

index 01f4d9a5a0d205ad353627040a8db570afafa2a2..ac2f059697868053cd40c496009f6a59a4da3311 100644 (file)
@@ -153,14 +153,6 @@ Surface * OsdVector::createNewSurface()
        return new SurfaceVector(this);
 }
 
-void OsdVector::BeginPainting()
-{
-       surfaces_mutex.Lock();
-}
-void OsdVector::EndPainting()
-{
-       surfaces_mutex.Unlock();
-}
 
 void OsdVector::Blank()
 {
@@ -369,11 +361,13 @@ void OsdVector::removeImageRef(const ImageIndex ref)
 
 int OsdVector::getLoadIndexRef(LoadIndex index)
 {
+       surfaces_mutex.Lock();
        if (loadindex_ref.find(index)==loadindex_ref.end()) {
                return -1;
        } else {
                return loadindex_ref[index];
        }
+       surfaces_mutex.Unlock();
 }
 
 void OsdVector::incLoadIndexRef(LoadIndex index)
@@ -488,11 +482,13 @@ void OsdVector::cleanupOrphanedRefs()
 
 int OsdVector::getImageRef(ImageIndex index)
 {
+       surfaces_mutex.Lock();
        if (images_ref.find(index)==images_ref.end()) {
                return -1;
        } else {
                return images_ref[index];
        }
+       surfaces_mutex.Unlock();
 }
 
 void OsdVector::incStyleRef(unsigned int index)
@@ -511,36 +507,52 @@ void OsdVector::removeStyleRef(unsigned int index)
 
 unsigned int OsdVector::getStyleRef(const DrawStyle &c)
 {
+       surfaces_mutex.Lock();
        unsigned int style_handle=0;
        if (styles.find(pair<Colour*,unsigned int>((Colour*)&c,c.rgba()))==styles.end())
        {
-               style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=createStyleRef(c);
+               surfaces_mutex.Unlock();
+               style_handle=createStyleRef(c);
+               surfaces_mutex.Lock();
+               styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
        } else {
                style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())];
                //Now check if the handle is valid
                if (styles_ref.find(style_handle)==styles_ref.end()) {
                        //invalid handle recreate
-                       style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=createStyleRef(c);
+                       surfaces_mutex.Unlock();
+                       style_handle=createStyleRef(c);
+                       surfaces_mutex.Lock();
+                       styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
                }
        }
        incStyleRef(style_handle);
+       surfaces_mutex.Unlock();
        return style_handle;
 }
 
 unsigned int OsdVector::getColorRef(const Colour &c)
 {
+       surfaces_mutex.Lock();
        unsigned int style_handle=0;
        if (styles.find(pair<Colour*,unsigned int>((Colour*)&c,c.rgba()))==styles.end())
        {
-               style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=createColorRef(c);
+               surfaces_mutex.Unlock();
+               style_handle=createColorRef(c);
+               surfaces_mutex.Lock();
+               styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
        } else {
                style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())];
                if (styles_ref.find(style_handle)==styles_ref.end()) {
                        //invalid handle recreate
-                       style_handle=styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=createColorRef(c);
+                       surfaces_mutex.Unlock();
+                       style_handle=createColorRef(c);
+                       surfaces_mutex.Lock();
+                       styles[pair<Colour*,unsigned int>((Colour*)&c,c.rgba())]=style_handle;
                }
        }
        incStyleRef(style_handle);
+       surfaces_mutex.Unlock();
        return style_handle;
 }
 
@@ -557,6 +569,7 @@ LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
 {
        ImageIndex image_handle=0;
        LoadIndex loadindex=0;
+       surfaces_mutex.Lock();
        if (tvmedias.find(tvmedia)==tvmedias.end())
        {
                loadindex=loadTVMedia(tvmedia);
@@ -573,6 +586,7 @@ LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
        /*tvmedias[tvmedia]=createTVMedia(tvmedia,width,height);
        incImageRef(image_handle);*/
        image=image_handle;
+       surfaces_mutex.Unlock();
        return loadindex;
 }
 
@@ -619,15 +633,16 @@ void OsdVector::informPicture(LoadIndex index, ImageIndex imageIndex)
        //Beware for thread safety
        ImageIndex image_index=0;
 
+       Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Picture for request id %llx arrived %d",index, imageIndex);
+       surfaces_mutex.Lock();
        TVMediaInfo tvmedia=tvmedias_load_inv[index];
-         Log::getInstance()->log("OsdVector", Log::DEBUG, "TVMedia Picture for request id %llx arrived %d",index, imageIndex);
        if (imageIndex) {
                image_index=tvmedias[tvmedia]=imageIndex;
                tvmedias_loaded[index]=image_index;
-               if (getLoadIndexRef(index) < 1) {
+               if (loadindex_ref.find(index)==loadindex_ref.end()) {
                        // we do not want the picture anymore . Really...
                        // fill images_ref in to not irritate the garbage collector
-                       if (getImageRef(image_index) < 0) {
+                       if (images_ref.find(index)==images_ref.end()) {
                                images_ref[image_index]=0;
                        }
                } else {
@@ -635,6 +650,7 @@ void OsdVector::informPicture(LoadIndex index, ImageIndex imageIndex)
                        incImageRef(image_index); // hold one index until all loadings refs are gone;
                }
        }
+       surfaces_mutex.Unlock();
 
 
 }
@@ -666,17 +682,25 @@ ImageIndex OsdVector::getJpegRef(const char* fileName, int *width,int *height)
 ImageIndex OsdVector::getMonoBitmapRef(void *base,int width,int height)
 {
        ImageIndex image_handle;
+       surfaces_mutex.Lock();
        if (monobitmaps.find(base)==monobitmaps.end())
        {
-               image_handle=monobitmaps[base]=createMonoBitmap(base,width,height);
+               surfaces_mutex.Unlock();
+               image_handle=createMonoBitmap(base,width,height);
+               surfaces_mutex.Lock();
+               monobitmaps[base]=image_handle;
        } else {
                image_handle=monobitmaps[base];
                if (images_ref.find(image_handle)==images_ref.end()) {
                        //invalid handle recreate
-                       image_handle=monobitmaps[base]=createMonoBitmap(base,width,height);
+                       surfaces_mutex.Unlock();
+                       image_handle=createMonoBitmap(base,width,height);
+                       surfaces_mutex.Lock();
+                       monobitmaps[base]=image_handle;
                }
        }
        incImageRef(image_handle);
+       surfaces_mutex.Unlock();
        return image_handle;
 }
 
@@ -684,8 +708,10 @@ ImageIndex  OsdVector::getImagePalette(int width,int height,const unsigned char
 {
        ImageIndex image_handle;
        image_handle=createImagePalette(width,height,image_data,palette_data);
+       surfaces_mutex.Lock();
        palettepics.push_back(image_handle);
        incImageRef(image_handle);
+       surfaces_mutex.Unlock();
        return image_handle;
 }
 
index 7881f3ad61df75dd5228a6468655eeaa5370cc9b..698b66890549e87f8043f91b423214cefa46be92 100644 (file)
@@ -216,8 +216,6 @@ class OsdVector : public Osd
     virtual bool screenShot(void *buffer, int width, int height, bool osd /*include osd*/)=0;
 
     Surface * createNewSurface();
-       void BeginPainting();
-       void EndPainting();
 
        void Blank();
 
diff --git a/other/properties.png b/other/properties.png
new file mode 100644 (file)
index 0000000..77b00a5
Binary files /dev/null and b/other/properties.png differ
diff --git a/other/radio.png b/other/radio.png
new file mode 100644 (file)
index 0000000..df66c4e
Binary files /dev/null and b/other/radio.png differ
diff --git a/other/recordings.png b/other/recordings.png
new file mode 100644 (file)
index 0000000..d1f4902
Binary files /dev/null and b/other/recordings.png differ
diff --git a/other/restart.png b/other/restart.png
new file mode 100644 (file)
index 0000000..07b651b
Binary files /dev/null and b/other/restart.png differ
diff --git a/other/timers.png b/other/timers.png
new file mode 100644 (file)
index 0000000..e6860ba
Binary files /dev/null and b/other/timers.png differ
diff --git a/other/tv.png b/other/tv.png
new file mode 100644 (file)
index 0000000..32de8d4
Binary files /dev/null and b/other/tv.png differ
diff --git a/other/vdrhires.png b/other/vdrhires.png
new file mode 100644 (file)
index 0000000..91fc814
Binary files /dev/null and b/other/vdrhires.png differ
diff --git a/vrecordinglistadvanced.cc b/vrecordinglistadvanced.cc
new file mode 100644 (file)
index 0000000..557516f
--- /dev/null
@@ -0,0 +1,314 @@
+/*
+    Copyright 2004-2007 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
+
+#include "vrecordinglistadvanced.h"
+
+#include "recman.h"
+#include "directory.h"
+#include "recording.h"
+#include "recinfo.h"
+#include "remote.h"
+#include "wsymbol.h"
+#include "boxstack.h"
+#include "vrecordingmenu.h"
+#include "vrecording.h"
+#include "vdr.h"
+#include "vvideorec.h"
+#include "vradiorec.h"
+#include "colour.h"
+#include "video.h"
+#include "i18n.h"
+#include "command.h"
+#include "vinfo.h"
+#include "log.h"
+#include "movieinfo.h"
+#include "seriesinfo.h"
+#include "staticartwork.h"
+
+#include <sstream>
+
+
+VRecordingListAdvanced::VRecordingListAdvanced()
+{
+       setSize(640, 500); //old   setSize(570, 420);
+       createBuffer();
+
+       setPosition(40, 40);
+
+       setTitleBarOn(1);
+       setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
+    TVMediaInfo *info= new TVMediaInfo();
+    info->setStaticArtwork(sa_recordings);
+    setTitleBarIcon(info);
+
+       sl.setPosition(10, 30 + 5);
+       sl.setSize(area.w*42/100 - 20, area.h - 30 - 15 - 30);
+       sl.setLinesPerOption(2.4f);
+       add(&sl);
+
+       Region slarea=sl.getRegionR();
+
+       epg.setParaMode(true);
+       epg.setPosition(slarea.x  +slarea.w+10 ,30+5);
+       epg.setSize(area.w -slarea.x -slarea.w -10, area.h - 30 - 15 - 30);
+       add(&epg);
+       epg.setText("");
+       epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND);
+
+       epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
+       epgTVmedia.setSize(100,150/Osd::getInstance()->getPixelAspect());
+       epg.add(&epgTVmedia);
+
+}
+
+VRecordingListAdvanced::~VRecordingListAdvanced()
+{
+}
+
+void VRecordingListAdvanced::drawData(bool doIndexPop)
+{
+  int saveIndex = sl.getCurrentOption();
+  int saveTop = sl.getTopOption();
+  sl.clear();
+  sl.addColumn(0);
+  sl.addColumn(25 );
+  sl.addColumn(25 + 7);
+  //sl.addColumn(118);
+
+  int first = 1;
+
+  char tempA[300]; // FIXME  this is guesswork!
+  char tempB[300]; // FIXME
+  struct tm* btime;
+
+  Directory* currentSubDir;
+  DirectoryList::iterator i;
+  DirectoryList* dirList = recman->getDirectories();
+  for (i = dirList->begin(); i != dirList->end(); i++)
+  {
+    currentSubDir = *i;
+    SNPRINTF(tempA, 299, tr("\t%s \n \t <dir> %lu/%lu"),  currentSubDir->name, currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings());
+
+    TVMediaInfo *info= NULL;
+    if (currentSubDir->recList.begin() != currentSubDir->recList.end())
+    {
+               info=new TVMediaInfo();
+               info->setPosterThumb((*currentSubDir->recList.begin())->getFileName());
+    }
+    currentSubDir->index = sl.addOption(tempA, 0, first, info);
+    first = 0;
+
+  }
+  // FIXME convert the whole program to time_t's
+
+  Recording* currentRec;
+  RecordingList::iterator j;
+  RecordingList* recList = recman->getRecordings();
+  for (j = recList->begin(); j != recList->end(); j++)
+  {
+    currentRec = *j;
+    time_t recStartTime = (time_t)currentRec->getStartTime();
+    btime = localtime(&recStartTime);
+//NMT does not like this too!
+       //#ifndef _MSC_VER
+//    strftime(tempA, 299, "%0d/%0m %0H:%0M ", btime);
+//#else
+    strftime(tempA, 299, "%d/%m/%y %H:%M ", btime);
+//#endif
+    sprintf(tempB, "%c\t%s\n \t%s",  (currentRec->getNew() ? '*': ' '), currentRec->getProgName(),tempA);
+    // New TVMedia stuff
+    TVMediaInfo *info= new TVMediaInfo();
+    info->setPosterThumb(currentRec->getFileName());
+    currentRec->index = sl.addOption(tempB, 0, first, info);
+    first = 0;
+  }
+
+  if (doIndexPop)
+  {
+    sl.hintSetCurrent(slIndexStack.top());
+    slIndexStack.pop();
+  }
+  else
+  {
+    sl.hintSetCurrent(saveIndex);
+    sl.hintSetTop(saveTop);
+  }
+  updateSelection();
+  sl.draw();
+  doShowingBar();
+  epg.draw();
+}
+
+void VRecordingListAdvanced::draw(bool doIndexPop)
+{
+  if (!loading)
+  {
+    if (recman->isSubDir())
+    {
+      char title[300];
+      SNPRINTF(title, 299, tr("Recordings - %s"), recman->getCurDirName());
+      setTitleText(title, 364);
+    }
+    else
+    {
+      setTitleText(tr("Recordings"));
+    }
+  }
+
+  TBBoxx::draw();
+
+  if (loading)
+  {
+    drawText(tr("Loading..."), area.w*22/100-90, 180, DrawStyle::LIGHTTEXT);
+  }
+  else
+  {
+    char freeSpace[50];
+    int gigFree = recman->getFreeSpace() / 1024;
+    SNPRINTF(freeSpace, 49, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
+    drawTextRJ(freeSpace, 560+70, 5, DrawStyle::LIGHTTEXT);
+    // Symbols
+
+    WSymbol w;
+    TEMPADD(&w);
+    w.nextSymbol = WSymbol::UP;
+    w.setPosition(20, area.h-35);
+    w.draw();
+    w.nextSymbol = WSymbol::DOWN;
+    w.setPosition(50, area.h-35);
+    w.draw();
+    w.nextSymbol = WSymbol::SKIPBACK;
+    w.setPosition(85, area.h-35);
+    w.draw();
+    w.nextSymbol = WSymbol::SKIPFORWARD;
+    w.setPosition(115, area.h-35);
+    w.draw();
+    w.nextSymbol = WSymbol::PLAY;
+    w.setPosition(150, area.h-35);
+    w.draw();
+    drawTextRJ(tr("[ok] = menu"), 560+70, 385+80, DrawStyle::LIGHTTEXT);
+
+    // All static stuff done
+    drawData(doIndexPop);
+  }
+}
+
+void VRecordingListAdvanced::doShowingBar()
+{ //setSize(640, 500); //old   setSize(570, 420);
+  int topOption = sl.getTopOption() + 1;
+  if (sl.getNumOptions() == 0) topOption = 0;
+#ifndef GRADIENT_DRAWING
+  rectangle(area.w/2-65, area.h-115, 180, 25, DrawStyle::VIEWBACKGROUND);
+#endif
+  char showing[200];
+  sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
+  drawText(showing, area.w/2-65, area.h-35, DrawStyle::LIGHTTEXT);
+}
+
+void VRecordingListAdvanced::updateSelection()
+{
+       Recording* toShow = getCurrentOptionRecording();
+       if (toShow)
+       {
+               toShow->loadRecInfo();
+               std::stringstream description;
+               if (toShow->recInfo && strlen(toShow->recInfo->summary)){
+                       description << "\n"<< toShow->recInfo->title  << "\n\n";
+                       description << toShow->recInfo->summary;
+               }else {
+                       description << "\n" << std::string(toShow->getProgName()) << "\n\n";
+                       description << tr("Summary unavailable");
+
+               }
+               TVMedia poster;
+               poster.height=0;
+               if (toShow->movieInfo) {
+                       poster=toShow->movieInfo->poster;
+               }
+               if (toShow->seriesInfo) {
+                       if (toShow->seriesInfo->seasonposter.height) {
+                               poster=toShow->seriesInfo->seasonposter;
+                       }
+                       else
+                               if (toShow->seriesInfo->posters.size()) {
+                                       poster=toShow->seriesInfo->posters[0];
+                               }
+               }
+               if (poster.height) {
+                       epgTVmedia.setTVMedia(poster.info, WTVMedia::ZoomHorizontal);
+                       epgTVmedia.setVisible(true);
+               } else {
+                       epgTVmedia.setVisible(false);
+               }
+
+               epg.setText(description.str().c_str());
+       } else {
+               Directory* toShowDir = getCurrentOptionDirectory();
+               if (toShowDir)
+               {
+                       std::stringstream description;
+                       description << "\n"<< std::string(toShowDir->name) << "\n\n";
+
+                       Directory* currentSubDir;
+                       DirectoryList::iterator i;
+                       DirectoryList & dirList = toShowDir->dirList;
+                       for (i = dirList.begin(); i != dirList.end(); i++)
+                       {
+                               currentSubDir = *i;
+                               description << tr("<dir> ") <<  std::string(currentSubDir->name) << " "
+                                               << currentSubDir->getNumNewRecordings() <<"/"<< currentSubDir->getNumRecordings() <<"\n";
+                       }
+                       Recording* currentRec;
+                       RecordingList::iterator j;
+                       RecordingList & recList = toShowDir->recList;
+                       char tempA[300];
+                       struct tm* btime;
+                       for (j = recList.begin(); j != recList.end(); j++)
+                       {
+                               currentRec = *j;
+
+                               time_t recStartTime = (time_t)currentRec->getStartTime();
+                               btime = localtime(&recStartTime);
+                               strftime(tempA, 299, "%d/%m/%y %H:%M ", btime);
+
+                               description<< tempA <<" "<< std::string(currentRec->getProgName()) << "\n";
+
+                       }
+                       epgTVmedia.setVisible(false);
+                       epg.setText(description.str().c_str());
+
+
+               }
+       }
+
+}
+
+
+
+void VRecordingListAdvanced::quickUpdate() { //only quick for plattform that need it!
+       updateSelection();
+#ifdef GRADIENT_DRAWING
+      draw();
+#else
+      sl.draw();
+      doShowingBar();
+      epg.draw();
+#endif
+}
diff --git a/vrecordinglistadvanced.h b/vrecordinglistadvanced.h
new file mode 100644 (file)
index 0000000..1c4028c
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+    Copyright 2004-2005 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
+
+#ifndef VRECORDINGLIST_ADVANCED_H
+#define VRECORDINGLIST_ADVANCED_H
+
+
+
+#include "vrecordinglist.h"
+#include "wtextbox.h"
+#include "wtvmedia.h"
+
+class VRecordingListAdvanced : public VRecordingList
+{
+  public:
+    VRecordingListAdvanced();
+    virtual ~VRecordingListAdvanced();
+
+    void draw(bool doIndexPop = false);
+    bool load();
+    void drawData(bool doIndexPop = false);
+
+  protected:
+    void quickUpdate();
+    void doShowingBar();
+    void updateSelection();
+
+    WTextbox epg;
+    WTVMedia epgTVmedia;
+
+};
+
+#endif
diff --git a/vrecordinglistclassic.cc b/vrecordinglistclassic.cc
new file mode 100644 (file)
index 0000000..1322e53
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+    Copyright 2004-2007 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
+
+#include "vrecordinglistclassic.h"
+
+#include "recman.h"
+#include "directory.h"
+#include "recording.h"
+#include "remote.h"
+#include "wsymbol.h"
+#include "boxstack.h"
+#include "vrecordingmenu.h"
+#include "vrecording.h"
+#include "vdr.h"
+#include "vvideorec.h"
+#include "vradiorec.h"
+#include "colour.h"
+#include "video.h"
+#include "i18n.h"
+#include "command.h"
+#include "vinfo.h"
+#include "log.h"
+
+VRecordingListClassic::VRecordingListClassic()
+{
+  setSize(570, 420);
+  createBuffer();
+  if (Video::getInstance()->getFormat() == Video::PAL)
+  {
+    setPosition(80, 70);
+  }
+  else
+  {
+    setPosition(70, 35);
+  }
+
+  setTitleBarOn(1);
+  setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
+
+  sl.setPosition(10, 30 + 5);
+  sl.setSize(area.w - 20, area.h - 30 - 15 - 30);
+  add(&sl);
+}
+
+VRecordingListClassic::~VRecordingListClassic()
+{
+}
+
+void VRecordingListClassic::drawData(bool doIndexPop)
+{
+  int saveIndex = sl.getCurrentOption();
+  int saveTop = sl.getTopOption();
+  sl.clear();
+  sl.addColumn(0);
+  sl.addColumn(102);
+  sl.addColumn(118);
+
+  int first = 1;
+
+  char tempA[300]; // FIXME  this is guesswork!
+  char tempB[300]; // FIXME
+  struct tm* btime;
+
+  Directory* currentSubDir;
+  DirectoryList::iterator i;
+  DirectoryList* dirList = recman->getDirectories();
+  for (i = dirList->begin(); i != dirList->end(); i++)
+  {
+    currentSubDir = *i;
+    SNPRINTF(tempA, 299, tr("<dir> %lu/%lu\t \t%s"), currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings(), currentSubDir->name);
+    currentSubDir->index = sl.addOption(tempA, 0, first);
+    first = 0;
+  }
+  // FIXME convert the whole program to time_t's
+
+  Recording* currentRec;
+  RecordingList::iterator j;
+  RecordingList* recList = recman->getRecordings();
+  for (j = recList->begin(); j != recList->end(); j++)
+  {
+    currentRec = *j;
+    time_t recStartTime = (time_t)currentRec->getStartTime();
+    btime = localtime(&recStartTime);
+//NMT does not like this too!
+       //#ifndef _MSC_VER
+//    strftime(tempA, 299, "%0d/%0m %0H:%0M ", btime);
+//#else
+    strftime(tempA, 299, "%d/%m %H:%M ", btime);
+//#endif
+    sprintf(tempB, "%s\t%c\t%s", tempA, (currentRec->getNew() ? '*': ' '), currentRec->getProgName());
+      
+    currentRec->index = sl.addOption(tempB, 0, first);
+    first = 0;
+  }
+
+  if (doIndexPop)
+  {
+    sl.hintSetCurrent(slIndexStack.top());
+    slIndexStack.pop();
+  }
+  else
+  {
+    sl.hintSetCurrent(saveIndex);
+    sl.hintSetTop(saveTop);
+  }
+  sl.draw();
+  doShowingBar();
+}
+
+void VRecordingListClassic::draw(bool doIndexPop)
+{
+  if (!loading)
+  {
+    if (recman->isSubDir())
+    {
+      char title[300];
+      SNPRINTF(title, 299, tr("Recordings - %s"), recman->getCurDirName());
+      setTitleText(title, 364);
+    }
+    else
+    {
+      setTitleText(tr("Recordings"));
+    }
+  }
+
+  TBBoxx::draw();
+
+  if (loading)
+  {
+    drawText(tr("Loading..."), 240, 180, DrawStyle::LIGHTTEXT);
+  }
+  else
+  {
+    char freeSpace[50];
+    int gigFree = recman->getFreeSpace() / 1024;
+    SNPRINTF(freeSpace, 49, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
+    drawTextRJ(freeSpace, 560, 5, DrawStyle::LIGHTTEXT);
+    // Symbols
+
+    WSymbol w;
+    TEMPADD(&w);
+    w.nextSymbol = WSymbol::UP;
+    w.setPosition(20, 385);
+    w.draw();
+    w.nextSymbol = WSymbol::DOWN;
+    w.setPosition(50, 385);
+    w.draw();
+    w.nextSymbol = WSymbol::SKIPBACK;
+    w.setPosition(85, 385);
+    w.draw();
+    w.nextSymbol = WSymbol::SKIPFORWARD;
+    w.setPosition(115, 385);
+    w.draw();
+    w.nextSymbol = WSymbol::PLAY;
+    w.setPosition(150, 385);
+    w.draw();
+    drawTextRJ(tr("[ok] = menu"), 560, 385, DrawStyle::LIGHTTEXT);
+
+    // All static stuff done
+    drawData(doIndexPop);
+  }
+}
+
+void VRecordingListClassic::doShowingBar()
+{
+  int topOption = sl.getTopOption() + 1;
+  if (sl.getNumOptions() == 0) topOption = 0;
+#ifndef GRADIENT_DRAWING
+  rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND);
+#endif
+  char showing[200];
+  sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
+  drawText(showing, 220, 385, DrawStyle::LIGHTTEXT);
+}
+
+void VRecordingListClassic::quickUpdate() { //only quick for plattform that need it!
+#ifdef GRADIENT_DRAWING
+      draw();
+#else
+      sl.draw();
+      doShowingBar();
+#endif
+}
diff --git a/vrecordinglistclassic.h b/vrecordinglistclassic.h
new file mode 100644 (file)
index 0000000..9676c59
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    Copyright 2004-2005 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
+
+#ifndef VRECORDINGLIST_CLASSIC_H
+#define VRECORDINGLIST_CLASSIC_H
+
+
+
+#include "vrecordinglist.h"
+
+
+class VRecordingListClassic : public VRecordingList
+{
+  public:
+    VRecordingListClassic();
+    virtual ~VRecordingListClassic();
+
+    void draw(bool doIndexPop = false);
+    bool load();
+    void drawData(bool doIndexPop = false);
+
+  protected:
+    void quickUpdate();
+    void doShowingBar();
+
+};
+
+#endif