]> git.vomp.tv Git - vompclient.git/commitdiff
Handle when recording disappears just before playback start
authorChris Tallon <chris@vomp.tv>
Tue, 8 Oct 2019 16:08:35 +0000 (17:08 +0100)
committerChris Tallon <chris@vomp.tv>
Tue, 8 Oct 2019 16:08:35 +0000 (17:08 +0100)
Make UI the same in each case

vrecordinglist.cc
vvideorec.cc

index bbb0e87753a4d57f96d736f79a1082e07656f017..bf28e7f395a2e45efe2d488b99e00bf4fc1b97d3 100644 (file)
@@ -188,9 +188,9 @@ void VRecordingList::doMoveRecording(Directory* toDir)
 int VRecordingList::doPlay(bool resume)
 {
   Recording* toPlay = getCurrentOptionRecording();
+
   if (toPlay)
   {
-    toPlay->loadRecInfo(); // check if still need this
     toPlay->loadMarks();
     bool ish264;
     bool isRadio = toPlay->isRadio(ish264);
@@ -247,6 +247,28 @@ int VRecordingList::doPlay(bool resume)
       }
       else
       {
+        toPlay->loadRecInfo();
+
+        if (toPlay->recInfo == NULL)
+        {
+          VInfo* vi = new VInfo();
+          vi->setSize(360, 200);
+          vi->createBuffer();
+          if (Video::getInstance()->getFormat() == Video::PAL)
+            vi->setPosition(190, 170);
+          else
+            vi->setPosition(180, 120);
+          vi->setOneLiner(tr("Error playing recording"));
+          vi->setExitable();
+          vi->setBorderOn(1);
+          vi->setTitleBarColour(DrawStyle::DANGER);
+          vi->okButton();
+          vi->draw();
+          boxstack->add(vi);
+          boxstack->update(vi);
+          return 0;
+        }
+
         VVideoRec* vidrec = new VVideoRec(toPlay, ish264);
         vidrec->draw();
         boxstack->add(vidrec);
index 0fbe3c605d27d7184ef37ac19edb7098aa63f1b3..0fc6e0753b258fdd999862d8d799d6dd5fff1214 100644 (file)
@@ -219,16 +219,17 @@ void VVideoRec::go(bool resume)
     Command::getInstance()->postMessageNoLock(m);
 
     VInfo* vi = new VInfo();
-    vi->setSize(400, 150);
+    vi->setSize(360, 200);
     vi->createBuffer();
-    if (video->getFormat() == Video::PAL)
-      vi->setPosition(170, 200);
+    if (Video::getInstance()->getFormat() == Video::PAL)
+      vi->setPosition(190, 170);
     else
-      vi->setPosition(160, 150);
+      vi->setPosition(180, 120);
+    vi->setOneLiner(tr("Error playing recording"));
     vi->setExitable();
     vi->setBorderOn(1);
-    vi->setTitleBarOn(0);
-    vi->setOneLiner(tr("Error playing recording"));
+    vi->setTitleBarColour(DrawStyle::DANGER);
+    vi->okButton();
     vi->draw();
 
     m = new Message();