]> git.vomp.tv Git - vompclient.git/commitdiff
WIP
authorChris Tallon <chris@vomp.tv>
Wed, 29 Jan 2020 15:23:52 +0000 (15:23 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 29 Jan 2020 15:23:52 +0000 (15:23 +0000)
Code cleaning and reformatting
Remove some ancient commented out log lines
Implemented more brace-init
Remove some old-style casts
More GPL headers updated
Split Message::parameter union into separate variables
Rename parameter.num to parameter, parameter.handle to data
Completed MessageQueue call changes

75 files changed:
audioplayer.cc
boxstack.cc
boxx.cc
boxx.h
channel.cc
channel.h
command.cc
command.h
defines.h
directory.cc
directory.h
dsock.cc
dsock.h
message.cc
message.h
osdopenvg.cc
osdwinvector.cc
player.cc
player.h
playerliveradio.cc
playerliveradio.h
playerlivetv.cc
playerlivetv.h
playermedia.cc
playerradio.cc
recman.cc
recman.h
recording.cc
recording.h
region.cc
region.h
teletextdecodervbiebu.cc
udp.cc
udp.h
vaudioselector.cc
vchannellist.cc
vchannelselect.cc
vchannelselect.h
vcolourtuner.cc
vconnect.cc
vconnect.h
vdr.cc
vdr.h
vepg.cc
vepglistadvanced.cc
vepgsettimer.cc
vepgsummary.cc
vmedialist.cc
vmediaview.cc
vmute.cc
vopts.cc
vpicturebanner.cc
vquestion.cc
vradiorec.cc
vrecmove.cc
vrecording.cc
vrecordinglist.cc
vrecordingmenu.cc
vrecordingmenu.h
vserverselect.cc
vsleeptimer.cc
vsleeptimer.h
vtimeredit.cc
vtimeredit.h
vtimerlist.cc
vvideolivetv.cc
vvideomedia.cc
vvideorec.cc
vwelcome.cc
winmain.cc
wremoteconfig.cc
wwinaudiofilter.cc
wwinmp3audiofilter.cc
wwinvideofilter.cc
wwinvideoh264filter.cc

index c1b2b306b18e0a9677ac63854dde7a78bbf3a801..eb48c2c1493fd8bd31868249f3c3a87de9723004 100644 (file)
@@ -22,7 +22,7 @@
 #include "demuxeraudio.h"
 #include "timers.h"
 #include "video.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "i18n.h"
 #include "boxx.h"
 #include "log.h"
@@ -295,8 +295,8 @@ void AudioPlayer::sendFrontendMessage(ULONG para)
        threadUnlock();
   m->from = this;
   m->message = Message::PLAYER_EVENT;
-  m->parameter.num = para;
-       Command::getInstance()->postMessageFromOuterSpace(m);
+  m->parameter = para;
+       MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 //open a new file
index 1776c611af4d4c6d5a3ab3375a9ae219886a1a0a..1107f3d096a11dce91836aa9d1d4256531d0c8b0 100644 (file)
@@ -21,6 +21,7 @@
 #include "boxstack.h"
 
 #include "command.h"
+#include "messagequeue.h"
 #include "remote.h"
 #include "log.h"
 
@@ -168,7 +169,7 @@ int BoxStack::remove(Boxx* toDelete)
     Message* m = new Message();
     m->to = Command::getInstance();
     m->message = Message::LAST_VIEW_CLOSE;
-    Command::getInstance()->postMessageNoLock(m);
+    MessageQueue::getInstance()->postMessageNoLock(m);
   }
 
   if (!videoStack.empty() && videoStack.top().first==toDelete) {
@@ -589,9 +590,9 @@ void BoxStack::processMessage(Message* m)
       remove((Boxx*)m->from);
       break;
     }
-    case Message::ADD_VIEW: // currently not used by anything but it might come in useful again
+    case Message::ADD_VIEW:
     {
-      Boxx* toAdd = (Boxx*)m->parameter.num;
+      Boxx* toAdd = (Boxx*)m->parameter;
       add(toAdd);
       toAdd->draw();
       update(toAdd);
diff --git a/boxx.cc b/boxx.cc
index 21bdb9c0e78e98c89b584b7fcd7ea5efca1686fe..08e56d82513f1ec89eaff104e96ac23f023b1add 100644 (file)
--- a/boxx.cc
+++ b/boxx.cc
@@ -1,5 +1,5 @@
 /*
-    Copyright 2007 Chris Tallon
+    Copyright 2007-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/>.
 */
 
 #include <stdlib.h>
 
 #include "boxx.h"
 #include "surfacevector.h"
+
 char Boxx::numBoxxes = 0;
 
 Boxx::Boxx()
 {
-  // I want a parent box or a surface.
-  parent = NULL;
-  surface = NULL;
-
-  area.x = 0;
-  area.y = 0;
-  area.w = 0;
-  area.h = 0;
-
   vdisplay.mode = None;
 
-  paraVSpace = 6; // default gap for drawPara
-
-  backgroundColourSet = false;
-  visible = true;
-
   numBoxxes++;
   Log::getInstance()->log("Boxx", Log::DEBUG, "Construct, now %u", numBoxxes);
 }
@@ -57,24 +43,18 @@ Boxx::~Boxx()
   numBoxxes--;
   Log::getInstance()->log("Boxx", Log::DEBUG, "Destruct, now %u", numBoxxes);
 }
-#include <typeinfo>
+
 void Boxx::draw()
 {
-  //Log::getInstance()->log("Boxx", Log::DEBUG, "Draw this %p surface %p", this, surface);
   if (backgroundColourSet) fillColour(backgroundColour);
 
   Boxx* currentBoxx;
   std::vector<Boxx*>::iterator j;
-  //int count=0;
   for (j = children.begin(); j != children.end(); j++)
   {
     currentBoxx = *j;
-   //Log::getInstance()->log("Boxx", Log::DEBUG, "Draw child %d %d %s", count,currentBoxx,typeid(*currentBoxx).name());
     if (currentBoxx->getVisible()) currentBoxx->draw();
-   //Log::getInstance()->log("Boxx", Log::DEBUG, "Draw child %d %d end", count,currentBoxx);
-   // count++;
   }  
- // Log::getInstance()->log("Boxx", Log::DEBUG, "Draw this %p surface %p End", this, surface);
 }
 
 void Boxx::setSize(UINT w, UINT h)
@@ -116,16 +96,14 @@ void Boxx::remove(Boxx* oldChild)
 
 void Boxx::removeVisibleChilds(Region & r)
 {
-       for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
-       {
-               if ((*i)->getVisible())
-               {
-                       Region temp=(*i)->getRegionR();
-                       if (r.intersects(temp)) {
-                               r=r.subtract(temp);
-                       }
-               }
-       }
+  for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+  {
+    if ((*i)->getVisible())
+    {
+      Region temp = (*i)->getRegionR();
+      if (r.intersects(temp)) r = r.subtract(temp);
+    }
+  }
 }
 
 void Boxx::setParent(Boxx* newParent)
@@ -141,12 +119,12 @@ void Boxx::setBackgroundColour(const DrawStyle& Tcolour)
 
 void Boxx::setVideoBackground()
 {
-       vdisplay.mode=Window;
-       vdisplay.fallbackMode=Fullscreen;
-       vdisplay.x=getScreenX();
-       vdisplay.y=getScreenY();
-       vdisplay.width=getWidth();
-       vdisplay.height=getHeight();
+  vdisplay.mode = Window;
+  vdisplay.fallbackMode = Fullscreen;
+  vdisplay.x = getScreenX();
+  vdisplay.y = getScreenY();
+  vdisplay.width = getWidth();
+  vdisplay.height = getHeight();
 }
 
 void Boxx::setVisible(bool isVisible)
@@ -182,7 +160,6 @@ void Boxx::blt(Region& r)
   r.y -= area.y;
 
   surface->updateToScreen(r.x, r.y, r.w, r.h, area.x + r.x, area.y + r.y);
-
 }
 
 int Boxx::getScreenX()
@@ -264,14 +241,14 @@ void Boxx::getRootBoxRegion(Region* r)
 
 bool Boxx::getVideoDisplay(VideoDisplay &vd)
 {
-       for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
-       {
-               if ((*i)->getVideoDisplay(vd)) return true;
-       }
+  for(std::vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+  {
+    if ((*i)->getVideoDisplay(vd)) return true;
+  }
 
-       if (vdisplay.mode==None) return false;
-       vd=vdisplay;
-       return true;
+  if (vdisplay.mode == None) return false;
+  vd = vdisplay;
+  return true;
 }
 
 // Level 1 drawing functions
@@ -281,7 +258,7 @@ void Boxx::fillColour(const DrawStyle& colour)
   rectangle(0, 0, area.w, area.h, colour);
 }
 
-int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsigned int skiplines)
+int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour, unsigned int skiplines)
 {
   char line[256];
   int lineHeight = getFontHeight() + paraVSpace;
@@ -306,18 +283,17 @@ int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsig
   ypos = y;
   Region tester;
 
-
   bool haschildren = true;
-  if ( children.size() == 0) haschildren = false;
-  bool mchar=false;
-  Osd *osd=Osd::getInstance();
-  if (osd->charSet()!=1) mchar=true;
-  OsdVector *osdv=dynamic_cast<OsdVector*>(osd);
-  float *charwidtharray=NULL;
-  if (osdv) charwidtharray=osdv->getCharWidthArray();
+  if (children.size() == 0) haschildren = false;
+  bool mchar = false;
+  Osd *osd = Osd::getInstance();
+  if (osd->charSet() != 1) mchar = true;
+  OsdVector *osdv = dynamic_cast<OsdVector*>(osd);
+  float *charwidtharray = NULL;
+  if (osdv) charwidtharray = osdv->getCharWidthArray();
 
   mbstate_t state;
-  memset((void*)&state,0,sizeof(state));
+  memset((void*)&state, 0, sizeof(state));
 
   while(1)
   {
@@ -337,14 +313,19 @@ int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsig
       int cur_length = 1;
       wchar_t cur_char;
       if (*(text + textPos) == '\0') break;
-      if (mchar) {
-         cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
-         if (cur_length <= 0){
-                 cur_char='?';
-                 cur_length=1;
-         }
-      } else cur_char= *(text + textPos);
-
+      if (mchar)
+      {
+        cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
+        if (cur_length <= 0)
+        {
+          cur_char = '?';
+          cur_length = 1;
+        }
+      }
+      else
+      {
+        cur_char = *(text + textPos);
+      }
 
       if (cur_char == '\0') break;
 
@@ -354,13 +335,16 @@ int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsig
         printLine = 1;
         break;
       }
-      if (charwidtharray) {
-         thisCharWidth=charwidtharray[cur_char & 0xFF];
-         if (cur_char && 0xFFFFFF00) thisCharWidth=osdv->getCharWidth(cur_char);
-      } else  thisCharWidth = charWidth(cur_char);
-
-
 
+      if (charwidtharray)
+      {
+        thisCharWidth = charwidtharray[cur_char & 0xFF];
+        if (cur_char && 0xFFFFFF00) thisCharWidth = osdv->getCharWidth(cur_char);
+      }
+      else
+      {
+        thisCharWidth = charWidth(cur_char);
+      }
 
 
       if ((lineWidth + thisCharWidth + x) > tester.w)
@@ -378,13 +362,19 @@ int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsig
           while ((cur_char != ' ') && (linePos >= 0))
           {
             textPos -= cur_length;
-            if (mchar) {
-                 cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
-                 if (cur_length <= 0){
-                       cur_char='?';
-                       cur_length=1;
-                 }
-            } else cur_char= *(text + textPos);
+            if (mchar)
+            {
+              cur_length = mbrtowc(&cur_char, text + textPos, textLength-textPos, &state);
+              if (cur_length <= 0)
+              {
+                cur_char='?';
+                cur_length=1;
+              }
+            }
+            else
+            {
+              cur_char = *(text + textPos);
+            }
             linePos--;
           }
           // Now take the space we just found
@@ -397,19 +387,23 @@ int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour,unsig
       textPos += cur_length;
     }
 
-//    line[linePos++] = '\0';
+//  line[linePos++] = '\0';
     if (linePos >= 0) line[linePos++] = '\0'; //Here is the change
 
     if (printLine || (linePos > 1)) // if some text was put in line
     {
-       if (ypos <= (int)(area.h - lineHeight + paraVSpace)) {
-               if (drawLinePos >= 0) {
-                       drawText(line, x, ypos, colour);
-                       ypos += lineHeight;
-               }
-       } else {
-               leftlines++;
-       }
+      if (ypos <= (int)(area.h - lineHeight + paraVSpace))
+      {
+        if (drawLinePos >= 0)
+        {
+          drawText(line, x, ypos, colour);
+          ypos += lineHeight;
+        }
+      }
+      else
+      {
+        leftlines++;
+      }
       drawLinePos++;
     }
     else
@@ -489,9 +483,8 @@ void Boxx::drawPixel(UINT x, UINT y, const Colour& colour, bool fastdraw)
 
 void Boxx::drawTTChar(int ox, int oy,int x, int y, cTeletextChar c)
 {
-       if (parent) parent->drawTTChar(area.x + ox, area.y + oy, x,y,c);
-       else  if (surface) surface->drawTTChar(ox, oy,x,y,c);
-
+  if (parent) parent->drawTTChar(area.x + ox, area.y + oy, x,y,c);
+  else  if (surface) surface->drawTTChar(ox, oy,x,y,c);
 }
 
 void Boxx::drawBitmap(UINT x, UINT y, const Bitmap& bm, const DisplayRegion & region)
@@ -514,23 +507,23 @@ void Boxx::drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsign
 
 void Boxx::drawTVMedia(TVMediaInfo & tvmedia,float x, float y, float  width, float height, Corner corner)
 {
-       if (parent) parent->drawTVMedia(tvmedia,area.x + x,area.y + y,width, height, corner);
-       else if (surface) {
-               SurfaceVector * surfacevector=dynamic_cast<SurfaceVector*>(surface);
-               if (surfacevector) surfacevector->drawTVMedia(tvmedia,x, y,width, height, corner);
-               else surface->fillblt((int)x, (int)y, (int)width, (int)height, DrawStyle::RED); // Signal that something went wrong
-       }
-
+  if (parent) parent->drawTVMedia(tvmedia,area.x + x,area.y + y,width, height, corner);
+  else if (surface)
+  {
+    SurfaceVector* surfacevector = dynamic_cast<SurfaceVector*>(surface);
+    if (surfacevector) surfacevector->drawTVMedia(tvmedia, x, y, width, height, corner);
+    else surface->fillblt((int)x, (int)y, (int)width, (int)height, DrawStyle::RED); // Signal that something went wrong
+  }
 }
 
 void Boxx::drawClippingRectangle(float x, float y, float w, float h)
 {
-       if (parent) parent->drawClippingRectangle(area.x + x, area.y + y, w, h);
-       else if (surface) {
-               SurfaceVector * surfacevector=dynamic_cast<SurfaceVector*>(surface);
-               if (surfacevector) surfacevector->drawClippingRectangle(x, y, w, h);
-
-       }
+  if (parent) parent->drawClippingRectangle(area.x + x, area.y + y, w, h);
+  else if (surface)
+  {
+    SurfaceVector* surfacevector = dynamic_cast<SurfaceVector*>(surface);
+    if (surfacevector) surfacevector->drawClippingRectangle(x, y, w, h);
+  }
 }
 
 int Boxx::getFontHeight()
@@ -571,7 +564,6 @@ float Boxx::charWidth(wchar_t c)
   else return 16.; //?
 }
 
