]> git.vomp.tv Git - vompclient.git/commitdiff
v0.6 dev
authorChris Tallon <chris@vomp.tv>
Sun, 26 Jan 2020 21:33:03 +0000 (21:33 +0000)
committerChris Tallon <chris@vomp.tv>
Sun, 26 Jan 2020 21:33:03 +0000 (21:33 +0000)
Update some GPL headers
Don't import std by "using namespace std"
Start implementing brace-init initialisation
General code cleanup
Start implementing things calling MessageQueue::postMessage* instead of Command::
Removed Osd::init() parameter
Removed some log lines, some old comments

77 files changed:
audioomx.cc
audioomx.h
audiowin.h
boxstack.cc
boxx.cc
boxx.h
channel.h
command.cc
command.h
defines.h
directory.cc
directory.h
draintarget.h
dsallocator.h
eventdispatcher.h
i18n.cc
imageomx.cc
imageomx.h
main.cc
mark.h
media.h
mediaoptions.h
mediaplayer.h
messagequeue.cc
messagequeue.h
option.h
osd.h
osddirectfb.cc
osddirectfb.h
osdopengl.cc
osdopengl.h
osdopenvg.cc
osdopenvg.h
osdvector.cc
osdvector.h
osdwinpixel.cc
osdwinpixel.h
osdwinvector.cc
osdwinvector.h
playerliveradio.h
playerlivetv.h
recman.cc
remote.h
remotelinux.cc
remotelinux.h
serialize.h
surfacevector.cc
teletextdecodervbiebu.h
timers.h
vaudioselector.cc
vaudioselector.h
vdp6.h
vdr.cc
vdr.h
vepg.cc
videoomx.cc
videoomx.h
videowin.h
vmedialist.cc
vopts.cc
vopts.h
vquestion.cc
vquestion.h
vrecordinglist.h
vserverselect.cc
vserverselect.h
vsleeptimer.cc
vsleeptimer.h
vvideolivetv.cc
vvolume.cc
vwelcome.cc
winmain.cc
woptionpane.h
wpictureview.cc
wpictureview.h
wselectlist.h
wtabbar.h

