From fa854a3abe995de8e3a06c422a535fc0e4a8484a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 8 Oct 2019 17:08:35 +0100 Subject: [PATCH] Handle when recording disappears just before playback start Make UI the same in each case --- vrecordinglist.cc | 24 +++++++++++++++++++++++- vvideorec.cc | 13 +++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/vrecordinglist.cc b/vrecordinglist.cc index bbb0e87..bf28e7f 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -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); diff --git a/vvideorec.cc b/vvideorec.cc index 0fbe3c6..0fc6e07 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -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(); -- 2.39.2