-
 Surface* Boxx::getSurface()
 {
   if (parent) return parent->getSurface();
@@ -580,26 +572,26 @@ Surface* Boxx::getSurface()
 
 bool Boxx::mouseMove(int x, int y)
 {
-       if ((x >=  (int)area.x) && (x<(int)area.x2())
-               && (y >= (int)area.y) && (y < (int)area.y2()))
-       {
-               return true;
-       }
-       else 
-       {
-               return false;
-       }
+  if ((x >=  (int)area.x) && (x<(int)area.x2())
+      && (y >= (int)area.y) && (y < (int)area.y2()))
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
 }
 
 bool Boxx::mouseLBDOWN(int x, int y)
 {
-       if ((x >= (int)area.x) && (x<(int)area.x2())
-               && (y >= (int)area.y) && (y < (int)area.y2()))
-       {
-               return true;
-       }
-       else
-       {
-               return false;
-       }
+  if ((x >= (int)area.x) && (x<(int)area.x2())
+      && (y >= (int)area.y) && (y < (int)area.y2()))
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
 }
diff --git a/boxx.h b/boxx.h
index 6041513562324d57c144b45bb78506701274827c..3c88049a78d24218d619a98dc37a2f3ccbcc8968 100644 (file)
--- a/boxx.h
+++ b/boxx.h
@@ -140,7 +140,11 @@ class Boxx
   protected:
     //get the surface this box is drawing to
     Surface *getSurface();
-    Boxx* parent;
+
+    // I want a parent box or a surface.
+    Boxx* parent{};
+    Surface* surface{};
+
     Region area;
     std::vector<Boxx*> children;
     VideoDisplay vdisplay;
@@ -150,14 +154,13 @@ class Boxx
     void removeVisibleChilds(Region & r);
 
     static const int paraMargin = 10;
-    UINT paraVSpace;
+    UINT paraVSpace{6}; // default gap for drawPara
 
     DrawStyle backgroundColour;
-    bool backgroundColourSet;
-    bool visible;
+    bool backgroundColourSet{};
+    bool visible{true};
 
     static char numBoxxes;
-    Surface* surface;
 };
 
 #endif
index 075458154a54a93f19425d0a04addf4ef02730cc..8cd2f909a5b9164178020393fef5a35c6445f11d 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 "channel.h"
 
 Channel::Channel()
 {
-  number = 0;
-  type = 0;
-  name = NULL;
-
-  index = -1;
-  vpid = 0;
-  tpid = 0;
-  numAPids = 0;
-  numDPids = 0;
-  numSPids = 0;
-
-  vstreamtype=2; //Mpeg2
-
 }
 
 Channel::~Channel()
 {
   if (name) delete[] name;
   index = -1; // just in case
-
 }
 
 void Channel::loadPids()
index c6587fd172960ccd46e8e1609153454fdf4ec6e9..d6d33264e24bb169c6ee5b3176232516dce1696b 100644 (file)
--- a/channel.h
+++ b/channel.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 CHANNEL_H
@@ -47,21 +46,21 @@ class Channel
 
     void loadPids();
 
-    ULONG number;
-    ULONG type;
-       UCHAR vstreamtype;
-    char* name;
+    int index{-1};
+    ULONG number{};
+    ULONG type{};
+    UCHAR vstreamtype{2}; //Mpeg2
+    char* name{};
 
-    int index;
 
-    ULONG vpid;
-    ULONG numAPids;
+    ULONG vpid{};
+    ULONG numAPids{};
     APidList apids;
-    ULONG numDPids;
+    ULONG numDPids{};
     APidList dpids;
-    ULONG numSPids;
+    ULONG numSPids{};
     APidList spids;
-    ULONG tpid;
+    ULONG tpid{};
 };
 
 #endif
index 34b95c1d0d5455345234ca8b4481aebf8ec31988..7252599cc99f59cf4952a0c218567360efded294 100644 (file)
@@ -302,7 +302,6 @@ void Command::postMessage(Message* m)
   // remote->getButtonPress to break
   // locking the mutex ensures that the master thread is waiting on getButtonPress
 
-
 #ifndef WIN32
   pthread_mutex_lock(&masterLock);
 #else
@@ -457,7 +456,7 @@ void Command::processMessage(Message* m)
       }
       case Message::UDP_BUTTON:
       {
-        handleCommand(m->parameter.num);
+        handleCommand(m->parameter);
         break;
       }
       case Message::CHANGE_LANGUAGE:
@@ -492,14 +491,14 @@ void Command::processMessage(Message* m)
       {
         //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);
+        if (osdv) osdv->informPicture(m->tag, reinterpret_cast<ImageIndex>(m->data));
         break;
       }
       case Message::NEW_PICTURE_STATIC:
       {
-        //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter.num);
+        //Log::getInstance()->log("Command", Log::DEBUG, "TVMedia NEW_PICTURE %x %x",m->tag,m->parameter);
         OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
-        if (osdv) osdv->informPicture(((unsigned long long)m->tag)<<32LL,m->parameter.handle);
+        if (osdv) osdv->informPicture(static_cast<unsigned long long>(m->tag) << 32LL, reinterpret_cast<ImageIndex>(m->data));
         break;
       }
     }
index 49bf40daff1cdf48d9a8c0b85dccfbf89c79c286..0d5dafb1a2685e0d67b9c5e8a67c428647041ec8 100644 (file)
--- a/command.h
+++ b/command.h
@@ -49,10 +49,11 @@ class Log;
 class VInfo;
 class WJpeg;
 
-struct ASLPref {
-       std::string langcode;
-       int audiopref;
-       int subtitlepref;
+struct ASLPref
+{
+  std::string langcode;
+  int audiopref;
+  int subtitlepref;
 };
 
 typedef std::vector<struct ASLPref> ASLPrefList;
@@ -78,9 +79,9 @@ class Command : public MessageQueue
     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;};
+    void setSubDefault(int subon) { subdefault = subon; };
+    int getSubDefault() { return subdefault; };
+    ASLPrefList &getASLList() { return langcodes; };
 
   private:
     void stop();
@@ -103,15 +104,16 @@ class Command : public MessageQueue
     HANDLE masterLock;
     HANDLE mainPid; //Window
 #endif
+
+    Log* logger;
+    BoxStack* boxstack;
+    Remote* remote;
+
     bool initted{};
     bool irun{};
     bool isStandby{};
     bool firstBoot{true};
     int signals{};
-
-    Log* logger;
-    BoxStack* boxstack;
-    Remote* remote;
     Boxx* wallpaper{};
     WJpeg* wallpaper_pict{};
     VInfo* connLost{};
index 16f14d41ab7b82ed1ee74b6862599031d29ca522..a7b158ee474badaaea4bc6465acfa5b2c7c60c06 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -107,31 +107,31 @@ int getClockRealTime(struct timespec *tp);
 
 // add here defines for plattform specific objects
 #ifdef VOMP_PLATFORM_RASPBERRY
-   #define Remote_TYPE RemoteLinux  // Generic Remote under Linux (Konsole!, not X) will support in the end:
-   #define RemoteStartDev ""//No devices passed
+  #define Remote_TYPE RemoteLinux  // Generic Remote under Linux (Konsole!, not X) will support in the end:
+  #define RemoteStartDev ""//No devices passed
 
   // Keyboard
   // remotes under /dev/event
   // HDMI CEC
   //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 Audio_TYPE AudioOMX   // This is Audio based on OpenMax and libav for decoding
-   #define Video_TYPE VideoOMX   // This is Video based on OpenMax
-
-
-
-   #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il
-   #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"
-   #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"
-   #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"
-   #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"
-   #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"
-   #define VPE_OMX_CLOCK "OMX.broadcom.clock"
-   #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"
-   #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"
-   #define VPE_OMX_IMAGE_DECODER "OMX.broadcom.image_decode"
-   #define VPE_OMX_EGL_REND "OMX.broadcom.egl_render"
+  #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 Audio_TYPE AudioOMX   // This is Audio based on OpenMax and libav for decoding
+  #define Video_TYPE VideoOMX   // This is Video based on OpenMax
+
+
+
+  #define VPE_OMX_SUPPORT // Activate support for hardware codec using openmax il
+  #define VPE_OMX_H264_DECODER "OMX.broadcom.video_decode"
+  #define VPE_OMX_MPEG2_DECODER "OMX.broadcom.video_decode"
+  #define VPE_OMX_VIDEO_SCHED "OMX.broadcom.video_scheduler"
+  #define VPE_OMX_VIDEO_REND "OMX.broadcom.video_render"
+  #define VPE_OMX_VIDEO_DEINTERLACE "OMX.broadcom.image_fx"
+  #define VPE_OMX_CLOCK "OMX.broadcom.clock"
+  #define VPE_OMX_AUDIO_DECODER "OMX.broadcom.audio_decode"
+  #define VPE_OMX_AUDIO_REND "OMX.broadcom.audio_render"
+  #define VPE_OMX_IMAGE_DECODER "OMX.broadcom.image_decode"
+  #define VPE_OMX_EGL_REND "OMX.broadcom.egl_render"
 
    //#define  VPE_LIBAV_SUPPORT
   // #define  VPE_LIBAV_MPEG2_TRANSCODING
index 3c7eec3cf636443f9535af792975cbd99b79bce6..9540b3ef5c15d3799c9b562fe3cd4da3a9fb09af 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2020 Chris Tallon
 
     This file is part of VOMP.
 
     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 "directory.h"
 
 Directory::Directory(const char* newName)
 {
-  index = -1;
-
   name = new char[strlen(newName) + 1];
   strcpy(name, newName);
-
-  parent = NULL;
 }
 
 Directory::~Directory()
 {
   if (name) delete[] name;
   name = NULL;
-  index = -1; // just in case
+  index = -1; // just in case // FIXME remove this
   UINT i;
 
   for (i = 0; i < dirList.size(); i++)
index b08018dc4f7bbbdb7db472ae3814ba56adc8318b..d4e62e1863a88de29fbc8ba721f3c1fe65d75336 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 DIRECTORY_H
@@ -46,9 +45,9 @@ class Directory
 
     char* name;
 
-    int index;
+    int index{-1};
 
-    Directory* parent;
+    Directory* parent{};
     DirectoryList dirList;
     RecordingList recList;
 
index 3ad854ea6f4d34020a5f8195d5d7c2b707b6cf12..ec793b54e0317714a51c60eda2f2e8bb8c8e1bf3 100644 (file)
--- a/dsock.cc
+++ b/dsock.cc
@@ -131,14 +131,14 @@ unsigned char DatagramSocket::waitforMessage(unsigned char how)
   */
 }
 
-int DatagramSocket::getDataLength(void) const
+UINT DatagramSocket::getDataLength(void) const
 {
-  return mlength;
+  return static_cast<UINT>(mlength);
 }
 
-char *DatagramSocket::getData(void)             {  return buf;  }
-char *DatagramSocket::getFromIPA(void)          {  return fromIPA;  }
-short DatagramSocket::getFromPort(void) const   {  return fromPort; }
+const void* DatagramSocket::getData() const     {  return buf;  }
+const char* DatagramSocket::getFromIPA() const  {  return fromIPA;  }
+short DatagramSocket::getFromPort() const       {  return fromPort; }
 
 void DatagramSocket::send(const char *ipa, short port, char *message, int length)
 {
diff --git a/dsock.h b/dsock.h
index 6723260fc6c7f147622fbf853e70697b7df608a8..14938891a4a3d798335ae0f9b470ac0b00d4bf32 100644 (file)
--- a/dsock.h
+++ b/dsock.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 DSOCK_H
@@ -52,12 +51,12 @@ class DatagramSocket
     int init();
     void shutdown();
     unsigned char waitforMessage(unsigned char); // int =0-block =1-new wait =2-continue wait
-    int getDataLength(void) const;
-    char *getData(void);               // returns a pointer to the data
-    char *getFromIPA(void);            // returns a pointer to from IP address
-    short getFromPort(void) const;
-    void send(const char *, short, char *, int); // send wants: IP Address ddn style, port,
-                                           // data, length of data
+    UINT getDataLength() const;
+    const void* getData() const;         // returns a pointer to the data
+    const char* getFromIPA() const;      // returns a pointer to from IP address
+    short getFromPort() const;
+    void send(const char *, short, char *, int); // send wants: IP Address ddn style, port, data, length of data
+
   private:
     bool initted;
     ULONG getIPNumber(ULONG num);
index 94c65f155cba43a55c4aaf418f0d9c7d12ed1e6a..95f359a056528e15b3aad22f632439376897f2b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2020 Chris Tallon
 
     This file is part of VOMP.
 
     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 "message.h"
 
 Message::Message()
 {
-  from = NULL;
-  to = NULL;
-  message = 0;
-  parameter.num = 0;
-  parameter.handle = 0;
-  tag = 0;
 }
index ed903e5906410dc01dd663b345b55c1a37725003..d3d3b176c5e6e4737633cc4f00e4f9ec338e4dcc 100644 (file)
--- a/message.h
+++ b/message.h
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2019 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 MESSAGE_H
@@ -23,7 +22,7 @@
 
 #include <stdio.h>
 
-class Message;
+//class Message;
 #include "defines.h"
 
 // Usage of messages is more dubious now that the single master mutex lock
@@ -39,14 +38,12 @@ class Message
   public:
     Message();
 
-    void* from;
-    void* to;
-    ULONG message;
-       union {
-               ULONG num;
-               VectorHandle handle;
-       } parameter;
-    ULONG tag;     // use this for identifying which object / question is being replied to
+    void* from{};
+    void* to{};
+    ULONG message{};
+    ULONG parameter{};
+    ULONG tag{};     // use this for identifying which object / question is being replied to
+    void* data{};    // Use this for anything. Int, pointer, pointer to memory to be freed by the recipient, etc.
 
     const static ULONG QUESTION_YES = 1;
     const static ULONG CLOSE_ME = 2;
@@ -61,7 +58,6 @@ class Message
     const static ULONG ADD_VIEW = 12;
     const static ULONG REDRAW_LANG = 14;
     const static ULONG EPG = 16;
-    //const static ULONG EPG_CLOSE = 17; // Not needed anymore
     const static ULONG CHANGED_OPTIONS = 18;
     const static ULONG CONNECTION_LOST = 19;
     const static ULONG MOVE_RECORDING = 20;
@@ -86,3 +82,7 @@ class Message
 };
 
 #endif
+
+// FIXME idea - instead of always having to specify a real pointer in the "to" variable (meaning clients may have to
+// run Command::getInstance() for e.g.), how about having some constant values for well known targets. Then
+// clients may not need the #include "command.h"
index e511ebf7ff2723c6dcb2b3a63a4bf7af9c38cabf..c1682a200e03e547bc753c27a7c926e35ce23e10 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/>.
 */
 
 
@@ -1230,7 +1229,7 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                // We have a pictures! send a message to ourself, to switch to gui thread
                m->from=this;
                m->to=Command::getInstance();
-               m->parameter.handle = handle;
+               m->data = reinterpret_cast<void*>(handle);
                if (!static_image) {
                        m->message=Message::NEW_PICTURE;
                        m->tag = info->lindex;
@@ -1238,7 +1237,7 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                        m->message=Message::NEW_PICTURE_STATIC;
                        m->tag = info->lindex>> 32LL;
                }
-               Command::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
+               MessageQueue::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
 
                delete info;
 
@@ -1269,7 +1268,7 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                Message* m = new  Message();
                m->from=this;
                m->to=Command::getInstance();
-               m->parameter.handle = info->handle;
+               m->data = reinterpret_cast<void*>(info->handle);
                if (!static_image) {
                        m->message=Message::NEW_PICTURE;
                        m->tag = info->lindex;
@@ -1277,7 +1276,7 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                        m->message=Message::NEW_PICTURE_STATIC;
                        m->tag = info->lindex>> 32LL;
                }
-               Command::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
+               MessageQueue::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
 
                delete info;
        } break;
index 75ae7ddabf76e5b130cb5424f0c54b15a627ace9..cc3bb099fbcfa4f765a8474a0f3708f90cb2f7df 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/>.
 */
 
 
@@ -25,7 +24,7 @@
 
 
 #include "message.h"
-#include "command.h"
+#include "messagequeue.h"
 
 #include "teletxt/txtfont.h"
 
@@ -1241,7 +1240,7 @@ void  OsdWinVector::createPicture(struct PictureInfo& pict_inf)
                // We have a pictures! send a message to ourself, to switch to gui thread
                m->from = this;
                m->to = Command::getInstance();
-               m->parameter.handle = pict_inf.reference;
+               m->data = pict_inf.reference;
                if (!static_image) {
                        m->message = Message::NEW_PICTURE;
                        m->tag = pict_inf.lindex;
@@ -1250,7 +1249,7 @@ void  OsdWinVector::createPicture(struct PictureInfo& pict_inf)
                        m->message = Message::NEW_PICTURE_STATIC;
                        m->tag = pict_inf.lindex >> 32LL;
                }