index 58c29cb0df2c1dcab9f5a3e532013b25a573c67d..94f5137bf74a68e6d174345ce93c406b11271ed1 100644 (file)
@@ -1276,7 +1276,7 @@ int AudioOMX::DestroyInputBufsOMXwhilePlaying() //call with clock mutex locked
        while (input_bufs_omx_all.size()>0) {
                if (input_bufs_omx_free.size()>0) {
                        // Destroy one buffer
-                       vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
+                       std::vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
                        OMX_BUFFERHEADERTYPE* cur_buf=input_bufs_omx_free.front();
                        for (; itty!= input_bufs_omx_all.end();itty++) {
                                if ((*itty)==cur_buf) {
index 5a3b18d8575b226a444096e690a1516a1f7c7ae0..326038002d4a2c25fd4fcc08d9e60702db9dcbb6 100644 (file)
@@ -167,8 +167,8 @@ class AudioOMX : public Audio
        int ChangeAudioDestination();
        long long correctAudioLatency(long long pts,int addsamples,int srate);
 
-       vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
-       list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
+       std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
+       std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
        Mutex input_bufs_omx_mutex;
        OMX_BUFFERHEADERTYPE* cur_input_buf_omx;
 
index e1b087cb80c271f89f51c6af1125fec30e5d3c6f..c3eed89fd6886afaa13e5a2ba8e093fe0f2eba1c 100644 (file)
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #ifndef AUDIOWIN_H
@@ -34,8 +33,7 @@ struct AudioFilterDesc {
     char * displayname;
     char * friendlyname;
 };
-using namespace std;
-typedef vector<AudioFilterDesc> AudioFilterDescList;
+typedef std::vector<AudioFilterDesc> AudioFilterDescList;
 
 class AudioWin : public Audio
 {
index fe26a213c6cd29fdcaae3a773639eacc29e7cb3b..1776c611af4d4c6d5a3ab3375a9ae219886a1a0a 100644 (file)
@@ -69,7 +69,7 @@ void BoxStack::removeAll()
 int BoxStack::addVideoDisplay(Boxx* box,VideoDisplay vd)
 {
          boxLock.Lock();
-         videoStack.push(pair<Boxx*,VideoDisplay>(box,vd));
+         videoStack.push(std::pair<Boxx*,VideoDisplay>(box,vd));
          boxLock.Unlock();
          Video::getInstance()->setVideoDisplay(vd);
          return 1;
diff --git a/boxx.cc b/boxx.cc
index 73e81716b7b25425a891d508896e8222b58d49b3..21bdb9c0e78e98c89b584b7fcd7ea5efca1686fe 100644 (file)
--- a/boxx.cc
+++ b/boxx.cc
@@ -64,7 +64,7 @@ void Boxx::draw()
   if (backgroundColourSet) fillColour(backgroundColour);
 
   Boxx* currentBoxx;
-  vector<Boxx*>::iterator j;
+  std::vector<Boxx*>::iterator j;
   //int count=0;
   for (j = children.begin(); j != children.end(); j++)
   {
@@ -103,7 +103,7 @@ void Boxx::add(Boxx* newChild)
 
 void Boxx::remove(Boxx* oldChild)
 {
-  for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+  for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
   {
     if (*i == oldChild)
     {
@@ -116,7 +116,7 @@ void Boxx::remove(Boxx* oldChild)
 
 void Boxx::removeVisibleChilds(Region & r)
 {
-       for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+       for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
        {
                if ((*i)->getVisible())
                {
@@ -264,7 +264,7 @@ void Boxx::getRootBoxRegion(Region* r)
 
 bool Boxx::getVideoDisplay(VideoDisplay &vd)
 {
-       for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+       for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
        {
                if ((*i)->getVideoDisplay(vd)) return true;
        }
diff --git a/boxx.h b/boxx.h
index abd97c639b99936f0a4cd714cecaa19462c5f39a..6041513562324d57c144b45bb78506701274827c 100644 (file)
--- a/boxx.h
+++ b/boxx.h
@@ -23,8 +23,6 @@
 #include <stdio.h>
 #include <vector>
 
-using namespace std;
-
 #include "colour.h"
 #include "region.h"
 #include "message.h"
@@ -144,7 +142,7 @@ class Boxx
     Surface *getSurface();
     Boxx* parent;
     Region area;
-    vector<Boxx*> children;
+    std::vector<Boxx*> children;
     VideoDisplay vdisplay;
 
     void setParent(Boxx*);    
index bb9ea8f20180dc3533f5112b19dd99db705722fc..c6587fd172960ccd46e8e1609153454fdf4ec6e9 100644 (file)
--- a/channel.h
+++ b/channel.h
@@ -26,7 +26,6 @@
 
 #include "defines.h"
 
-using namespace std;
 // A struct to hold a audio pid pair
 
 typedef struct _apid
@@ -38,7 +37,7 @@ typedef struct _apid
   ULONG data2;
 } apid;
 
-typedef vector<apid> APidList;
+typedef std::vector<apid> APidList;
 
 class Channel
 {
index a77129a4c5992084afd2d178472f48e07df5db04..34b95c1d0d5455345234ca8b4481aebf8ec31988 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2020 Chris Tallon
 
     This file is part of VOMP.
 
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #ifndef WIN32
@@ -64,14 +63,6 @@ Command::Command()
 {
   if (instance) return;
   instance = this;
-  initted = 0;
-  isStandby = 0;
-  firstBoot = 1;
-  signals = 0;
-  connLost = NULL;
-  crashed = false;
-  server = NULL;
-  wallpaper = wallpaper_pict = NULL;
 }
 
 Command::~Command()
@@ -87,7 +78,7 @@ Command* Command::getInstance()
 int Command::init(bool tcrashed, char* tServer)
 {
   if (initted) return 0;
-  initted = 1;
+  initted = true;
   crashed = tcrashed;
   server = tServer;
 
@@ -99,7 +90,7 @@ int Command::init(bool tcrashed, char* tServer)
   
   if (!logger || !boxstack || !remote)
   {
-    initted = 0;
+    initted = false;
     return 0;
   }
 
@@ -108,7 +99,7 @@ int Command::init(bool tcrashed, char* tServer)
 #ifndef WIN32
   pthread_mutex_init(&masterLock, NULL);
 #else
-  masterLock=CreateMutex(NULL,FALSE,NULL);
+  masterLock = CreateMutex(NULL, FALSE, NULL);
 #endif
 
   return 1;
@@ -117,85 +108,73 @@ int Command::init(bool tcrashed, char* tServer)
 int Command::shutdown()
 {
   if (!initted) return 0;
-  initted = 0;
+  initted = false;
   return 1;
 }
 
 void Command::stop()
 {
-//  VDR::getInstance()->cancelFindingServer();
-       logger->log("Command", Log::NOTICE, "Command stop1...");
-       
+  logger->log("Command", Log::NOTICE, "stop");
   udp.shutdown();
-  logger->log("Command", Log::NOTICE,  "Command stop2...");
-  irun = 0;
+  irun = false;
 }
 
 void Command::doWallpaper()
 {
-       Video* video = Video::getInstance();
-
-       // Blue background
-       Boxx* bbg = new Boxx();
-       bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
-       bbg->createBuffer();
-       bbg->fillColour(DrawStyle::WALLPAPER);
-       boxstack->add(bbg);
-       boxstack->update(bbg);
-       boxstack->remove(bbg);
-
-       // Wallpaper
-       wallpaper = new Boxx();
-       wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
-       wallpaper->createBuffer();
-       wallpaper ->setBackgroundColour(DrawStyle::WALLPAPER);
-
-
+  Video* video = Video::getInstance();
 
+  // Blue background
+  Boxx* bbg = new Boxx();
+  bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
+  bbg->createBuffer();
+  bbg->fillColour(DrawStyle::WALLPAPER);
+  boxstack->add(bbg);
+  boxstack->update(bbg);
+  boxstack->remove(bbg);
 
-       wallpaper_pict = new WJpegTYPE();
-       wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
+  // Wallpaper
+  wallpaper = new Boxx();
+  wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
+  wallpaper->createBuffer();
+  wallpaper->setBackgroundColour(DrawStyle::WALLPAPER);
 
+  wallpaper_pict = new WJpegTYPE();
+  wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
 
-       if (video->getFormat() == Video::PAL)
-       {
-               logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
+  if (video->getFormat() == Video::PAL)
+  {
+    logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
 #ifndef _MIPS_ARCH    
-               wallpaper_pict->init("/wallpaperPAL.jpg");
+    wallpaper_pict->init("/wallpaperPAL.jpg");
 #else
-               wallpaper_pict->init("wallpaperPAL.jpg");
+    wallpaper_pict->init("wallpaperPAL.jpg");
 #endif
-       }
-       else
-       {
-               logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
-               wallpaper_pict->init("/wallpaperNTSC.jpg");
-       }
-       if (DrawStyle::WALLPAPER.alpha) {
-               wallpaper_pict->setVisible(true);
-       } else {
-               wallpaper_pict->setVisible(false);
-       }
-       wallpaper->add(wallpaper_pict);
-       wallpaper->draw();
-
-       boxstack->add(wallpaper);
-       boxstack->update(wallpaper);
-
-    OsdVector* osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
-    if (osdv)
-    {
-         osdv->updateBackgroundColor(DrawStyle::WALLPAPER);
-    }
+  }
+  else
+  {
+    logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
+    wallpaper_pict->init("/wallpaperNTSC.jpg");
+  }
+
+  if (DrawStyle::WALLPAPER.alpha)
+    wallpaper_pict->setVisible(true);
+  else
+    wallpaper_pict->setVisible(false);
 
+  wallpaper->add(wallpaper_pict);
+  wallpaper->draw();
 
+  boxstack->add(wallpaper);
+  boxstack->update(wallpaper);
 
+  OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
+  if (osdv) osdv->updateBackgroundColor(DrawStyle::WALLPAPER);
 }
 
 void Command::run()
 {
   if (!initted) return;
-  irun = 1;
+  irun = true;
 #ifndef WIN32
   mainPid = getpid();
 #endif
@@ -207,13 +186,11 @@ void Command::run()
   doWallpaper();
 
   // End of startup. Lock the mutex and put the first view up
-//  logger->log("Command", Log::DEBUG, "WANT LOCK");
 #ifndef WIN32
   pthread_mutex_lock(&masterLock);
 #else
   WaitForSingleObject(masterLock, INFINITE );
 #endif
-  //logger->log("Command", Log::DEBUG, "LOCKED");
 
   if (crashed)
   {
@@ -233,7 +210,6 @@ void Command::run()
   while(irun)
   {
     // unlock and wait
-    //logger->log("Command", Log::DEBUG, "UNLOCK");
 #ifndef WIN32
     pthread_mutex_unlock(&masterLock);
 #else
@@ -243,34 +219,27 @@ void Command::run()
     // something happened, lock and process
     if (signals) processSignals(); // If a signal arrived process now.
 
-    //  logger->log("Command", Log::DEBUG, "WANT LOCK");
 #ifndef WIN32
     pthread_mutex_lock(&masterLock);
 #else
     WaitForSingleObject(masterLock, INFINITE );
 #endif
-    // logger->log("Command", Log::DEBUG, "LOCK");
 
-    if ((button == Remote::NA_NONE) /*|| (button == Remote::NA_UNKNOWN)*/) continue;
+    if (button == Remote::NA_NONE) continue;
 
     if (button != Remote::NA_SIGNAL) handleCommand(button);
     processMessageQueue();
-
   }
 
-  //logger->log("Command", Log::DEBUG, "UNLOCK");
 #ifndef WIN32
   pthread_mutex_unlock(&masterLock);
 #else
   ReleaseMutex(masterLock);
 #endif
 
-
-
   boxstack->removeAllExceptWallpaper();
   boxstack->remove(wallpaper);
   delete wallpaper_pict; wallpaper_pict = NULL; wallpaper = NULL;
-
 }
 
 void Command::setSignal(int signalReceived)
@@ -334,13 +303,11 @@ void Command::postMessage(Message* m)
   // locking the mutex ensures that the master thread is waiting on getButtonPress
 
 
-  //logger->log("Command", Log::DEBUG, "WANT LOCK");
 #ifndef WIN32
   pthread_mutex_lock(&masterLock);
 #else
   WaitForSingleObject(masterLock, INFINITE );
 #endif
-  //logger->log("Command", Log::DEBUG, "LOCK");
   MessageQueue::postMessage(m);
 
 #ifndef WIN32
@@ -354,10 +321,9 @@ void Command::postMessage(Message* m)
   ((RemoteWin*)Remote::getInstance())->Signal();
   ReleaseMutex(masterLock);
 #endif
-  //logger->log("Command", Log::DEBUG, "UNLOCK");
 }
 
-void Command::postMessageNoLock(Message* m)
+void Command::postMessageNoLock(Message* m) // FIXME - get rid of this if the sending-to-MessageQueue idea pans out
 {
   // As above but use this one if this message is being posted because of a button press
   // the mutex is already locked, locking around postMessage is not needed as the
@@ -369,11 +335,9 @@ bool Command::postMessageIfNotBusy(Message* m)
 {
   // Used for Windows mouse events
 
-  //logger->log("Command", Log::DEBUG, "TRY LOCK");
 #ifndef WIN32
   if (pthread_mutex_trylock(&masterLock) != EBUSY)
   {
-    //logger->log("Command", Log::DEBUG, "LOCK");
     MessageQueue::postMessage(m);
 #ifndef __ANDROID__
     kill(mainPid, SIGURG);
@@ -381,7 +345,6 @@ bool Command::postMessageIfNotBusy(Message* m)
     ((RemoteAndroid*)Remote::getInstance())->Signal();
 #endif
     pthread_mutex_unlock(&masterLock);
-    //logger->log("Command", Log::DEBUG, "UNLOCK");
     return true;
   }
   else
@@ -478,7 +441,7 @@ void Command::processMessage(Message* m)
 
       case Message::VDR_CONNECTED:
       {
-        doJustConnected((VConnect*)m->from);
+        doJustConnected(static_cast<VConnect*>(m->from));
         break;
       }
       case Message::SCREENSHOT:
@@ -527,22 +490,18 @@ void Command::processMessage(Message* m)
       }
       case Message::NEW_PICTURE:
       {
-         //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE");
-         OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
-         if (osdv) {
-                 osdv->informPicture(m->tag,m->parameter.handle);
-         }
-
-      } break;
+        //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE");
+        OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
+        if (osdv) osdv->informPicture(m->tag, m->parameter.handle);
+        break;
+      }
       case Message::NEW_PICTURE_STATIC:
       {
-         //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter.num);
-         OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
-         if (osdv) {
-                 osdv->informPicture(((unsigned long long)m->tag)<<32LL,m->parameter.handle);
-         }
-
-      } break;
+        //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter.num);
+        OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
+        if (osdv) osdv->informPicture(((unsigned long long)m->tag)<<32LL,m->parameter.handle);
+        break;
+      }
     }
   }
   else
@@ -563,7 +522,9 @@ void Command::processMessage(Message* m)
 void Command::handleCommand(int button)
 {
   if (isStandby && (button != Remote::POWER) 
-      && (button != Remote::POWERON) && (button != Remote::POWEROFF))  return;
+                && (button != Remote::POWERON)
+                && (button != Remote::POWEROFF))  return;
+
   if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost
 
   // command was not handled
@@ -575,27 +536,34 @@ void Command::handleCommand(int button)
     case Remote::VOLUMEUP:
     case Remote::VOLUMEDOWN:
     {
-       if (remote->handlesVolume()) {
-               if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
-                       remote->volumeDown();
-               else remote->volumeUp();
-       } else {
-               VVolume* v = new VVolume();
-               boxstack->add(v);
-               v->handleCommand(button); // this will draw+show
-       }
+      if (remote->handlesVolume())
+      {
+        if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN)
+          remote->volumeDown();
+        else
+          remote->volumeUp();
+      }
+      else
+      {
+        VVolume* v = new VVolume();
+        boxstack->add(v);
+        v->handleCommand(button); // this will draw+show
+      }
       return;
     }
     case Remote::MUTE:
     {
-       if (remote->handlesVolume()) {
-               remote->volumeMute();
-       } else {
-               VMute* v = new VMute();
-               v->draw();
-               boxstack->add(v);
-               boxstack->update(v);
-       }
+      if (remote->handlesVolume())
+      {
+        remote->volumeMute();
+      }
+      else
+      {
+        VMute* v = new VMute();
+        v->draw();
+        boxstack->add(v);
+        boxstack->update(v);
+      }
       return;
     }
     case Remote::POWER:
@@ -648,7 +616,7 @@ void Command::doStandby()
   }
   else
   {
-   doPowerOff();
+    doPowerOff();
   }
 }
 
@@ -660,8 +628,7 @@ void Command::doPowerOn()
     Video::getInstance()->signalOn();
     Led::getInstance()->on();
     Remote::getInstance()->changePowerState(true);
-    isStandby = 0;
-
+    isStandby = false;
 
     VConnect* vconnect = new VConnect(server);
     boxstack->add(vconnect);
@@ -683,7 +650,7 @@ void Command::doPowerOff()
     VDR::getInstance()->disconnect();
     Led::getInstance()->off();
     Remote::getInstance()->changePowerState(false);
-    isStandby = 1;
+    isStandby = true;
     Sleeptimer::getInstance()->shutdown();
 #ifdef WIN32
     stop(); //different behavoiur on windows, we exit
@@ -798,44 +765,45 @@ void Command::buildCrashedBox()
   boxstack->update(crash);
 }
 
-int Command::getLangPref(bool subtitle,const char* langcode)
+int Command::getLangPref(bool subtitle, const char* langcode)
 {
-       vector<struct ASLPref>::iterator itty=langcodes.begin();
-       char templangcode[4];
-       templangcode[0]=langcode[0];
-       templangcode[1]=langcode[1];
-       templangcode[2]=langcode[2];
-       templangcode[3]='\0';
-       int langpos =0;
-       while (itty != langcodes.end()) {
-               size_t pos=(*itty).langcode.find(templangcode);
-               if (pos != string::npos) {
-                       //vector<struct ASLPref>::iterator itty2=langcodes.begin();
-                       for (unsigned int i=0; i<langcodes.size();i++) {
-                               int pref=0;
-                               if (subtitle) {
-                                       pref=langcodes[i].subtitlepref;
-                               } else {
-                                       pref=langcodes[i].audiopref;
-                               }
-                               if (pref < 0) break;
-
-                               if (subtitle) {
-                                       if (langcodes[i].subtitlepref==langpos) {
-                                               return i;
-                                       }
-                               } else {
-                                       if (langcodes[i].audiopref==langpos) {
-                                               return i;
-                                       }
-                               }
-                       }
-                       break;
-               }
-               itty++;
-               langpos++;
-       }
-       return langcodes.size(); //neutral
+  std::vector<struct ASLPref>::iterator itty=langcodes.begin();
+  char templangcode[4];
+  templangcode[0] = langcode[0];
+  templangcode[1] = langcode[1];
+  templangcode[2] = langcode[2];
+  templangcode[3] = '\0';
+  int langpos = 0;
+  while (itty != langcodes.end())
+  {
+    size_t pos = (*itty).langcode.find(templangcode);
+    if (pos != std::string::npos)
+    {
+      //vector<struct ASLPref>::iterator itty2=langcodes.begin();
+      for (unsigned int i = 0; i < langcodes.size(); i++)
+      {
+        int pref = 0;
+        if (subtitle)
+          pref = langcodes[i].subtitlepref;
+        else
+          pref = langcodes[i].audiopref;
+        if (pref < 0) break;
+
+        if (subtitle)
+        {
+          if (langcodes[i].subtitlepref==langpos) return i;
+        }
+        else
+        {
+          if (langcodes[i].audiopref==langpos) return i;
+        }
+      }
+      break;
+    }
+    itty++;
+    langpos++;
+  }
+  return langcodes.size(); //neutral
 }
 
 void Command::doJustConnected(VConnect* vconnect)
@@ -878,27 +846,33 @@ void Command::doJustConnected(VConnect* vconnect)
   if (config) delete[] config;
 
   config = vdr->configLoad("Advanced", "Skin Name");
-  if (config) {
-         const char **skinnames=SkinFactory::getSkinNames();
-         for (int i=0;i<SkinFactory::getNumberofSkins();i++) {
-                 if (!STRCASECMP(config, skinnames[i])) {
-                         SkinFactory::InitSkin(i);
-                         break;
-                 }
-         }
-         delete[] config;
-         if (wallpaper && wallpaper_pict) {
-                 if (DrawStyle::WALLPAPER.alpha) {
-                         wallpaper_pict->setVisible(true);
-                 } else {
-                         wallpaper_pict->setVisible(false);
-                 }
-                 wallpaper->draw();
-                 boxstack->update(wallpaper);
-         }
-
-  } else {
-         SkinFactory::InitSkin(0);
+  if (config)
+  {
+    const char **skinnames=SkinFactory::getSkinNames();
+    for (int i=0;i<SkinFactory::getNumberofSkins();i++)
+    {
+      if (!STRCASECMP(config, skinnames[i]))
+      {
+        SkinFactory::InitSkin(i);
+        break;
+      }
+    }
+    delete[] config;
+
+    if (wallpaper && wallpaper_pict)
+    {
+      if (DrawStyle::WALLPAPER.alpha)
+        wallpaper_pict->setVisible(true);
+      else
+        wallpaper_pict->setVisible(false);
+
+      wallpaper->draw();
+      boxstack->update(wallpaper);
+    }
+  }
+  else
+  {
+    SkinFactory::InitSkin(0);
   }
 
   // See if config says to override video format (PAL/NTSC)
@@ -952,7 +926,7 @@ void Command::doJustConnected(VConnect* vconnect)
 
 #ifndef __ANDROID__
       //we do not init twice
-      osd->init((char*)("/dev/stbgfx"));
+      osd->init();
 #endif
 
       // Put the wallpaper back
@@ -985,7 +959,7 @@ void Command::doJustConnected(VConnect* vconnect)
   // Power off if first boot and config says so
   if (firstBoot)
   {
-    firstBoot = 0;
+    firstBoot = false;
 
     logger->log("Command", Log::DEBUG, "Load power after boot");
 
@@ -1198,29 +1172,27 @@ void Command::doJustConnected(VConnect* vconnect)
 
   // Set recording list type
 
-  advmenues=false;
-#ifdef   ADVANCED_MENUES
+#ifdef ADVANCED_MENUES
   config = vdr->configLoad("Advanced", "Menu type");
 
   if (config)
   {
-         if (!STRCASECMP(config, "Advanced"))
-         {
-                 logger->log("Command", Log::INFO, "Switching to Advanced menu");
-                 advmenues=true;
-
-         }
-         else
-         {
-                 logger->log("Command", Log::INFO, "Switching to Classic menu");
-                 advmenues=false;
-         }
-         delete[] config;
+    if (!STRCASECMP(config, "Advanced"))
+    {
+      logger->log("Command", Log::INFO, "Switching to Advanced menu");
+      advMenus = true;
+    }
+    else
+    {
+      logger->log("Command", Log::INFO, "Switching to Classic menu");
+      advMenus = false;
+    }
+    delete[] config;
   }
   else
   {
-         logger->log("Command", Log::INFO, "Config General/menu type not found");
-         advmenues=true;
+    logger->log("Command", Log::INFO, "Config General/menu type not found");
+    advMenus = true;
   }
 #endif
 
index 04cd8035bfe1ce5ab20b29aeec2e938f2a5ae224..49bf40daff1cdf48d9a8c0b85dccfbf89c79c286 100644 (file)
--- a/command.h
+++ b/command.h
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2020 Chris Tallon
 
     This file is part of VOMP.
 
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #ifndef COMMAND_H
@@ -56,13 +55,7 @@ struct ASLPref {
        int subtitlepref;
 };
 
-typedef vector<struct ASLPref> ASLPrefList;
-
-#define SIG_INT 1
-#define SIG_TERM 2
-#define SIG_USR1 4
-#define SIG_USR2 8
-#define SIG_URG 16
+typedef std::vector<struct ASLPref> ASLPrefList;
 
 class Command : public MessageQueue
 {
@@ -74,7 +67,6 @@ class Command : public MessageQueue
     int init(bool crashed = false, char* server = NULL);
     int shutdown();
     void run();
-    void stop();
     void doReboot();
     void postMessage(Message* m); // override of MessageQueue::postMessage
     void postMessageNoLock(Message* m); // override of MessageQueue::postMessage
@@ -83,14 +75,15 @@ class Command : public MessageQueue
     void setSignal(int signalReceived);
     void connectionLost();
 
-    void setAdvMenues(bool adv) {advmenues=adv;};
-    bool advMenues() { return advmenues;};
+    void setAdvMenus(bool adv) { advMenus = adv; };
+    bool isAdvMenus() { return advMenus; };
     int getLangPref(bool subtitle,const char* langcode);
     void setSubDefault(int subon) {subdefault=subon;};
     int getSubDefault() { return subdefault;};
     ASLPrefList &getASLList(){return langcodes;};
 
   private:
+    void stop();
     void handleCommand(int);
     void processSignals();
     void doStandby();
@@ -110,28 +103,35 @@ class Command : public MessageQueue
     HANDLE masterLock;
     HANDLE mainPid; //Window
 #endif
-    UCHAR initted;
-    UCHAR irun;
-    UCHAR isStandby;
-    UCHAR firstBoot;
-    ULONG signals;
+    bool initted{};
+    bool irun{};
+    bool isStandby{};
+    bool firstBoot{true};
+    int signals{};
 
     Log* logger;
     BoxStack* boxstack;
     Remote* remote;
-    Boxx* wallpaper;
-    WJpeg* wallpaper_pict;
-    VInfo* connLost;
-    bool crashed;
-    char* server;
+    Boxx* wallpaper{};
+    WJpeg* wallpaper_pict{};
+    VInfo* connLost{};
+    bool crashed{};
+    char* server{};
 
-    bool  advmenues;
+    bool advMenus{};
     ASLPrefList langcodes;
     int subdefault;
         
     UDP udp;
 
     void processMessage(Message* m);
+
+    const static int SIG_INT{1};
+    const static int SIG_TERM{2};
+    const static int SIG_USR1{4};
+    const static int SIG_USR2{8};
+    const static int SIG_URG{16};
+
 };
 
 #endif
index 46e25192ae243b78a99f309e4f0475f3d7762af9..16f14d41ab7b82ed1ee74b6862599031d29ca522 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -116,7 +116,6 @@ int getClockRealTime(struct timespec *tp);
   //lirc?
    #define Led_TYPE LedRaspberry  //this is device dependent
    #define Osd_TYPE OsdOpenVG   // This OpenGL ES 2.0, in the moment only for raspberry, but might be splitted for other devices
-   #define OsdStartDev ""
    #define Audio_TYPE AudioOMX   // This is Audio based on OpenMax and libav for decoding
    #define Video_TYPE VideoOMX   // This is Video based on OpenMax
 
@@ -159,7 +158,6 @@ int getClockRealTime(struct timespec *tp);
   #define RemoteStartDev "/dev/rawir"
   #define Led_TYPE
   #define Osd_TYPE
-  #define OsdStartDev "/dev/stbgfx"
   #define Audio_TYPE
   #define Video_TYPE
   #define Surface_TYPE
@@ -181,7 +179,6 @@ int getClockRealTime(struct timespec *tp);
   #define RemoteStartDev "/dev/lircd"
   #define Led_TYPE LedMVP
   #define Osd_TYPE OsdDirectFB
-  #define OsdStartDev ""
   #define Audio_TYPE AudioNMT
   #define Video_TYPE VideoNMT
   #define Surface_TYPE SurfaceDirectFB //deprecated
index 09b585bf08fe65edfb5e20451c02c2108d42036f..3c7eec3cf636443f9535af792975cbd99b79bce6 100644 (file)
@@ -87,13 +87,13 @@ ULONG Directory::getNumNewRecordings()
 void Directory::sort(bool chronoSortOrder)
 {
   // Sort the directory order
-  ::sort(dirList.begin(), dirList.end(), DirectorySorter());
+  std::sort(dirList.begin(), dirList.end(), DirectorySorter());
 
   // Sort the recordings order
   if (chronoSortOrder)
-    ::sort(recList.begin(), recList.end(), RecordingSorterChrono());
+    std::sort(recList.begin(), recList.end(), RecordingSorterChrono());
   else
-    ::sort(recList.begin(), recList.end(), RecordingSorterAlpha());
+    std::sort(recList.begin(), recList.end(), RecordingSorterAlpha());
 
   // Now get the dirs to sort themselves! oh I love recursion.
   for(UINT i = 0; i < dirList.size(); i++) dirList[i]->sort(chronoSortOrder);
index e37c59d1dcee5d1d0eb10a41b5b792634a78b234..b08018dc4f7bbbdb7db472ae3814ba56adc8318b 100644 (file)
 #include <stdio.h>
 #include <vector>
 #include <algorithm>
-using namespace std;
 
 #include "defines.h"
 #include "recording.h"
 
 class Directory;
-typedef vector<Directory*> DirectoryList;
-typedef vector<Recording*> RecordingList;
+typedef std::vector<Directory*> DirectoryList;
+typedef std::vector<Recording*> RecordingList;
 
 class Directory
 {
index e3a8f2b195050f4076c814686a2ee91705653998..ee07b7ffc384abc259973092546f560b00c6e75e 100644 (file)
@@ -51,8 +51,7 @@ struct MediaPacket
 #endif
 };
 
-using namespace std;
-typedef list<MediaPacket> MediaPacketList;
+typedef std::list<MediaPacket> MediaPacketList;
 
 
 
index 645c3fbdf2e1295fd3153917aa1337398608c626..acc73f84dee1fd133159f18e0dba1ddfd819414d 100644 (file)
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 #ifndef DSALLOCATOR_H
 #define DSALLOCATOR_H
@@ -23,9 +22,6 @@
 #include <queue>
 #include <vector>
 
-
-using namespace std;
-
 #include <winsock2.h>
 
 #include <d3d9.h>
@@ -38,44 +34,42 @@ using namespace std;
 //The Allocator and Presenter for VMR9 is also a Presnter for EVR
 
 class DsAllocator: public IVMRSurfaceAllocator9, IVMRImagePresenter9, Mutex,IMFVideoDeviceID, 
-       IMFTopologyServiceLookupClient,public IMFVideoPresenter,IMFGetService, IQualProp {
-public:
-       DsAllocator();
-       virtual ~DsAllocator();
-
-       virtual HRESULT STDMETHODCALLTYPE StartPresenting(DWORD_PTR userid);
-       virtual HRESULT STDMETHODCALLTYPE StopPresenting(DWORD_PTR userid);
-       virtual HRESULT STDMETHODCALLTYPE PresentImage(DWORD_PTR userid,VMR9PresentationInfo* presinf);
-
-       virtual HRESULT STDMETHODCALLTYPE InitializeDevice(DWORD_PTR userid,
-               VMR9AllocationInfo* allocinf,DWORD* numbuf);
-       virtual HRESULT STDMETHODCALLTYPE TerminateDevice(DWORD_PTR userid); 
-       virtual HRESULT STDMETHODCALLTYPE GetSurface(DWORD_PTR userid,DWORD surfindex,DWORD surfflags, IDirect3DSurface9** surf);
-       virtual HRESULT STDMETHODCALLTYPE AdviseNotify(IVMRSurfaceAllocatorNotify9* allnoty);
-       
-
-       virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid,void ** obj);
-       virtual ULONG STDMETHODCALLTYPE AddRef();
-       virtual ULONG STDMETHODCALLTYPE Release();
+    IMFTopologyServiceLookupClient,public IMFVideoPresenter,IMFGetService, IQualProp {
+  public:
+    DsAllocator();
+    virtual ~DsAllocator();
+
+    virtual HRESULT STDMETHODCALLTYPE StartPresenting(DWORD_PTR userid);
+    virtual HRESULT STDMETHODCALLTYPE StopPresenting(DWORD_PTR userid);
+    virtual HRESULT STDMETHODCALLTYPE PresentImage(DWORD_PTR userid,VMR9PresentationInfo* presinf);
+
+    virtual HRESULT STDMETHODCALLTYPE InitializeDevice(DWORD_PTR userid, VMR9AllocationInfo* allocinf,DWORD* numbuf);
+    virtual HRESULT STDMETHODCALLTYPE TerminateDevice(DWORD_PTR userid);
+    virtual HRESULT STDMETHODCALLTYPE GetSurface(DWORD_PTR userid,DWORD surfindex,DWORD surfflags, IDirect3DSurface9** surf);
+    virtual HRESULT STDMETHODCALLTYPE AdviseNotify(IVMRSurfaceAllocatorNotify9* allnoty);
+
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid,void ** obj);
+    virtual ULONG STDMETHODCALLTYPE AddRef();
+    virtual ULONG STDMETHODCALLTYPE Release();
 
     void LostDevice(IDirect3DDevice9 *d3ddev, IDirect3D9* d3d);
 
-       /* EVR members */
-       virtual HRESULT STDMETHODCALLTYPE GetDeviceID(IID *pDid);
+    /* EVR members */
+    virtual HRESULT STDMETHODCALLTYPE GetDeviceID(IID *pDid);
 
-       virtual HRESULT STDMETHODCALLTYPE InitServicePointers(IMFTopologyServiceLookup *plooky);
-       virtual HRESULT STDMETHODCALLTYPE ReleaseServicePointers();
+    virtual HRESULT STDMETHODCALLTYPE InitServicePointers(IMFTopologyServiceLookup *plooky);
+    virtual HRESULT STDMETHODCALLTYPE ReleaseServicePointers();
 
-       virtual HRESULT STDMETHODCALLTYPE ProcessMessage(MFVP_MESSAGE_TYPE mess,ULONG_PTR mess_para);
+    virtual HRESULT STDMETHODCALLTYPE ProcessMessage(MFVP_MESSAGE_TYPE mess,ULONG_PTR mess_para);
 
-       virtual HRESULT STDMETHODCALLTYPE OnClockStart(MFTIME systime,LONGLONG startoffset);
-       virtual HRESULT STDMETHODCALLTYPE OnClockStop(MFTIME systime);
-       virtual HRESULT STDMETHODCALLTYPE OnClockPause(MFTIME systime);
-       virtual HRESULT STDMETHODCALLTYPE OnClockRestart(MFTIME systime);
-       virtual HRESULT STDMETHODCALLTYPE OnClockSetRate(MFTIME systime,float rate);
-       virtual HRESULT STDMETHODCALLTYPE GetCurrentMediaType(IMFVideoMediaType **mtype);
+    virtual HRESULT STDMETHODCALLTYPE OnClockStart(MFTIME systime,LONGLONG startoffset);
+    virtual HRESULT STDMETHODCALLTYPE OnClockStop(MFTIME systime);
+    virtual HRESULT STDMETHODCALLTYPE OnClockPause(MFTIME systime);
+    virtual HRESULT STDMETHODCALLTYPE OnClockRestart(MFTIME systime);
+    virtual HRESULT STDMETHODCALLTYPE OnClockSetRate(MFTIME systime,float rate);
+    virtual HRESULT STDMETHODCALLTYPE GetCurrentMediaType(IMFVideoMediaType **mtype);
 
-       virtual HRESULT STDMETHODCALLTYPE GetService(const GUID &guid,const IID &iid,LPVOID *obj);
+    virtual HRESULT STDMETHODCALLTYPE GetService(const GUID &guid,const IID &iid,LPVOID *obj);
 
     virtual HRESULT STDMETHODCALLTYPE get_FramesDrawn(int *val);
     virtual HRESULT STDMETHODCALLTYPE get_AvgFrameRate(int *val);
@@ -84,61 +78,50 @@ public:
     virtual HRESULT STDMETHODCALLTYPE get_DevSyncOffset(int *val);
     virtual HRESULT STDMETHODCALLTYPE get_FramesDroppedInRenderer(int *val);
 
-       void GetNextSurface(LPDIRECT3DSURFACE9 *surf,DWORD *waittime);
-       void DiscardSurfaceandgetWait(DWORD *waittime);
-
+    void GetNextSurface(LPDIRECT3DSURFACE9 *surf,DWORD *waittime);
+    void DiscardSurfaceandgetWait(DWORD *waittime);
 
 protected:
 
-       void RenegotiateEVRMediaType();
-       void AllocateEVRSurfaces();
-       void FlushEVRSamples();
-       void GetEVRSamples();
-
-       void ResetSyncOffsets();
-       void CalcSyncOffsets(int sync);
-       void CalcJitter(int jitter);
-       
-       vector<IDirect3DSurface9*> surfaces;
-       queue<IMFSample*> emptyevrsamples;
-       queue<IMFSample*> fullevrsamples;
-       //CCritSec objCritSec;
-       IVMRSurfaceAllocatorNotify9* surfallocnotify;
-       void CleanupSurfaces();
-       LONG refcount;
-       DWORD vheight;
-       DWORD vwidth;
-       bool inevrmode;
-       bool endofstream;
+    void RenegotiateEVRMediaType();
+    void AllocateEVRSurfaces();
+    void FlushEVRSamples();
+    void GetEVRSamples();
+
+    void ResetSyncOffsets();
+    void CalcSyncOffsets(int sync);
+    void CalcJitter(int jitter);
+
+    std::vector<IDirect3DSurface9*> surfaces;
+    std::queue<IMFSample*> emptyevrsamples;
+    std::queue<IMFSample*> fullevrsamples;
+    //CCritSec objCritSec;
+    IVMRSurfaceAllocatorNotify9* surfallocnotify;
+    void CleanupSurfaces();
+    LONG refcount;
+    DWORD vheight;
+    DWORD vwidth;
+    bool inevrmode;
+    bool endofstream;
     bool start_get_evr_samples;
 
-       IMFTransform* mftransform;
-       IMediaEventSink* mediasink;
-       IMFClock* mfclock;
-       IMFMediaType *mfmediatype;
-
-       static const int n_stats=126;
-       int sync_offset[n_stats];
-       int jitter_offset[n_stats];
-       unsigned int sync_pos;
-       unsigned int jitter_pos;
-       int framesdrawn;
-       int framesdropped;
-       int avg_sync_offset;
-       int dev_sync_offset;
-       int jitter;
+    IMFTransform* mftransform;
+    IMediaEventSink* mediasink;
+    IMFClock* mfclock;
+    IMFMediaType *mfmediatype;
+
+    static const int n_stats=126;
+    int sync_offset[n_stats];
+    int jitter_offset[n_stats];
+    unsigned int sync_pos;
+    unsigned int jitter_pos;
+    int framesdrawn;
+    int framesdropped;
+    int avg_sync_offset;
+    int dev_sync_offset;
+    int jitter;
     int avgfps;
     LONGLONG lastdelframe;
-
-
-
 };
 
-
-
-
-
-
-
-
 #endif
index 3471754b5d241287a7fb1b0a16950c69b5488963..407e0b7ebf5a493cca315db9ea9d3e8c5e3228fe 100644 (file)
@@ -32,9 +32,6 @@
 
 #include "defines.h"
 
-using namespace std;
-
-
 class EDReceiver //(implementation in eventdispatcher.cc)
 {
   friend class EventDispatcher;
@@ -63,7 +60,7 @@ class EventDispatcher
 {
 
   public:
-    typedef list<EDReceiver*> EDRL;
+    typedef std::list<EDReceiver*> EDRL;
 
     EventDispatcher();
     virtual ~EventDispatcher() {};
diff --git a/i18n.cc b/i18n.cc
index cc2c6a02b288b7c88e78332225bb68fe4dd215f2..0f14365979a21dd1d828807bf4154884eedab4a8 100644 (file)
--- a/i18n.cc
+++ b/i18n.cc
@@ -31,7 +31,6 @@
 #include "vdr.h"
 #include "log.h"
 
-using namespace std;
 I18n::trans_table I18n::Translations;
 
 int I18n::initialize(void)
@@ -39,7 +38,7 @@ int I18n::initialize(void)
   VDR *vdr = VDR::getInstance();
   char *lang = vdr->configLoad("General", "LangCode");
   lang_code_list list = vdr->getLanguageList();
-  string code;
+  std::string code;
   if (lang && list.count(lang) > 0)
     code = lang;
   else
@@ -61,7 +60,7 @@ int I18n::initialize(void)
 
 const char* I18n::translate(const char *s)
 {
-  string str = s;
+  std::string str = s;
   if (Translations.count(str) == 0) return s;
   return Translations[str].c_str();
   // This isn't ideal. A call to initialize() invalidates
index 501542bb7b287b5ebf30fdb00bbc7eefcd505af7..7e791bfe0bc90aa5fcddc9a61664f925af96e5bc 100644 (file)
@@ -743,7 +743,7 @@ int ImageOMX::DestroyInputBufsOMXwhilePlaying() //call with clock mutex locked
        while (input_bufs_omx_all.size()>0) {
                if (input_bufs_omx_free.size()>0) {
                        // Destroy one buffer
-                       vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
+                       std::vector<OMX_BUFFERHEADERTYPE*>::iterator itty=input_bufs_omx_all.begin();
                        OMX_BUFFERHEADERTYPE* cur_buf=input_bufs_omx_free.front();
                        for (; itty!= input_bufs_omx_all.end();itty++) {
                                if ((*itty)==cur_buf) {
index 352856f07620aa72680754f8b658f7175c8c6ea0..5a204e7fac49b1140a0381b3ee5f78176cd3ce28 100644 (file)
@@ -58,46 +58,46 @@ class ImageOMX : public OsdVector::PictureDecoder
   private:
 
     static OMX_ERRORTYPE EmptyBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp,OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
-       static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
+    static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
 
 
-       bool intDecodePicture(LoadIndex index, unsigned char * buffer, unsigned int length, EGLPictureCreator* egl_pict, VideoOMX *video);
+    bool intDecodePicture(LoadIndex index, unsigned char * buffer, unsigned int length, EGLPictureCreator* egl_pict, VideoOMX *video);
 
     void ReturnEmptyOMXBuffer(OMX_BUFFERHEADERTYPE* bulibaver);
     void ReturnFillOMXBuffer(OMX_BUFFERHEADERTYPE* buffer);
 
 
-       OMX_HANDLETYPE omx_imag_decode;
-       OMX_HANDLETYPE omx_egl_render;
+    OMX_HANDLETYPE omx_imag_decode;
+    OMX_HANDLETYPE omx_egl_render;
 
-       OMX_U32 omx_image_input_port;
-       OMX_U32 omx_image_output_port;
+    OMX_U32 omx_image_input_port;
+    OMX_U32 omx_image_output_port;
 
-       OMX_U32 omx_egl_input_port;
-       OMX_U32 omx_egl_output_port;
+    OMX_U32 omx_egl_input_port;
+    OMX_U32 omx_egl_output_port;
 
 
-       int AllocateCodecsOMX( unsigned char * buffer, unsigned int length);
-       int DeAllocateCodecsOMX();
+    int AllocateCodecsOMX( unsigned char * buffer, unsigned int length);
+    int DeAllocateCodecsOMX();
 
-       int PrepareInputBufsOMX(bool setportdef, unsigned char * buffer, unsigned int length);
-       int DestroyInputBufsOMX();
-       int DestroyInputBufsOMXwhilePlaying();
+    int PrepareInputBufsOMX(bool setportdef, unsigned char * buffer, unsigned int length);
+    int DestroyInputBufsOMX();
+    int DestroyInputBufsOMXwhilePlaying();
 
-       enum ImageFormats {
-               Unsupported,
-               Jpeg,
-               PNG
-       };
+    enum ImageFormats {
+        Unsupported,
+        Jpeg,
+        PNG
+    };
 
-       enum ImageFormats curformat;
+    enum ImageFormats curformat;
 
 
 
-       vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
-       list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
-       //list<OMX_BUFFERHEADERTYPE*> output_bufs_omx_full;
-       Mutex input_bufs_omx_mutex;
+    std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
+    std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
+    //list<OMX_BUFFERHEADERTYPE*> output_bufs_omx_full;
+    Mutex input_bufs_omx_mutex;
 
     bool omx_running;
     bool omx_first_frame;
@@ -111,8 +111,8 @@ class ImageOMX : public OsdVector::PictureDecoder
     char L_VPE_OMX_EGL_REND[128];
 
   protected:
-      OsdVector::PictureInfo pictInf;
-         bool pictInfValid;
+    OsdVector::PictureInfo pictInf;
+    bool pictInfValid;
 
 };
 
diff --git a/main.cc b/main.cc
index 9b0fff60ece805fd5a6b8e51fa5f3d2f1de7a8df..1c1a7abb99c553cdeeb188c06101855e2a0a56ba 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -287,7 +287,7 @@ int main(int argc, char** argv)
     shutdown(1);
   }
 
-  success = osd->init((void*)OsdStartDev);
+  success = osd->init();
   if (success)
   {
     logger->log("Core", Log::INFO, "OSD module initialised");
diff --git a/mark.h b/mark.h
index 6139a175909ae3e8f68cb4d38fbaa85bab540746..f4c092372f37fe02bb8d946cb7e3051a881dabeb 100644 (file)
--- a/mark.h
+++ b/mark.h
@@ -26,8 +26,6 @@
 
 #include "defines.h"
 
-using namespace std;
-
 class Mark
 {
   public:
@@ -36,6 +34,6 @@ class Mark
     int pos;
 };
 
-typedef vector<Mark*> MarkList;
+typedef std::vector<Mark*> MarkList;
 
 #endif
diff --git a/media.h b/media.h
index 7ad052271d573583d7a48c870acdfd1fe678f64b..4681bbe165550a77b2976dfe1cf3f38d7a2fc6bc 100644 (file)
--- a/media.h
+++ b/media.h
 #define MEDIA_H
 
 
-#include <vector>
-using namespace std;
 #include <stdio.h>
 #include <string.h>
+#include <vector>
+
 #include "defines.h"
 #include "serialize.h"
 
@@ -204,7 +204,7 @@ class Media : public Serializable
 };
 
 
-typedef vector<Media*> MediaListI;
+typedef std::vector<Media*> MediaListI;
 
 /**
   * the MediaList - containing a root URI and
index 9e04bc62846c13888bc7766e006aab789d33153f..f2ad8cbe97cc74828b504f6081207c27cd23d85a 100644 (file)
@@ -28,7 +28,6 @@
 #include "log.h"
 #include "abstractoption.h"
 
-using namespace std;
 class WTabBar;
 class VDR;
 class Option;
@@ -51,7 +50,7 @@ class MediaOptions: AbstractOption
     bool setIntOption(const char * name, UINT value) ;
   private:
     bool saveOption(Option *option);
-    vector<Option*> myOptions;
+    std::vector<Option*> myOptions;
     Option * findOption(const char* name);
     static MediaOptions * instance;
     WOptionPane *pane;
index ada5c9704220ca4271051b201d66407710e59e91..f39f7aa36b8f76734efca1427aa11a8ff5cbfc85 100644 (file)
@@ -23,7 +23,6 @@
 
 
 #include <vector>
-using namespace std;
 #include <stdio.h>
 #include <string.h>
 #include "mediaprovider.h"
@@ -99,7 +98,7 @@ class MediaPlayer : public MediaPlayerRegister, public MediaProvider
 
   private:
     MediaProvider * providerById(ULONG id);
-    typedef vector<MediaProviderHolder *> Tplist;
+    typedef std::vector<MediaProviderHolder *> Tplist;
     Tplist plist;
     struct channelInfo {
       ULONG providerId;
index 0a0a9066818466600b1122962d3eb057c6f73456..6f7a44b0d080b9177fe31e0fb55cee64fda4ba8e 100644 (file)
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #include "messagequeue.h"
 #include "message.h"
 #include "log.h"
 
+MessageQueue* MessageQueue::instance{};
+
+MessageQueue::MessageQueue() { instance = this; }
+
+MessageQueue::~MessageQueue() { instance = NULL; }
+
+MessageQueue* MessageQueue::getInstance() { return instance; }
+
 void MessageQueue::postMessage(Message* m)
 {
   messages.push(m);
-//  Log::getInstance()->log("MessageQueue", Log::DEBUG, "have stored message %lu in queue", m->message);
 }
 
 void MessageQueue::processMessageQueue()
@@ -36,7 +42,6 @@ void MessageQueue::processMessageQueue()
   {
     m = messages.front();
     messages.pop();
-//    Log::getInstance()->log("MessageQueue", Log::DEBUG, "retrieved message from queue");
     processMessage(m);
     delete m;
   }
index 9544645d1d4471d3d8ebe4bcbb1d904133b6e305..e56f8ffb8b6054bcbdd582d94ae086d58faaffa2 100644 (file)
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #ifndef MESSAGEQUEUE_H
 #define MESSAGEQUEUE_H
 
 #include <queue>
-using namespace std;
 
 class Message;
 
-typedef queue<Message*> MQueue;
+typedef std::queue<Message*> MQueue;
 
 class MessageQueue
 {
   public:
-    MessageQueue() {};
-    virtual ~MessageQueue() {};
+    MessageQueue();
+    virtual ~MessageQueue();
+
+    static MessageQueue* getInstance();
 
     virtual void postMessage(Message* m);
     virtual void postMessageNoLock(Message* m)=0;
@@ -44,6 +44,8 @@ class MessageQueue
     virtual void processMessage(Message* m)=0;
 
   private:
+    static MessageQueue* instance;
+
     MQueue messages;
 
 };
index b4bd3f63167d82cc6382550f2962203bb4f7baa2..130f3be2cf7fcce7a436db1d6898183fa02838e9 100644 (file)
--- a/option.h
+++ b/option.h
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #ifndef OPTION_H
@@ -29,8 +28,7 @@ class AbstractOption;
 #include <vector>
 
 class Option;
-using namespace std;
-typedef vector<Option*> Options;
+typedef std::vector<Option*> Options;
 
 class Option
 {
diff --git a/osd.h b/osd.h
index a3cfef3654ce9d9ea851e7157bcbe3741e4e1bfb..aef86fa33ac44eea3a47c61c7bf304d22d842ed5 100644 (file)
--- a/osd.h
+++ b/osd.h
@@ -29,7 +29,7 @@ class Osd
     virtual ~Osd();
     static Osd* getInstance();
 
-    virtual int init(void* device)=0;
+    virtual int init()=0;
     virtual int shutdown()=0;
     virtual int restore() { return 1; };
     virtual int stopUpdate() { return 1; };
index 827364348e16468a4dca819d4ed6007ef4f241e7..844288c749ff3af9d47fc1a49297609ba9d2993e 100644 (file)
@@ -45,7 +45,7 @@ int OsdDirectFB::getFD()
   return 0;
 }
 
-int OsdDirectFB::init(void* device)
+int OsdDirectFB::init()
 {
 
   if (initted) return 0;
index 0b555b3ebe0a33fee829421705fb1555603deda2..dcdafed23ca8fd050c35578de978de8001b41ef0 100644 (file)
@@ -39,7 +39,7 @@ class OsdDirectFB : public Osd
     OsdDirectFB();
     ~OsdDirectFB();
 
-    int init(void* device);
+    int init();
     int shutdown();
 
     int getFD();
index 61aa6b08fad13c4d78cb5a9121fafeb590f0ce85..8e22988977c53ae1d0a8356de7ca5d23bcf76890 100644 (file)
@@ -70,13 +70,10 @@ Surface * OsdOpenGL::createNewSurface() {
        return (Surface*)new SurfaceOpenGL();
 }
 
-int OsdOpenGL::init(void* device)
+int OsdOpenGL::init()
 {
   if (initted) return 0;
   Video* video = Video::getInstance();
-   //window=*((HWND*)device);
-  
-   // May be this device specific part should go to a device specific child class
 
    //init broadcom chipset (Move to video?)
 
index 853c334e2790f24842fcc411aca5a58cf848ccd6..aa078df71e029329d2c30bc64e06cbd47c00bf28 100644 (file)
@@ -71,7 +71,7 @@ class OsdOpenGL : public Osd, public Thread_TYPE
     OsdOpenGL();
     virtual ~OsdOpenGL();
 
-    int init(void* device);
+    int init();
     int shutdown();
 
     int getFD();
index 3450472d0ef256626211870667124e878f939aac..e511ebf7ff2723c6dcb2b3a63a4bf7af9c38cabf 100644 (file)
@@ -92,7 +92,7 @@ OsdOpenVG::~OsdOpenVG()
   // pointed at anyway, so it's correctly not working?!
 
   if (!fontnames.size()) {
-         vector<char*>::iterator itty=fontnames.begin();
+         std::vector<char*>::iterator itty=fontnames.begin();
          while (itty!=fontnames.end()) {
                  free((void*)*itty);
 
@@ -105,7 +105,7 @@ OsdOpenVG::~OsdOpenVG()
 
 
   if (fontnames_keys.size()) {
-         vector<char*>::iterator itty=fontnames_keys.begin();
+         std::vector<char*>::iterator itty=fontnames_keys.begin();
          while (itty!=fontnames_keys.end()) {
                  free((void*)*itty);
                  itty++;
@@ -118,14 +118,10 @@ OsdOpenVG::~OsdOpenVG()
 
 
 
-int OsdOpenVG::init(void* device)
+int OsdOpenVG::init()
 {
   if (initted) return 0;
   reader.init();
-  //Video* video = Video::getInstance();
-   //window=*((HWND*)device);
-
-   // May be this device specific part should go to a device specific child class
 
    //init broadcom chipset (Move to video?)
 
@@ -773,8 +769,8 @@ int  OsdOpenVG::loadFont(bool newfont)
        FT_UInt glyph;
        font_height=ft_face->size->metrics.height/256.f;
        cur_char = FT_Get_First_Char(ft_face,&glyph);
-       vector<VGubyte> segments;
-       vector<VGfloat> coord;
+       std::vector<VGubyte> segments;
+       std::vector<VGfloat> coord;
        segments.reserve(256);
        coord.reserve(1024);
        //Log::getInstance()->log("OSD", Log::DEBUG, "Create Glyph test %d %x %x %d",cur_char,font_data_end,font_data,glyph);
@@ -1391,7 +1387,7 @@ bool OsdOpenVG::haveOpenVGResponse(unsigned int id,unsigned int * resp)
        taskmutex.Lock();
        if (vgresponses.size()>0)
        {
-               deque<OpenVGResponse>::iterator itty=vgresponses.begin();
+               std::deque<OpenVGResponse>::iterator itty=vgresponses.begin();
                while (itty!=vgresponses.end())
                {
                        if ((*itty).id==id) {
index c462e147bbdb508258f8b88548de51030706fcd9..a0b0cc7484d19807eaa360085cfdded63504b9fe 100644 (file)
@@ -86,7 +86,7 @@ class OsdOpenVG : public OsdVector, public Thread_TYPE
     OsdOpenVG();
     virtual ~OsdOpenVG();
 
-    int init(void* device);
+    int init();
     int shutdown();
     int stopUpdate();
 
@@ -117,28 +117,28 @@ protected:
     ImageIndex createMonoBitmap(void *base,int width,int height);
     ImageIndex createImagePalette(int width,int height,const unsigned char *image_data,const unsigned int*palette_data);
     void createPicture(struct PictureInfo& pict_inf);
-       void destroyStyleRef(VectorHandle index);
-       VectorHandle createStyleRef(const DrawStyle &c);
-       bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
+    void destroyStyleRef(VectorHandle index);
+    VectorHandle createStyleRef(const DrawStyle &c);
+    bool getStaticImageData(unsigned int static_id, UCHAR **userdata, ULONG *length);
 
-       void drawSetTrans(SurfaceCommands & sc);
-       void executeDrawCommand(SVGCommand & command);
+    void drawSetTrans(SurfaceCommands & sc);
+    void executeDrawCommand(SVGCommand & command);
 
-       void initPaths();
-       void destroyPaths();
-       VGPath std_paths[PIPoint+1];
-       long long  lastrendertime;
-       void InternalRendering();
-       void getScreenSize(int &width, int &height);
-       void getRealScreenSize(int &width, int &height);
+    void initPaths();
+    void destroyPaths();
+    VGPath std_paths[PIPoint+1];
+    long long  lastrendertime;
+    void InternalRendering();
+    void getScreenSize(int &width, int &height);
+    void getRealScreenSize(int &width, int &height);
 
 
 
-       Mutex vgmutex;
-       Mutex taskmutex;
-       Signal vgtaskSignal;
-    deque<OpenVGCommand> vgcommands;
-    deque<OpenVGResponse> vgresponses;
+    Mutex vgmutex;
+    Mutex taskmutex;
+    Signal vgtaskSignal;
+    std::deque<OpenVGCommand> vgcommands;
+    std::deque<OpenVGResponse> vgresponses;
     bool processTasks();
     bool haveOpenVGResponse(unsigned int id,unsigned int * resp);
     unsigned int  putOpenVGCommand(OpenVGCommand& comm,bool wait);
@@ -151,34 +151,32 @@ protected:
     VGFont vgfont;
     VGFont vgttfont;
     VGPaint vgttpaint;
-    int  loadFont(bool fontchange);
-    map<unsigned int,float> font_exp_x;
-    vector<char*> fontnames;
-    vector<char*> fontnames_keys;
-    char * cur_fontname;
+    int loadFont(bool fontchange);
+    std::map<unsigned int,float> font_exp_x;
+    std::vector<char*> fontnames;
+    std::vector<char*> fontnames_keys;
+    char* cur_fontname;
 
     int clip_shift_x;
     int clip_shift_y;
 
     unsigned int loadTTchar(cTeletextChar c);
-    map<unsigned int,int> tt_font_chars;
+    std::map<unsigned int,int> tt_font_chars;
 
 
-
-       void threadMethod();
+    void threadMethod();
     void threadPostStopCleanup();
 
-
-        /* BCM specific */
+    /* BCM specific */
 
     uint32_t display_height;
-       uint32_t display_width;
-       DISPMANX_DISPLAY_HANDLE_T bcm_display;
-       DISPMANX_ELEMENT_HANDLE_T bcm_element;
-       DISPMANX_ELEMENT_HANDLE_T bcm_background;
-       DISPMANX_RESOURCE_HANDLE_T bcm_backres;
+    uint32_t display_width;
+    DISPMANX_DISPLAY_HANDLE_T bcm_display;
+    DISPMANX_ELEMENT_HANDLE_T bcm_element;
+    DISPMANX_ELEMENT_HANDLE_T bcm_background;
+    DISPMANX_RESOURCE_HANDLE_T bcm_backres;
 
-       uint32_t mode;
+    uint32_t mode;
 
 
        EGLDisplay egl_display;
index 0ecc7e1cf8536a4d1ab629fa3ceafcf4c298a4be..0ee1c5fd738e162a742988c171468ec5e648e9cc 100644 (file)
@@ -172,7 +172,7 @@ int OsdVector::restore()
        surfaces_mutex.Lock();
 
        //Now go through all surfaces and draw them
-       list<SurfaceCommands>::iterator curdraw=scommands.begin();
+       std::list<SurfaceCommands>::iterator curdraw=scommands.begin();
        while (curdraw!=scommands.end()) {
                (*curdraw).commands.clear();
                (*curdraw).commands.reserve(2048);
@@ -200,10 +200,10 @@ int OsdVector::restore()
 void OsdVector::drawSurfaces()
 {
        surfaces_mutex.Lock();
-       list<SurfaceCommands*> todraw; //First figure out if a surfaces is below another surface
-       list<SurfaceCommands>::iterator itty1=scommands.begin();
+       std::list<SurfaceCommands*> todraw; //First figure out if a surfaces is below another surface
+       std::list<SurfaceCommands>::iterator itty1=scommands.begin();
        while (itty1!=scommands.end()) {
-               list<SurfaceCommands>::iterator itty2=itty1;
+               std::list<SurfaceCommands>::iterator itty2=itty1;
                itty2++;
                bool hidden=false;
                while (itty2!=scommands.end()) {
@@ -225,7 +225,7 @@ void OsdVector::drawSurfaces()
        int swidth,sheight;
        getScreenSize(swidth,sheight);
        //Now go through all surfaces and draw them
-       list<SurfaceCommands*>::iterator curdraw=todraw.begin();
+       std::list<SurfaceCommands*>::iterator curdraw=todraw.begin();
        while (curdraw!=todraw.end()) {
                drawSetTrans(*(*curdraw));
                std::vector<SVGCommand>::iterator commands=(*(*curdraw)).commands.begin();
@@ -259,7 +259,7 @@ void OsdVector::updateOrAddSurface(const SurfaceVector *surf,float x,float y,flo
 {
        surfaces_mutex.Lock();
        //First determine it is already in our system
-       list<SurfaceCommands>::iterator itty=scommands.begin();
+       std::list<SurfaceCommands>::iterator itty=scommands.begin();
        while (itty!=scommands.end()) {
                if ((*itty).surf==surf) {
                        //decrease the references
@@ -311,7 +311,7 @@ void OsdVector::removeSurface(const SurfaceVector *surf)
 {
        surfaces_mutex.Lock();
        //First determine it is already in our system
-       list<SurfaceCommands>::iterator itty=scommands.begin();
+       std::list<SurfaceCommands>::iterator itty=scommands.begin();
        while (itty!=scommands.end()) {
                if ((*itty).surf==surf) {
                        dereferenceSVGCommand((*itty).commands);
@@ -393,7 +393,7 @@ void OsdVector::removeLoadIndexRef(const LoadIndex ref)
        loadindex_ref[ref]--;
        if (loadindex_ref[ref]==0) {
                //now check, if it is already loaded
-               map<LoadIndex,ImageIndex>::iterator itty=tvmedias_loaded.find(ref);
+               std::map<LoadIndex,ImageIndex>::iterator itty=tvmedias_loaded.find(ref);
                if ( itty != tvmedias_loaded.end()) {
                        removeImageRef((*itty).second); // remove lock
                }
@@ -413,9 +413,9 @@ void OsdVector::removeLoadIndexRef(const LoadIndex ref)
 void OsdVector::cleanupOrphanedRefs()
 { // Do some garbage collection
 
-       map<void *,ImageIndex>::iterator mitty=monobitmaps.begin();
+       std::map<void *,ImageIndex>::iterator mitty=monobitmaps.begin();
        while (mitty!=monobitmaps.end()) {
-               map<ImageIndex,int>::iterator curitty=images_ref.find((*mitty).second);
+               std::map<ImageIndex,int>::iterator curitty=images_ref.find((*mitty).second);
                int count=(*curitty).second;
                if (count==0) {
                        ImageIndex ref=(*curitty).first;
@@ -437,9 +437,9 @@ void OsdVector::cleanupOrphanedRefs()
                } else ++jitty;
        }*/
 
-       map<TVMediaInfo,ImageIndex>::iterator titty=tvmedias.begin();
+       std::map<TVMediaInfo,ImageIndex>::iterator titty=tvmedias.begin();
        while (titty!=tvmedias.end()) {
-               map<ImageIndex,int>::iterator curitty=images_ref.find((*titty).second);
+               std::map<ImageIndex,int>::iterator curitty=images_ref.find((*titty).second);
                int count=(*curitty).second;
                if (count==0) {
                        ImageIndex ref=(*curitty).first;
@@ -450,9 +450,9 @@ void OsdVector::cleanupOrphanedRefs()
        }
 
 
-       map<TVMediaInfo,LoadIndex>::iterator litty=tvmedias_load.begin();
+       std::map<TVMediaInfo,LoadIndex>::iterator litty=tvmedias_load.begin();
        while (litty!=tvmedias_load.end()) {
-               map<LoadIndex,int>::iterator curitty=loadindex_ref.find((*litty).second);
+               std::map<LoadIndex,int>::iterator curitty=loadindex_ref.find((*litty).second);
                int count=(*curitty).second;
                if (count==0) {
                        tvmedias_load_inv.erase((*litty).second);
@@ -461,9 +461,9 @@ void OsdVector::cleanupOrphanedRefs()
                } else ++litty;
        }
 
-       list<ImageIndex>::iterator pitty=palettepics.begin();
+       std::list<ImageIndex>::iterator pitty=palettepics.begin();
        while (pitty!=palettepics.end()) {
-               map<ImageIndex,int>::iterator curitty=images_ref.find((*pitty));
+               std::map<ImageIndex,int>::iterator curitty=images_ref.find((*pitty));
                int count=(*curitty).second;
                if (count==0) {
                        ImageIndex ref=(*curitty).first;
@@ -473,7 +473,7 @@ void OsdVector::cleanupOrphanedRefs()
                } else ++pitty;
        }
 
-       map<ImageIndex,int>::iterator citty=images_ref.begin();
+       std::map<ImageIndex,int>::iterator citty=images_ref.begin();
        while (citty!=images_ref.end()) {
                int count=(*citty).second;
                if (count==0) {
@@ -484,9 +484,9 @@ void OsdVector::cleanupOrphanedRefs()
        }
 
 
-       map<DrawStyle, VectorHandle>::iterator sitty = styles.begin();
+       std::map<DrawStyle, VectorHandle>::iterator sitty = styles.begin();
        while (sitty!=styles.end()) {
-               map<VectorHandle, int>::iterator curitty = styles_ref.find((*sitty).second);
+               std::map<VectorHandle, int>::iterator curitty = styles_ref.find((*sitty).second);
                int count=(*curitty).second;
                if (count==0) {
                        VectorHandle ref = (*curitty).first;
@@ -667,7 +667,7 @@ void OsdVector::informPicture(LoadIndex index, ImageIndex imageIndex)
        surfaces_mutex.Lock();
        TVMediaInfo tvmedia=tvmedias_load_inv[index];
        if (imageIndex) {
-               map<LoadIndex,int>::iterator itty=loadindex_ref.find(index);
+               std::map<LoadIndex,int>::iterator itty=loadindex_ref.find(index);
                image_index=tvmedias[tvmedia]=imageIndex;
                tvmedias_loaded[index]=image_index;
 
@@ -896,7 +896,7 @@ bool OsdVector::PictureReader::processReceivedPictures()
     if (pict_incoming.size()) {
                VDR_ResponsePacket *vresp=pict_incoming.front();
                pict_incoming.pop();
-               set<LoadIndex>::iterator setpos = invalid_loadindex.find(vresp->getStreamID());
+               std::set<LoadIndex>::iterator setpos = invalid_loadindex.find(vresp->getStreamID());
                if (setpos != invalid_loadindex.end()) {
                        valid = false;
                        invalid_loadindex.erase(setpos);
@@ -954,7 +954,7 @@ bool OsdVector::PictureReader::processReceivedPictures()
        } else if (pict_incoming_static.size()){
                unsigned int static_id = pict_incoming_static.front();
                pict_incoming_static.pop();
-               set<LoadIndex>::iterator setpos = invalid_loadindex.find(((long long) static_id) << 32LL);
+               std::set<LoadIndex>::iterator setpos = invalid_loadindex.find(((long long) static_id) << 32LL);
                if (setpos != invalid_loadindex.end()) {
                        valid = false;
                        invalid_loadindex.erase(setpos);
index 0628e080515f1670bad08e40acbbdeda5db1192e..3f2a8bb9feb8731433fd5ff47e59a9cf1e4e7223 100644 (file)
@@ -197,7 +197,7 @@ class VDR_ResponsePacket;
 
 struct SurfaceCommands{
        const SurfaceVector* surf;
-       vector<SVGCommand> commands;
+       std::vector<SVGCommand> commands;
        float x,y,w,h;
 };
 
@@ -332,7 +332,7 @@ class OsdVector : public Osd
        std::queue<unsigned int> pict_incoming_static;
        std::list<PictureDecoder*> decoders;
        std::map<LoadIndex,int> inform_fallback;
-       set<LoadIndex> invalid_loadindex;
+       std::set<LoadIndex> invalid_loadindex;
 
        bool picture_update;
 
@@ -362,18 +362,18 @@ protected:
 
 
 
-       map<ImageIndex,int> images_ref;
-       map<void *,ImageIndex> monobitmaps;
+       std::map<ImageIndex,int> images_ref;
+       std::map<void *,ImageIndex> monobitmaps;
        //map<string,ImageIndex> jpegs;
-       map<TVMediaInfo,ImageIndex> tvmedias;
-       list<ImageIndex> palettepics;
+       std::map<TVMediaInfo,ImageIndex> tvmedias;
+       std::list<ImageIndex> palettepics;
 
 
 
-       map<LoadIndex,int> loadindex_ref;
-       map<TVMediaInfo,LoadIndex> tvmedias_load;
-       map<LoadIndex,TVMediaInfo> tvmedias_load_inv;
-       map<LoadIndex,ImageIndex> tvmedias_loaded;
+       std::map<LoadIndex,int> loadindex_ref;
+       std::map<TVMediaInfo,LoadIndex> tvmedias_load;
+       std::map<LoadIndex,TVMediaInfo> tvmedias_load_inv;
+       std::map<LoadIndex,ImageIndex> tvmedias_loaded;
 
 
 
@@ -382,11 +382,11 @@ protected:
        virtual void destroyStyleRef(VectorHandle index) = 0;
 
 
-       map<DrawStyle, VectorHandle> styles;
-       map<VectorHandle, int> styles_ref;
-       map<DrawStyle, VectorHandle>::iterator styles_lastit;
+       std::map<DrawStyle, VectorHandle> styles;
+       std::map<VectorHandle, int> styles_ref;
+       std::map<DrawStyle, VectorHandle>::iterator styles_lastit;
        bool styles_lastit_valid;
-       map<VectorHandle, int>::iterator styles_ref_lastit;
+       std::map<VectorHandle, int>::iterator styles_ref_lastit;
        bool styles_ref_lastit_valid;
 
        virtual VectorHandle createStyleRef(const DrawStyle &c) = 0;
@@ -401,8 +401,6 @@ protected:
        virtual void executeDrawCommand(SVGCommand & command)=0;
 
 
-
-
        std::list<SurfaceCommands> scommands;
 
        Mutex surfaces_mutex;
@@ -412,7 +410,4 @@ protected:
        void drawSurfaces();
 };
 
-
-
-
 #endif
index 87314bf378588317a2f3ea2c2913aff5c346756f..a64d34d6cc1ce6e2c085bb0209f460acd275a7b3 100644 (file)
@@ -58,7 +58,7 @@ Surface * OsdWinPixel::createNewSurface(){
        return (Surface*)new SurfaceWin();
 }
 
-int OsdWinPixel::init(void* device)
+int OsdWinPixel::init()
 {
   if (initted) return 0;
 
index 863813c5297189f8aebef815e0bbf558dd7fcacc..a9e41433e15cdbdbcc22b54bc06b4a6d710a7015 100644 (file)
@@ -36,7 +36,7 @@ class OsdWinPixel : public Osd, public WindowsOsd
     OsdWinPixel();
     ~OsdWinPixel();
 
-    int init(void* device);
+    int init();
     int shutdown();
 
        int isInitialized() { return initted; }
index 8ad49bc1227d08d995643cad94f8f51b0f602eab..75ae7ddabf76e5b130cb5424f0c54b15a627ace9 100644 (file)
@@ -265,7 +265,7 @@ OsdWinVector::~OsdWinVector()
 
 
 
-int OsdWinVector::init(void* device)
+int OsdWinVector::init()
 {
   if (initted) return 0;
   reader.init();
index a4b49fb4bb65a0c4f93b6cd898256fc2f1cd3eeb..7957975f7f57eb9ab699c4180c8ada4fb704c118 100644 (file)
@@ -44,7 +44,7 @@ class OsdWinVector : public OsdVector, public WindowsOsd
     OsdWinVector();
     ~OsdWinVector();
 
-    int init(void* device);
+    int init();
     int shutdown();
 
        int isInitialized() { return initted; }
index 4c5b783700085ca50574d4ff57fe3991860712d5..c5cd47dee1115fa53768a3c3883cab2495b1475e 100644 (file)
@@ -98,11 +98,11 @@ class PlayerLiveRadio : public PlayerLive, public Thread_TYPE, public Callback,
     AFeed afeed;
     ChannelList* chanList;
 
-    queue<PLInstruction> instructions;
+    std::queue<PLInstruction> instructions;
     const static UCHAR I_SETCHANNEL = 1;
     const static UCHAR I_STOP = 2;
     
-    queue<StreamChunk> streamChunks;
+    std::queue<StreamChunk> streamChunks;
     
     bool initted;
 
index 49bc9fe5e3cc3ef76f3663df7b9cdd31b48f0ff7..cff36b56d11f90b5e49761c7937d38ffcb3e22e9 100644 (file)
@@ -118,11 +118,11 @@ class PlayerLiveTV : public PlayerLive, public Thread_TYPE, public Callback, pub
     TFeed tfeed;
     ChannelList* chanList;
 
-    queue<PLInstruction> instructions;
+    std::queue<PLInstruction> instructions;
     const static UCHAR I_SETCHANNEL = 1;
     const static UCHAR I_STOP = 2;
     
-    queue<StreamChunk> streamChunks;
+    std::queue<StreamChunk> streamChunks;
     
     bool initted;
 
index 8691cc8cba942ca7e85923aa7ace7b7db89f3877..2bc05a4ec56cc8fae109912496230a06af937b98 100644 (file)
--- a/recman.cc
+++ b/recman.cc
@@ -58,7 +58,7 @@ void RecMan::addEntry(bool isNew, ULONG startTime, char* name, char* fileName)
 
   char* c;
   char* d;
-  stack<char*> dirNamesStack;
+  std::stack<char*> dirNamesStack;
   char* oneDirName;
   bool gotProgName = false;
   for(c = (name + strlen(name) - 1); c >= name; c--)
index 61c28928c0bceed1e396b723a250c6df3d847e96..cccfb64bce7c1dc95edeb4a0a7b2b56fe8e00e71 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -27,8 +27,7 @@
 #include "abstractoption.h"
 
 
-using namespace std;
-typedef map<ULLONG,UCHAR> RemoteTranslationList;
+typedef std::map<ULLONG,UCHAR> RemoteTranslationList;
 
 class Remote: public AbstractOption
 {
index c912071eea929b5db49bf9b3b1a614c35da5f3f0..0ff0916e072cb84297cd7df9501a52560d2c5bbe 100644 (file)
 
 #include <bcm_host.h>
 
-using namespace std;
 using namespace CEC;
 
 #include <libcec/cecloader.h>
 
 
-
-
-#define W_G_HCW(type,code) ( (((ULLONG)(type))<<32) | code)
+#define W_G_HCW(type,code) ((static_cast<ULLONG>(type) << 32) | code)
 
 #define W_HCW_KC 1 /* key code as defined by kernel for keyboard and remotes through /dev/input */
 #define W_HCW_CEC 2 /* HDMI_CEC */
@@ -925,15 +922,15 @@ void RemoteLinux::changePowerState(bool poweron){
 // libcec4 API changed these params to pointers rather than copies, and the returns to void
 // Otherwise, these two blocks of code are the same
 
-void RemoteLinux::cecLogMessage(void *param, const cec_log_message* message)
+void RemoteLinux::cecLogMessage(void* /* param */, const cec_log_message* message)
 {
        Log::getInstance()->log("Remote", Log::DEBUG, "CECLOG: %lld %d %s", message->time, message->level, message->message);
 }
 
-void RemoteLinux::cecKeyPress(void*param, const cec_keypress* key)
+void RemoteLinux::cecKeyPress(void* /* param */, const cec_keypress* key)
 {
        //Log::getInstance()->log("Remote", Log::DEBUG, "Incoming cec key %d %d", key->keycode,key->duration);
-       if (key->duration==0) ((RemoteLinux*)Remote::getInstance())->incomingCECkey(key->keycode);
+       if (key->duration==0) static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(key->keycode);
 }
 
 void RemoteLinux::cecCommand(void* /* param */, const cec_command* command)
@@ -942,13 +939,13 @@ void RemoteLinux::cecCommand(void* /* param */, const cec_command* command)
        switch (command->opcode) {
        case CEC_OPCODE_STANDBY: {
                if (command->initiator==CECDEVICE_TV) {
-                       ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWEROFF);
+                       static_cast<RemoteLinux*>(Remote::getInstance())->incomingPowerkey(POWEROFF);
                }
        } break;
        case CEC_OPCODE_DECK_CONTROL: {
                if (command->initiator==CECDEVICE_TV && command->parameters.size == 1
                                && command->parameters[0]==CEC_DECK_CONTROL_MODE_STOP) {
-                       ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
+                       static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP);
 
                }
 
@@ -956,9 +953,9 @@ void RemoteLinux::cecCommand(void* /* param */, const cec_command* command)
        case CEC_OPCODE_PLAY: {
                if (command->initiator==CECDEVICE_TV && command->parameters.size == 1) {
                        if (command->parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) {
-                               ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
+                               static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY);
                        } else if (command->parameters[0]==CEC_PLAY_MODE_PLAY_STILL) {
-                               ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
+                               static_cast<RemoteLinux*>(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE);
                        }
                }
 
@@ -969,7 +966,7 @@ void RemoteLinux::cecCommand(void* /* param */, const cec_command* command)
        };
 }
 
-void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration* config)
+void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration*)
 {
        Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config->string()*/);
 }
@@ -1035,7 +1032,7 @@ void  RemoteLinux::cecSourceActivated(void* /* param */, const cec_logical_addre
 {
        Log::getInstance()->log("Remote", Log::DEBUG, "CECSourceActivated: %d %d", address, activated);
        if (activated==1) {
-               ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWERON);
+               static_cast<RemoteLinux*>(Remote::getInstance())->incomingPowerkey(POWERON);
        }
 }
 
@@ -1043,7 +1040,6 @@ void RemoteLinux::incomingCECkey(int keys)
 {
        curcec=keys;
        hascurcec=true;
-
 }
 
 void RemoteLinux::incomingPowerkey(UCHAR key){
index 84462cfbd534bba9349cfdd321c0d541bef01f54..fe382fe3d8ac1cdd9a43ce4fa39503391966f1b6 100644 (file)
@@ -82,7 +82,7 @@ class RemoteLinux : public Remote
 
     UCHAR TranslateHWCFixed(ULLONG code);
     void InitKeymap();
-    vector<int> devices;
+    std::vector<int> devices;
     int num_loop;
 
     CEC::ICECAdapter * cec_adap;
index d60534aa799ff45d7118222b5b178df5e1d9474b..ffba6b9ccac7ed5ba8705a2ed5bff8a017c19873 100644 (file)
 
 #ifndef SERIALIZE_H
 #define SERIALIZE_H
-#include <vector>
-using namespace std;
+
 #include <stdio.h>
 #include <string.h>
+#include <vector>
+
 #include "defines.h"
 
 class SerializeBuffer {
@@ -59,9 +60,9 @@ class SerializeBuffer {
     int decodeByte(UCHAR &data);
 
   private:
-    UCHAR * start;
-    UCHAR * end;
-    UCHAR * current;
+    UCHAR* start;
+    UCHAR* end;
+    UCHAR* current;
     ULONG size;
     bool useMalloc;
     bool owning;
@@ -210,7 +211,7 @@ class SerializableList : public Serializable{
       TULONG,
       TULLONG,
       TCHAR } Ptypes;
-    struct Pentry{
+    struct Pentry {
       Ptypes ptype;
       bool isDeserialized;
       USHORT version;
@@ -229,7 +230,7 @@ class SerializableList : public Serializable{
       }
       bool isEqual(void *p,Ptypes t);
     } ;
-    vector<struct Pentry>list;
+    std::vector<struct Pentry>list;
     Pentry *findEntry(void *p,Ptypes t);
 };
 
index d21e03ceb9c8cd26b4aafb4f7b82ab692429b7cc..52b19ecb44d5e8de3dac88794105054301ca35cb 100644 (file)
@@ -35,7 +35,7 @@ SurfaceVector::SurfaceVector(OsdVector* vosd)
 SurfaceVector::~SurfaceVector()
 {
        osd->removeSurface(this);
-       vector<SVGCommand>::iterator itty=commands.begin();
+       std::vector<SVGCommand>::iterator itty=commands.begin();
        while (itty!=commands.end())
        {
                osd->removeStyleRef((*itty).getRef()); // We remove the Style reference, so that osd can free stuff
@@ -329,8 +329,8 @@ void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int hei
 int SurfaceVector::removeCommands(float x,float y,float width,float height)
 {
        // we iterate through all old commands in order to remove commands hidden by this rectangle
-       vector<SVGCommand>::iterator itty=commands.begin();
-       vector<SVGCommand>::iterator remstart;
+       std::vector<SVGCommand>::iterator itty=commands.begin();
+       std::vector<SVGCommand>::iterator remstart;
        bool remove=false;
        float cx, cy, cw, ch;
        cx = cy = 0.f;
@@ -404,7 +404,7 @@ void SurfaceVector::endFastDraw() {
 void SurfaceVector::drawTTChar(int ox, int oy,int x, int y, cTeletextChar c)
 {
        command_mutex.Lock();
-       vector<SVGCommand>::iterator itty=commands.begin();
+       std::vector<SVGCommand>::iterator itty=commands.begin();
        while (itty!=commands.end())
        {
                if ((*itty).TTTest(ox,oy,x,y) ) {
index 54a1d860885a7173752add39dc85c90870720b21..8223eea6f27552882656e7de77746db75b2f2479 100644 (file)
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 /* Portions from vdr osdteletext plugin "txtrender.c": */
 /***************************************************************************
@@ -173,21 +172,21 @@ public:
         { return cTeletextChar((c&~CHAR)|chr); }
         
     inline enumCharsets GetCharset() 
-        { return (enumCharsets)(c&CHARSET); }
+        { return static_cast<enumCharsets>(c&CHARSET); }
     inline void SetCharset(enumCharsets charset) 
         { c=(c&~CHARSET)|charset; }
     inline cTeletextChar ToCharset(enumCharsets charset) 
         { return cTeletextChar((c&~CHARSET)|charset); }
     
     inline enumTeletextColor GetFGColor() 
-        { return (enumTeletextColor)((c&FGCOLOR) >> LowestSet32Bit(FGCOLOR)); }
+        { return static_cast<enumTeletextColor>((c&FGCOLOR) >> LowestSet32Bit(FGCOLOR)); }
     inline void SetFGColor(enumTeletextColor fgc) 
         { c=(c&~FGCOLOR) | (fgc << LowestSet32Bit(FGCOLOR)); }
     inline cTeletextChar ToFGColor(enumTeletextColor fgc) 
         { return cTeletextChar((c&~FGCOLOR) | (fgc << LowestSet32Bit(FGCOLOR))); }
     
     inline enumTeletextColor GetBGColor() 
-        { return (enumTeletextColor)((c&BGCOLOR) >> LowestSet32Bit(BGCOLOR)); }
+        { return static_cast<enumTeletextColor>((c&BGCOLOR) >> LowestSet32Bit(BGCOLOR)); }
     inline void SetBGColor(enumTeletextColor bgc) 
         { c=(c&~BGCOLOR) | (bgc << LowestSet32Bit(BGCOLOR)); }
     inline cTeletextChar ToBGColor(enumTeletextColor bgc) 
@@ -208,14 +207,14 @@ public:
         { return cTeletextChar((Dirty)?(c|DIRTY):(c&~DIRTY)); }
     
     inline enumDblHeight GetDblHeight() 
-        { return (enumDblHeight)(c&DBLHEIGHT); }
+        { return static_cast<enumDblHeight>(c&DBLHEIGHT); }
     inline void SetDblHeight(enumDblHeight dh) 
         { c=(c&~(DBLHEIGHT)) | dh; }
     inline cTeletextChar ToDblHeight(enumDblHeight dh) 
         { return cTeletextChar((c&~(DBLHEIGHT)) | dh); }
     
     inline enumDblWidth GetDblWidth() 
-        { return (enumDblWidth)(c&DBLWIDTH); }
+        { return static_cast<enumDblWidth>(c&DBLWIDTH); }
     inline void SetDblWidth(enumDblWidth dw) 
         { c=(c&~(DBLWIDTH)) | dw; }
     inline cTeletextChar ToDblWidth(enumDblWidth dw) 
index b879592867de7909806677ff537fa9dc03e00a8f..36db4436084c489b39f4defcad36610e705f6125 100644 (file)
--- a/timers.h
+++ b/timers.h
@@ -132,9 +132,7 @@ class TimerEvent : public Thread_TYPE
 };
 
 
-using namespace std;
-
-typedef list<TimerEvent*> TimerList;
+typedef std::list<TimerEvent*> TimerList;
 
 class Timers : public Thread_TYPE
 {
index eed93ec9bac6ee0cd7c91bf1fc56d7472551b38a..60257206950877d19b1cf7fb95651de17d2fc6ab 100644 (file)
@@ -27,7 +27,7 @@
 #include "boxstack.h"
 #include "i18n.h"
 #include "message.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "recinfo.h"
 #include "log.h"
 #include "channel.h"
@@ -441,7 +441,7 @@ VAudioSelector::~VAudioSelector()
   m->from = this;
   m->to = parent;
   m->message = Message::CHILD_CLOSE;
-  Command::getInstance()->postMessageNoLock(m);
+  MessageQueue::getInstance()->postMessageNoLock(m);
 }
 
 void VAudioSelector::draw()
@@ -486,7 +486,7 @@ int VAudioSelector::handleCommand(int command)
             m->to = parent;
             m->message = Message::SUBTITLE_CHANGE_CHANNEL;
             m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
-            Command::getInstance()->postMessageNoLock(m);
+            MessageQueue::getInstance()->postMessageNoLock(m);
         } else {
             asl.up();
             asl.draw();
@@ -496,7 +496,7 @@ int VAudioSelector::handleCommand(int command)
             m->to = parent;
             m->message = Message::AUDIO_CHANGE_CHANNEL;
             m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
-            Command::getInstance()->postMessageNoLock(m);
+            MessageQueue::getInstance()->postMessageNoLock(m);
         }
 
       return 2;
@@ -514,7 +514,7 @@ int VAudioSelector::handleCommand(int command)
             m->message = Message::SUBTITLE_CHANGE_CHANNEL;
             m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
                        |(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
-            Command::getInstance()->postMessageNoLock(m);
+            MessageQueue::getInstance()->postMessageNoLock(m);
         } else {
             asl.down();
             asl.draw();
@@ -525,7 +525,7 @@ int VAudioSelector::handleCommand(int command)
             m->message = Message::AUDIO_CHANGE_CHANNEL;
             m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
                        |(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
-            Command::getInstance()->postMessageNoLock(m);
+            MessageQueue::getInstance()->postMessageNoLock(m);
         }
 
       return 2;
@@ -583,7 +583,7 @@ void VAudioSelector::processMessage(Message* m)
               m2->to = parent;
               m2->message = Message::AUDIO_CHANGE_CHANNEL;
               m2->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
-              Command::getInstance()->postMessageNoLock(m2);
+              MessageQueue::getInstance()->postMessageNoLock(m2);
           }
           return;
         
@@ -605,7 +605,7 @@ void VAudioSelector::processMessage(Message* m)
               m2->to = parent;
               m2->message = Message::SUBTITLE_CHANGE_CHANNEL;
               m2->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
-              Command::getInstance()->postMessageNoLock(m2);
+              MessageQueue::getInstance()->postMessageNoLock(m2);
           }
          return;
      } 
index 63efe33897b16a721c02aff2c41ddd55ac6ad289..17b229ede6f0dc599205745c55d9c4d786c44fb6 100644 (file)
@@ -49,8 +49,7 @@ class AudioSubtitleChannel
 };
 
 
-
-typedef vector<AudioSubtitleChannel*> AudioSubtitleChannelList;
+typedef std::vector<AudioSubtitleChannel*> AudioSubtitleChannelList;
 
 class VAudioSelector : public TBBoxx
 {
diff --git a/vdp6.h b/vdp6.h
index 479656090a2048ccda56341d09b3b38cac5902bb..c3becdf8042557a7285ec016191415f7495cc8c6 100644 (file)
--- a/vdp6.h
+++ b/vdp6.h
@@ -41,13 +41,13 @@ class VDP6
     void run();
     void stop();
     int numFound();
-    vector<VDRServer>* getServers() { return &servers; }
+    std::vector<VDRServer>* getServers() { return &servers; }
 
   private:
     int pfds[2];
     int sock;
     std::thread receiveThread;
-    vector<VDRServer> servers;
+    std::vector<VDRServer> servers;
 };
 
 #endif
diff --git a/vdr.cc b/vdr.cc
index 8049ea3f7967f69f4d3c7336f44ecdcba83bb4f4..dbe6e0261e5b8563cdd68ed0ef46127dce0dc102 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -161,7 +161,7 @@ int VDR::shutdown()
   return 1;
 }
 
-void VDR::findServers(vector<VDRServer>& servers)
+void VDR::findServers(std::vector<VDRServer>& servers)
 {
   Wol* wol = Wol::getInstance();
   findingServer = 1;
@@ -252,7 +252,7 @@ void VDR::findServers(vector<VDRServer>& servers)
 
 #if IPV6
   vdp6.stop();
-  vector<VDRServer>* servers6 = vdp6.getServers();
+  std::vector<VDRServer>* servers6 = vdp6.getServers();
   
   // Add IPv6 found servers to servers vector, if not in servers already
   // Free buffers from VDRServer objects if not taken. (Itching for that rewrite already).
@@ -1635,8 +1635,8 @@ I18n::lang_code_list VDR::getLanguageList()
   {
     char* c_code = vresp->extractString();
     char* c_name = vresp->extractString();
-    string code = c_code;
-    string name = c_name;
+    std::string code = c_code;
+    std::string name = c_name;
     CodeList[code] = name;
     delete[] c_code;
     delete[] c_name;
@@ -1657,8 +1657,8 @@ int VDR::getLanguageContent(const std::string code, I18n::trans_table& texts)
   {
     char* c_key = vresp->extractString();
     char* c_text = vresp->extractString();
-    string key = c_key;
-    string text = c_text;
+    std::string key = c_key;
+    std::string text = c_text;
     texts[key] = text;
     delete[] c_key;
     delete[] c_text;
diff --git a/vdr.h b/vdr.h
index 7e8d7ec40fc737b345fdb0ec31d5c03c1738353f..928b24f4fed66ea6a10821689cb707f091f083a9 100644 (file)
--- a/vdr.h
+++ b/vdr.h
@@ -58,12 +58,9 @@ class MovieInfo;
 class SeriesInfo;
 class TVMediaInfo;
 
-
-using namespace std;
-
-typedef vector<Event*> EventList;
-typedef vector<Channel*> ChannelList;
-typedef vector<RecTimer*> RecTimerList;
+typedef std::vector<Event*> EventList;
+typedef std::vector<Channel*> ChannelList;
+typedef std::vector<RecTimer*> RecTimerList;
 
 struct VDRServer
 {
@@ -142,7 +139,7 @@ public ExternLogger
     int init();
     int shutdown();
 
-    void findServers(vector<VDRServer>& servers);
+    void findServers(std::vector<VDRServer>& servers);
     void cancelFindingServer();
     void setServerIP(char*);
     void setServerPort(USHORT);
@@ -229,7 +226,7 @@ public ExternLogger
 
 
     I18n::lang_code_list getLanguageList();
-    int           getLanguageContent(const string code, I18n::trans_table&);
+    int           getLanguageContent(const std::string code, I18n::trans_table&);
 
     // end protocol functions
 
diff --git a/vepg.cc b/vepg.cc
index bc2285c77f14eccbaaf95261b087d4fefc2bcbb7..aa0099f5fc3f62d536ead4b45e522d936d39d8c6 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -35,7 +35,7 @@
 
 #include "remote.h"
 #include "vchannellist.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "video.h"
 #include "vepgsettimer.h"
 #include "timers.h"
@@ -453,7 +453,7 @@ int VEpg::handleCommand(int command)
         m->to = parent;
         m->message = Message::CHANNEL_CHANGE;
         m->parameter.num = (*chanList)[currentChannelIndex]->number;
-        Command::getInstance()->postMessageNoLock(m);
+        MessageQueue::getInstance()->postMessageNoLock(m);
       }
       
       setCurrentChannel();
@@ -481,7 +481,7 @@ int VEpg::handleCommand(int command)
         m->to = parent;
         m->message = Message::CHANNEL_CHANGE;
         m->parameter.num = (*chanList)[currentChannelIndex]->number;
-        Command::getInstance()->postMessageNoLock(m);
+        MessageQueue::getInstance()->postMessageNoLock(m);
       }
       
       setCurrentChannel();
@@ -502,7 +502,7 @@ int VEpg::handleCommand(int command)
         m->to = parent;
         m->message = Message::CHANNEL_CHANGE;
         m->parameter.num = (*chanList)[currentChannelIndex]->number;
-        Command::getInstance()->postMessageNoLock(m);
+        MessageQueue::getInstance()->postMessageNoLock(m);
       }
       
       setCurrentChannel();
index f9d5c30ad01399a28104a8927049b2d140bdb5c0..76b629252f5b9d7e6e7a3fc6a3adef1fc8955208 100644 (file)
@@ -359,7 +359,7 @@ void VideoOMX::executePendingModeChanges()
                Osd::getInstance()->shutdown();
                selectVideoMode(0);
                Osd::getInstance()->restore();
-               Osd::getInstance()->init((void*) "");
+               Osd::getInstance()->init();
                BoxStack::getInstance()->redrawAllBoxes();
                initted = 1;
        }
@@ -738,7 +738,7 @@ int VideoOMX::signalOn()
          Log::getInstance()->log("Video", Log::NOTICE, "signalOn");
          selectVideoMode(0);
          Osd::getInstance()->restore();
-         Osd::getInstance()->init((void*)"");
+         Osd::getInstance()->init();
          BoxStack::getInstance()->redrawAllBoxes();
          initted=1;
 
@@ -790,7 +790,7 @@ void VideoOMX::interlaceSwitch4Demux() {
                        selectVideoMode(set_interlaced);
                        Osd::getInstance()->shutdown();
                        Osd::getInstance()->restore();
-                       Osd::getInstance()->init((void*)"");
+                       Osd::getInstance()->init();
                        BoxStack::getInstance()->redrawAllBoxes();
                        initted=1;
                }
@@ -1768,7 +1768,7 @@ int VideoOMX::WaitForEvent(OMX_HANDLETYPE handle,OMX_U32 event, int wait) //need
        int iend=(wait/5+1);
        while (i<iend) {
                omx_event_mutex.Lock();
-               list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+               std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
                while (itty!=omx_events.end()) {
 
                        VPE_OMX_EVENT current=*itty;
@@ -1812,7 +1812,7 @@ int VideoOMX::clearEvents()
 int VideoOMX::clearEventsForComponent(OMX_HANDLETYPE handle)
 {
        omx_event_mutex.Lock();
-       list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+       std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
        while (itty!=omx_events.end()) {
                VPE_OMX_EVENT current=*itty;
                if (current.handle==handle) { //this is ours
@@ -1831,7 +1831,7 @@ void VideoOMX::checkForStalledBuffers()
        //Log::getInstance()->log("Video", Log::DEBUG, "Check stalled");
        clock_mutex.Lock();
        omx_event_mutex.Lock();
-       list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+       std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
        while (itty!=omx_events.end()) {
                VPE_OMX_EVENT current=*itty;
                if (current.event_type==OMX_EventParamOrConfigChanged && current.data1==omx_codec_output_port
@@ -1875,7 +1875,7 @@ int VideoOMX::CommandFinished(OMX_HANDLETYPE handle,OMX_U32 command,OMX_U32 data
        int i=0;
        while (i<200/*1000*/) {
                omx_event_mutex.Lock();
-               list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
+               std::list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
                while (itty!=omx_events.end()) {
 
                        VPE_OMX_EVENT current=*itty;
@@ -2867,8 +2867,8 @@ void VideoOMX::PrepareMediaSample(const MediaPacketList& mplist,UINT samplepos)
 {
 
        mediapackets.clear();
-       list<MediaPacket>::const_iterator begin=mplist.begin();
-       list<MediaPacket>::const_iterator itty=mplist.begin();
+       std::list<MediaPacket>::const_iterator begin=mplist.begin();
+       std::list<MediaPacket>::const_iterator itty=mplist.begin();
        advance(itty,min(mplist.size(),10));
        mediapackets.insert(mediapackets.begin(),begin,itty);//front
 
index 121ce2fbc41837a417ebb7f9c51f53224a0ef821..7b8ad149b43afa35f97d3453070ba07e98805626 100644 (file)
@@ -87,7 +87,7 @@ class VideoOMX : public Video
     int setMode(UCHAR mode);
     bool setVideoDisplay(VideoDisplay display);
     int setTVsize(UCHAR size);               // Is the TV a widescreen?
-   UCHAR getTVsize();
+    UCHAR getTVsize();
 
     void executePendingModeChanges();
     int setDefaultAspect();
@@ -269,8 +269,8 @@ class VideoOMX : public Video
           int DeAllocateCodecsOMX();
           int FlushRenderingPipe();
 
-          vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
-          list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
+          std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
+          std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
           Mutex input_bufs_omx_mutex;
           OMX_BUFFERHEADERTYPE* cur_input_buf_omx;
 
@@ -284,7 +284,7 @@ class VideoOMX : public Video
           Mutex omx_event_mutex;
           Signal omx_event_ready_signal;
 
-          list<VPE_OMX_EVENT> omx_events;
+          std::list<VPE_OMX_EVENT> omx_events;
 
           bool omx_mpeg2;
           bool omx_h264;
@@ -309,7 +309,7 @@ class VideoOMX : public Video
           bool firstsynched;
 
 
-          vector<MediaPacket> mediapackets;
+          std::vector<MediaPacket> mediapackets;
 
           char L_VPE_OMX_CLOCK[128];
           char L_VPE_OMX_H264_DECODER[128];
index c379049513c7ca795b67bcab416f445cc41e009f..43ea009d2a7ae4a89370249c2b924b48808058c6 100644 (file)
@@ -42,8 +42,7 @@ struct VideoFilterDesc {
     bool vmr9;
     bool vmr9tested;
 };
-using namespace std;
-typedef vector<VideoFilterDesc> VideoFilterDescList;
+typedef std::vector<VideoFilterDesc> VideoFilterDescList;
 #endif
 
 class DsSourceFilter;
index a104e3a3d8ee613aaca1ace52c92f344f7d2846a..7bbb7c9e11aea3de27871589a7e6cb74365d4440 100644 (file)
@@ -74,7 +74,6 @@
 #include "localmediafile.h"
 #include "mediaoptions.h"
 
-using namespace std;
 //a ref count holder
 class MediaListHolder {
   public:
@@ -185,7 +184,7 @@ class MediaDirectory {
                }
 };
 
-typedef vector<MediaDirectory*> MDirList;
+typedef std::vector<MediaDirectory*> MDirList;
 class DirList {
        private:
                int current;
@@ -362,7 +361,7 @@ VMediaList::~VMediaList()
   Timers::getInstance()->cancelTimer(this,1);
   Timers::getInstance()->cancelTimer(this,2);
   removeViewer();
-       delete dirlist;
+  delete dirlist;
   if (audiodirlist) delete audiodirlist;
   Log::getInstance()->log("VMediaList::~VMediaList", Log::DEBUG, "finished");
 }
@@ -717,15 +716,15 @@ int VMediaList::handleCommand(int command)
   playingAll=false;
   switch(command)
   {
-               case Remote::ONE:
-                       {
+    case Remote::ONE:
+    {
       sl.hintSetCurrent(0);
       sl.draw();
       updateSelection();
       doShowingBar();
       boxstack->update(this);
       return 2;
-                       }
+    }
     case Remote::DF_UP:
     case Remote::UP:
     {
index fa196f8efc3d32b8352f1f408ef26955061d346b..505763a2171d8f85aaa0aafe74b050e03fcfcb4e 100644 (file)
--- a/vopts.cc
+++ b/vopts.cc
@@ -38,7 +38,8 @@
 #include "mediaoptions.h"
 #endif
 //#include "vdr.h"
-//#include "command.h"
+#include "command.h"
+#include "messagequeue.h"
 
 VOpts::VOpts()
 {
@@ -100,7 +101,7 @@ VOpts::VOpts()
 
   UINT suppconn = Video::getInstance()->getSupportedFormats();
   if (suppconn) {
-         int defaultch = 0;
+         UINT defaultch = 0;
          if (suppconn & Video::COMPOSITERGB) {
                  defaultch = 0;
                  options3.push_back("RGB+composite");
@@ -129,7 +130,7 @@ VOpts::VOpts()
 
   UINT suppformats = Video::getInstance()->supportedTVFormats();
   if (suppformats) {
-         int defaultch = 0;
+         UINT defaultch = 0;
          options16.push_back("NTSC");
          options16keys.push_back("NTSC");
          if (suppformats & Video::PAL) {
@@ -156,7 +157,7 @@ VOpts::VOpts()
 
   UINT supptvsize=Video::getInstance()->supportedTVsize();
   if (supptvsize) {
-         int defaultch=0;
+         UINT defaultch=0;
          options4.push_back("4:3");
          options4keys.push_back("4:3");
       if (Video::ASPECT16X9 & supptvsize) {
@@ -273,7 +274,7 @@ VOpts::~VOpts()
  // for (int i = 0; i < numPanes; i++) delete panes[i]; //Move to TabBar, Marten
   delete[] panes;
 
-  for(vector<Option*>::iterator j = options.begin(); j != options.end(); j++) delete *j;
+  for(std::vector<Option*>::iterator j = options.begin(); j != options.end(); j++) delete *j;
   delete[] options2;
   delete[] options2keys;
 }
@@ -320,12 +321,12 @@ void VOpts::doSave()
   // Damn, and the dynamic idea was going *so* well...
   //Whats about a check with typeid operator?
   WOptionPane* wop;
-  wop = (WOptionPane*)panes[0];
-  wop->saveOpts();  
-  wop = (WOptionPane*)panes[1];
-  wop->saveOpts();  
-  wop = (WOptionPane*)panes[2];
+  wop = static_cast<WOptionPane*>(panes[0]);
   wop->saveOpts();  
+  wop = static_cast<WOptionPane*>(panes[1]);
+  wop->saveOpts();
+  wop = static_cast<WOptionPane*>(panes[2]);
+  wop->saveOpts();
 
 
   for (UINT i = 0; i < options.size(); i++)
@@ -365,7 +366,7 @@ void VOpts::doSave()
           Message* m = new Message();
           m->message = Message::CHANGE_LANGUAGE;
           m->to = Command::getInstance();
-          Command::getInstance()->postMessageNoLock(m);
+          MessageQueue::getInstance()->postMessageNoLock(m);
           break;
         }
         case 3:
@@ -464,12 +465,12 @@ void VOpts::doSave()
                if (options[i]->userSetChoice == 1)
                {
                        Log::getInstance()->log("Options", Log::DEBUG, "Setting classic menu");
-                       Command::getInstance()->setAdvMenues(false);
+                       Command::getInstance()->setAdvMenus(false);
                }
                else
                {
                        Log::getInstance()->log("Options", Log::DEBUG, "Setting advanced menu");
-                       Command::getInstance()->setAdvMenues(true);
+                       Command::getInstance()->setAdvMenus(true);
                }
                break;
         }
diff --git a/vopts.h b/vopts.h
index 416aeb71ae91a126094beb77a38e6beb56fe505b..e2e2da3b4854882be085a99846458066537d9773 100644 (file)
--- a/vopts.h
+++ b/vopts.h
@@ -58,11 +58,11 @@ class VOpts : public TBBoxx
     // be valid for the lifetime of the VOpts instance, because we
     // create Option objects with pointers into LangCode's data.
 
-    vector<const char*> options4; // this is for tv size
-    vector<const char*> options4keys;
-    vector<const char*> options3; // this is for tv size
-    vector<const char*> options3keys;
-    vector<const char*> options16; // this is for tv standard
-    vector<const char*> options16keys;
+    std::vector<const char*> options4; // this is for tv size
+    std::vector<const char*> options4keys;
+    std::vector<const char*> options3; // this is for tv size
+    std::vector<const char*> options3keys;
+    std::vector<const char*> options16; // this is for tv standard
+    std::vector<const char*> options16keys;
 };
 #endif
index 307df44ad0335bb3ad1fbeddd97d9113b76ab703..356b012831a5503778794bf7e3df9c3682607d8e 100644 (file)
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #include "vquestion.h"
@@ -24,7 +23,7 @@
 #include "boxstack.h"
 #include "colour.h"
 #include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
 
 VQuestion::VQuestion(void* treplyTo)
 {
@@ -110,7 +109,7 @@ int VQuestion::handleCommand(int command)
       m->from = this;
       m->to = replyTo;
       m->message = Message::QUESTION_YES;
-      Command::getInstance()->postMessageNoLock(m);
+      MessageQueue::getInstance()->postMessageNoLock(m);
 
       return 4;
     }
index 7fbf061cf1538b35f10e6d89aa3d4df40e410baa..d061a554f5833851de34f4bdec9f4fffe88cdd15 100644 (file)
@@ -14,8 +14,7 @@
     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.
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #ifndef VQUESTION_H
index 8db32bc04e3ab953c84efe9d3bbe305d33a62014..0a59671e170cae6d4ae36ba10da92e82b2f6bd67 100644 (file)
@@ -65,7 +65,7 @@ class VRecordingList : public TBBoxx
 
     virtual void quickUpdate()=0;
 
-    stack<int> slIndexStack;
+    std::stack<int> slIndexStack;
 };
 
 #endif
index d6219d28f65021a9e8d42e8b248b50ecc9e236a6..e9f9839325b89190e722d365876c7ad2dceab600 100644 (file)
@@ -29,7 +29,7 @@
 #include "command.h"
 
 
-VServerSelect::VServerSelect(vector<VDRServer>& servers, void* treplyTo)
+VServerSelect::VServerSelect(std::vector<VDRServer>& servers, void* treplyTo)
 {
   // I tried the whole passing using a reference here, but
   // the program segfaulted when settitletext tried to new
index ffe62d088eb135f07eac354bd31b0a120a118b68..2a4a022b113668c4a96a9e8ba57b9a400d5361b1 100644 (file)
 
 class Message;
 
-using namespace std;
-
 class VServerSelect : public TBBoxx
 {
   public:
-    VServerSelect(vector<VDRServer>& servers, void* replyTo);
+    VServerSelect(std::vector<VDRServer>& servers, void* replyTo);
     ~VServerSelect();
 
     int handleCommand(int command);
index 4b3df05084c02902bfa1a3c7c3d4e7653c51d813..278c5986dc2b2c22857eb936b49bd51de1b0f902 100644 (file)
@@ -27,6 +27,7 @@
 #include "timers.h"
 #include "boxstack.h"
 #include "command.h"
+#include "messagequeue.h"
 
 Sleeptimer* Sleeptimer::instance = NULL;
 
@@ -162,13 +163,13 @@ void Sleeptimer::threadMethod()
             VCountdown* count = new VCountdown();
              char* temp = (char*)malloc(20);
             sprintf(temp, "0:%02d", sec);
-            count->draw(temp);
+            count->drawClock(temp);
             free(temp);
             Message* m1 = new Message();
             m1->message = Message::ADD_VIEW;
          m1->to = BoxStack::getInstance();
             m1->parameter.num = (ULONG)count;
-            Command::getInstance()->postMessageNoLock(m1);
+            MessageQueue::getInstance()->postMessageNoLock(m1);
          }
         MILLISLEEP(1000);
        
@@ -180,7 +181,7 @@ void Sleeptimer::threadMethod()
             m2->to = Command::getInstance();
             m2->from = this;
                 m2->parameter.num = 61;
-            Command::getInstance()->postMessageFromOuterSpace(m2);
+            MessageQueue::getInstance()->postMessageFromOuterSpace(m2);
             shutdown();
          }
        
@@ -242,7 +243,7 @@ void VSleeptimer::timercall(int clientReference)
   m->message = Message::CLOSE_ME;
   m->to = BoxStack::getInstance();
   m->from = this;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 int VSleeptimer::handleCommand(int command)
@@ -287,7 +288,7 @@ VCountdown::~VCountdown()
   Timers::getInstance()->cancelTimer(this, 1);
 }
 
-void VCountdown::draw(const char* sec)
+void VCountdown::drawClock(const char* sec)
 {
    
    fillColour(DrawStyle::VIEWBACKGROUND);
@@ -310,5 +311,5 @@ void VCountdown::timercall(int clientReference)
   m->message = Message::CLOSE_ME;
   m->to = BoxStack::getInstance();
   m->from = this;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
index d5bb518642d723f51ed449659f7656e247d58d1d..d8f78088a97bb306e10d4111c232ae9b3d68f552 100644 (file)
@@ -71,7 +71,7 @@ class VCountdown : public Boxx, public TimerReceiver
  public:
        VCountdown();
        ~VCountdown();
-       void draw(const char* sec);
+       void drawClock(const char* sec);
        void timercall(int clientReference);
    
 }
index 62d21895ab2b9e666d8a92800d15b6895365d99d..94a9e568983f3680dbc58fe565f55890d15db9ed 100644 (file)
@@ -713,7 +713,7 @@ void VVideoLiveTV::doEPG()
 {
   if (osd.getVisible()) clearScreen();
 
-  if (!Command::getInstance()->advMenues())
+  if (!Command::getInstance()->isAdvMenus())
   {
     VEpg* vepg = new VEpg(this, currentChannelIndex, chanList);
     vepg->draw();
index 02cbf745b8b7d826700c8f1ec87c8fc2b5ac5a68..0cbb104b70ed053e70e0992b967b2fd6500f742b 100644 (file)
@@ -27,7 +27,7 @@
 #include "video.h"
 #include "timers.h"
 #include "boxstack.h"
-#include "command.h"
+#include "messagequeue.h"
 
 VVolume::VVolume()
 {
@@ -89,7 +89,7 @@ void VVolume::timercall(int clientReference)
   m->message = Message::CLOSE_ME;
   m->to = BoxStack::getInstance();
   m->from = this;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 int VVolume::handleCommand(int command)
index 6a88f3b5ed78f0d238b6e57ca266ddc9b5751191..adec7d794dbdccf581c7afeeb2261a59446194ac 100644 (file)
@@ -344,11 +344,11 @@ void VWelcome::doRadioList()
 void VWelcome::doRecordingsList()
 {
        VRecordingList* vrec;
-       if (Command::getInstance()->advMenues()) {
-          vrec =  new VRecordingListAdvanced();
-       } else {
+       if (Command::getInstance()->isAdvMenus())
+          vrec = new VRecordingListAdvanced();
+       else
           vrec = new VRecordingListClassic();
-       }
+
        vrec->draw();
        boxstack->add(vrec);
        boxstack->update(vrec);
index 0097303052bc90db9ab9b7af85052a1672eb2b4e..e06cb43abe2cfa57323456736db68963161ec768 100644 (file)
@@ -248,7 +248,7 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd
   }
 
   dynamic_cast<WindowsOsd*>(osd)->setWindow(win);
-  success = osd->init(NULL);
+  success = osd->init();
   if (success)
   {
     logger->log("Core", Log::INFO, "OSD module initialised");
index ca54f0ccbe70936dd3203684ca684fbdcb0c1f07..58374885ecf83747d56b0c95615ddf2786b4525c 100644 (file)
@@ -46,10 +46,10 @@ class WOptionPane : public Boxx
     int numOptions;
     int selectedOption;
     
-    vector<Option*> options;
+    std::vector<Option*> options;
     
-    vector<WTextbox*> textBoxes;
-    vector<WOptionBox*> optionBoxes;
+    std::vector<WTextbox*> textBoxes;
+    std::vector<WOptionBox*> optionBoxes;
 };
 
 #endif
index fd1a6bfe3c37aaed2cc0d2e881cac7cb67c276f5..50be37c9bdefddc5355b9dd12dcc678e50b62cb5 100644 (file)
@@ -57,11 +57,11 @@ void WPictureView::draw()
 
   drawClippingRectangle(1,1,area.w-1,area.h-1);
 
-  list<Picture>::iterator itty=pictures.begin();
+  std::list<Picture>::iterator itty=pictures.begin();
   while (itty!=pictures.end())
   {
          // We now calculate the pictures in one row
-         list<Picture*> cur_pict;
+         std::list<Picture*> cur_pict;
          float cur_width=0;
          float max_height=const_height;
 
@@ -75,7 +75,7 @@ void WPictureView::draw()
                  itty++;
          }
          // ok now we have a list of pictures, let's draw them
-         list<Picture*>::iterator citty=cur_pict.begin();
+         std::list<Picture*>::iterator citty=cur_pict.begin();
          float xpos= (area.w - cur_width)*0.5f;
          if (xpos < 0) xpos=0;
          while (citty!=cur_pict.end())
index 04a32c7fdf41860b450f10123c75f9cf72fc1db4..84e5032a7abb80578d96e326a339bb8b97afa9f0 100644 (file)
@@ -59,7 +59,7 @@ class WPictureView : public Boxx
        float h;
        bool banner;
     };
-    list<Picture> pictures;
+    std::list<Picture> pictures;
 
     DrawStyle foreColour;
     unsigned int cur_scroll_line;
index 9106484feb495e3d09ee90160b1ce6361f613cc6..24b301cf06a67cd9df6841690e8c1752f10c19a2 100644 (file)
@@ -29,8 +29,6 @@
 #include "defines.h"
 #include "boxx.h"
 
-using namespace std;
-
 typedef struct
 {
   char* text;
@@ -78,7 +76,7 @@ class WSelectList : public Boxx
     void drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour, TVMediaInfo* pict);
     int getMouseLine(int x, int y);
 
-    vector<wsloption> options;
+    std::vector<wsloption> options;
     UINT selectedOption;
     int topOption;
     UINT numOptionsDisplayable;
index b3846a4e16ed6056cde3b7871004178368502711..baa0706a2e7e5a905b0f18763d13879cf6b7f1e5 100644 (file)
--- a/wtabbar.h
+++ b/wtabbar.h
@@ -54,7 +54,7 @@ class WTabBar : public Boxx
   
     UINT visiblePane;
     bool buttonBarActive;
-    vector<TabDetails> tabs;
+    std::vector<TabDetails> tabs;
     
     WSymbol symbolLeft;
     WSymbol symbolRight;