From 12c8c6313e4c1f34123849bc6c2b080850521d0c Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 18 Sep 2021 17:41:23 +0100 Subject: [PATCH] Add some BoxStack constants for readability --- boxstack.h | 6 ++++ vaudioselector.cc | 12 ++++---- vchannellist.cc | 16 +++++----- vchannelselect.cc | 6 ++-- vcolourtuner.cc | 23 +++++---------- vconnect.cc | 2 +- vepg.cc | 31 ++++++++++--------- vepglistadvanced.cc | 24 +++++++-------- vepgsettimer.cc | 10 +++---- vepgsummary.cc | 13 ++++---- vinfo.cc | 6 ++-- vmedialist.cc | 26 ++++++++-------- vmediaview.cc | 72 ++++++++++++++++++++++----------------------- vmute.cc | 5 ++-- vopts.cc | 8 ++--- vpicturebanner.cc | 2 +- vquestion.cc | 10 +++---- vradiorec.cc | 24 +++++++-------- vrecmove.cc | 10 +++---- vrecording.cc | 27 +++++++++-------- vrecordinglist.cc | 28 +++++++++--------- vrecordingmenu.cc | 18 ++++++------ vscreensaver.cc | 3 +- vserverselect.cc | 8 ++--- vteletextview.cc | 10 +++---- vtimeredit.cc | 16 +++++----- vtimerlist.cc | 16 +++++----- vvideolivetv.cc | 36 +++++++++++------------ vvideomedia.cc | 36 +++++++++++------------ vvideorec.cc | 44 +++++++++++++-------------- vvolume.cc | 6 ++-- vwelcome.cc | 40 ++++++++++++------------- 32 files changed, 296 insertions(+), 298 deletions(-) diff --git a/boxstack.h b/boxstack.h index f9a492e..fae2fd0 100644 --- a/boxstack.h +++ b/boxstack.h @@ -58,6 +58,12 @@ class BoxStack int handleCommand(int command); void processMessage(Message* m); + // handleCommand() return values + const static int DROP_THROUGH = 0; + const static int ABANDON_COMMAND = 1; + const static int COMMAND_HANDLED = 2; + const static int DELETE_ME = 4; + private: static BoxStack* instance; int initted{}; diff --git a/vaudioselector.cc b/vaudioselector.cc index ea6bcac..81e86a7 100644 --- a/vaudioselector.cc +++ b/vaudioselector.cc @@ -422,7 +422,7 @@ int VAudioSelector::handleCommand(int command) case Input::OK: case Input::GREEN: { - return 4; + return BoxStack::DELETE_ME; } case Input::UP: @@ -454,7 +454,7 @@ int VAudioSelector::handleCommand(int command) MessageQueue::getInstance()->postMessage(m); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: @@ -491,7 +491,7 @@ int VAudioSelector::handleCommand(int command) MessageQueue::getInstance()->postMessage(m); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::LEFT: @@ -506,7 +506,7 @@ int VAudioSelector::handleCommand(int command) BoxStack::getInstance()->update(this); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: @@ -521,11 +521,11 @@ int VAudioSelector::handleCommand(int command) BoxStack::getInstance()->update(this); } - return 2; + return BoxStack::COMMAND_HANDLED; } } - return 1; + return BoxStack::ABANDON_COMMAND; } void VAudioSelector::processMessage(Message* m) diff --git a/vchannellist.cc b/vchannellist.cc index c34bf06..a47ba45 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -202,7 +202,7 @@ int VChannelList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { @@ -210,7 +210,7 @@ int VChannelList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { @@ -218,7 +218,7 @@ int VChannelList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { @@ -226,7 +226,7 @@ int VChannelList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::ZERO: case Input::ONE: @@ -244,7 +244,7 @@ int VChannelList::handleCommand(int command) boxstack->add(v); boxstack->update(v); v->handleCommand(command); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: case Input::PLAY: @@ -257,15 +257,15 @@ int VChannelList::handleCommand(int command) boxstack->add(v); v->go(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VChannelList::processMessage(Message* m) diff --git a/vchannelselect.cc b/vchannelselect.cc index 8614136..50bb59b 100644 --- a/vchannelselect.cc +++ b/vchannelselect.cc @@ -143,15 +143,15 @@ int VChannelSelect::handleCommand(int command) BoxStack::getInstance()->update(this); if (numGot == numWidth) changeChannel(); else Timers::getInstance()->setTimerD(this, 1, 3); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { changeChannel(); - return 2; + return BoxStack::COMMAND_HANDLED; } } // allow command to drop through to other views - return 0; + return BoxStack::DROP_THROUGH; } diff --git a/vcolourtuner.cc b/vcolourtuner.cc index 63133a2..2f3b0b0 100644 --- a/vcolourtuner.cc +++ b/vcolourtuner.cc @@ -112,56 +112,49 @@ void VColourTuner::draw() int VColourTuner::handleCommand(int command) { - int rt=0; + int rt = BoxStack::COMMAND_HANDLED; // Assume BoxStack::COMMAND_HANDLED switch(command) { - case Input::ONE: + default: // Unless no case matches, then set to BoxStack::DROP_THROUGH + rt = BoxStack::DROP_THROUGH; + break; + case Input::ONE: updateFactor(1,-1); - rt=2; hasChanged=true; break; case Input::TWO: updateFactor(1,1); - rt=2; hasChanged=true; break; case Input::FOUR: updateFactor(2,-1); - rt=2; hasChanged=true; break; case Input::FIVE: updateFactor(2,1); - rt=2; hasChanged=true; break; case Input::SEVEN: updateFactor(3,-1); - rt=2; hasChanged=true; break; case Input::EIGHT: updateFactor(3,1); hasChanged=true; - rt=2; break; case Input::THREE: updateFactor(4,-1); hasChanged=true; - rt=2; break; case Input::SIX: updateFactor(4,1); hasChanged=true; - rt=2; break; case Input::NINE: updateFactor(5,0); hasChanged=true; - rt=2; break; case Input::ZERO: drawPicture=true; - rt=2; break; case Input::BACK: vrfactor=rfactor; @@ -174,7 +167,7 @@ int VColourTuner::handleCommand(int command) #endif #endif #endif - rt=4; + rt=BoxStack::DELETE_ME; break; case Input::OK: rfactor=vrfactor; @@ -183,10 +176,10 @@ int VColourTuner::handleCommand(int command) MediaOptions::getInstance()->setIntOption("FactorRed",rfactor); MediaOptions::getInstance()->setIntOption("FactorGreen",gfactor); MediaOptions::getInstance()->setIntOption("FactorBlue",bfactor); - rt=4; + rt=BoxStack::DELETE_ME; break; } - if (rt == 2) { + if (rt == BoxStack::COMMAND_HANDLED) { #ifndef WIN32 #ifndef _MIPS_ARCH #ifndef __ANDROID__ diff --git a/vconnect.cc b/vconnect.cc index 2929934..2621760 100644 --- a/vconnect.cc +++ b/vconnect.cc @@ -71,7 +71,7 @@ void VConnect::draw() int VConnect::handleCommand(int /* command */) { - return 1; + return BoxStack::ABANDON_COMMAND; } void VConnect::run() diff --git a/vepg.cc b/vepg.cc index d6440eb..a72f071 100644 --- a/vepg.cc +++ b/vepg.cc @@ -360,7 +360,7 @@ int VEpg::handleCommand(int command) chanListbox.up(); drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { // cursor down the channel list @@ -371,14 +371,14 @@ int VEpg::handleCommand(int command) boxstack->update(this); LogNT::getInstance()->debug(TAG, "Down end"); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::LEFT: { // cursor left through time selTime = thisEvent.time - 1; drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: { @@ -386,7 +386,7 @@ int VEpg::handleCommand(int command) selTime = thisEvent.time + thisEvent.duration; drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RED: { @@ -394,7 +394,7 @@ int VEpg::handleCommand(int command) chanListbox.pageUp(); drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GREEN: { @@ -402,7 +402,7 @@ int VEpg::handleCommand(int command) chanListbox.pageDown(); drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BLUE: { @@ -410,7 +410,7 @@ int VEpg::handleCommand(int command) selTime += 24 * 60 * 60; drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::YELLOW: { @@ -418,7 +418,7 @@ int VEpg::handleCommand(int command) selTime -= 24 * 60 * 60; drawData(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RECORD: { @@ -428,14 +428,13 @@ int VEpg::handleCommand(int command) vs->draw(); boxstack->add(vs); boxstack->update(vs); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::PLAY: case Input::GO: case Input::OK: { - if (!chanList) return 2; - + if (!chanList) return BoxStack::COMMAND_HANDLED; // select programme and display menu TODO currently just changes to selected channel currentChannelIndex = chanListbox.getCurrentOption(); @@ -453,13 +452,13 @@ int VEpg::handleCommand(int command) setCurrentChannel(); if(command == Input::GO) - return 2; + return BoxStack::COMMAND_HANDLED; // GO just changes channel in preview, PLAY changes channel and returns to normal TV } case Input::BACK: case Input::GUIDE: { - return 4; + return BoxStack::DELETE_ME; } case Input::CHANNELUP: { @@ -480,7 +479,7 @@ int VEpg::handleCommand(int command) setCurrentChannel(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::CHANNELDOWN: { @@ -501,11 +500,11 @@ int VEpg::handleCommand(int command) setCurrentChannel(); - return 2; + return BoxStack::COMMAND_HANDLED; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VEpg::drawgrid() // redraws grid and select programme diff --git a/vepglistadvanced.cc b/vepglistadvanced.cc index c59b913..ab558d0 100644 --- a/vepglistadvanced.cc +++ b/vepglistadvanced.cc @@ -820,7 +820,7 @@ int VEpgListAdvanced::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: @@ -829,7 +829,7 @@ int VEpgListAdvanced::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: @@ -838,7 +838,7 @@ int VEpgListAdvanced::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: @@ -847,31 +847,31 @@ int VEpgListAdvanced::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RED: { doRed(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GREEN: { doGreen(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::YELLOW: { doYellow(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BLUE: { doBlue(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: @@ -899,21 +899,21 @@ int VEpgListAdvanced::handleCommand(int command) boxstack->add(vr); boxstack->update(vr); - return 2; + return BoxStack::COMMAND_HANDLED; } // should not get to here - return 1; + return BoxStack::ABANDON_COMMAND; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VEpgListAdvanced::processMessage(Message* m) diff --git a/vepgsettimer.cc b/vepgsettimer.cc index a82f6e4..edac8a8 100644 --- a/vepgsettimer.cc +++ b/vepgsettimer.cc @@ -218,28 +218,28 @@ int VEpgSetTimer::handleCommand(int command) swap(); draw(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: { swap(); draw(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } case Input::OK: { if (selectedOption != YES) return 4; doit(); - return 4; + return BoxStack::DELETE_ME; } } - return 1; + return BoxStack::ABANDON_COMMAND; } diff --git a/vepgsummary.cc b/vepgsummary.cc index 8cd8c2f..a78ce88 100644 --- a/vepgsummary.cc +++ b/vepgsummary.cc @@ -167,18 +167,18 @@ VEpgSummary::~VEpgSummary() int VEpgSummary::handleCommand(int command) { if (command==Input::BACK) { - return 4; + return BoxStack::DELETE_ME; } if (command==Input::RED) { - if (!channel) return 2; + if (!channel) return BoxStack::COMMAND_HANDLED; LogNT::getInstance()->debug("VEpgSummary", "ID {} TIME {} DURATION {} TITLE {}", event->id, event->time, event->duration, event->title); VEpgSetTimer* vs = new VEpgSetTimer(event, channel); vs->draw(); BoxStack *boxstack=BoxStack::getInstance(); boxstack->add(vs); boxstack->update(vs); - return 2; + return BoxStack::COMMAND_HANDLED; } // Pass to tabbar @@ -186,18 +186,17 @@ int VEpgSummary::handleCommand(int command) if (retval == 1) { BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (retval == 2) { - - return 2; + return BoxStack::COMMAND_HANDLED; } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } diff --git a/vinfo.cc b/vinfo.cc index f7b89d6..791b820 100644 --- a/vinfo.cc +++ b/vinfo.cc @@ -89,18 +89,18 @@ void VInfo::draw() int VInfo::handleCommand(int command) { - if (dropThrough) return 0; + if (dropThrough) return BoxStack::DROP_THROUGH; switch(command) { case Input::OK: case Input::BACK: { - if (exitable) return 4; + if (exitable) return BoxStack::DELETE_ME; } } - return 1; + return BoxStack::ABANDON_COMMAND; } void VInfo::okButton() diff --git a/vmedialist.cc b/vmedialist.cc index bfc14a6..360433d 100644 --- a/vmedialist.cc +++ b/vmedialist.cc @@ -722,7 +722,7 @@ int VMediaList::handleCommand(int command) updateSelection(); doShowingBar(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::UP: { @@ -732,7 +732,7 @@ int VMediaList::handleCommand(int command) doShowingBar(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { @@ -742,7 +742,7 @@ int VMediaList::handleCommand(int command) doShowingBar(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { @@ -752,7 +752,7 @@ int VMediaList::handleCommand(int command) doShowingBar(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { @@ -762,7 +762,7 @@ int VMediaList::handleCommand(int command) doShowingBar(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BLUE: { @@ -770,15 +770,15 @@ int VMediaList::handleCommand(int command) case SORT_NAME: sortList(SORT_TIME); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; case SORT_TIME: sortList(SORT_RANDOM); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; default: sortList(SORT_NAME); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } } case Input::OK: @@ -786,7 +786,7 @@ int VMediaList::handleCommand(int command) { Media* media = NULL; if (dirlist) media = getCurrentMedia(dirlist); - if (media == NULL) return 2; + if (media == NULL) return BoxStack::COMMAND_HANDLED; Log::getInstance()->log("VMediaList", Log::DEBUG, "activated %lu", media->index); switch(media->getMediaType()) { @@ -794,7 +794,7 @@ int VMediaList::handleCommand(int command) { //create child Log::getInstance()->log("VMediaList", Log::DEBUG, "create child for %s",media->getFileName()); - if (media->getFileName() == NULL ) return 2; + if (media->getFileName() == NULL ) return BoxStack::COMMAND_HANDLED; if (command == Input::PLAY) { dirlist->setStartLevel(); playingAll=true; @@ -864,17 +864,17 @@ int VMediaList::handleCommand(int command) v->medianelChange(VVideoLive::NUMBER, media->number); */ - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: { - if (dirlist->getLevel() < 1) return 4; + if (dirlist->getLevel() < 1) return BoxStack::DELETE_ME; dirlist->dropTop(); load(); } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } //go to the next level dir diff --git a/vmediaview.cc b/vmediaview.cc index d9e5db9..79036a5 100644 --- a/vmediaview.cc +++ b/vmediaview.cc @@ -432,21 +432,21 @@ int VMediaView::handleCommand(int command) //only handle YELLOW if (command == Input::YELLOW) { setAudioMode(true); - return 1; + return BoxStack::ABANDON_COMMAND; } - return 0; + return BoxStack::DROP_THROUGH; } if ( ! audioEnabled) { //------------------------- command in mode PICTURE (i.e. picture is on top) ---------------- //picture on top - int rt=1; + int rt = BoxStack::ABANDON_COMMAND; switch(command) { case Input::UP: case Input::SKIPBACK: rotate=WJpegComplex::ROT_0; showPicture(VMediaList::MV_PREV,slideshow,true); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::FORWARD: if (showtime > 1) showtime--; @@ -456,7 +456,7 @@ int VMediaView::handleCommand(int command) case Input::SKIPFORWARD: rotate=WJpegComplex::ROT_0; showPicture(VMediaList::MV_NEXT,slideshow,true); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::REVERSE: if (showtime < 50 ) showtime++; @@ -473,7 +473,7 @@ int VMediaView::handleCommand(int command) havePictureBanner=true; showPictureBanner(pictureLoading); } - rt= 2; + rt= BoxStack::COMMAND_HANDLED; } break; case Input::PLAY: @@ -481,7 +481,7 @@ int VMediaView::handleCommand(int command) slideshow=true; rotate=WJpegComplex::ROT_0; showPicture(VMediaList::MV_NEXT,slideshow,true); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; } break; case Input::PAUSE: @@ -494,13 +494,13 @@ int VMediaView::handleCommand(int command) rotate=WJpegComplex::ROT_0; showPicture(VMediaList::MV_NEXT,slideshow,true); } - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::STOP: stopSlideshow(true); showtime=INITIAL_SHOWTIME; updatePictureBanner(); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::RED: switch(rotate) { @@ -518,12 +518,12 @@ int VMediaView::handleCommand(int command) break; } showPicture(VMediaList::MV_NONE,slideshow,true); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::GREEN: if (info) destroyInfo(); else showPictureInfo(); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::BLUE: switch (cropmode) { @@ -548,13 +548,13 @@ int VMediaView::handleCommand(int command) BoxStack::getInstance()->add(ct); ct->draw(); BoxStack::getInstance()->update(ct); - rt=2; + rt=BoxStack::COMMAND_HANDLED; } break; case Input::BACK: { setPictureMode(false); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; } break; case Input::YELLOW: @@ -566,78 +566,78 @@ int VMediaView::handleCommand(int command) } else { - int rt=1; + int rt = BoxStack::ABANDON_COMMAND; bool updateInfo=false; //------------------------- command in mode AUDIO (i.e. audio is on top) ---------------- switch(command) { case Input::YELLOW: setAudioMode(false); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::UP: play(playall,false,VMediaList::MV_PREV); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::FORWARD: if (! audioError) getPlayer()->fastForward(); updateInfo=true; - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::DOWN: play(playall,false,VMediaList::MV_NEXT); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::SKIPFORWARD: if (! audioError) getPlayer()->skipForward(10); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::SKIPBACK: if (! audioError) getPlayer()->skipBackward(10); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::REVERSE: - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::ZERO: if (! audioError) getPlayer()->jumpToPercent(0); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::ONE: if (! audioError) getPlayer()->jumpToPercent(10); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::TWO: if (! audioError) getPlayer()->jumpToPercent(20); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::THREE: if (! audioError) getPlayer()->jumpToPercent(30); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::FOUR: if (! audioError) getPlayer()->jumpToPercent(40); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::FIVE: if (! audioError) getPlayer()->jumpToPercent(50); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::SIX: if (! audioError) getPlayer()->jumpToPercent(60); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::SEVEN: if (! audioError) getPlayer()->jumpToPercent(70); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::EIGHT: if (! audioError) getPlayer()->jumpToPercent(80); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::NINE: if (! audioError) getPlayer()->jumpToPercent(90); - rt=2; + rt=BoxStack::COMMAND_HANDLED; break; case Input::OK: case Input::GREEN: @@ -653,7 +653,7 @@ int VMediaView::handleCommand(int command) if (getPlayer()->getState() == AudioPlayer::S_ERROR) { if (playall) play(playall,false,VMediaList::MV_NEXT); } - rt= 2; + rt= BoxStack::COMMAND_HANDLED; } break; case Input::PLAY: @@ -662,19 +662,19 @@ int VMediaView::handleCommand(int command) updateInfo=true; if (getPlayer()->getState() != AudioPlayer::S_ERROR) ; else if (playall) play(playall,false,VMediaList::MV_NEXT); - rt= 2; + rt= BoxStack::COMMAND_HANDLED; } break; case Input::PAUSE: if (! audioError) getPlayer()->pause(); updateInfo=true; - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::STOP: getPlayer()->stop(); justPlaying=false; updateInfo=true; - rt= 2; + rt= BoxStack::COMMAND_HANDLED; break; case Input::BACK: { @@ -684,7 +684,7 @@ int VMediaView::handleCommand(int command) justPlaying=false; setAudioMode(false); if (! pictureShowing) setPictureMode(false); //could have been delayed - rt= 2; + rt= BoxStack::COMMAND_HANDLED; } break; } diff --git a/vmute.cc b/vmute.cc index c10ad78..0b40c27 100644 --- a/vmute.cc +++ b/vmute.cc @@ -83,11 +83,10 @@ int VMute::handleCommand(int command) isMuted = Audio::getInstance()->toggleUserMute(); draw(); BoxStack::getInstance()->update(this); - // handled - return 2; + return BoxStack::COMMAND_HANDLED; } } // allow command to drop through to other views - return 0; + return BoxStack::DROP_THROUGH; } diff --git a/vopts.cc b/vopts.cc index 6a4589f..9890ce1 100644 --- a/vopts.cc +++ b/vopts.cc @@ -286,7 +286,7 @@ int VOpts::handleCommand(int command) if (command == Input::BACK) { doSave(); - return 4; + return BoxStack::DELETE_ME; } else { @@ -294,16 +294,16 @@ int VOpts::handleCommand(int command) if (retval == 1) { BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (retval == 2) { // command was taken and actively ignored - return 2; + return BoxStack::COMMAND_HANDLED; } else { - return 1; // ??? + return BoxStack::ABANDON_COMMAND; } } } diff --git a/vpicturebanner.cc b/vpicturebanner.cc index 0fd2425..cf88c09 100644 --- a/vpicturebanner.cc +++ b/vpicturebanner.cc @@ -91,7 +91,7 @@ void VPictureBanner::draw() int VPictureBanner::handleCommand(int /*command*/) { //don not handle commands - leave this to the picture viewer - return 0; + return BoxStack::DROP_THROUGH; } diff --git a/vquestion.cc b/vquestion.cc index d9f52eb..fb8a3d3 100644 --- a/vquestion.cc +++ b/vquestion.cc @@ -86,18 +86,18 @@ int VQuestion::handleCommand(int command) swap(); draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: { swap(); draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } case Input::OK: { @@ -109,10 +109,10 @@ int VQuestion::handleCommand(int command) m->message = Message::QUESTION_YES; MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } } - return 1; + return BoxStack::ABANDON_COMMAND; } void VQuestion::setDefault(UCHAR option) diff --git a/vradiorec.cc b/vradiorec.cc index 72f2e17..8a6ada0 100644 --- a/vradiorec.cc +++ b/vradiorec.cc @@ -188,13 +188,13 @@ int VRadioRec::handleCommand(int command) { player->play(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::PLAYPAUSE: { player->playpause(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::STOP: @@ -202,43 +202,43 @@ int VRadioRec::handleCommand(int command) case Input::MENU: { if (playing) stopPlay(); - return 4; + return BoxStack::DELETE_ME; } case Input::PAUSE: { player->pause(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { doBar(3); player->skipForward(60); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { doBar(4); player->skipBackward(60); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::YELLOW: { doBar(2); player->skipBackward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BLUE: { doBar(1); player->skipForward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { if (barShowing) removeBar(); else doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::ZERO: player->jumpToPercent(0); doBar(0); return 2; @@ -257,18 +257,18 @@ int VRadioRec::handleCommand(int command) { //player->test1(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GREEN: { //player->test2(); - return 2; + return BoxStack::COMMAND_HANDLED; } #endif } - return 1; + return BoxStack::ABANDON_COMMAND; } void VRadioRec::processMessage(Message* m) diff --git a/vrecmove.cc b/vrecmove.cc index 527dfdd..66e7720 100644 --- a/vrecmove.cc +++ b/vrecmove.cc @@ -114,14 +114,14 @@ int VRecMove::handleCommand(int command) sl.up(); sl.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { sl.down(); sl.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { @@ -131,15 +131,15 @@ int VRecMove::handleCommand(int command) m->parameter = reinterpret_cast(sl.getCurrentOptionData()); // FIXME move to m->data MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VRecMove::processMessage(Message* m) diff --git a/vrecording.cc b/vrecording.cc index e30dcd7..1fdca58 100644 --- a/vrecording.cc +++ b/vrecording.cc @@ -184,8 +184,9 @@ void VRecording::draw() int VRecording::handleCommand(int command) { - if (command==Input::BACK) { - return 4; + if (command==Input::BACK) + { + return BoxStack::DELETE_ME; } if (buttons) { switch(command) @@ -194,14 +195,14 @@ int VRecording::handleCommand(int command) { tabbar.activateFocus(false); moveCursor(LEFT); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { tabbar.activateFocus(false); moveCursor(RIGHT); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::LEFT: case Input::RIGHT: @@ -212,7 +213,7 @@ int VRecording::handleCommand(int command) button[selected].draw(); tabbar.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { @@ -224,7 +225,7 @@ int VRecording::handleCommand(int command) m->to = vRecList; m->message = Message::PLAY_SELECTED_RECORDING; MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } if (selected == RESUME) @@ -234,7 +235,7 @@ int VRecording::handleCommand(int command) m->to = vRecList; m->message = Message::RESUME_SELECTED_RECORDING; MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } if (selected == MARKASNEW) @@ -282,7 +283,7 @@ int VRecording::handleCommand(int command) MessageQueue::getInstance()->postMessage(m2); } - return 2; + return BoxStack::COMMAND_HANDLED; } if (selected == MOVE) @@ -292,7 +293,7 @@ int VRecording::handleCommand(int command) vrm->draw(); BoxStack::getInstance()->add(vrm); BoxStack::getInstance()->update(vrm); - return 2; + return BoxStack::COMMAND_HANDLED; } if (selected == A_DELETE) @@ -318,7 +319,7 @@ int VRecording::handleCommand(int command) v->draw(); BoxStack::getInstance()->add(v); BoxStack::getInstance()->update(v); - return 2; + return BoxStack::COMMAND_HANDLED; } } } @@ -328,7 +329,7 @@ int VRecording::handleCommand(int command) if (retval == 1) { BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (retval == 2) { @@ -342,13 +343,13 @@ int VRecording::handleCommand(int command) tabbar.draw(); BoxStack::getInstance()->update(this); } - return 2; + return BoxStack::COMMAND_HANDLED; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VRecording::moveCursor(Direction direction) diff --git a/vrecordinglist.cc b/vrecordinglist.cc index 7f3c1a4..86a83bb 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -323,7 +323,7 @@ int VRecordingList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { @@ -331,7 +331,7 @@ int VRecordingList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { @@ -339,7 +339,7 @@ int VRecordingList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { @@ -347,11 +347,11 @@ int VRecordingList::handleCommand(int command) quickUpdate(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { - if (sl.getNumOptions() == 0) return 2; + if (sl.getNumOptions() == 0) return BoxStack::COMMAND_HANDLED; // Check to see if it is a sub directory Directory* currentSubDir=getCurrentOptionDirectory(); @@ -365,7 +365,7 @@ int VRecordingList::handleCommand(int command) draw(); boxstack->update(this); } - return 2; + return BoxStack::COMMAND_HANDLED; } @@ -389,10 +389,10 @@ int VRecordingList::handleCommand(int command) boxstack->add(vr); boxstack->update(vr); - return 2; + return BoxStack::COMMAND_HANDLED; } // should not get to here - return 1; + return BoxStack::ABANDON_COMMAND; } case Input::BACK: { @@ -402,29 +402,29 @@ int VRecordingList::handleCommand(int command) sl.clear(); draw(true); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } else { - return 4; + return BoxStack::DELETE_ME; } } case Input::PLAYPAUSE: case Input::PLAY: { - if (doPlay(true)) return 2; - return 1; + if (doPlay(true)) return BoxStack::COMMAND_HANDLED; + return BoxStack::ABANDON_COMMAND; } case Input::LEFT: case Input::RIGHT: case Input::ZERO: { reSort(); - return 2; + return BoxStack::COMMAND_HANDLED; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } bool VRecordingList::load() diff --git a/vrecordingmenu.cc b/vrecordingmenu.cc index 06e108a..73c78a9 100644 --- a/vrecordingmenu.cc +++ b/vrecordingmenu.cc @@ -89,14 +89,14 @@ int VRecordingMenu::handleCommand(int command) sl.up(); sl.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { sl.down(); sl.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { @@ -108,7 +108,7 @@ int VRecordingMenu::handleCommand(int command) m->to = vRecList; m->message = Message::PLAY_SELECTED_RECORDING; MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } if (slCurrentOption == 2) @@ -118,7 +118,7 @@ int VRecordingMenu::handleCommand(int command) m->to = vRecList; m->message = Message::RESUME_SELECTED_RECORDING; MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } if (slCurrentOption == 3) @@ -143,7 +143,7 @@ int VRecordingMenu::handleCommand(int command) BoxStack::getInstance()->add(vi); BoxStack::getInstance()->update(vi); - return 2; + return BoxStack::COMMAND_HANDLED; } if (slCurrentOption == 4) @@ -153,7 +153,7 @@ int VRecordingMenu::handleCommand(int command) vrm->draw(); BoxStack::getInstance()->add(vrm); BoxStack::getInstance()->update(vrm); - return 2; + return BoxStack::COMMAND_HANDLED; } if (slCurrentOption == 5) @@ -179,7 +179,7 @@ int VRecordingMenu::handleCommand(int command) v->draw(); BoxStack::getInstance()->add(v); BoxStack::getInstance()->update(v); - return 2; + return BoxStack::COMMAND_HANDLED; } FALLTHROUGH @@ -187,11 +187,11 @@ int VRecordingMenu::handleCommand(int command) } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VRecordingMenu::processMessage(Message* m) diff --git a/vscreensaver.cc b/vscreensaver.cc index b290b10..471b47c 100644 --- a/vscreensaver.cc +++ b/vscreensaver.cc @@ -23,6 +23,7 @@ #include "defines.h" #include "input.h" +#include "boxstack.h" #include "colour.h" #include "video.h" #include "surface.h" @@ -64,7 +65,7 @@ void VScreensaver::draw() int VScreensaver::handleCommand(int /*command*/) { stopThread(); - return 4; + return BoxStack::DELETE_ME; } void VScreensaver::stopThread() diff --git a/vserverselect.cc b/vserverselect.cc index 1f4175a..26d22b4 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -75,14 +75,14 @@ int VServerSelect::handleCommand(int command) sl.up(); sl.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { sl.down(); sl.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { @@ -91,11 +91,11 @@ int VServerSelect::handleCommand(int command) m->message = Message::SERVER_SELECTED; m->parameter = sl.getCurrentOption(); MessageQueue::getInstance()->postMessage(m); - return 4; + return BoxStack::DELETE_ME; } } - return 1; + return BoxStack::ABANDON_COMMAND; } void VServerSelect::processMessage(Message* m) diff --git a/vteletextview.cc b/vteletextview.cc index 6b297f8..d969228 100644 --- a/vteletextview.cc +++ b/vteletextview.cc @@ -101,14 +101,14 @@ void VTeletextView::draw(bool completedraw, bool onlyfirstline) int VTeletextView::handleCommand(int command) { - if (subtitlemode) return 0; //Ok we are in subtitle mode, we are a slave of the player + if (subtitlemode) return BoxStack::DROP_THROUGH; //Ok we are in subtitle mode, we are a slave of the player switch (command) { case Input::OK: - return 2; + return BoxStack::COMMAND_HANDLED; case Input::BACK: if(player) player->tellSubtitlesOSDVisible(false); // Only on liveTV - return 4; + return BoxStack::DELETE_ME; case Input::ZERO: case Input::ONE: case Input::TWO: @@ -122,11 +122,11 @@ int VTeletextView::handleCommand(int command) { // key in teletext page doKey(command); - return 2; + return BoxStack::COMMAND_HANDLED; } } - return 0; + return BoxStack::DROP_THROUGH; } void VTeletextView::doKey(int command) diff --git a/vtimeredit.cc b/vtimeredit.cc index dbc8fac..291d1b4 100644 --- a/vtimeredit.cc +++ b/vtimeredit.cc @@ -174,13 +174,13 @@ int VTimerEdit::handleCommand(int command) { ViewMan::getInstance()->updateView(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { ViewMan::getInstance()->updateView(this); - return 2; + return BoxStack::COMMAND_HANDLED; } */ case Input::LEFT: @@ -189,7 +189,7 @@ int VTimerEdit::handleCommand(int command) buttonBack.draw(); buttonDelete.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: { @@ -197,12 +197,12 @@ int VTimerEdit::handleCommand(int command) buttonBack.draw(); buttonDelete.draw(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { // Back - if (selectedButton == 0) return 4; + if (selectedButton == 0) return BoxStack::DELETE_ME; // Delete VQuestion* v = new VQuestion(this); v->setSize(260, 180); @@ -220,15 +220,15 @@ int VTimerEdit::handleCommand(int command) v->draw(); BoxStack::getInstance()->add(v); BoxStack::getInstance()->update(v); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VTimerEdit::processMessage(Message* m) diff --git a/vtimerlist.cc b/vtimerlist.cc index e2dbd00..058835c 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -269,34 +269,34 @@ int VTimerList::handleCommand(int command) sl.up(); quickUpdate(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { sl.down(); quickUpdate(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { sl.pageUp(); quickUpdate(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { sl.pageDown(); quickUpdate(); BoxStack::getInstance()->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { RecTimer* recTimer = NULL; if (recTimerList) recTimer = reinterpret_cast(sl.getCurrentOptionData()); - if (recTimer == NULL) return 2; + if (recTimer == NULL) return BoxStack::COMMAND_HANDLED; VTimerEdit* v = new VTimerEdit(recTimer); v->setParent(this); @@ -304,15 +304,15 @@ int VTimerList::handleCommand(int command) BoxStack::getInstance()->add(v); BoxStack::getInstance()->update(v); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: { - return 4; + return BoxStack::DELETE_ME; } } // stop command getting to any more views - return 1; + return BoxStack::ABANDON_COMMAND; } void VTimerList::processMessage(Message* m) diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 4d3f64f..2c0b622 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -315,7 +315,7 @@ int VVideoLiveTV::handleCommand(int command) if (osd.getVisible() && !textUnavailable.getVisible()) { clearScreen(); - return 2; + return BoxStack::COMMAND_HANDLED; } // else drop through to stop } @@ -324,7 +324,7 @@ int VVideoLiveTV::handleCommand(int command) { stop(); vchannelList->highlightChannel((*chanList)[currentChannelIndex]); - return 4; + return BoxStack::DELETE_ME; } // navigate EPG, bring it onscreen if it's not there @@ -339,7 +339,7 @@ int VVideoLiveTV::handleCommand(int command) { doUpDown(false); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { @@ -352,51 +352,51 @@ int VVideoLiveTV::handleCommand(int command) { doUpDown(true); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::LEFT: { doLeftRight(false); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: { doLeftRight(true); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::CHANNELUP: { doChanUpDown(UP); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::CHANNELDOWN: { doChanUpDown(DOWN); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::PREVCHANNEL: { channelChange(PREVIOUS, 0); osdChannelIndex = currentChannelIndex; displayOSD(true); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { doOK(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RED: case Input::MENU: { doSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::FULL: case Input::TV: { toggleChopSides(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::ZERO: @@ -412,13 +412,13 @@ int VVideoLiveTV::handleCommand(int command) { // key in channel number doKey(command); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GREEN: { if (streamType == VDR::VIDEO) doAudioSelector(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::YELLOW: { @@ -426,21 +426,21 @@ int VVideoLiveTV::handleCommand(int command) { doTeletext(); //TODO: Add a selector for subtitles or teletext } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GUIDE: case Input::BLUE: { doEPG(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RECORD: if (streamType == VDR::VIDEO) (static_cast(player))->toggleSubtitles(); - return 2; + return BoxStack::COMMAND_HANDLED; } - return 1; + return BoxStack::ABANDON_COMMAND; } void VVideoLiveTV::go() diff --git a/vvideomedia.cc b/vvideomedia.cc index fd580ac..c2aa626 100644 --- a/vvideomedia.cc +++ b/vvideomedia.cc @@ -203,7 +203,7 @@ int VVideoMedia::handleCommand(int command) { player->play(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: @@ -211,7 +211,7 @@ int VVideoMedia::handleCommand(int command) if (vsummary) { removeSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } } // DROP THROUGH case Input::STOP: @@ -219,78 +219,78 @@ int VVideoMedia::handleCommand(int command) { if (playing) stopPlay(); - return 4; + return BoxStack::DELETE_ME; } case Input::PAUSE: { player->pause(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { doBar(3); player->skipForward(60); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { doBar(4); player->skipBackward(60); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::FORWARD: { player->fastForward(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::REVERSE: { player->fastBackward(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RED: { if (vsummary) removeSummary(); else doSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GREEN: { doAudioSelector(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::YELLOW: { doBar(2); player->skipBackward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BLUE: { doBar(1); player->skipForward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::STAR: { doBar(2); player->skipBackward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::HASH: { doBar(1); player->skipForward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::FULL: case Input::TV: { toggleChopSides(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: @@ -298,7 +298,7 @@ int VVideoMedia::handleCommand(int command) if (vsummary) { removeSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } if (barShowing) removeBar(); @@ -306,7 +306,7 @@ int VVideoMedia::handleCommand(int command) doBar(0); barGenHold=true; } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::ZERO: player->jumpToPercent(0); doBar(0); return 2; @@ -323,7 +323,7 @@ int VVideoMedia::handleCommand(int command) } - return 1; + return BoxStack::ABANDON_COMMAND; } void VVideoMedia::processMessage(Message* m) diff --git a/vvideorec.cc b/vvideorec.cc index a626d28..844e41f 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -223,14 +223,14 @@ int VVideoRec::handleCommand(int command) { player->play(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::PLAYPAUSE: { player->playpause(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BACK: @@ -238,7 +238,7 @@ int VVideoRec::handleCommand(int command) if (vsummary) { removeSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } } FALLTHROUGH @@ -247,51 +247,51 @@ int VVideoRec::handleCommand(int command) { if (playing) stopPlay(); - return 4; + return BoxStack::DELETE_ME; } case Input::DOWN: case Input::PAUSE: { player->pause(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPFORWARD: { doBar(3); player->skipForward(60); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SKIPBACK: { doBar(4); player->skipBackward(60); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RIGHT: case Input::FORWARD: { player->fastForward(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::LEFT: case Input::REVERSE: { player->fastBackward(); doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::RED: { if (vsummary) removeSummary(); else doSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::GREEN: { doAudioSelector(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::YELLOW: { @@ -315,7 +315,7 @@ int VVideoRec::handleCommand(int command) doBar(2); player->skipBackward(10); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::BLUE: { @@ -339,30 +339,30 @@ int VVideoRec::handleCommand(int command) doBar(1); player->skipForward(10); } - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::PREVCHANNEL: { player->skipBackward(2); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::STAR: { doBar(2); player->skipBackward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::HASH: { doBar(1); player->skipForward(10); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::FULL: case Input::TV: { toggleChopSides(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: @@ -370,12 +370,12 @@ int VVideoRec::handleCommand(int command) if (vsummary) { removeSummary(); - return 2; + return BoxStack::COMMAND_HANDLED; } if (barShowing) removeBar(); else doBar(0); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::ZERO: player->jumpToPercent(0); doBar(0); return 2; @@ -389,7 +389,7 @@ int VVideoRec::handleCommand(int command) case Input::EIGHT: player->jumpToPercent(80); doBar(0); return 2; case Input::NINE: player->jumpToPercent(90); doBar(0); return 2; - case Input::RECORD: player->toggleSubtitles(); return 2; + case Input::RECORD: player->toggleSubtitles(); return BoxStack::COMMAND_HANDLED; #ifdef DEV // case Input::RED: // { @@ -408,14 +408,14 @@ int VVideoRec::handleCommand(int command) BoxStack::getInstance()->update(vepg); */ -// return 2; +// return BoxStack::COMMAND_HANDLED; // } #endif } - return 1; + return BoxStack::ABANDON_COMMAND; } void VVideoRec::doTeletext() diff --git a/vvolume.cc b/vvolume.cc index dd6941d..6409509 100644 --- a/vvolume.cc +++ b/vvolume.cc @@ -100,7 +100,7 @@ int VVolume::handleCommand(int command) draw(); BoxStack::getInstance()->update(this); // handled - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::VOLUMEUP: { @@ -108,10 +108,10 @@ int VVolume::handleCommand(int command) draw(); BoxStack::getInstance()->update(this); // handled - return 2; + return BoxStack::COMMAND_HANDLED; } } // allow command to drop through to other views - return 0; + return BoxStack::DROP_THROUGH; } diff --git a/vwelcome.cc b/vwelcome.cc index a3bace7..e80349b 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -192,51 +192,51 @@ int VWelcome::handleCommand(int command) sl.up(); sl.draw(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::DOWN: { sl.down(); sl.draw(); boxstack->update(this); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::ONE: { doChannelsList(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::TWO: { doRadioList(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::THREE: { doRecordingsList(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::FOUR: { doTimersList(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::FIVE: { #ifdef VOMP_PLATTFORM_MVP doMediaList(); #endif - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SIX: { doOptions(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::SEVEN: { Control::getInstance()->doReboot(); - return 2; + return BoxStack::COMMAND_HANDLED; } case Input::OK: { @@ -244,39 +244,39 @@ int VWelcome::handleCommand(int command) if (option == 1) { doChannelsList(); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (option == 2) { doRadioList(); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (option == 3) { doRecordingsList(); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (option == 4) { doTimersList(); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (option == 5) { doMediaList(); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (option == 6) { doOptions(); - return 2; + return BoxStack::COMMAND_HANDLED; } else if (option == 7) { Control::getInstance()->doReboot(); - return 2; + return BoxStack::COMMAND_HANDLED; } - return 2; // never gets here + return BoxStack::COMMAND_HANDLED; // never gets here } //#ifdef DEV case Input::NINE: @@ -286,18 +286,18 @@ int VWelcome::handleCommand(int command) vscreensaver->draw(); // boxstack->update(vscreensaver); - return 2; + return BoxStack::COMMAND_HANDLED; } //#endif // Test // case Input::BACK: // { -// return 4; +// return BoxStack::DELETE_ME; // } } - return 1; + return BoxStack::ABANDON_COMMAND; } void VWelcome::doChannelsList() -- 2.39.5