-               Command::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
+               MessageQueue::getInstance()->postMessageFromOuterSpace(m); // inform command about new picture
 
        } else {
                pict_inf.decoder->freeReference(pict_inf.reference);
index f0fc4eb2d33ba75fe8ff3267372370e4fbcb204f..e8a1323f2f1067847093ff9f0ff831a3bd48eb3f 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -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 "player.h"
@@ -46,21 +45,7 @@ Player::Player(MessageQueue* tmessageQueue, void* tmessageReceiver, OSDReceiver*
   video = Video::getInstance();
   logger = Log::getInstance();
   vdr = VDR::getInstance();
-  initted = false;
-  lengthBytes = 0;
-  lengthFrames = 0;
-  currentFrameNumber = 0;
-  state = S_STOP;
-  ifactor = 4;
-  is_pesrecording=true;
-
-  subtitlesShowing = false;
 
-  videoStartup = false;
-  threadBuffer = NULL;
-  blockSize = 100000;
-  startupBlockSize = 250000;
   video->turnVideoOn();
 }
 
@@ -69,7 +54,7 @@ Player::~Player()
   if (initted) shutdown();
 }
 
-int Player::init(bool p_isPesRecording,double framespersecond)
+int Player::init(bool p_isPesRecording, double framespersecond)
 {
   if (initted) return 0;
 #ifndef WIN32
@@ -78,7 +63,7 @@ int Player::init(bool p_isPesRecording,double framespersecond)
   mutex=CreateMutex(NULL,FALSE,NULL);
 #endif
   is_pesrecording = p_isPesRecording;
-  fps=framespersecond;
+  fps = framespersecond;
   if (is_pesrecording)
     demuxer = new DemuxerVDR();
   else
@@ -90,14 +75,15 @@ int Player::init(bool p_isPesRecording,double framespersecond)
   teletext = new TeletextDecoderVBIEBU();
   if (!teletext) return 0;
   teletext->setRecordigMode(true);
-  unsigned int demux_video_size=2097152;
-  unsigned int demux_audio_size=524288;
-  if (video->supportsh264()) {
-         demux_video_size*=5*2;//5;
-
+  unsigned int demux_video_size = 2097152;
+  unsigned int demux_audio_size = 524288;
+  if (video->supportsh264())
+  {
+    demux_video_size *= 5 * 2;
   }
-  if (audio->maysupportAc3()) {
-         //demux_audio_size*=2;
+  if (audio->maysupportAc3())
+  {
+    //demux_audio_size*=2;
   }
  
   if (!demuxer->init(this, audio, video,teletext, demux_video_size,demux_audio_size,65536, framespersecond, subtitles))
@@ -115,11 +101,10 @@ int Player::init(bool p_isPesRecording,double framespersecond)
   video->blank();
   audio->stop();
 
-  if (Command::getInstance()->getSubDefault()) {
-         turnSubtitlesOn(true);
-  } else {
-         turnSubtitlesOn(false);
-  }
+  if (Command::getInstance()->getSubDefault())
+    turnSubtitlesOn(true);
+  else
+    turnSubtitlesOn(false);
 
   initted = true;
   return 1;
@@ -147,20 +132,19 @@ int Player::shutdown()
 
 void Player::setStartFrame(ULONG startFrame)
 {
-       ULONG nextiframeNumber;
-       ULONG iframeLength;
-       ULONG iframeNumber;
-       ULLONG filePos;
-
-       // newFrame could be anywhere, go forwards to next I-Frame
-       if (!vdr->getNextIFrame(startFrame, 1, &filePos, &nextiframeNumber, &iframeLength)) return;
+  ULONG nextiframeNumber;
+  ULONG iframeLength;
+  ULONG iframeNumber;
+  ULLONG filePos;
 
-       // Now step back a GOP. This ensures we go to the greatest I-Frame equal to or less than the requested frame
-       vdr->getNextIFrame(nextiframeNumber, 0, &filePos, &iframeNumber, &iframeLength);
+  // newFrame could be anywhere, go forwards to next I-Frame
+  if (!vdr->getNextIFrame(startFrame, 1, &filePos, &nextiframeNumber, &iframeLength)) return;
 
-         logger->log("Player", Log::DEBUG, "setStartFrame %lu %lu %lu", startFrame, nextiframeNumber,iframeNumber);
-       currentFrameNumber = iframeNumber;
+  // Now step back a GOP. This ensures we go to the greatest I-Frame equal to or less than the requested frame
+  vdr->getNextIFrame(nextiframeNumber, 0, &filePos, &iframeNumber, &iframeLength);
 
+  logger->log("Player", Log::DEBUG, "setStartFrame %lu %lu %lu", startFrame, nextiframeNumber,iframeNumber);
+  currentFrameNumber = iframeNumber;
 }
 
 void Player::setLengthBytes(ULLONG length)
@@ -214,45 +198,45 @@ bool* Player::getDemuxerSubtitleChannels()
 
 int Player::getCurrentAudioChannel()
 {
-    if (is_pesrecording) {
-        return demuxer->getselAudioChannel();
-    } else {
-        return ((DemuxerTS*)demuxer)->getAID();
-    }
+  if (is_pesrecording)
+    return demuxer->getselAudioChannel();
+  else
+    return dynamic_cast<DemuxerTS*>(demuxer)->getAID();
 }
 
 int Player::getCurrentSubtitleChannel()
 {
-    if (is_pesrecording) {
-        return demuxer->getselSubtitleChannel();
-    } else {
-        return ((DemuxerTS*)demuxer)->getSubID();
-    }
+  if (is_pesrecording)
+    return demuxer->getselSubtitleChannel();
+  else
+    return dynamic_cast<DemuxerTS*>(demuxer)->getSubID();
 }
 
 void Player::setSubtitleChannel(int newChannel)
 {
-    if (is_pesrecording) {
-         demuxer->setDVBSubtitleStream(newChannel);
-    } else {
-        ((DemuxerTS*)demuxer)->setSubID(newChannel);
-    }
+  if (is_pesrecording)
+    demuxer->setDVBSubtitleStream(newChannel);
+  else
+    dynamic_cast<DemuxerTS*>(demuxer)->setSubID(newChannel);
 }
 
 int *Player::getTeletxtSubtitlePages()
 {
-    return teletext->getSubtitlePages();
+  return teletext->getSubtitlePages();
 }
 
 void Player::setAudioChannel(int newChannel, int type, int streamtype)
 {
-    if (is_pesrecording) {
-        demuxer->setAudioStream(newChannel);
-        return;
-    } else {
-        ((DemuxerTS*)demuxer)->setAID(newChannel,type,streamtype,false);
-        return;
-    }
+  if (is_pesrecording)
+  {
+    demuxer->setAudioStream(newChannel);
+    return;
+  }
+  else
+  {
+    dynamic_cast<DemuxerTS*>(demuxer)->setAID(newChannel,type,streamtype,false);
+    return;
+  }
 }
 
 bool Player::toggleSubtitles()
@@ -270,7 +254,8 @@ bool Player::toggleSubtitles()
   return subtitlesShowing;
 }
 
-void  Player::turnSubtitlesOn(bool ison) {
+void  Player::turnSubtitlesOn(bool ison)
+{
  if (ison)
   {
     subtitlesShowing = true;
@@ -281,18 +266,20 @@ void  Player::turnSubtitlesOn(bool ison) {
     subtitlesShowing = false;
     subtitles->hide();
   }
-
 }
 
-void Player::tellSubtitlesOSDVisible(bool visible){
-subtitles->setOSDMenuVisibility(visible);
+void Player::tellSubtitlesOSDVisible(bool visible)
+{
+  subtitles->setOSDMenuVisibility(visible);
 }
 
-Channel * Player::getDemuxerChannel() {
-    if (!is_pesrecording) {
-        return ((DemuxerTS*) demuxer)->getChannelInfo();
-    } 
-    return NULL; //Should not happen!
+Channel * Player::getDemuxerChannel()
+{
+  if (!is_pesrecording)
+  {
+    return dynamic_cast<DemuxerTS*>(demuxer)->getChannelInfo();
+  }
+  return NULL; //Should not happen!
 }
 
 
@@ -316,20 +303,19 @@ void Player::playpause()
   lock();
 
   bool doUnlock = false;
-  if (state==S_PLAY) {
-         doUnlock=true;
-         switchState(S_PAUSE_P);
-  } else {
-         if (state == S_PAUSE_P) doUnlock = true;
-         switchState(S_PLAY);
+  if (state==S_PLAY)
+  {
+    doUnlock=true;
+    switchState(S_PAUSE_P);
+  }
+  else
+  {
+    if (state == S_PAUSE_P) doUnlock = true;
+    switchState(S_PLAY);
   }
   if (doUnlock) unLock();
-
 }
 
-
-
-
 void Player::stop()
 {
   if (!initted) return;
@@ -413,7 +399,7 @@ void Player::jumpToPercent(double percent)
 {
   lock();
   logger->log("Player", Log::DEBUG, "JUMP TO %f%%", percent);
-  ULONG newFrame = (ULONG)(percent * lengthFrames / 100);
+  ULONG newFrame = static_cast<ULONG>(percent * lengthFrames / 100);
   switchState(S_JUMP, newFrame);
 //  unLock(); - let thread unlock this
 }
@@ -440,7 +426,7 @@ void Player::skipForward(int seconds)
   logger->log("Player", Log::DEBUG, "SKIP FORWARD %i SECONDS", seconds);
   ULONG newFrame = getCurrentFrameNum();
   if (newFrame == 0) { unLock(); return; } // Current pos from demuxer is not valid
-  newFrame +=(ULONG) (((double)seconds) * fps);
+  newFrame += static_cast<ULONG>(static_cast<double>(seconds) * fps);
   if (newFrame > lengthFrames) { switchState(S_PLAY); unLock(); }
   else switchState(S_JUMP, newFrame);
 //  unLock(); - let thread unlock this
@@ -452,7 +438,7 @@ void Player::skipBackward(int seconds)
   logger->log("Player", Log::DEBUG, "SKIP BACKWARD %i SECONDS", seconds);
   long newFrame = getCurrentFrameNum();
   if (newFrame == 0) { unLock(); return; } // Current pos from demuxer is not valid
-  newFrame -= (ULONG) (((double)seconds) * fps);
+  newFrame -= static_cast<ULONG>(static_cast<double>(seconds) * fps);
   if (newFrame < 0) newFrame = 0;
   switchState(S_JUMP, newFrame);
 //  unLock(); - let thread unlock this
@@ -988,7 +974,7 @@ void Player::doConnectionLost()
   m->to = messageReceiver;
   m->from = this;
   m->message = Message::PLAYER_EVENT;
-  m->parameter.num = Player::CONNECTION_LOST;
+  m->parameter = Player::CONNECTION_LOST;
   messageQueue->postMessage(m);
 }
 
@@ -1017,7 +1003,7 @@ void Player::call(void* caller)
       m->from = this;
       m->to = messageReceiver;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = Player::ASPECT43;
+      m->parameter = Player::ASPECT43;
       messageQueue->postMessageFromOuterSpace(m);
     }
     else if (dxCurrentAspect == Demuxer::ASPECT_16_9)
@@ -1029,7 +1015,7 @@ void Player::call(void* caller)
       m->from = this;
       m->to = messageReceiver;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = Player::ASPECT169;
+      m->parameter = Player::ASPECT169;
       messageQueue->postMessageFromOuterSpace(m);
     }
     else
@@ -1075,7 +1061,7 @@ void Player::threadMethod()
       m->to = messageReceiver;
       m->from = this;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = STOP_PLAYBACK;
+      m->parameter = STOP_PLAYBACK;
       logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue);
       messageQueue->postMessage(m);
       logger->log("Player", Log::DEBUG, "Message posted...");
@@ -1212,7 +1198,7 @@ void Player::threadFeedPlay()
   m->to = messageReceiver;
   m->from = this;
   m->message = Message::PLAYER_EVENT;
-  m->parameter.num = Player::STOP_PLAYBACK;
+  m->parameter = Player::STOP_PLAYBACK;
   logger->log("Player", Log::DEBUG, "Posting message to %p...", messageQueue);
   messageQueue->postMessage(m);
 }
index a798750ad9b07c935268621ffc00a102abc44291..3ac56ccc9b09057e656dfad4ea8deee99bc1bfc4 100644 (file)
--- a/player.h
+++ b/player.h
@@ -134,7 +134,7 @@ class Player : public Thread_TYPE, public Callback
     void restartAtFrame(ULONG newFrame);
     void restartAtFramePI(ULONG newFrame);
 
-    bool subtitlesShowing;
+    bool subtitlesShowing{};
     MessageQueue* messageQueue;
     void* messageReceiver;
     OSDReceiver* osdReceiver;
@@ -151,11 +151,11 @@ class Player : public Thread_TYPE, public Callback
   
     
 
-    bool initted;
+    bool initted{};
     bool startup;
-    bool videoStartup;
+    bool videoStartup{};
 
-    bool is_pesrecording;
+    bool is_pesrecording{true};
        double fps;
 
 #ifndef WIN32
@@ -166,14 +166,14 @@ class Player : public Thread_TYPE, public Callback
     void lock();
     void unLock();
 
-    ULLONG lengthBytes;
-    ULONG lengthFrames;
-    ULONG currentFrameNumber;
-    UINT blockSize;
-    UINT startupBlockSize;
-    UCHAR* threadBuffer;
-    UCHAR state;
-    UCHAR ifactor;
+    ULLONG lengthBytes{};
+    ULONG lengthFrames{};
+    ULONG currentFrameNumber{};
+    UINT blockSize{100000};
+    UINT startupBlockSize{250000};
+    UCHAR* threadBuffer{};
+    UCHAR state{S_STOP};
+    UCHAR ifactor{4};
 };
 
 #endif
index 233c55ce7f7b451b42ebdac056251f12cd0c6635..077d27c24a63eff4414e8d06d7d652aea1878f05 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 "playerliveradio.h"
@@ -175,7 +174,7 @@ void PlayerLiveRadio::streamReceive(ULONG flag, void* data, ULONG len)
     m->from = this;
     m->to = messageReceiver;
     m->message = Message::PLAYER_EVENT;
-    m->parameter.num = PlayerLiveRadio::STREAM_END;
+    m->parameter = PlayerLiveRadio::STREAM_END;
     messageQueue->postMessageFromOuterSpace(m);
   }
   
@@ -348,7 +347,7 @@ bool PlayerLiveRadio::checkError()
     m->from = this;
     m->to = messageReceiver;
     m->message = Message::PLAYER_EVENT;
-    m->parameter.num = PlayerLiveRadio::CONNECTION_LOST;
+    m->parameter = PlayerLiveRadio::CONNECTION_LOST;
     messageQueue->postMessageFromOuterSpace(m);
     
     return true;
@@ -451,7 +450,7 @@ void PlayerLiveRadio::threadMethod()
             m->from = this;
             m->to = messageReceiver;
             m->message = Message::PLAYER_EVENT;
-            m->parameter.num = PlayerLiveRadio::STREAM_END;
+            m->parameter = PlayerLiveRadio::STREAM_END;
             messageQueue->postMessageFromOuterSpace(m);
           }
         }
@@ -483,7 +482,7 @@ void PlayerLiveRadio::threadMethod()
         m->from = this;
         m->to = messageReceiver;
         m->message = Message::PLAYER_EVENT;
-        m->parameter.num = PlayerLiveRadio::PREBUFFERING;
+        m->parameter = PlayerLiveRadio::PREBUFFERING;
         m->tag = percentDone;
         messageQueue->postMessageFromOuterSpace(m);
 
index c5cd47dee1115fa53768a3c3883cab2495b1475e..f0e36f8ad2f74fafba5e1e658db33de2936fb887 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 PLAYERLIVERADIO_H
index 7d0c708199ee3bb4aaea53b9ec7036a0945ed031..7a79996f91a7aae1f5426209dcc5db51327cc82e 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 "playerlivetv.h"
@@ -32,6 +31,7 @@
 #include "channel.h"
 #include "dvbsubtitles.h"
 #include "osdreceiver.h"
