]> git.vomp.tv Git - vompclient.git/commitdiff
VVideoLiveTV CWFs
authorChris Tallon <chris@vomp.tv>
Fri, 22 May 2020 16:36:31 +0000 (17:36 +0100)
committerChris Tallon <chris@vomp.tv>
Fri, 22 May 2020 16:36:31 +0000 (17:36 +0100)
vvideolivetv.cc

index dcaaa04aafbdc36fbef7bad9002edf7788d87c8b..27c7290442495b8a4175517a9b1c664ade909573 100644 (file)
@@ -504,7 +504,7 @@ void VVideoLiveTV::doOK()
     if (keying)
     {
       UINT newChannel = 0;
-      for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i);
+      for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * static_cast<int>(pow(10.f, i));
       
       channelChange(NUMBER, newChannel);
       osdChannelIndex = currentChannelIndex;
@@ -567,12 +567,12 @@ void VVideoLiveTV::doKey(int command)
   for (i = 0; i < numberWidth; i++) keyingString[i] = '_';
   keyingString[numberWidth] = '\0';
 
-  for (i = 0; i < keying; i++) keyingString[i] = keyingInput[keying - 1 - i] + 48;
+  for (i = 0; i < keying; i++) keyingString[i] = static_cast<char>(keyingInput[keying - 1 - i] + 48);
   
   if (keying == numberWidth)
   {
     UINT newChannel = 0;
-    for(i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i);
+    for(i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * static_cast<int>(pow(10.f, i));
     
     channelChange(NUMBER, newChannel);
     osdChannelIndex = currentChannelIndex;
@@ -852,7 +852,7 @@ void VVideoLiveTV::timercall(int ref)
     {
       Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Timer Call 1 key start.");
       UINT newChannel = 0;
-      for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i);
+      for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * static_cast<int>(pow(10.f, i));
       
       Message* m = new Message();
       m->message = Message::CHANNEL_CHANGE;
@@ -1014,29 +1014,30 @@ void VVideoLiveTV::processMessage(Message* m)
     int y = m->tag - osd.getScreenY();
     if (osd.getVisible())
     {
-        if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) &&
-            (boxRed.getY()<=y) && (boxRed.getY()+(int)boxRed.getHeight()>=y ))
-        {
-          BoxStack::getInstance()->handleCommand(Input::RED);
-        }
-        else if ((boxGreen.getX()<=x) && (boxGreen.getX()+(int)boxGreen.getWidth()>=x ) &&
-                 (boxGreen.getY()<=y) && (boxGreen.getY()+(int)boxGreen.getHeight()>=y))
-        {
-          BoxStack::getInstance()->handleCommand(Input::GREEN);
-        }
-        else if ((boxYellow.getX()<=x) && (boxYellow.getX()+(int)boxYellow.getWidth()>=x ) &&
-                 (boxYellow.getY()<=y) && (boxYellow.getY()+(int)boxYellow.getHeight()>=y )){
-          BoxStack::getInstance()->handleCommand(Input::YELLOW);
-        }
-        else if ((boxBlue.getX()<=x) && (boxBlue.getX()+(int)boxBlue.getWidth()>=x ) &&
-                 (boxBlue.getY()<=y) && (boxBlue.getY()+(int)boxBlue.getHeight()>=y ))
-        {
-          BoxStack::getInstance()->handleCommand(Input::BLUE);
-        }
-        else
-        {
-          BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
-        }
+      if ((boxRed.getX() <= x) && (boxRed.getX() + static_cast<int>(boxRed.getWidth()) >= x) &&
+          (boxRed.getY() <= y) && (boxRed.getY() + static_cast<int>(boxRed.getHeight()) >= y))
+      {
+        BoxStack::getInstance()->handleCommand(Input::RED);
+      }
+      else if ((boxGreen.getX() <= x) && (boxGreen.getX() + static_cast<int>(boxGreen.getWidth()) >= x) &&
+               (boxGreen.getY() <= y) && (boxGreen.getY() + static_cast<int>(boxGreen.getHeight()) >= y))
+      {
+        BoxStack::getInstance()->handleCommand(Input::GREEN);
+      }
+      else if ((boxYellow.getX() <= x) && (boxYellow.getX() + static_cast<int>(boxYellow.getWidth()) >= x) &&
+               (boxYellow.getY() <= y) && (boxYellow.getY() + static_cast<int>(boxYellow.getHeight()) >= y))
+      {
+        BoxStack::getInstance()->handleCommand(Input::YELLOW);
+      }
+      else if ((boxBlue.getX() <= x) && (boxBlue.getX() + static_cast<int>(boxBlue.getWidth()) >= x) &&
+               (boxBlue.getY() <= y) && (boxBlue.getY() + static_cast<int>(boxBlue.getHeight()) >= y))
+      {
+        BoxStack::getInstance()->handleCommand(Input::BLUE);
+      }
+      else
+      {
+        BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press
+      }
     }
     else
     {
@@ -1360,12 +1361,12 @@ void VVideoLiveTV::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, c
   Region r;
   r.x = posX+region.windowx; r.y = posY+region.windowy; r.w = width; r.h = height;
   //now convert to our display
-  float scalex=720.f/((float) (region.framewidth+1));
-  float scaley=576.f/((float) (region.frameheight+1));
-  r.x = (UINT)floor(scalex*((float)r.x));
-  r.y = (UINT)floor(scaley*((float)r.y));
-  r.w = (UINT)(ceil(scalex*((float)r.w))+1.f);
-  r.h = (UINT)(ceil(scaley*((float)r.h))+1.f);
+  float scalex = 720.f / static_cast<float>(region.framewidth + 1);
+  float scaley = 576.f / static_cast<float>(region.frameheight + 1);
+  r.x = static_cast<UINT>(floor(scalex * static_cast<float>(r.x)));
+  r.y = static_cast<UINT>(floor(scaley * static_cast<float>(r.y)));
+  r.w = static_cast<UINT>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
+  r.h = static_cast<UINT>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
   rectangle(r, DrawStyle(0,0,0,0));
   boxstack->update(this, &r);
 }