+#include "command.h"
 
 // ----------------------------------- Called from outside, one offs or info funcs
 
@@ -250,7 +250,7 @@ void PlayerLiveTV::call(void* caller)
       m->from = this;
       m->to = messageReceiver;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = PlayerLiveTV::ASPECT43;
+      m->parameter = PlayerLiveTV::ASPECT43;
       messageQueue->postMessageFromOuterSpace(m);
     }
     else if (dxCurrentAspect == Demuxer::ASPECT_16_9)
@@ -269,7 +269,7 @@ void PlayerLiveTV::call(void* caller)
       m->from = this;
       m->to = messageReceiver;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = PlayerLiveTV::ASPECT169;
+      m->parameter = PlayerLiveTV::ASPECT169;
       messageQueue->postMessageFromOuterSpace(m);
     }
     else
@@ -308,7 +308,7 @@ void PlayerLiveTV::streamReceive(ULONG flag, void* data, ULONG len)
     m->from = this;
     m->to = messageReceiver;
     m->message = Message::PLAYER_EVENT;
-    m->parameter.num = PlayerLiveTV::STREAM_END;
+    m->parameter = PlayerLiveTV::STREAM_END;
     messageQueue->postMessageFromOuterSpace(m);
   }
         
@@ -652,7 +652,7 @@ bool PlayerLiveTV::checkError()
     m->from = this;
     m->to = messageReceiver;
     m->message = Message::PLAYER_EVENT;
-    m->parameter.num = PlayerLiveTV::CONNECTION_LOST;
+    m->parameter = PlayerLiveTV::CONNECTION_LOST;
     messageQueue->postMessageFromOuterSpace(m);
     
     return true;
@@ -812,7 +812,7 @@ void PlayerLiveTV::threadMethod()
                        m->from = this;
                        m->to = messageReceiver;
                        m->message = Message::PLAYER_EVENT;
-                       m->parameter.num = PlayerLiveTV::STREAM_END;
+                       m->parameter = PlayerLiveTV::STREAM_END;
                        messageQueue->postMessageFromOuterSpace(m);
                }
         }
@@ -849,7 +849,7 @@ void PlayerLiveTV::threadMethod()
         m->from = this;
         m->to = messageReceiver;
         m->message = Message::PLAYER_EVENT;
-        m->parameter.num = PlayerLiveTV::PREBUFFERING;
+        m->parameter = PlayerLiveTV::PREBUFFERING;
         m->tag = percentDone;
         messageQueue->postMessageFromOuterSpace(m);
 
index cff36b56d11f90b5e49761c7937d38ffcb3e22e9..98e4e34a7967e636338b7210d0a903b532eedfcd 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 PLAYERLIVETV_H
index 3919ba84ab0d67a8e7996f4b59801444aff50a44..a3a308a25258f314f6b9279f8b9eff1f462e5f9b 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 "playermedia.h"
@@ -23,7 +22,7 @@
 #include "demuxermedia.h"
 #include "timers.h"
 #include "video.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "i18n.h"
 #include "boxx.h"
 #include "log.h"
@@ -332,8 +331,8 @@ void PlayerMedia::sendFrontendMessage(ULONG para)
        threadUnlock();
   m->from = this;
   m->message = Message::PLAYER_EVENT;
-  m->parameter.num = para;
-       Command::getInstance()->postMessageFromOuterSpace(m);
+  m->parameter = para;
+       MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 //method called by the playing thread to handle 
@@ -669,8 +668,8 @@ void PlayerMedia::call(void* caller)
       m->from = this;
       m->to = frontend;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = PlayerMedia::ASPECT43;
-      Command::getInstance()->postMessageFromOuterSpace(m);
+      m->parameter = PlayerMedia::ASPECT43;
+      MessageQueue::getInstance()->postMessageFromOuterSpace(m);
     }
     else if (dxCurrentAspect == Demuxer::ASPECT_16_9)
     {
@@ -681,8 +680,8 @@ void PlayerMedia::call(void* caller)
       m->from = this;
       m->to = frontend;
       m->message = Message::PLAYER_EVENT;
-      m->parameter.num = PlayerMedia::ASPECT169;
-      Command::getInstance()->postMessageFromOuterSpace(m);
+      m->parameter = PlayerMedia::ASPECT169;
+      MessageQueue::getInstance()->postMessageFromOuterSpace(m);
     }
     else
     {
index cb7e8d74ee457a70f4579d4da856462dcb5f5829..b5f84176576a2db055a5d6ae206244be4f24f3ac 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 "playerradio.h"
@@ -457,7 +456,7 @@ void PlayerRadio::doConnectionLost()
   m->to = messageReceiver;
   m->from = this;
   m->message = Message::PLAYER_EVENT;
-  m->parameter.num = PlayerRadio::CONNECTION_LOST;
+  m->parameter = PlayerRadio::CONNECTION_LOST;
   messageQueue->postMessage(m);
 }
 
@@ -578,7 +577,7 @@ void PlayerRadio::threadFeedPlay()
   m->to = messageReceiver;
   m->from = this;
   m->message = Message::PLAYER_EVENT;
-  m->parameter.num = PlayerRadio::STOP_PLAYBACK;
+  m->parameter = PlayerRadio::STOP_PLAYBACK;
   logger->log("PlayerRadio", Log::DEBUG, "Posting message to %p...", messageQueue);
   messageQueue->postMessage(m);
 }
index 2bc05a4ec56cc8fae109912496230a06af937b98..7b8f1d203f1101ca2b237e3dc7e1fa17f67e8aeb 100644 (file)
--- a/recman.cc
+++ b/recman.cc
@@ -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 "recman.h"
 
 RecMan::RecMan()
 {
-  totalSpace = 0;
-  freeSpace = 0;
-  usedPercent = 0;
-
   rootDir = new Directory("/");
   currentDir = rootDir;
-
-  chronoSortOrder = false;
 }
 
 RecMan::~RecMan()
index 537075b78fb42f909ba5434ce385e25199b3d740..a8e657c7799ddb6448bb53ab18ca25651fa4673a 100644 (file)
--- a/recman.h
+++ b/recman.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 RECMAN_H
@@ -65,16 +64,16 @@ class RecMan
     ULONG getUsedPercent();
 
   private:
-    ULONG totalSpace;
-    ULONG freeSpace;
-    ULONG usedPercent;
+    ULONG totalSpace{};
+    ULONG freeSpace{};
+    ULONG usedPercent{};
 
     Directory* rootDir;
     Directory* currentDir;
 
-    bool chronoSortOrder;
+    bool chronoSortOrder{};
 
-    void constructPath(char* target, Directory* dir) ;
+    void constructPath(char* target, Directory* dir);
 };
 
 #endif
index c1bcff9187e3cb33d3c9056df83f59caebeab8ad..908f4ee633d799de40b3307f1a55248fa74700d1 100644 (file)
@@ -38,16 +38,6 @@ Recording::Recording()
 {
   logger = Log::getInstance();
   vdr = VDR::getInstance();
-
-  isNew = false;
-  start = 0;
-  progName = NULL;
-  fileName = NULL;
-  index = -1;
-  markList = NULL;
-  movieID = 0;
-  seriesID = 0;
-  episodeID = 0;
 }
 
 Recording::~Recording()
index 50ff7f2cf8052655cbf93c60721d951bf566db51..020ec74295943c316ce4c4e76af44dc78cd88a62 100644 (file)
@@ -43,7 +43,7 @@ class Recording
     char* getProgName() const;
     char* getFileName() const;
 
-    int index;
+    int index{-1}; // FIXME make private?
 
     void loadRecInfo();
     void dropRecInfo();
@@ -59,9 +59,9 @@ class Recording
     bool hasMarks();
     MarkList* getMarkList();
 
-    int movieID;
-    int seriesID;
-    int episodeID;
+    int movieID{};
+    int seriesID{};
+    int episodeID{};
 
     static RecInfo* recInfo;
     static MovieInfo* movieInfo;
@@ -71,10 +71,10 @@ class Recording
     Log* logger;
     VDR* vdr;
 
-    bool isNew;
-    ULONG start;
-    char* progName;
-    char* fileName;
+    bool isNew{};
+    ULONG start{};
+    char* progName{};
+    char* fileName{};
 
     // I only want 1 RecInfo loaded at a time
     // if (recInfoFor == this) then recInfo is valid
@@ -82,7 +82,7 @@ class Recording
     static Recording* recInfoFor;
 
 
-    MarkList* markList;
+    MarkList* markList{};
 };
 
 #endif
index b556277244b40e718ef0ef43f8a741c62cc26338..dde0f546c7bf0f05305c889f2419ee48ef7b6f6a 100644 (file)
--- a/region.cc
+++ b/region.cc
@@ -1,13 +1,23 @@
-#include "region.h"
+/*
+    Copyright 2020 Chris Tallon
 
-Region::Region()
-{
-  x = 0;
-  y = 0;
-  w = 0;
-  h = 0;
-  z = 0;
-}
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#include "region.h"
 
 bool Region::overlappedBy(Region& d)
 {
@@ -39,8 +49,6 @@ Region Region::operator + (Region& other)
   
   return toReturn;
 }
-    
-    
 
 Region Region::subtract(Region& other)
 {
index 2b191b17a0f35f340a96ed4018ac094208800eb4..ee667095d66bb301a77c9edb7022878d49e386c2 100644 (file)
--- a/region.h
+++ b/region.h
@@ -1,3 +1,22 @@
+/*
+    Copyright 2020 Chris Tallon
+
+    This file is part of VOMP.
+
+    VOMP is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    VOMP is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
 #ifndef REGION_H
 #define REGION_H
 
@@ -7,7 +26,6 @@
 class Region
 {
   public:
-    Region();
     bool overlappedBy(Region& doesthisOverlap);
     Region subtract(Region& other);
     Region operator + (Region& other);
@@ -19,11 +37,11 @@ class Region
     UINT x2();
     UINT y2();
 
-    UINT x;
-    UINT y;
-    UINT w;
-    UINT h;
-    int z;
+    UINT x{};
+    UINT y{};
+    UINT w{};
+    UINT h{};
+    int z{};
 };
 
 #endif
index d52d3df186d81360b81b84fb1d31848d4f696a5d..4a4a2e281842dfe33055196de4be55abb84a6d95 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/>.
 */
 
 
@@ -38,7 +37,7 @@
 #include "teletextdecodervbiebu.h"
 #include "teletxt/tables.h"
 #include "message.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "video.h"
 
 #ifdef WIN32
@@ -824,15 +823,15 @@ void TeletextDecoderVBIEBU::RenderTeletextCode(bool renderfirstlineonly) {
             m->message = Message::TELETEXTUPDATE;
             m->to = txtview;
             m->from = this;
-            m->parameter.num = 0;
-            Command::getInstance()->postMessageFromOuterSpace(m);
+            m->parameter = 0;
+            MessageQueue::getInstance()->postMessageFromOuterSpace(m);
         } else if (firstlineupdate==10) {
             Message* m= new Message();
             m->message = Message::TELETEXTUPDATEFIRSTLINE;
             m->to = txtview;
             m->from = this;
-            m->parameter.num = 0;
-            Command::getInstance()->postMessageFromOuterSpace(m);
+            m->parameter = 0;
+            MessageQueue::getInstance()->postMessageFromOuterSpace(m);
             firstlineupdate=0;
         } else firstlineupdate++;
         
diff --git a/udp.cc b/udp.cc
index 3486346edd73f34d524c5f3c3e5e98360fe8986d..70b1364fddba9adda08d18d654f416c9cd3f110c 100644 (file)
--- a/udp.cc
+++ b/udp.cc
@@ -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 "udp.h"
@@ -24,6 +23,7 @@
 #include "messagequeue.h"
 #include "message.h"
 #include "log.h"
+#include "command.h"
 
 //void dump(unsigned char* data, USHORT size);
 //unsigned char dcc(UCHAR c);
@@ -50,14 +50,14 @@ int UDP::shutdown()
   return 1;
 }
 
-int UDP::run(MessageQueue* tcommandMessageQueue)
+int UDP::run(MessageQueue* tMessageQueue)
 {
   if (threadIsActive()) return 1;
   log->log("UDP", Log::DEBUG, "Starting UDP command server");
 
   initted = 1;
 
-  commandMessageQueue = tcommandMessageQueue;
+  messageQueue = tMessageQueue;
   ds = new DatagramSocket(2000);
 
   if (!ds->init())
@@ -99,30 +99,30 @@ void UDP::threadMethod()
     }
     else
     {
-      processRequest((UCHAR*)ds->getData(), ds->getDataLength());
+      processRequest(ds->getData(), ds->getDataLength());
     }
     threadCheckExit();
   }
 }
 
-void UDP::processRequest(UCHAR* data, int length)
+void UDP::processRequest(const void* data, UINT length)
 {
   log->log("UDP", Log::DEBUG, "Got request");
 
   char* temp = new char[length + 1];
   memcpy(temp, data, length);
   temp[length] = '\0';
-  int command = atoi(temp);
+  UINT command = static_cast<UINT>(atoi(temp));
   delete[] temp;
 
   log->log("UDP", Log::DEBUG, "Command %i recieved", command);
 
 
   Message *m = new Message();
-  m->to = commandMessageQueue;
+  m->to = Command::getInstance();
   m->message = Message::UDP_BUTTON;
-  m->parameter.num = command;
-  commandMessageQueue->postMessage(m);
+  m->parameter = command;
+  messageQueue->postMessage(m);
 }
 
 /*
diff --git a/udp.h b/udp.h
index 36b30433eabd35de6c949a6454cb091c01f15ec9..a14156e8b02ed23c440b39d46a73370fe3fd61ba 100644 (file)
--- a/udp.h
+++ b/udp.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 UDP_H
@@ -39,18 +38,18 @@ class UDP : public Thread_TYPE
     UDP();
     virtual ~UDP();
 
-    int run(MessageQueue* commandMessageQueue);
+    int run(MessageQueue* messageQueue);
     int shutdown();
 
   private:
     void threadPostStopCleanup() {};
 
     void threadMethod();
-    void processRequest(UCHAR* data, int length);
+    void processRequest(const void* data, UINT length);
 
     int initted;
     DatagramSocket* ds;
-    MessageQueue* commandMessageQueue;
+    MessageQueue* messageQueue;
     Log* log;
 };
 
index 60257206950877d19b1cf7fb95651de17d2fc6ab..746f189debf04e371a3f45c79d382fdbe098e046 100644 (file)
@@ -485,7 +485,7 @@ int VAudioSelector::handleCommand(int command)
             m->from = this;
             m->to = parent;
             m->message = Message::SUBTITLE_CHANGE_CHANNEL;
-            m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
+            m->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
             MessageQueue::getInstance()->postMessageNoLock(m);
         } else {
             asl.up();
@@ -495,7 +495,7 @@ int VAudioSelector::handleCommand(int command)
             m->from = this;
             m->to = parent;
             m->message = Message::AUDIO_CHANGE_CHANNEL;
-            m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
+            m->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
             MessageQueue::getInstance()->postMessageNoLock(m);
         }
 
@@ -512,7 +512,7 @@ int VAudioSelector::handleCommand(int command)
             m->from = this;
             m->to = parent;
             m->message = Message::SUBTITLE_CHANGE_CHANNEL;
-            m->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
+            m->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16
                        |(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
             MessageQueue::getInstance()->postMessageNoLock(m);
         } else {
@@ -523,7 +523,7 @@ int VAudioSelector::handleCommand(int command)
             m->from = this;
             m->to = parent;
             m->message = Message::AUDIO_CHANGE_CHANNEL;
-            m->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
+            m->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16
                        |(((AudioSubtitleChannel*)asl.getCurrentOptionData())->streamtype &0xFF)<<24 ;
             MessageQueue::getInstance()->postMessageNoLock(m);
         }
@@ -568,7 +568,7 @@ void VAudioSelector::processMessage(Message* m)
     
       UINT lastsel=asl.getCurrentOption();
       
-      if (((m->parameter.num>>16)-getScreenX()) < 200 && asl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+      if (((m->parameter>>16)-getScreenX()) < 200 && asl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
       {
           editsubtitles=false;
           ssl.setDarkSelOption(true);
@@ -582,7 +582,7 @@ void VAudioSelector::processMessage(Message* m)
               m2->from = this;
               m2->to = parent;
               m2->message = Message::AUDIO_CHANGE_CHANNEL;
-              m2->parameter.num = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
+              m2->parameter = (((AudioSubtitleChannel*)asl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)asl.getCurrentOptionData())->type &0xFF)<<16 ;
               MessageQueue::getInstance()->postMessageNoLock(m2);
           }
           return;
@@ -590,7 +590,7 @@ void VAudioSelector::processMessage(Message* m)
       }
       lastsel=ssl.getCurrentOption();
       
-      if (ssl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+      if (ssl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
       {
          editsubtitles=true;
          ssl.setDarkSelOption(false);
@@ -604,7 +604,7 @@ void VAudioSelector::processMessage(Message* m)
               m2->from = this;
               m2->to = parent;
               m2->message = Message::SUBTITLE_CHANGE_CHANNEL;
-              m2->parameter.num = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
+              m2->parameter = (((AudioSubtitleChannel*)ssl.getCurrentOptionData())->pestype &0xFFFF)|(((AudioSubtitleChannel*)ssl.getCurrentOptionData())->type &0xFF)<<16 ;
               MessageQueue::getInstance()->postMessageNoLock(m2);
           }
          return;
@@ -612,7 +612,7 @@ void VAudioSelector::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (asl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (asl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       editsubtitles=false;
       ssl.setDarkSelOption(true);
@@ -621,7 +621,7 @@ void VAudioSelector::processMessage(Message* m)
       ssl.draw();
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
-    else if (ssl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    else if (ssl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       editsubtitles=true;
       ssl.setDarkSelOption(false);
@@ -632,8 +632,8 @@ void VAudioSelector::processMessage(Message* m)
     }
     else
     { //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
index d16d7cfda918d8a174d6df160cc12a7209c66839..8d6573db818d80b3385fc46685e5cf6ced7e027c 100644 (file)
@@ -264,7 +264,7 @@ void VChannelList::processMessage(Message* m)
 {
  /* if (m->message == Message::MOUSE_MOVE) {
        if (sl.mouseAndroidScroll((m->tag >> 16),(m->tag & 0xFFFF),
-                       (m->parameter.num >> 16),(m->parameter.num & 0xFFFF))) {
+                       (m->parameter >> 16),(m->parameter & 0xFFFF))) {
                sl.draw();
                doShowingBar();
                boxstack->update(this);
@@ -272,7 +272,7 @@ void VChannelList::processMessage(Message* m)
   }
   else */if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       quickUpdate();
       boxstack->update(this);
@@ -280,14 +280,14 @@ void VChannelList::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
     else
     { //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         boxstack->handleCommand(Remote::BACK); //simulate cancel press
@@ -299,7 +299,7 @@ void VChannelList::processMessage(Message* m)
     Channel* chan = NULL;
     for (UINT i = 0; i < chanList->size(); i++)
     {
-      if ((*chanList)[i]->number == m->parameter.num)
+      if ((*chanList)[i]->number == m->parameter)
       {
         chan = (*chanList)[i];
         break;
index 12128ead2848cc6bd8a17c333bafe40dd54230d2..0bba053aea6b6f970a52b2b1812b8b2e644f2839 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 "vchannelselect.h"
@@ -26,8 +25,8 @@
 #include "colour.h"
 #include "log.h"
 #include "timers.h"
-#include "command.h"
 #include "vdr.h"
+#include "messagequeue.h"
 
 // this class only works as it does because the remote command
 // values for the numbers are the numbers themselves !
@@ -109,17 +108,17 @@ void VChannelSelect::changeChannel(bool which)
     m->from = this;
     m->to = parent;
     m->message = Message::CHANNEL_CHANGE;
-    m->parameter.num = 0;
+    m->parameter = 0;
 
     for(i = numGot - 1; i >= 0; i--)
     {
-      m->parameter.num += input[i] * (ULONG)pow(10., i);
+      m->parameter += input[i] * (ULONG)pow(10., i);
     }
 
     if (which)
-      Command::getInstance()->postMessageNoLock(m);
+      MessageQueue::getInstance()->postMessageNoLock(m);
     else
-      Command::getInstance()->postMessageFromOuterSpace(m);
+      MessageQueue::getInstance()->postMessageFromOuterSpace(m);
   }
 
   // Close me
@@ -128,9 +127,9 @@ void VChannelSelect::changeChannel(bool which)
   m->to = BoxStack::getInstance();
   m->message = Message::CLOSE_ME;
   if (which)
-    Command::getInstance()->postMessageNoLock(m);
+    MessageQueue::getInstance()->postMessageNoLock(m);
   else
-    Command::getInstance()->postMessageFromOuterSpace(m);
+    MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 int VChannelSelect::handleCommand(int command)
index 61db671df7f10862ff292ada4cbf405ffb0e3670..fbd8fbfaf2bc0d4a4da810b22dcab0d6492bec95 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 VCHANNELSELECT_H
index 7112da3499f965beafc4fac133f2c394f3b5be51..178c22aa206feac81357d27fee9d93ea2be23f26 100644 (file)
@@ -227,8 +227,8 @@ void VColourTuner::processMessage(Message* m)
   else if (m->message == Message::MOUSE_LBDOWN)
   {
     //check if press is outside this view! then simulate cancel
-    int x=(m->parameter.num>>16)-getScreenX();
-    int y=(m->parameter.num&0xFFFF)-getScreenY();
+    int x=(m->parameter>>16)-getScreenX();
+    int y=(m->parameter&0xFFFF)-getScreenY();
     if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
       BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
index 4f62274266a0805225baa5ea5764f3ed3825306e..e5c70cc1de84fbd16fb58a7cf2f3d455e12eb8c5 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 "vconnect.h"
 #include "log.h"
 #include "wol.h"
 #include "vserverselect.h"
+#include "messagequeue.h"
 
 VConnect::VConnect(char* tServer)
 {
+  server = tServer;
+
   boxstack = BoxStack::getInstance();
   vdr = VDR::getInstance();
   logger = Log::getInstance();
@@ -48,8 +50,6 @@ VConnect::VConnect(char* tServer)
   }
 
   exitable = 0;
-  irun = 0;
-  server = tServer;
 }
 
 VConnect::~VConnect()
@@ -197,14 +197,14 @@ void VConnect::threadMethod()
   m->from = this;
   m->to = Command::getInstance();
   m->message = Message::VDR_CONNECTED;
-  Command::getInstance()->postMessage(m);
+  MessageQueue::getInstance()->postMessage(m);
 }
 
 void VConnect::processMessage(Message* m)
 {
   if (m->message == Message::SERVER_SELECTED)
   {
-    selectedServer = m->parameter.num;
+    selectedServer = m->parameter;
     threadSignal();
   }
 }
index 0e0df7b2a2472ab0732cd9da587a003a6b6047e3..8773a5acd23d6b425609ac431c65edc46c95ee7d 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 VCONNECT_H
@@ -56,7 +55,7 @@ class VConnect : public VInfo, public Thread_TYPE
     void clearServerIPs();
 
     BoxStack* boxstack;
-    UCHAR irun;
+    UCHAR irun{};
     VDR* vdr;
     Log* logger;
     std::vector<VDRServer> servers;
diff --git a/vdr.cc b/vdr.cc
index dbe6e0261e5b8563cdd68ed0ef46127dce0dc102..6e1b6ac92cf26d9028d1a8d86125d796e62dd124 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -119,13 +119,7 @@ VDR::VDR()
 {
   if (instance) return;
   instance = this;
-  initted = 0;
-  findingServer = 0;
-  tcp = NULL;
-  connected = false;
-  maxChannelNumber = 0;
-  channelNumberWidth = 1;
-  doVDRShutdown = false;
+
   TEMP_SINGLE_VDR_PR = NULL;
 #ifdef VOMP_MEDIAPLAYER
   providerId=MPROVIDERID_VDR;
@@ -204,7 +198,7 @@ void VDR::findServers(std::vector<VDRServer>& servers)
     {
       waitType = 2;
       
-      char* vdpreply = ds.getData();
+      const char* vdpreply = static_cast<const char*>(ds.getData());
       if ((ds.getDataLength() >= 24) && !strncmp(vdpreply, "VDP-0002", 8))
       {
         VDRServer newServer;
diff --git a/vdr.h b/vdr.h
index 928b24f4fed66ea6a10821689cb707f091f083a9..6506f7550878adcb8fa9945b636a3a3f5f2227b8 100644 (file)
--- a/vdr.h
+++ b/vdr.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/>.
 */
 
 
@@ -246,15 +245,15 @@ public ExternLogger
     bool sendKA(ULONG timeStamp);
     
     Log* logger;
-    int initted;
-    int findingServer;
-    TCP* tcp;
+    int initted{};
+    int findingServer{};
+    TCP* tcp{};
     char serverIP[40];
     USHORT serverPort;
-    bool connected;
-    ULONG maxChannelNumber;
-    bool doVDRShutdown;
-    ULONG channelNumberWidth;
+    bool connected{};
+    ULONG maxChannelNumber{};
+    bool doVDRShutdown{};
+    ULONG channelNumberWidth{1};
     VDR_PacketReceiver* TEMP_SINGLE_VDR_PR;
 
 #ifdef VOMP_MEDIAPLAYER
diff --git a/vepg.cc b/vepg.cc
index aa0099f5fc3f62d536ead4b45e522d936d39d8c6..fb0b526acd7a520c60e4d2b06e358446ef6c31b4 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -452,7 +452,7 @@ int VEpg::handleCommand(int command)
         m->from = this;
         m->to = parent;
         m->message = Message::CHANNEL_CHANGE;
-        m->parameter.num = (*chanList)[currentChannelIndex]->number;
+        m->parameter = (*chanList)[currentChannelIndex]->number;
         MessageQueue::getInstance()->postMessageNoLock(m);
       }
       
@@ -480,7 +480,7 @@ int VEpg::handleCommand(int command)
         m->from = this;
         m->to = parent;
         m->message = Message::CHANNEL_CHANGE;
-        m->parameter.num = (*chanList)[currentChannelIndex]->number;
+        m->parameter = (*chanList)[currentChannelIndex]->number;
         MessageQueue::getInstance()->postMessageNoLock(m);
       }
       
@@ -501,7 +501,7 @@ int VEpg::handleCommand(int command)
         m->from = this;
         m->to = parent;
         m->message = Message::CHANNEL_CHANGE;
-        m->parameter.num = (*chanList)[currentChannelIndex]->number;
+        m->parameter = (*chanList)[currentChannelIndex]->number;
         MessageQueue::getInstance()->postMessageNoLock(m);
       }
       
@@ -770,7 +770,7 @@ void VEpg::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (chanListbox.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (chanListbox.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       drawData();
       boxstack->update(this);
@@ -778,15 +778,15 @@ void VEpg::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (chanListbox.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (chanListbox.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       int keyx = chanListbox.getRootBoxOffsetX();
       int keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2;
 
index 360798e2c740875a0a4202c0c061597e523347e8..7df9c207113f7e6d4c18c9758296e409771ea8b7 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 "vepglistadvanced.h"
@@ -28,7 +27,7 @@
 #include "colour.h"
 #include "video.h"
 #include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "log.h"
 #include "movieinfo.h"
 #include "seriesinfo.h"
@@ -269,9 +268,9 @@ void VEpgListAdvanced::doSwitch()
                m->from = this;
                m->to = videolive;
                m->message = Message::CHANNEL_CHANGE;
-               m->parameter.num = channelNumber;
+               m->parameter = channelNumber;
                m->tag = 0;
-               Command::getInstance()->postMessageNoLock(m);
+               MessageQueue::getInstance()->postMessageNoLock(m);
        }
 }
 
@@ -868,7 +867,7 @@ void VEpgListAdvanced::processMessage(Message* m)
 
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       quickUpdate();
       boxstack->update(this);
@@ -876,31 +875,31 @@ void VEpgListAdvanced::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
-       else if (boxRed.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+       else if (boxRed.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
                boxstack->handleCommand(Remote::RED);
        }
-       else if (boxGreen.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+       else if (boxGreen.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
                boxstack->handleCommand(Remote::GREEN);
        }
-       else if (boxYellow.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+       else if (boxYellow.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
                boxstack->handleCommand(Remote::GREEN);
        }
-       else if (boxBlue.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+       else if (boxBlue.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
                boxstack->handleCommand(Remote::GREEN);
        }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         boxstack->handleCommand(Remote::BACK); //simulate cancel press
index 5c6a527c0b260315bb3f75ccc23ddb1a27e05596..8a34346ced10cc984acbcb59c90139425f75809e 100644 (file)
@@ -28,6 +28,7 @@
 #include "vinfo.h"
 #include "message.h"
 #include "command.h"
+#include "messagequeue.h"
 #include "video.h"
 #include "remote.h"
 #include "i18n.h"
@@ -278,22 +279,22 @@ void VEpgSetTimer::doit()
   Message* m = new Message();
   m->message = Message::ADD_VIEW;
   m->to = boxstack;
-  m->parameter.num = (ULONG)vi;
-  Command::getInstance()->postMessageNoLock(m);
+  m->parameter = (ULONG)vi;
+  MessageQueue::getInstance()->postMessageNoLock(m);
 }
 
 void VEpgSetTimer::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (buttonYes.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (buttonYes.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       buttonNo.setActive(0);
       selectedOption = YES;
       draw();
       boxstack->update(this);
     }
-    else if (buttonNo.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    else if (buttonNo.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       buttonYes.setActive(0);
       selectedOption = NO;
@@ -303,19 +304,19 @@ void VEpgSetTimer::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (buttonYes.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
-    else if (buttonNo.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         boxstack->handleCommand(Remote::BACK); //simulate cancel press
index ac67c4ee96767a11164e0bd60e5d2949680316d5..75c5a3fc1266ab7a08ecc871c886a04593164030 100644 (file)
@@ -207,7 +207,7 @@ void VEpgSummary::processMessage(Message* m)
 {
        if (m->message == Message::MOUSE_MOVE)
        {
-               if (tabbar.mouseMove((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+               if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
                {
                        BoxStack::getInstance()->update(this);
                }
@@ -215,8 +215,8 @@ void VEpgSummary::processMessage(Message* m)
        else if (m->message == Message::MOUSE_LBDOWN)
        {
                int cancel = true;
-               int x = (m->parameter.num >> 16) - getScreenX();
-               int y = (m->parameter.num & 0xFFFF) - getScreenY();
+               int x = (m->parameter >> 16) - getScreenX();
+               int y = (m->parameter & 0xFFFF) - getScreenY();
 
                if ((boxRed.getX() <= x) && (boxRed.getX() + (int)boxRed.getWidth() >= x) &&
                                (boxRed.getY() <= y) && (boxRed.getY() + (int)boxRed.getHeight() >= y)) {
@@ -225,7 +225,7 @@ void VEpgSummary::processMessage(Message* m)
                }
 
 
-               if (cancel && tabbar.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+               if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
                {
                        BoxStack::getInstance()->update(this);
                        cancel = false;
@@ -233,8 +233,8 @@ void VEpgSummary::processMessage(Message* m)
                if (cancel)
                {
                        //check if press is outside this view! then simulate cancel
-                       int checkX=(m->parameter.num>>16)-getScreenX();
-                       int checkY=(m->parameter.num&0xFFFF)-getScreenY();
+                       int checkX=(m->parameter>>16)-getScreenX();
+                       int checkY=(m->parameter&0xFFFF)-getScreenY();
                        if (checkX<0 || checkY <0 || checkX>(int)getWidth() || checkY>(int)getHeight())
                        {
                                BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
@@ -243,7 +243,7 @@ void VEpgSummary::processMessage(Message* m)
        } else if (m->message == Message::MOUSE_SCROLL)
        {
                if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(),
-                               (short)(m->parameter.num >> 16), (short)(m->parameter.num & 0xFFFF)))
+                               (short)(m->parameter >> 16), (short)(m->parameter & 0xFFFF)))
                {
                        BoxStack::getInstance()->update(this);
                        return;
index 7bbb7c9e11aea3de27871589a7e6cb74365d4440..0f792393aa4c35f3f5981ac04c7e7d8c250aeaba 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/>.
 */
 
 /*
@@ -66,7 +65,7 @@
 #include "video.h"
 #include "i18n.h"
 #include "vdr.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "vinfo.h"
 #include "media.h"
 #include "mediaplayer.h"
@@ -1067,7 +1066,7 @@ void VMediaList::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       sl.draw();
       doShowingBar();
@@ -1077,15 +1076,15 @@ void VMediaList::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       updateSelection();
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
     else
     { //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         boxstack->handleCommand(Remote::BACK); //simulate cancel press
@@ -1093,7 +1092,7 @@ void VMediaList::processMessage(Message* m)
     }
   }
   else if (m->message == Message::PLAYER_EVENT) {
-    switch (m->parameter.num) {
+    switch (m->parameter) {
       case 1:
         directoryDone();
         break;
@@ -1185,8 +1184,8 @@ int VMediaList::load() {
     Message* m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter.num = (ULONG)vi;
-    Command::getInstance()->postMessageNoLock(m);
+    m->parameter = (ULONG)vi;
+    MessageQueue::getInstance()->postMessageNoLock(m);
   }
   return 1;
 }
@@ -1204,8 +1203,8 @@ void VMediaList::timercall(int ref) {
     Message* m = new Message();
     m->message = Message::PLAYER_EVENT;
     m->to = this;
-    m->parameter.num = ref;
-    Command::getInstance()->postMessageFromOuterSpace(m);
+    m->parameter = ref;
+    MessageQueue::getInstance()->postMessageFromOuterSpace(m);
   }
 }
  
index ef380ae346f2800178177b7ea0d09eb12f40718d..d40f45d06de5862f76e23277841ea45a6684ff44 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 <time.h>
@@ -41,6 +40,7 @@
 #include "mediaoptions.h"
 #include "mediaplayer.h"
 #include "log.h"
+#include "messagequeue.h"
 
 const int VMediaView::EVENT_SLIDESHOW=100;
 const int VMediaView::EVENT_DRAWINGDONE=101;
@@ -221,8 +221,8 @@ class DrawingThread : public Thread_TYPE {
         m->message = Message::PLAYER_EVENT;
         m->to = _parent;
         m->from = _parent;
-        m->parameter.num = rt?VMediaView::EVENT_DRAWINGDONE:VMediaView::EVENT_DRAWINGERROR;
-        Command::getInstance()->postMessageFromOuterSpace(m);
+        m->parameter = rt?VMediaView::EVENT_DRAWINGDONE:VMediaView::EVENT_DRAWINGERROR;
+        MessageQueue::getInstance()->postMessageFromOuterSpace(m);
       }
       Log::getInstance()->log("DrawingThread",Log::DEBUG,"finishing interrupt=%d",(int)_interrupted);
     }
@@ -711,15 +711,15 @@ void VMediaView::processMessage(Message* m)
   {
     
     //check if press is outside this view! then simulate cancel
-    int x=(m->parameter.num>>16)-getScreenX();
-    int y=(m->parameter.num&0xFFFF)-getScreenY();
+    int x=(m->parameter>>16)-getScreenX();
+    int y=(m->parameter&0xFFFF)-getScreenY();
     if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
       BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
     }
   }
   else if (m->message = Message::PLAYER_EVENT) {
-    switch (m->parameter.num) {
+    switch (m->parameter) {
       case EVENT_SLIDESHOW:
         if (! pictureEnabled) break; //old timer msg...
         //if (! audioEnabled) {
@@ -1084,8 +1084,8 @@ void VMediaView::sendViewMsg(Boxx *v) {
   m->message = Message::CLOSE_ME;
   m->to = BoxStack::getInstance();
   m->from = v;
-  m->parameter.num=(ULONG)v;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  m->parameter=(ULONG)v;
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 void VMediaView::sendCommandMsg(int command) {
   Message* m = new Message(); 
@@ -1093,8 +1093,8 @@ void VMediaView::sendCommandMsg(int command) {
   m->message = Message::PLAYER_EVENT;
   m->to = this;
   m->from = this;
-  m->parameter.num = command;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  m->parameter = command;
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 void VMediaView::enableBanner(bool enable) {
index c371cafb7af053786133ac2f187c877bb7dc50ad..2de57ab118dde543875586dc75f227b072d95c86 100644 (file)
--- a/vmute.cc
+++ b/vmute.cc
@@ -27,7 +27,7 @@
 #include "colour.h"
 #include "timers.h"
 #include "boxstack.h"
-#include "command.h"
+#include "messagequeue.h"
 
 VMute::VMute()
 {
@@ -73,7 +73,7 @@ void VMute::timercall(int clientReference)
   m->message = Message::CLOSE_ME;
   m->to = BoxStack::getInstance();
   m->from = this;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 int VMute::handleCommand(int command)
index 505763a2171d8f85aaa0aafe74b050e03fcfcb4e..963ea588a8cec45db8d2dfd15b9e570c1181515f 100644 (file)
--- a/vopts.cc
+++ b/vopts.cc
@@ -493,8 +493,8 @@ void VOpts::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    int x=(m->parameter.num>>16)-getScreenX();
-    int y=(m->parameter.num&0xFFFF)-getScreenY();
+    int x=(m->parameter>>16)-getScreenX();
+    int y=(m->parameter&0xFFFF)-getScreenY();
     if (tabbar.mouseMove(x,y))
     {
       BoxStack::getInstance()->update(this);
@@ -503,8 +503,8 @@ void VOpts::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    int x=(m->parameter.num>>16)-getScreenX();
-    int y=(m->parameter.num&0xFFFF)-getScreenY();
+    int x=(m->parameter>>16)-getScreenX();
+    int y=(m->parameter&0xFFFF)-getScreenY();
     if (tabbar.mouseLBDOWN(x,y)) 
     {
       BoxStack::getInstance()->update(this);
index d89ce4bdd95b406b65b5c4b34e557e436ed29279..c1ceef62eb4c87ddf928b6f41b42886e714f6644 100644 (file)
@@ -105,8 +105,8 @@ void VPictureBanner::processMessage(Message* m)
   else if (m->message == Message::MOUSE_LBDOWN)
   {
     //check if press is outside this view! then simulate cancel
-    int x=(m->parameter.num>>16)-getScreenX();
-    int y=(m->parameter.num&0xFFFF)-getScreenY();
+    int x=(m->parameter>>16)-getScreenX();
+    int y=(m->parameter&0xFFFF)-getScreenY();
     if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
     {
       BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
index 356b012831a5503778794bf7e3df9c3682607d8e..2a41a4a4c81cceaee039ab9796808d34109f5e01 100644 (file)
@@ -126,14 +126,14 @@ void VQuestion::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (buttonYes.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (buttonYes.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       buttonNo.setActive(0);
       selectedOption = YES;
       draw();
       BoxStack::getInstance()->update(this);
     }
-    else if (buttonNo.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    else if (buttonNo.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       buttonYes.setActive(0);
       selectedOption = NO;
@@ -143,19 +143,19 @@ void VQuestion::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (buttonYes.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
-    else if (buttonNo.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
index 99624eba5b750cacb9f869103ff37ec0caeabbbd..b031c86f6f1ccf40fdbfe4e8f2b287339819cb75 100644 (file)
@@ -36,6 +36,7 @@
 #include "vinfo.h"
 #include "i18n.h"
 #include "log.h"
+#include "messagequeue.h"
 
 VRadioRec::VRadioRec(Recording* rec)
 {
@@ -158,7 +159,7 @@ void VRadioRec::go(bool resume)
     m->message = Message::CLOSE_ME;
     m->from = this;
     m->to = boxstack;
-    Command::getInstance()->postMessageNoLock(m);
+    MessageQueue::getInstance()->postMessageNoLock(m);
 
     VInfo* vi = new VInfo();
     vi->setSize(400, 150);
@@ -176,8 +177,8 @@ void VRadioRec::go(bool resume)
     m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter.num = (ULONG)vi;
-    Command::getInstance()->postMessageNoLock(m);
+    m->parameter = (ULONG)vi;
+    MessageQueue::getInstance()->postMessageNoLock(m);
   }
 }
 
@@ -276,8 +277,8 @@ void VRadioRec::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_LBDOWN)
   {
-    int x=(m->parameter.num>>16)-(int)getScreenX();
-    int y=(m->parameter.num&0xFFFF)-(int)getScreenY();
+    int x=(m->parameter>>16)-(int)getScreenX();
+    int y=(m->parameter&0xFFFF)-(int)getScreenY();
     if (!barShowing)
     {
       boxstack->handleCommand(Remote::OK); //simulate rok press
@@ -311,7 +312,7 @@ void VRadioRec::processMessage(Message* m)
 
     Log::getInstance()->log("VRadioRec", Log::DEBUG, "Message received");
 
-    switch(m->parameter.num)
+    switch(m->parameter)
     {
       case Player::CONNECTION_LOST: // connection lost detected
       {
@@ -319,7 +320,7 @@ void VRadioRec::processMessage(Message* m)
         Message* m2 = new Message();
         m2->to = Command::getInstance();
         m2->message = Message::CONNECTION_LOST;
-        Command::getInstance()->postMessageNoLock(m2);
+        MessageQueue::getInstance()->postMessageNoLock(m2);
         break;
       }
       case Player::STOP_PLAYBACK:
@@ -328,7 +329,7 @@ void VRadioRec::processMessage(Message* m)
         Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
         m2->to = Command::getInstance();
         m2->message = Message::STOP_PLAYBACK;
-        Command::getInstance()->postMessageNoLock(m2);
+        MessageQueue::getInstance()->postMessageNoLock(m2);
         break;
       }
     }
index caa28ea2e380ef8a5bddad3f1d60a4825be53b19..c899bd7453a915f386b7657ab5c52ce80cd0c353 100644 (file)
@@ -27,7 +27,7 @@
 #include "colour.h"
 #include "video.h"
 #include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "wsymbol.h"
 #include "recman.h"
 #include "directory.h"
@@ -130,8 +130,8 @@ int VRecMove::handleCommand(int command)
       Message* m = new Message();
       m->message = Message::MOVE_RECORDING;
       m->to = parent;
-      m->parameter.num = sl.getCurrentOptionData();
-      Command::getInstance()->postMessageNoLock(m);
+      m->parameter = sl.getCurrentOptionData();
+      MessageQueue::getInstance()->postMessageNoLock(m);
 
       return 4;
     }
@@ -148,7 +148,7 @@ void VRecMove::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       sl.draw();
       BoxStack::getInstance()->update(this);
@@ -156,15 +156,15 @@ void VRecMove::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
index 9a140285f5074e2642b01f9d9b4d8669a79d1551..2cb7509bbcf4c73d783c67b71f2c66dcbc9c2e86 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 "vrecording.h"
@@ -28,7 +27,7 @@
 #include "colour.h"
 #include "video.h"
 #include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "vrecmove.h"
 #include "boxstack.h"
 #include "recman.h"
@@ -227,7 +226,7 @@ int VRecording::handleCommand(int command)
                                m->from = this;
                                m->to = vRecList;
                                m->message = Message::PLAY_SELECTED_RECORDING;
-                               Command::getInstance()->postMessageNoLock(m);
+                               MessageQueue::getInstance()->postMessageNoLock(m);
                                return 4;
                        }
 
@@ -237,7 +236,7 @@ int VRecording::handleCommand(int command)
                                m->from = this;
                                m->to = vRecList;
                                m->message = Message::RESUME_SELECTED_RECORDING;
-                               Command::getInstance()->postMessageNoLock(m);
+                               MessageQueue::getInstance()->postMessageNoLock(m);
                                return 4;
                        }
 
@@ -266,8 +265,8 @@ int VRecording::handleCommand(int command)
               Message* m = new Message();
               m->message = Message::ADD_VIEW;
               m->to = BoxStack::getInstance();
-              m->parameter.num = (ULONG)vi;
-              Command::getInstance()->postMessageNoLock(m);
+              m->parameter = (ULONG)vi;
+              MessageQueue::getInstance()->postMessageNoLock(m);
 
               if (ret == 1)
               {
@@ -283,7 +282,7 @@ int VRecording::handleCommand(int command)
                 m2->from = this;
                 m2->to = vRecList;
                 m2->message = Message::REDRAW;
-                Command::getInstance()->postMessageNoLock(m2);
+                MessageQueue::getInstance()->postMessageNoLock(m2);
               }
 
               return 2;
@@ -379,7 +378,7 @@ void VRecording::processMessage(Message* m)
   {
     for (int i = PLAY; i < last; i++)
     {
-         if (button[i].mouseMove((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+         if (button[i].mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
       {
         for (int j = PLAY; j < last; j++)
           button[j].setActive(0);
@@ -392,7 +391,7 @@ void VRecording::processMessage(Message* m)
         break;
       }
     }
-       if (tabbar.mouseMove((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+       if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
                BoxStack::getInstance()->update(this);
                return;
@@ -401,7 +400,7 @@ void VRecording::processMessage(Message* m)
   else if (m->message == Message::MOUSE_SCROLL)
   {
          if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(),
-                 (short)(m->parameter.num >> 16), (short) (m->parameter.num & 0xFFFF)))
+                 (short)(m->parameter >> 16), (short) (m->parameter & 0xFFFF)))
          {
                  BoxStack::getInstance()->update(this);
                  return;
@@ -412,7 +411,7 @@ void VRecording::processMessage(Message* m)
     int cancel = true;
     for (int i = PLAY; i < last; i++)
     {
-      if (button[i].mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+      if (button[i].mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
       {
         BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
                buttons = true;
@@ -420,7 +419,7 @@ void VRecording::processMessage(Message* m)
         break;
       }
     }
-       if (cancel && tabbar.mouseLBDOWN((m->parameter.num >> 16) - getScreenX(), (m->parameter.num & 0xFFFF) - getScreenY()))
+       if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
        {
                buttons = false;
                button[selected].setActive(0);
@@ -431,8 +430,8 @@ void VRecording::processMessage(Message* m)
     if (cancel)
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
@@ -447,13 +446,13 @@ void VRecording::processMessage(Message* m)
       m2->from = this;
       m2->to = BoxStack::getInstance();
       m2->message = Message::CLOSE_ME;
-      Command::getInstance()->postMessageNoLock(m2);
+      MessageQueue::getInstance()->postMessageNoLock(m2);
 
       m2 = new Message(); // OK. Want this to delete before this message does its job
       m2->from = this;
       m2->to = vRecList;
       m2->message = Message::DELETE_SELECTED_RECORDING;
-      Command::getInstance()->postMessageNoLock(m2);
+      MessageQueue::getInstance()->postMessageNoLock(m2);
     }
   }
   else if (m->message == Message::MOVE_RECORDING)
@@ -462,14 +461,14 @@ void VRecording::processMessage(Message* m)
     m2->from = this;
     m2->to = BoxStack::getInstance();
     m2->message = Message::CLOSE_ME;
-    Command::getInstance()->postMessageNoLock(m2);
+    MessageQueue::getInstance()->postMessageNoLock(m2);
 
     m2 = new Message();
     m2->from = this;
     m2->to = vRecList;
     m2->message = Message::MOVE_RECORDING;
-    m2->parameter.num = m->parameter.num;
-    Command::getInstance()->postMessageNoLock(m2);
+    m2->parameter = m->parameter;
+    MessageQueue::getInstance()->postMessageNoLock(m2);
   }
 }
 
index 6c4ca2697756a2eb5bb59224cb10d9b03cbd6746..9331cb624ce7d2063121c14ec2f2806bc487eb03 100644 (file)
@@ -57,7 +57,7 @@ void VRecordingList::processMessage(Message* m)
 
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       quickUpdate();
       boxstack->update(this);
@@ -65,15 +65,15 @@ void VRecordingList::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         boxstack->handleCommand(Remote::BACK); //simulate cancel press
@@ -88,7 +88,7 @@ void VRecordingList::processMessage(Message* m)
   else if (m->message == Message::MOVE_RECORDING)
   {
     Log::getInstance()->log("VRecordingList", Log::DEBUG, "Doing move recording");
-    doMoveRecording((Directory*)m->parameter.num);
+    doMoveRecording((Directory*)m->parameter);
   }
   else if (m->message == Message::PLAY_SELECTED_RECORDING)
   {
index 3cccca7f8a7423266de60504a0f3d7ff106bb909..2db388bab5e62a211a886f7c1551c2aadb9be6cd 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 "vrecordingmenu.h"
@@ -28,7 +27,7 @@
 #include "colour.h"
 #include "video.h"
 #include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "vrecmove.h"
 #include "boxstack.h"
 #include "recman.h"
@@ -109,7 +108,7 @@ int VRecordingMenu::handleCommand(int command)
         m->from = this;
         m->to = vRecList;
         m->message = Message::PLAY_SELECTED_RECORDING;
-        Command::getInstance()->postMessageNoLock(m);
+        MessageQueue::getInstance()->postMessageNoLock(m);
         return 4;
       }
 
@@ -119,7 +118,7 @@ int VRecordingMenu::handleCommand(int command)
         m->from = this;
         m->to = vRecList;
         m->message = Message::RESUME_SELECTED_RECORDING;
-        Command::getInstance()->postMessageNoLock(m);
+        MessageQueue::getInstance()->postMessageNoLock(m);
         return 4;
       }
 
@@ -197,7 +196,7 @@ void VRecordingMenu::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       sl.draw();
       BoxStack::getInstance()->update(this);
@@ -205,15 +204,15 @@ void VRecordingMenu::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
@@ -228,13 +227,13 @@ void VRecordingMenu::processMessage(Message* m)
       m2->from = this;
       m2->to = BoxStack::getInstance();
       m2->message = Message::CLOSE_ME;
-      Command::getInstance()->postMessageNoLock(m2);
+      MessageQueue::getInstance()->postMessageNoLock(m2);
 
       m2 = new Message(); // OK. Want this to delete before this message does its job
       m2->from = this;
       m2->to = vRecList;
       m2->message = Message::DELETE_SELECTED_RECORDING;
-      Command::getInstance()->postMessageNoLock(m2);
+      MessageQueue::getInstance()->postMessageNoLock(m2);
     }
   }
   else if (m->message == Message::MOVE_RECORDING)
@@ -243,13 +242,13 @@ void VRecordingMenu::processMessage(Message* m)
     m2->from = this;
     m2->to = BoxStack::getInstance();
     m2->message = Message::CLOSE_ME;
-    Command::getInstance()->postMessageNoLock(m2);
+    MessageQueue::getInstance()->postMessageNoLock(m2);
 
     m2 = new Message();
     m2->from = this;
     m2->to = vRecList;
     m2->message = Message::MOVE_RECORDING;
-    m2->parameter.num = m->parameter.num;
-    Command::getInstance()->postMessageNoLock(m2);
+    m2->parameter = m->parameter;
+    MessageQueue::getInstance()->postMessageNoLock(m2);
   }
 }
index e033b66051588f0753aeb9d6609b2639aca34c04..c67729b6cb749efa61e256293a6c4347c349ac12 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 VRECORDINGMENU_H
index e9f9839325b89190e722d365876c7ad2dceab600..182e04fb46eaa593876915b37a9233a42f3f8fd2 100644 (file)
@@ -26,7 +26,7 @@
 #include "video.h"
 #include "boxstack.h"
 #include "i18n.h"
-#include "command.h"
+#include "messagequeue.h"
 
 
 VServerSelect::VServerSelect(std::vector<VDRServer>& servers, void* treplyTo)
@@ -98,8 +98,8 @@ int VServerSelect::handleCommand(int command)
       Message* m = new Message(); // Question/Answer mech. Better being messages
       m->to = replyTo;
       m->message = Message::SERVER_SELECTED;
-      m->parameter.num = sl.getCurrentOption();
-      Command::getInstance()->postMessageNoLock(m);
+      m->parameter = sl.getCurrentOption();
+      MessageQueue::getInstance()->postMessageNoLock(m);
       return 4;
     }
   }
@@ -111,7 +111,7 @@ void VServerSelect::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       sl.draw();
       BoxStack::getInstance()->update(this);
@@ -119,7 +119,7 @@ void VServerSelect::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
index 278c5986dc2b2c22857eb936b49bd51de1b0f902..0258e0b8699d350522cac1648ddc82ee24c09061 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 "vsleeptimer.h"
@@ -34,10 +33,7 @@ Sleeptimer* Sleeptimer::instance = NULL;
 Sleeptimer::Sleeptimer()
 {
    if (instance) return;
-   sec = -1;
-   active = false;
    instance = this;
-   
 }
 
 Sleeptimer::~Sleeptimer()
@@ -45,160 +41,152 @@ Sleeptimer::~Sleeptimer()
    instance = NULL;
 }
 
-
 const char* Sleeptimer::SetTime()
 {
-   if (sec <890)
-     {
-       sec=900;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "0:15";
-     }
-   else if (sec <1790)
-     {
-       sec = 1800;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "0:30";
-     }
-   else if (sec < 2690)
-     {
-       sec = 2700;
-       if (active==false)
-       {
-          active = true;  
-          threadStart();
-       }
-       
-       return "0:45";
-     }
-   else if (sec < 3590)
-     {
-       sec = 3600;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "1:00";
-     }
-   else if (sec < 4490)
-     {
-       sec = 4500;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "1:15";
-     }
-   else if (sec < 5390)
-     {
-       sec = 5400;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "1:30";
-     }
-   else if (sec < 6290)
-     {
-       sec = 6300;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "1:45";
-     }
-   else if (sec < 7190)
-     {
-       sec = 7200;
-       if (active==false)
-       {
-          active = true;
-          threadStart();
-       }
-       
-       return "2:00";
-       
-     }
-   else
-     {
-       sec = -1;
-       if (active==true)
-       shutdown();
-       return "AUS";
-     }
-   
+  if (sec < 890)
+  {
+    sec = 900;
+    if (active == false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "0:15";
+  }
+  else if (sec <1790)
+  {
+    sec = 1800;
+    if (active == false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "0:30";
+  }
+  else if (sec < 2690)
+  {
+    sec = 2700;
+    if (active==false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "0:45";
+  }
+  else if (sec < 3590)
+  {
+    sec = 3600;
+    if (active==false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "1:00";
+  }
+  else if (sec < 4490)
+  {
+    sec = 4500;
+    if (active==false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "1:15";
+  }
+  else if (sec < 5390)
+  {
+    sec = 5400;
+    if (active==false)
+    {
+        active = true;
+        threadStart();
+    }
+
+    return "1:30";
+  }
+  else if (sec < 6290)
+  {
+    sec = 6300;
+    if (active==false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "1:45";
+  }
+  else if (sec < 7190)
+  {
+    sec = 7200;
+    if (active==false)
+    {
+      active = true;
+      threadStart();
+    }
+
+    return "2:00";
+
+  }
+  else
+  {
+    sec = -1;
+    if (active==true)
+    shutdown();
+    return "AUS";
+  }
 }
 
 Sleeptimer* Sleeptimer::getInstance()
 {
-     return instance;
+  return instance;
 }
 
 void Sleeptimer::threadMethod()
 {
-   
-   while (sec>-1 && active==true)
-     {
-       sec--;
-       if (sec<31 && sec>-1)
-         {
-            VCountdown* count = new VCountdown();
-             char* temp = (char*)malloc(20);
-            sprintf(temp, "0:%02d", sec);
-            count->drawClock(temp);
-            free(temp);
-            Message* m1 = new Message();
-            m1->message = Message::ADD_VIEW;
-         m1->to = BoxStack::getInstance();
-            m1->parameter.num = (ULONG)count;
-            MessageQueue::getInstance()->postMessageNoLock(m1);
-         }
-        MILLISLEEP(1000);
-       
-       
-        if (sec==-1)
-         {
-            Message* m2 = new Message(); // Delete self
-            m2->message = Message::UDP_BUTTON;
-            m2->to = Command::getInstance();
-            m2->from = this;
-                m2->parameter.num = 61;
-            MessageQueue::getInstance()->postMessageFromOuterSpace(m2);
-            shutdown();
-         }
-       
-     }
-   
-     
+  while (sec>-1 && active==true)
+  {
+    sec--;
+    if (sec<31 && sec>-1)
+    {
+      VCountdown* count = new VCountdown();
+      char temp[20];
+      sprintf(temp, "0:%02d", sec);
+      count->drawClock(temp);
+
+      Message* m1 = new Message();
+      m1->message = Message::ADD_VIEW;
+      m1->to = BoxStack::getInstance();
+      m1->parameter = (ULONG)count;
+      MessageQueue::getInstance()->postMessageNoLock(m1);
+    }
+    MILLISLEEP(1000);
+
+    if (sec == -1)
+    {
+      Message* m2 = new Message(); // Delete self
+      m2->message = Message::UDP_BUTTON;
+      m2->to = Command::getInstance();
+      m2->from = this;
+      m2->parameter = 61; // FIXME use constant name when they're sorted out
+      MessageQueue::getInstance()->postMessageFromOuterSpace(m2);
+      shutdown();
+    }
+  }
 }
 
 void Sleeptimer::shutdown()
 {
-   if (active==true)
-     {
-       sec=-1; 
-       threadCancel();
-       active = false;
-     }
-   
+  if (active)
+  {
+    sec = -1;
+    threadCancel();
+    active = false;
+  }
 }
 
 
@@ -224,16 +212,16 @@ VSleeptimer::~VSleeptimer()
 
 void VSleeptimer::draw()
 {
-   fillColour(DrawStyle::VIEWBACKGROUND);
-   WSymbol w;
-   TEMPADD(&w);
-   w.nextSymbol = WSymbol::CLOCK;
-   w.setPosition(3, 0);
-   w.draw();
+  fillColour(DrawStyle::VIEWBACKGROUND);
+  WSymbol w;
+  TEMPADD(&w);
+  w.nextSymbol = WSymbol::CLOCK;
+  w.setPosition(3, 0);
+  w.draw();
  
-   Boxx::draw();
-   drawText(displaySleeptimer,50,2,DrawStyle::LIGHTTEXT);
-   Timers::getInstance()->setTimerD(this, 1, 2);
+  Boxx::draw();
+  drawText(displaySleeptimer,50,2,DrawStyle::LIGHTTEXT);
+  Timers::getInstance()->setTimerD(this, 1, 2);
 }
 
 void VSleeptimer::timercall(int clientReference)
@@ -290,18 +278,17 @@ VCountdown::~VCountdown()
 
 void VCountdown::drawClock(const char* sec)
 {
-   
-   fillColour(DrawStyle::VIEWBACKGROUND);
-   WSymbol w;
-   TEMPADD(&w);
-   w.nextSymbol = WSymbol::CLOCK;
-   w.nextColour = DrawStyle::RED;
-   w.setPosition(3, 0);
-   w.draw();
-   Boxx::draw();
-   drawText(sec,50,2,DrawStyle::RED);
-   Timers::getInstance()->setTimerD(this, 1, 1);
+  fillColour(DrawStyle::VIEWBACKGROUND);
+  WSymbol w;
+  TEMPADD(&w);
+  w.nextSymbol = WSymbol::CLOCK;
+  w.nextColour = DrawStyle::RED;
+  w.setPosition(3, 0);
+  w.draw();
+
+  Boxx::draw();
+  drawText(sec, 50, 2, DrawStyle::RED);
+  Timers::getInstance()->setTimerD(this, 1, 1);
 }
 
 void VCountdown::timercall(int clientReference)
index d8f78088a97bb306e10d4111c232ae9b3d68f552..4a87beb17ecec6b5d877bf3f0475e8b01e9b2e82 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 VSLEEPTIMER_H
@@ -40,17 +39,12 @@ class Sleeptimer : public Thread_TYPE
    virtual void threadPostStopCleanup() {};
    
  private:
-   int sec;
-   bool active;
+   int sec{-1};
+   bool active{};
    static Sleeptimer* instance;
-   
-
-   
 };
 
 
-
-
 class VSleeptimer : public Boxx, public TimerReceiver
 {
   public:
@@ -61,22 +55,16 @@ class VSleeptimer : public Boxx, public TimerReceiver
     void timercall(int clientReference);
 
   private:
-    const char*  displaySleeptimer;
-
+    const char* displaySleeptimer;
 };
 
 class VCountdown : public Boxx, public TimerReceiver
 {
-   
- public:
-       VCountdown();
-       ~VCountdown();
-       void drawClock(const char* sec);
-       void timercall(int clientReference);
-   
-}
-;
-
+  public:
+    VCountdown();
+    ~VCountdown();
+    void drawClock(const char* sec);
+    void timercall(int clientReference);
+};
 
 #endif
-
index 47e0540fd4a4fe01fc450126c0577d55a605e34e..70319021ed74e4541ee833e9cc4f4890c7c822d9 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 "vtimeredit.h"
@@ -29,7 +28,7 @@
 #include "i18n.h"
 #include "timers.h"
 #include "vquestion.h"
-#include "command.h"
+#include "messagequeue.h"
 #include "staticartwork.h"
 
 VTimerEdit::VTimerEdit(RecTimer* trt)
@@ -240,8 +239,8 @@ void VTimerEdit::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (buttonBack.mouseMove(x,y)) {
           selectedButton=0;
           buttonDelete.setActive(false);
@@ -268,13 +267,13 @@ void VTimerEdit::processMessage(Message* m)
       m2->from = this;
       m2->to = BoxStack::getInstance();
       m2->message = Message::CLOSE_ME;
-      Command::getInstance()->postMessageNoLock(m2);
+      MessageQueue::getInstance()->postMessageNoLock(m2);
 
       m2 = new Message(); // OK. Want this to delete before this message does its job
       m2->from = this;
       m2->to = vTimerList;
       m2->message = Message::DELETE_SELECTED_TIMER;
-      Command::getInstance()->postMessageNoLock(m2);
+      MessageQueue::getInstance()->postMessageNoLock(m2);
     }
   }
 }
index 29f500a5cb65ae4828109de1785c5365345c6a95..9f230aa9cb087c140e0ae968f0af6577a56f2f0c 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 VTIMEREDIT_H
index 76d1280677cc2c3071162e39e40527ee3549f697..2a4f65da676ce01b571a602a5a10851c831d969a 100644 (file)
@@ -322,7 +322,7 @@ void VTimerList::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
        quickUpdate();
       BoxStack::getInstance()->update(this);
@@ -330,15 +330,15 @@ void VTimerList::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press
     }
     else
     {
       //check if press is outside this view! then simulate cancel
-      int x=(m->parameter.num>>16)-getScreenX();
-      int y=(m->parameter.num&0xFFFF)-getScreenY();
+      int x=(m->parameter>>16)-getScreenX();
+      int y=(m->parameter&0xFFFF)-getScreenY();
       if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
       {
         BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press
index 94a9e568983f3680dbc58fe565f55890d15db9ed..b8cab9d68fb20cceb8884ee7745c2916ddf55ad2 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 "vvideolivetv.h"
@@ -46,6 +45,7 @@
 #include "vepglistadvanced.h"
 #include "staticartwork.h"
 #include "demuxer.h"
+#include "messagequeue.h"
 
 #include <sstream>
 
@@ -872,9 +872,9 @@ void VVideoLiveTV::timercall(int ref)
       Message* m = new Message();
       m->message = Message::CHANNEL_CHANGE;
       m->to = this;
-      m->parameter.num = newChannel;
+      m->parameter = newChannel;
       m->tag = 1; // signal to call displayOSD();
-      Command::getInstance()->postMessageFromOuterSpace(m);
+      MessageQueue::getInstance()->postMessageFromOuterSpace(m);
       Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 key end."); 
     }
     else
@@ -1025,8 +1025,8 @@ void VVideoLiveTV::processMessage(Message* m)
   if (m->message == Message::MOUSE_LBDOWN)
   {
     //check if press is outside this view! then simulate cancel
-    int x = (m->parameter.num >> 16) - osd.getScreenX();
-    int y = (m->parameter.num & 0xFFFF) - osd.getScreenY();
+    int x = (m->parameter >> 16) - osd.getScreenX();
+    int y = (m->parameter & 0xFFFF) - osd.getScreenY();
     if (osd.getVisible())
     {
         if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) &&
@@ -1060,7 +1060,7 @@ void VVideoLiveTV::processMessage(Message* m)
   }
   else if (m->message == Message::CHANNEL_CHANGE)
   {
-    channelChange(NUMBER, m->parameter.num);
+    channelChange(NUMBER, m->parameter);
     osdChannelIndex = currentChannelIndex;
     if (m->tag == 1) displayOSD(true);
   }
@@ -1074,14 +1074,14 @@ void VVideoLiveTV::processMessage(Message* m)
   }
   else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
   {
-    Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %x", m->parameter.num);
-    player->setAudioChannel((m->parameter.num & 0xFFFF), (m->parameter.num & 0xFF0000) >> 16, (m->parameter.num & 0xFF000000) >> 24);
+    Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change audio channel to %x", m->parameter);
+    player->setAudioChannel((m->parameter & 0xFFFF), (m->parameter & 0xFF0000) >> 16, (m->parameter & 0xFF000000) >> 24);
   } 
   else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
   {
     if (streamType != VDR::VIDEO) return;
-    Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %x", m->parameter.num);
-    int type = (m->parameter.num & 0xFF0000) >> 16;
+    Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %x", m->parameter);
+    int type = (m->parameter & 0xFF0000) >> 16;
     switch (type)
     {
       case 0x10:
@@ -1089,7 +1089,7 @@ void VVideoLiveTV::processMessage(Message* m)
         //dvbsubtitle
         if (streamType == VDR::VIDEO)
         {
-          player->setSubtitleChannel((m->parameter.num & 0xFFFF));
+          player->setSubtitleChannel((m->parameter & 0xFFFF));
           (static_cast<PlayerLiveTV*>(player))->turnSubtitlesOn(true);
           VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView();
           if (vtxt && vtxt->isInSubtitleMode())
@@ -1113,7 +1113,7 @@ void VVideoLiveTV::processMessage(Message* m)
       { //videotext
           (static_cast<PlayerLiveTV*>(player))->turnSubtitlesOn(false);
           doTeletext(true);
-          ((PlayerLiveTV*)player)->getTeletextDecoder()->setPage((m->parameter.num & 0xFFFF));
+          ((PlayerLiveTV*)player)->getTeletextDecoder()->setPage((m->parameter & 0xFFFF));
       } break;
     };
 
@@ -1126,7 +1126,7 @@ void VVideoLiveTV::processMessage(Message* m)
   }
   else if (m->message == Message::PLAYER_EVENT)
   {
-       switch (m->parameter.num)
+       switch (m->parameter)
     {
       case PlayerLiveTV::CONNECTION_LOST: // connection lost detected
       {
index 7477f0ed68abcc0db92ad24a1581cbe8fedd6e2c..04e17e742c7ce199ba88bd48bf67a7bb9812f19e 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 "vvideomedia.h"
@@ -39,6 +38,7 @@
 #include "i18n.h"
 #include "log.h"
 #include "recinfo.h"
+#include "messagequeue.h"
 
 //use the picture channel
 #define MEDIACHANNEL 1
@@ -175,7 +175,7 @@ void VVideoMedia::go(bool resume)
     m->message = Message::CLOSE_ME;
     m->from = this;
     m->to = boxstack;
-    Command::getInstance()->postMessageNoLock(m);
+    MessageQueue::getInstance()->postMessageNoLock(m);
 
     VInfo* vi = new VInfo();
     vi->setSize(400, 150);
@@ -193,8 +193,8 @@ void VVideoMedia::go(bool resume)
     m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter.num = (ULONG)vi;
-    Command::getInstance()->postMessageNoLock(m);
+    m->parameter = (ULONG)vi;
+    MessageQueue::getInstance()->postMessageNoLock(m);
   }
 }
 
@@ -335,8 +335,8 @@ void VVideoMedia::processMessage(Message* m)
 
   if (m->message == Message::MOUSE_LBDOWN)
   {
-    UINT x = (m->parameter.num>>16) - getScreenX();
-    UINT y = (m->parameter.num&0xFFFF) - getScreenY();
+    UINT x = (m->parameter>>16) - getScreenX();
+    UINT y = (m->parameter&0xFFFF) - getScreenY();
 
     if (!barShowing)
     {
@@ -366,7 +366,7 @@ void VVideoMedia::processMessage(Message* m)
   }
   else if (m->message == Message::PLAYER_EVENT)
   {
-    switch(m->parameter.num)
+    switch(m->parameter)
     {
       case PlayerMedia::CONNECTION_LOST: // connection lost detected
       {
@@ -374,7 +374,7 @@ void VVideoMedia::processMessage(Message* m)
         Message* m2 = new Message();
         m2->to = Command::getInstance();
         m2->message = Message::CONNECTION_LOST;
-        Command::getInstance()->postMessageNoLock(m2);
+        MessageQueue::getInstance()->postMessageNoLock(m2);
         break;
       }
       case PlayerMedia::STREAM_END:
@@ -382,7 +382,7 @@ void VVideoMedia::processMessage(Message* m)
         Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
         m2->to = BoxStack::getInstance();
         m2->message = Message::CLOSE_ME;
-        Command::getInstance()->postMessageNoLock(m2);
+        MessageQueue::getInstance()->postMessageNoLock(m2);
         break;
       }
       case PlayerMedia::STATUS_CHANGE:
@@ -429,7 +429,7 @@ void VVideoMedia::processMessage(Message* m)
   else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
   {
     Log::getInstance()->log("VVideoMedia", Log::DEBUG, "Received change audio channel to %i", m->parameter);
-    player->setAudioChannel(m->parameter.num);
+    player->setAudioChannel(m->parameter);
   }
   else if (m->message == Message::CHILD_CLOSE)
   {
@@ -584,8 +584,8 @@ void VVideoMedia::timercall(int clientReference)
   m->message=Message::PLAYER_EVENT;
   m->to=this;
   m->from=this;
-  m->parameter.num=PLAYER_TIMER_BASE+clientReference;
-  Command::getInstance()->postMessageFromOuterSpace(m);
+  m->parameter=PLAYER_TIMER_BASE+clientReference;
+  MessageQueue::getInstance()->postMessageFromOuterSpace(m);
 }
 
 void VVideoMedia::drawBarClocks()
index 6acb8b4d0f5cf0be130f539afb0e4e8ed845d8b4..2a71f155e3b02d0654a5c79aff2107ddf4e8245d 100644 (file)
@@ -40,6 +40,7 @@
 #include "log.h"
 #include "channel.h"
 #include "vteletextview.h"
+#include "messagequeue.h"
 #include "vvideorec.h"
 
 VVideoRec::VVideoRec(Recording* rec, bool ish264)
@@ -195,7 +196,7 @@ void VVideoRec::go(bool resume)
     m->message = Message::CLOSE_ME;
     m->from = this;
     m->to = boxstack;
-    Command::getInstance()->postMessageNoLock(m);
+    MessageQueue::getInstance()->postMessageNoLock(m);
 
     VInfo* vi = new VInfo();
     vi->setSize(360, 200);
@@ -214,8 +215,8 @@ void VVideoRec::go(bool resume)
     m = new Message();
     m->message = Message::ADD_VIEW;
     m->to = boxstack;
-    m->parameter.num = (ULONG)vi;
-    Command::getInstance()->postMessageNoLock(m);
+    m->parameter = (ULONG)vi;
+    MessageQueue::getInstance()->postMessageNoLock(m);
   }
 }
 
@@ -452,8 +453,8 @@ void VVideoRec::processMessage(Message* m)
 
   if (m->message == Message::MOUSE_LBDOWN)
   {
-    UINT x = (m->parameter.num>>16) - getScreenX();
-    UINT y = (m->parameter.num&0xFFFF) - getScreenY();
+    UINT x = (m->parameter>>16) - getScreenX();
+    UINT y = (m->parameter&0xFFFF) - getScreenY();
 
     if (!barShowing)
     {
@@ -521,7 +522,7 @@ void VVideoRec::processMessage(Message* m)
   else if (m->from == player)
   {
     if (m->message != Message::PLAYER_EVENT) return;
-    switch(m->parameter.num)
+    switch(m->parameter)
     {
       case Player::CONNECTION_LOST: // connection lost detected
       {
@@ -529,7 +530,7 @@ void VVideoRec::processMessage(Message* m)
         Message* m2 = new Message();
         m2->to = Command::getInstance();
         m2->message = Message::CONNECTION_LOST;
-        Command::getInstance()->postMessageNoLock(m2);
+        MessageQueue::getInstance()->postMessageNoLock(m2);
         break;
       }
       case Player::STOP_PLAYBACK:
@@ -538,7 +539,7 @@ void VVideoRec::processMessage(Message* m)
         Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
         m2->to = Command::getInstance();
         m2->message = Message::STOP_PLAYBACK;
-        Command::getInstance()->postMessageNoLock(m2);
+        MessageQueue::getInstance()->postMessageNoLock(m2);
         break;
       }
       case Player::ASPECT43:
@@ -553,16 +554,16 @@ void VVideoRec::processMessage(Message* m)
   }
   else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
   {
-    Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter.num);
-    player->setAudioChannel(m->parameter.num&0xFFFF,(m->parameter.num&0xFF0000)>> 16,(m->parameter.num&0xFF000000)>> 24 );
+    Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter);
+    player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16,(m->parameter&0xFF000000)>> 24 );
   }
   else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
   {
-      Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter.num);
-      int type=((m->parameter.num & 0xFF0000)>>16);
+      Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter);
+      int type=((m->parameter & 0xFF0000)>>16);
       switch (type) {
       case 0x10: { //dvbsubtitle
-          player->setSubtitleChannel((m->parameter.num & 0xFFFF));
+          player->setSubtitleChannel((m->parameter & 0xFFFF));
           player->turnSubtitlesOn(true);
           VTeletextView *vtxt=((Player*)player)->getTeletextDecoder()->getTeletxtView();
           if (vtxt && vtxt->isInSubtitleMode()) {
@@ -581,7 +582,7 @@ void VVideoRec::processMessage(Message* m)
       case 0x11: { //videotext
           player->turnSubtitlesOn(false);
           doTeletext();
-          ((Player*)player)->getTeletextDecoder()->setPage((m->parameter.num & 0xFFFF));
+          ((Player*)player)->getTeletextDecoder()->setPage((m->parameter & 0xFFFF));
                  } break;
       };
       if (vas) {
index adec7d794dbdccf581c7afeeb2261a59446194ac..d995e4a77101c3f6af533a8c385393dfe3f792bb 100644 (file)
@@ -398,7 +398,7 @@ void VWelcome::processMessage(Message* m)
 {
   if (m->message == Message::MOUSE_MOVE)
   {
-    if (sl.mouseMove((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       sl.draw();
       boxstack->update(this);
@@ -406,7 +406,7 @@ void VWelcome::processMessage(Message* m)
   }
   else if (m->message == Message::MOUSE_LBDOWN)
   {
-    if (sl.mouseLBDOWN((m->parameter.num>>16)-getScreenX(),(m->parameter.num&0xFFFF)-getScreenY()))
+    if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
     {
       boxstack->handleCommand(Remote::OK); //simulate OK press
     }
index e06cb43abe2cfa57323456736db68963161ec768..3dbc7fb4fd6c74975ffb3d3c763109dbf3a93483 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/>.
 */
 #ifdef WIN32
 #include <stdio.h>
@@ -47,6 +46,7 @@
 #include "command.h"
 #include "wol.h"
 #include "vsleeptimer.h"
+#include "messagequeue.h"
 
 void sighandler(int signalReceived);
 void shutdown(int code);
@@ -85,6 +85,8 @@ REGISTERRAWINPUTDEVICEFNC dynRegisterRawInputDevices=NULL;
 
 DWORD lastmousemove;
 
+MessageQueue* messageQueue;
+
 
 void MILLISLEEP(ULONG a)
 {
@@ -176,6 +178,8 @@ INT WINAPI WinMain( HINSTANCE hinst , HINSTANCE previnst, LPSTR cmdline, int cmd
   return 0;
   }
 
+  messageQueue = command;
+
   // Get logging module started --------------------------------------------------------------------------------------
 
   if (!logger->init(Log::DEBUG, "vompwin.log", true))
@@ -682,10 +686,10 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
       mousemes->message=Message::MOUSE_MOVE;
       mousemes->from=NULL;
       mousemes->to=BoxStack::getInstance();
-      mousemes->parameter.num=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
+      mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
       mousemes->tag=0;
       //command->postMessageFromOuterSpace(mousemes);
-      command->postMessageIfNotBusy(mousemes);
+      messageQueue->postMessageIfNotBusy(mousemes);
     }
 
     return 0;
@@ -715,9 +719,9 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
       mousemes->message=Message::MOUSE_LBDOWN;
       mousemes->from=NULL;
       mousemes->to=BoxStack::getInstance();
-      mousemes->parameter.num=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
+      mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
       mousemes->tag=0;
-      command->postMessageFromOuterSpace(mousemes);
+      messageQueue->postMessageFromOuterSpace(mousemes);
     }
             }break;
   case WM_MOUSEWHEEL:{
@@ -728,9 +732,9 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
                mousemes->message = Message::MOUSE_SCROLL;
                mousemes->from = NULL;
                mousemes->to = BoxStack::getInstance();
-               mousemes->parameter.num = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam)  &0xFFFF);
+               mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam)  &0xFFFF);
                mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
-               command->postMessageFromOuterSpace(mousemes);
+               messageQueue->postMessageFromOuterSpace(mousemes);
        }
 
   } break;
index f982b7fda86230ba001e12883c7ba215814a6cfc..f93475443b4680ae158b90a9c4c6cadec2ce493b 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 "wremoteconfig.h"
@@ -160,7 +159,7 @@ void WRemoteConfig::doSave()
     m->message = Message::CHANGED_REMOTECONTROL;
     m->to = parent;
     m->parameter = 0;
-    Command::getInstance()->postMessageNoLock(m);
+    //Command::getInstance()->postMessageNoLock(m);
     
 }
 */
@@ -238,7 +237,7 @@ int WRemoteConfig::handleCommand(int command)
       m->message = Message::CLOSE_ME;
       m->from = this;
       m->to = viewman;
-      Command::getInstance()->postMessageNoLock(m);
+      //Command::getInstance()->postMessageNoLock(m);
       return 2;
 */      
     }
index 126d93f552025b4ef6957126a2919fffea4c8565..1552f3146e21c021942221a573b31d68a9b551e3 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 "wwinaudiofilter.h"
@@ -171,7 +170,7 @@ void WWinAudioFilter::doSave()
     m->message = Message::CHANGED_DEVICEOPTIONS;
     m->to = parent;
     m->parameter = 0;
-    Command::getInstance()->postMessageNoLock(m);
+    //Command::getInstance()->postMessageNoLock(m);
     
 }*/
 
index 891f05e25e66943a0418126ddb097f803d62b024..3cda10847bc22ba1056b26dbe5e7bf8c6d1b55f1 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 "wwinmp3audiofilter.h"
@@ -179,7 +178,7 @@ void WWinMp3AudioFilter::processMessage(Message* m)
     m->message = Message::CHANGED_DEVICEOPTIONS;
     m->to = parent;
     m->parameter = 0;
-    Command::getInstance()->postMessageNoLock(m);
+    //Command::getInstance()->postMessageNoLock(m);
     
 }*/
 
index 718b9fa419af2b4b31873aa5e77bfe98eeb13fd5..b6b16b0f8ca7abffca120e4cfd9d6b4c38886c4a 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 "wwinvideofilter.h"
@@ -171,7 +170,7 @@ void WWinVideoFilter::doSave()
     m->message = Message::CHANGED_DEVICEOPTIONS;
     m->to = parent;
     m->parameter = 0;
-    Command::getInstance()->postMessageNoLock(m);
+    //Command::getInstance()->postMessageNoLock(m);
     
 }*/
 
index 401fb1fe43bddec3a501cfe5908167d94d1f618f..a18f9ad79f3dca69ba2d648011dad6c0f9353de7 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 "wwinvideoh264filter.h"
@@ -171,7 +170,7 @@ void WWinVideoH264Filter::doSave()
     m->message = Message::CHANGED_DEVICEOPTIONS;
     m->to = parent;
     m->parameter = 0;
-    Command::getInstance()->postMessageNoLock(m);
+    //Command::getInstance()->postMessageNoLock(m);
     
 }*/