From 9edab68c34624c31ff4caa942c5f0f4af06d7d3c Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Thu, 6 Feb 2020 15:22:37 +0000 Subject: [PATCH] Rename Remote class to Input, RemoteLinux to InputLinux --- audioplayer.h | 2 +- boxstack.cc | 4 +- command.cc | 72 ++++----- command.h | 4 +- defines.h | 2 +- remote.cc => input.cc | 145 ++++-------------- remote.h => input.h | 24 ++- remotelinux.cc => inputlinux.cc | 264 ++++++++++---------------------- remotelinux.h => inputlinux.h | 12 +- main.cc | 4 +- objects.mk | 4 +- player.cc | 2 +- playerliveradio.cc | 2 +- playerlivetv.cc | 2 +- playermedia.h | 2 +- playerradio.cc | 2 +- remotelirc.h | 2 +- remotewin.h | 2 +- vaudioselector.cc | 30 ++-- vchannellist.cc | 44 +++--- vchannelselect.cc | 24 +-- vcolourtuner.cc | 28 ++-- vepg.cc | 64 ++++---- vepglistadvanced.cc | 38 ++--- vepgsettimer.cc | 20 +-- vepgsummary.cc | 10 +- videoomx.cc | 12 +- vinfo.cc | 8 +- vmedialist.cc | 40 ++--- vmediaview.cc | 92 +++++------ vmute.cc | 4 +- vopts.cc | 16 +- vpicturebanner.cc | 8 +- vquestion.cc | 20 +-- vradiorec.cc | 52 +++---- vrecmove.cc | 18 +-- vrecording.cc | 30 ++-- vrecordinglist.cc | 32 ++-- vrecordinglistadvanced.cc | 2 +- vrecordinglistclassic.cc | 2 +- vrecordingmenu.cc | 18 +-- vscreensaver.cc | 2 +- vserverselect.cc | 14 +- vsleeptimer.cc | 4 +- vteletextview.cc | 26 ++-- vtimeredit.cc | 24 +-- vtimerlist.cc | 22 +-- vvideolivetv.cc | 80 +++++----- vvideomedia.cc | 62 ++++---- vvideorec.cc | 80 +++++----- vvolume.cc | 10 +- vwelcome.cc | 32 ++-- winmain.cc | 2 +- woptionpane.cc | 20 +-- wpictureview.cc | 18 +-- wremoteconfig.cc | 30 ++-- wremoteconfig.h | 4 +- wtabbar.cc | 18 +-- wtextbox.cc | 18 +-- wwinaudiofilter.cc | 24 +-- wwinmp3audiofilter.cc | 24 +-- wwinvideofilter.cc | 24 +-- wwinvideoh264filter.cc | 24 +-- 63 files changed, 769 insertions(+), 956 deletions(-) rename remote.cc => input.cc (72%) rename remote.h => input.h (93%) rename remotelinux.cc => inputlinux.cc (78%) rename remotelinux.h => inputlinux.h (95%) diff --git a/audioplayer.h b/audioplayer.h index 86aa712..08af3d9 100644 --- a/audioplayer.h +++ b/audioplayer.h @@ -29,7 +29,7 @@ #include #include "audio.h" -#include "remote.h" +#include "input.h" #include "vdr.h" #include "callback.h" #include "message.h" diff --git a/boxstack.cc b/boxstack.cc index 69345a0..5ba9cc8 100644 --- a/boxstack.cc +++ b/boxstack.cc @@ -21,7 +21,7 @@ #include "command.h" #include "messagequeue.h" -#include "remote.h" +#include "input.h" #include "log.h" BoxStack* BoxStack::instance = NULL; @@ -513,7 +513,7 @@ int BoxStack::handleCommand(int command) int retVal2 = 0; int i; - if (command != Remote::NA_NONE) + if (command != Input::NA_NONE) { // handle command return values // 0 - drop through to next box diff --git a/command.cc b/command.cc index ac05cc8..edf0974 100644 --- a/command.cc +++ b/command.cc @@ -43,7 +43,7 @@ #include "wol.h" #include "vconnect.h" #include "message.h" -#include "remote.h" +#include "input.h" #include "vinfo.h" #include "boxx.h" #include "boxstack.h" @@ -80,7 +80,7 @@ int Command::init(bool tcrashed, char* tServer) logger = Log::getInstance(); boxstack = BoxStack::getInstance(); - remote = Remote::getInstance(); + remote = Input::getInstance(); remote->InitHWCListwithDefaults(); @@ -192,7 +192,7 @@ void Command::run() // Start method 2 of getting commands in... udp.run(this); - // FIXME Remote::NA_SIGNAL is possibly obsolete now + // FIXME Input::NA_SIGNAL is possibly obsolete now std::unique_lock lockWrapper(messageQueueMutex); // locks. unlocks on out-of-scope @@ -246,7 +246,7 @@ void Command::processMessage(Message* m) // << FIXME OBSELETE case Message::STOP_PLAYBACK: { - handleCommand(Remote::STOP); // an odd way of doing it, but so simple + handleCommand(Input::STOP); // an odd way of doing it, but so simple break; } // Also connection_lost comes from player - anywhere else? @@ -342,9 +342,9 @@ void Command::processMessage(Message* m) void Command::handleCommand(int button) { - if (isStandby && (button != Remote::POWER) - && (button != Remote::POWERON) - && (button != Remote::POWEROFF)) return; + if (isStandby && (button != Input::POWER) + && (button != Input::POWERON) + && (button != Input::POWEROFF)) return; if (!connLost && boxstack->handleCommand(button)) return; // don't send to boxstack if connLost @@ -352,14 +352,14 @@ void Command::handleCommand(int button) switch(button) { - case Remote::DF_LEFT: - case Remote::DF_RIGHT: - case Remote::VOLUMEUP: - case Remote::VOLUMEDOWN: + case Input::DF_LEFT: + case Input::DF_RIGHT: + case Input::VOLUMEUP: + case Input::VOLUMEDOWN: { if (remote->handlesVolume()) { - if (button==Remote::DF_LEFT || button==Remote::VOLUMEDOWN) + if (button==Input::DF_LEFT || button==Input::VOLUMEDOWN) remote->volumeDown(); else remote->volumeUp(); @@ -372,7 +372,7 @@ void Command::handleCommand(int button) } return; } - case Remote::MUTE: + case Input::MUTE: { if (remote->handlesVolume()) { @@ -387,29 +387,29 @@ void Command::handleCommand(int button) } return; } - case Remote::POWER: + case Input::POWER: { doStandby(); return; } - case Remote::POWERON: + case Input::POWERON: { doPowerOn(); return; } - case Remote::POWEROFF: + case Input::POWEROFF: { doPowerOff(); return; } - case Remote::OK: + case Input::OK: { // FIXME - if (!connLost) return; // if connLost, handle Remote::OK + if (!connLost) return; // if connLost, handle Input::OK doFromTheTop(false); return; } - case Remote::GO: + case Input::GO: { VSleeptimer* sleep = new VSleeptimer(); boxstack->add(sleep); @@ -448,7 +448,7 @@ void Command::doPowerOn() { Video::getInstance()->signalOn(); Led::getInstance()->on(); - Remote::getInstance()->changePowerState(true); + Input::getInstance()->changePowerState(true); isStandby = false; VConnect* vconnect = new VConnect(server); @@ -470,7 +470,7 @@ void Command::doPowerOff() logger->unsetExternLogger(); VDR::getInstance()->disconnect(); Led::getInstance()->off(); - Remote::getInstance()->changePowerState(false); + Input::getInstance()->changePowerState(false); isStandby = true; Sleeptimer::getInstance()->shutdown(); #ifdef WIN32 @@ -545,7 +545,7 @@ void Command::doReboot() Osd::getInstance()->shutdown(); Audio::getInstance()->shutdown(); Video::getInstance()->shutdown(); - Remote::getInstance()->shutdown(); + Input::getInstance()->shutdown(); reboot(LINUX_REBOOT_CMD_RESTART); // if reboot is not allowed -> stop @@ -905,19 +905,19 @@ void Command::doJustConnected(VConnect* vconnect) if (!STRCASECMP(config, "New")) { logger->log("Command", Log::INFO, "Switching to New remote type"); - remote->setRemoteType(Remote::NEWREMOTE); + remote->setRemoteType(Input::NEWREMOTE); } else { logger->log("Command", Log::INFO, "Switching to Old remote type"); - remote->setRemoteType(Remote::OLDREMOTE); + remote->setRemoteType(Input::OLDREMOTE); } delete[] config; } else { logger->log("Command", Log::INFO, "Config General/Remote type not found"); - remote->setRemoteType(Remote::OLDREMOTE); + remote->setRemoteType(Input::OLDREMOTE); } @@ -1070,16 +1070,16 @@ void Command::doJustConnected(VConnect* vconnect) boxstack->update(vw); // Enter pre-keys here -// handleCommand(Remote::OK); -// handleCommand(Remote::THREE); -// handleCommand(Remote::SIX); -// handleCommand(Remote::OK); -// handleCommand(Remote::UP); -// handleCommand(Remote::PLAY); -// handleCommand(Remote::DOWN); -// handleCommand(Remote::DOWN); -// handleCommand(Remote::DOWN); - // handleCommand(Remote::OK); -// handleCommand(Remote::RED); +// handleCommand(Input::OK); +// handleCommand(Input::THREE); +// handleCommand(Input::SIX); +// handleCommand(Input::OK); +// handleCommand(Input::UP); +// handleCommand(Input::PLAY); +// handleCommand(Input::DOWN); +// handleCommand(Input::DOWN); +// handleCommand(Input::DOWN); + // handleCommand(Input::OK); +// handleCommand(Input::RED); } } diff --git a/command.h b/command.h index bc42923..6ac4c50 100644 --- a/command.h +++ b/command.h @@ -40,7 +40,7 @@ class VConnect; class Message; -class Remote; +class Input; class Boxx; class BoxStack; class Log; @@ -93,7 +93,7 @@ class Command : public MessageQueue Log* logger; BoxStack* boxstack; - Remote* remote; + Input* remote; bool initted{}; bool irun{}; diff --git a/defines.h b/defines.h index a7b158e..720d2af 100644 --- a/defines.h +++ b/defines.h @@ -107,7 +107,7 @@ 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 Remote_TYPE InputLinux // Generic Remote under Linux (Konsole!, not X) will support in the end: #define RemoteStartDev ""//No devices passed // Keyboard diff --git a/remote.cc b/input.cc similarity index 72% rename from remote.cc rename to input.cc index 1d0041e..0e0e947 100644 --- a/remote.cc +++ b/input.cc @@ -1,5 +1,5 @@ /* - Copyright 2004-2005 Chris Tallon + Copyright 2004-2020 Chris Tallon This file is part of VOMP. @@ -14,97 +14,19 @@ 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 . */ -#include "remote.h" #include "wremoteconfig.h" #include "i18n.h" #include "log.h" #include "vdr.h" #include "wtabbar.h" +#include "input.h" -Remote* Remote::instance = NULL; - -#ifndef _MSC_VER - -const ULONG Remote::NOLEARNMODE; -// Not buttons -const UCHAR Remote::NA_LEARN; -const UCHAR Remote::NA_NONE; -const UCHAR Remote::NA_UNKNOWN; -const UCHAR Remote::NA_SIGNAL; -const UCHAR Remote::DF_UP; -const UCHAR Remote::DF_DOWN; -const UCHAR Remote::DF_LEFT; -const UCHAR Remote::DF_RIGHT; - -// Problem common buttons -const UCHAR Remote::VOLUMEUP; -const UCHAR Remote::VOLUMEDOWN; -const UCHAR Remote::CHANNELUP; -const UCHAR Remote::CHANNELDOWN; - -// Common buttons -const UCHAR Remote::ZERO; -const UCHAR Remote::ONE; -const UCHAR Remote::TWO; -const UCHAR Remote::THREE; -const UCHAR Remote::FOUR; -const UCHAR Remote::FIVE; -const UCHAR Remote::SIX; -const UCHAR Remote::SEVEN; -const UCHAR Remote::EIGHT; -const UCHAR Remote::NINE; -const UCHAR Remote::POWER; -const UCHAR Remote::GO; -const UCHAR Remote::BACK; -const UCHAR Remote::MENU; -const UCHAR Remote::RED; -const UCHAR Remote::GREEN; -const UCHAR Remote::YELLOW; -const UCHAR Remote::BLUE; -const UCHAR Remote::MUTE; -const UCHAR Remote::RADIO; -const UCHAR Remote::REVERSE; -const UCHAR Remote::PLAY; -const UCHAR Remote::FORWARD; -const UCHAR Remote::RECORD; -const UCHAR Remote::STOP; -const UCHAR Remote::PAUSE; -const UCHAR Remote::SKIPBACK; -const UCHAR Remote::SKIPFORWARD; -const UCHAR Remote::OK; - -// Old remote only -const UCHAR Remote::FULL; - -// New remote only -const UCHAR Remote::TV; -const UCHAR Remote::VIDEOS; -const UCHAR Remote::MUSIC; -const UCHAR Remote::PICTURES; -const UCHAR Remote::GUIDE; -const UCHAR Remote::UP; -const UCHAR Remote::DOWN; -const UCHAR Remote::LEFT; -const UCHAR Remote::RIGHT; -const UCHAR Remote::PREVCHANNEL; -const UCHAR Remote::STAR; -const UCHAR Remote::HASH; - -// Android only -const UCHAR Remote::PLAYPAUSE; - - -// Remote types -const UCHAR Remote::OLDREMOTE; -const UCHAR Remote::NEWREMOTE; - -#endif - -Remote::Remote() +Input* Input::instance = NULL; + +Input::Input() { if (instance) return; instance = this; @@ -112,35 +34,35 @@ Remote::Remote() learnmode = NOLEARNMODE; } -Remote::~Remote() +Input::~Input() { instance = NULL; } -Remote* Remote::getInstance() +Input* Input::getInstance() { return instance; } -void Remote::setRemoteType(UCHAR newType) +void Input::setRemoteType(UCHAR newType) { if ((newType != OLDREMOTE) && (newType != NEWREMOTE)) return; remoteType = newType; } -void Remote::EnterLearningMode(UCHAR command) +void Input::EnterLearningMode(UCHAR command) { learnmode = command; //Armed } -void Remote::ResetToDefault() +void Input::ResetToDefault() { translist.clear(); InitHWCListwithDefaults(); } -UCHAR Remote::TranslateHWCFixed(ULLONG code) +UCHAR Input::TranslateHWCFixed(ULLONG code) { switch (code) { @@ -171,7 +93,7 @@ UCHAR Remote::TranslateHWCFixed(ULLONG code) } } -const char*Remote::HardcodedTranslateStr(UCHAR command) +const char* Input::HardcodedTranslateStr(UCHAR command) { switch (command) { @@ -194,7 +116,7 @@ const char*Remote::HardcodedTranslateStr(UCHAR command) } } -UCHAR Remote::TranslateHWCList(ULLONG code) +UCHAR Input::TranslateHWCList(ULLONG code) { if (learnmode != NOLEARNMODE) { @@ -213,7 +135,7 @@ UCHAR Remote::TranslateHWCList(ULLONG code) } } -UCHAR Remote::TranslateHWC(ULLONG code) +UCHAR Input::TranslateHWC(ULLONG code) { UCHAR ret = TranslateHWCFixed(code); if (ret == NA_UNKNOWN) @@ -232,21 +154,21 @@ UCHAR Remote::TranslateHWC(ULLONG code) return ret; } -void Remote::setHWCtoCommand(ULLONG hcw, UCHAR command) +void Input::setHWCtoCommand(ULLONG hcw, UCHAR command) { translist[hcw] = command; } -void Remote::unsetHWC(ULLONG hcw) +void Input::unsetHWC(ULLONG hcw) { translist.erase(hcw); } -void Remote::LoadKeysConfig(VDR *vdr,const char *cfg) +void Input::LoadKeysConfig(VDR *vdr,const char *cfg) { ULONG number=0; if (sscanf(cfg,"%ld",&number) != 1) return; - Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys num keys %d",number); + Log::getInstance()->log("Input", Log::INFO, "Config General/Remote keys num keys %d",number); char keybuf[1024]; for (ULONG i = 0; i < number; i++) { sprintf(keybuf, "RemoteKey%lu", i); @@ -263,7 +185,7 @@ void Remote::LoadKeysConfig(VDR *vdr,const char *cfg) } } -void Remote::SaveKeysConfig() +void Input::SaveKeysConfig() { int number=0; char buffer[1024]; @@ -282,7 +204,7 @@ void Remote::SaveKeysConfig() } -void Remote::InitHWCListwithDefaults() +void Input::InitHWCListwithDefaults() { translist[VOLUMEUP] = VOLUMEUP; translist[VOLUMEDOWN] = VOLUMEDOWN; @@ -332,7 +254,7 @@ void Remote::InitHWCListwithDefaults() translist[HASH] = HASH; } -const char *Remote::CommandDesc(UCHAR number) +const char* Input::CommandDesc(UCHAR number) { switch (number) { @@ -437,7 +359,7 @@ const char *Remote::CommandDesc(UCHAR number) } } -char* Remote::HCWDesc(ULLONG hcw) +char* Input::HCWDesc(ULLONG hcw) { char *dest,*temp; temp=(char*)CommandDesc((UCHAR)hcw); @@ -454,7 +376,7 @@ char* Remote::HCWDesc(ULLONG hcw) return dest; } -char *Remote::CommandTranslateStr(UCHAR command) +char* Input::CommandTranslateStr(UCHAR command) { char *desc; int length=5;//:+\t+0 @@ -509,14 +431,14 @@ char *Remote::CommandTranslateStr(UCHAR command) return desc; } -bool Remote::addOptionPagesToWTB(WTabBar *wtb) +bool Input::addOptionPagesToWTB(WTabBar *wtb) { WRemoteConfig* wrc = new WRemoteConfig(); wtb->addTab(tr("Remote Control"), wrc); return true; } -bool Remote::loadOptionsfromServer(VDR* vdr) +bool Input::loadOptionsfromServer(VDR* vdr) { // Set remote keys char * config; @@ -524,30 +446,27 @@ bool Remote::loadOptionsfromServer(VDR* vdr) if (config) { - Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys load"); + Log::getInstance()->log("Input", Log::INFO, "Config General/Remote keys load"); LoadKeysConfig(vdr,config); delete[] config; } else { - Log::getInstance()->log("Remote", Log::INFO, "Config General/Remote keys not found"); + Log::getInstance()->log("Input", Log::INFO, "Config General/Remote keys not found"); InitHWCListwithDefaults(); } return true; } -bool Remote::saveOptionstoServer() +bool Input::saveOptionstoServer() { SaveKeysConfig(); return true; } - - - -bool Remote::start() +bool Input::start() { - Log::getInstance()->log("Remote", Log::INFO, "start called"); + Log::getInstance()->log("Input", Log::INFO, "start called"); threadStartProtect.lock(); listenThread = std::thread( [this ] @@ -562,7 +481,7 @@ bool Remote::start() return true; } -void Remote::stop() +void Input::stop() { listenLoopStop = true; informStopEventLoop(); diff --git a/remote.h b/input.h similarity index 93% rename from remote.h rename to input.h index 2308ba6..169129a 100644 --- a/remote.h +++ b/input.h @@ -1,5 +1,5 @@ /* - Copyright 2004-2005 Chris Tallon + Copyright 2004-2020 Chris Tallon This file is part of VOMP. @@ -17,8 +17,8 @@ along with VOMP. If not, see . */ -#ifndef REMOTE_H -#define REMOTE_H +#ifndef INPUT_H +#define INPUT_H #include #include @@ -31,12 +31,12 @@ typedef std::map RemoteTranslationList; -class Remote: public AbstractOption +class Input: public AbstractOption { public: - Remote(); - virtual ~Remote(); - static Remote* getInstance(); + Input(); + virtual ~Input(); + static Input* getInstance(); bool start(); void stop(); @@ -139,10 +139,10 @@ class Remote: public AbstractOption const static UCHAR HASH = 14; // Android only - const static UCHAR PLAYPAUSE = 201; + const static UCHAR PLAYPAUSE = 201; // cec only - const static UCHAR POWERON = 202; - const static UCHAR POWEROFF = 203; + const static UCHAR POWERON = 202; + const static UCHAR POWEROFF = 203; // Remote types @@ -154,13 +154,11 @@ class Remote: public AbstractOption UCHAR TranslateHWCList(ULLONG code); UCHAR TranslateHWC(ULLONG code); - + static Input* instance; ULONG learnmode; - static Remote* instance; UCHAR remoteType; RemoteTranslationList translist; - std::thread listenThread; std::mutex threadStartProtect; diff --git a/remotelinux.cc b/inputlinux.cc similarity index 78% rename from remotelinux.cc rename to inputlinux.cc index 6367355..8adc479 100644 --- a/remotelinux.cc +++ b/inputlinux.cc @@ -41,7 +41,7 @@ using namespace CEC; #include "messagequeue.h" #include "command.h" // FIXME - get rid after predefined message targets -#include "remotelinux.h" +#include "inputlinux.h" #define W_G_HCW(type,code) ((static_cast(type) << 32) | code) @@ -50,11 +50,11 @@ using namespace CEC; #define W_HCW_LIRC 3 /* remote control LIRC*/ -RemoteLinux::RemoteLinux() +InputLinux::InputLinux() { } -RemoteLinux::~RemoteLinux() +InputLinux::~InputLinux() { for (unsigned int i = 0; i < devices.size(); i++) { @@ -64,7 +64,7 @@ RemoteLinux::~RemoteLinux() #define test_bit(input,b) ((1 << ((b) % 8))&(input)[b / 8] ) -int RemoteLinux::init(const char*) +int InputLinux::init(const char*) { if (initted) return 0; initted = 1; @@ -79,26 +79,26 @@ int RemoteLinux::init(const char*) struct stat test_buf; if (stat(buffer, &test_buf) == 0) { - Log::getInstance()->log("Remote", Log::NOTICE, "Probe /dev/input/event%d", eventid); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Probe /dev/input/event%d", eventid); // file exists unsigned long ev_type = 0; int new_fd = open(buffer, O_RDONLY); if (new_fd < 0) { - Log::getInstance()->log("Remote", Log::NOTICE, "Can not open /dev/input/event%d", eventid); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Can not open /dev/input/event%d", eventid); continue; } if (ioctl(new_fd, EVIOCGBIT(0, EV_MAX), &ev_type) < 0) { - Log::getInstance()->log("Remote", Log::NOTICE, "Ioctl failed /dev/input/event%d %d", eventid, errno); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Ioctl failed /dev/input/event%d %d", eventid, errno); close(new_fd); } //Now test if it generates keyboard presses if (test_bit(reinterpret_cast(&ev_type), EV_KEY)) { - Log::getInstance()->log("Remote", Log::NOTICE, "Add /dev/input/event%d to List", eventid); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Add /dev/input/event%d to List", eventid); devices.push_back(new_fd); // Grab the device - make it exclusive to vomp. Fixes rubbish input going to console in background @@ -113,11 +113,11 @@ int RemoteLinux::init(const char*) return initCec(); } -int RemoteLinux::initCec() { +int InputLinux::initCec() { // bcm_host_init(); //may be move to custom hardware init? // now init cec - Log::getInstance()->log("Remote", Log::NOTICE, "Init LibCEC"); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Init LibCEC"); cec_config.Clear(); cec_callbacks.Clear(); #if CEC_LIB_VERSION_MAJOR >= 4 @@ -148,7 +148,7 @@ int RemoteLinux::initCec() { cec_adap = LibCecInitialise(&cec_config); if (!cec_adap) { - Log::getInstance()->log("Remote", Log::ERR, "Init LibCEC failed"); + Log::getInstance()->log("InputLinux", Log::ERR, "Init LibCEC failed"); return 1; } cec_adap->InitVideoStandalone(); @@ -162,12 +162,12 @@ int RemoteLinux::initCec() { int adap_num=cec_adap->FindAdapters(cec_devices,10,NULL); #endif if (adap_num<0) { - Log::getInstance()->log("Remote", Log::ERR, "CEC:Failed to find adapter"); + Log::getInstance()->log("InputLinux", Log::ERR, "CEC:Failed to find adapter"); return 1; } if (adap_num==0) { - Log::getInstance()->log("Remote", Log::NOTICE, "CEC: No adapter found"); + Log::getInstance()->log("InputLinux", Log::NOTICE, "CEC: No adapter found"); return 1; } @@ -176,12 +176,12 @@ int RemoteLinux::initCec() { #else if (!cec_adap->Open(cec_devices[0].comm)) { #endif - Log::getInstance()->log("Remote", Log::ERR, "CEC:Failed to open adapter"); + Log::getInstance()->log("InputLinux", Log::ERR, "CEC:Failed to open adapter"); return 1; } if (!cec_adap->SetActiveSource(cec_config.deviceTypes[0])) { - Log::getInstance()->log("Remote", Log::ERR, "CEC:Failed set active source"); + Log::getInstance()->log("InputLinux", Log::ERR, "CEC:Failed set active source"); return 1; } @@ -191,7 +191,7 @@ int RemoteLinux::initCec() { return 1; } -int RemoteLinux::shutdown() +int InputLinux::shutdown() { if (!initted) return 0; @@ -208,125 +208,21 @@ int RemoteLinux::shutdown() return 1; } -void RemoteLinux::deinitCec() +void InputLinux::deinitCec() { if (cec_adap) { - Log::getInstance()->log("Remote", Log::NOTICE, "Shutdown libcec begin"); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Shutdown libcec begin"); cec_adap->SetInactiveView(); cec_adap->Close(); vc_cec_register_callback(NULL, NULL);//deactivate callback! UnloadLibCec(cec_adap); cec_adap = NULL; - Log::getInstance()->log("Remote", Log::NOTICE, "Shutdown libcec end"); + Log::getInstance()->log("InputLinux", Log::NOTICE, "Shutdown libcec end"); } } -/* -UCHAR RemoteLinux::getButtonPress(int waitType) { - / * how = 0 - block - how = 1 - start new wait - how = 2 - continue wait - how = 3 - no wait - * / - - //in units of 40 ms - Log::getInstance()->log("Remote", Log::NOTICE, "get button press"); - - int retval; - fd_set readfds; - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = 40000; - if (waitType == 0) { - num_loop = -1; - } else if (waitType == 1) { - - num_loop = 25; - } else if (waitType == 2) { - if (num_loop<=0) num_loop = 25; - } else if (waitType == 3) { - tv.tv_sec = 0; - tv.tv_usec = 0; - num_loop = 0; - } - - - int ret = 0; - while (num_loop!=0) { - ret = NA_UNKNOWN; - FD_ZERO(&readfds); - - int maxfd = 0; - for (unsigned int i = 0; i < devices.size(); i++) { - int cur_fd = devices[i]; - maxfd = max(cur_fd, maxfd); - FD_SET(cur_fd, &readfds); - } - - FD_SET(pfds[0], &readfds); - maxfd = max(pfds[0], maxfd); - - retval = select(maxfd + 1, &readfds, NULL, NULL, &tv); - tv.tv_sec = 0; - tv.tv_usec = 40000; - // 0 = nothing happened - // 1 = data arrived (actually num of descriptors that changed) - // other value = signal or error - if (retval == 0) { - if (hascurcec) { - hascurcec = false; - return (UCHAR) TranslateHWC(W_G_HCW(W_HCW_CEC,curcec)); - } - if (haspower) { - haspower =false; - return powerkey; - } - ret = NA_NONE; - } else { - if (retval == -1) { - Log::getInstance()->log("Remote", Log::NOTICE, "na_signal"); - return NA_SIGNAL; - } - - if (FD_ISSET(pfds[0], &readfds)) - { - // quit signal - Log::getInstance()->log("Remote", Log::NOTICE, "pfds quit"); - return NA_SIGNAL; // use NA_SIGNAL for now - } - - for (unsigned int i = 0; i < devices.size(); i++) { - int cur_fd = devices[i]; - if (FD_ISSET(cur_fd, &readfds)) { - struct input_event ev; - int count = read(cur_fd, &ev, sizeof(ev)); - if (count == sizeof(ev)) { - if (ev.type == EV_KEY && ev.value == 1) { - UCHAR retty=(UCHAR) TranslateHWC( - W_G_HCW(W_HCW_KC,ev.code)); - return retty; - } - } - - } - - } - - } - //Log::getInstance()->log("Remote", Log::NOTICE, "numloop: %d %d",num_loop,retval); - if (num_loop > 0) - num_loop--; - } - if (ret != 0) - return ret; - - return NA_UNKNOWN; - -} -*/ -UCHAR RemoteLinux::TranslateHWCFixed(ULLONG code) +UCHAR InputLinux::TranslateHWCFixed(ULLONG code) { switch (code) { @@ -379,7 +275,7 @@ UCHAR RemoteLinux::TranslateHWCFixed(ULLONG code) }; } -const char*RemoteLinux::HardcodedTranslateStr(UCHAR command) +const char* InputLinux::HardcodedTranslateStr(UCHAR command) { switch (command) { @@ -403,7 +299,7 @@ const char*RemoteLinux::HardcodedTranslateStr(UCHAR command) } -void RemoteLinux::InitHWCListwithDefaults() +void InputLinux::InitHWCListwithDefaults() { // Processing VK_Messages translist[W_G_HCW(W_HCW_KC,KEY_9)] = NINE; @@ -530,7 +426,7 @@ void RemoteLinux::InitHWCListwithDefaults() static const char * linux_keymap[KEY_MAX+1]; static const char * cec_keymap[CEC_USER_CONTROL_CODE_MAX+1]; -void RemoteLinux::InitKeymap() +void InputLinux::InitKeymap() { for (int i=0;i(hcw >> 32); @@ -907,18 +803,18 @@ char* RemoteLinux::HCWDesc(unsigned long long hcw) return rt; } -void RemoteLinux::changePowerState(bool poweron) +void InputLinux::changePowerState(bool poweron) { if (cec_adap) { if (poweron) { - //Log::getInstance()->log("Remote", Log::DEBUG, "CEC set active source"); + //Log::getInstance()->log("InputLinux", Log::DEBUG, "CEC set active source"); cec_adap->SetActiveSource(cec_config.deviceTypes[0]); } else { - //Log::getInstance()->log("Remote", Log::DEBUG, "CEC set inactive view"); + //Log::getInstance()->log("InputLinux", Log::DEBUG, "CEC set inactive view"); cec_adap->SetInactiveView(); } } @@ -929,30 +825,30 @@ void RemoteLinux::changePowerState(bool poweron) // libcec4 API changed these params to pointers rather than copies, and the returns to void // Otherwise, these two blocks of code are the same -void RemoteLinux::cecLogMessage(void* /* param */, const cec_log_message* message) +void InputLinux::cecLogMessage(void* /* param */, const cec_log_message* message) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECLOG: %lld %d %s", message->time, message->level, message->message); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECLOG: %lld %d %s", message->time, message->level, message->message); } -void RemoteLinux::cecKeyPress(void* /* param */, const cec_keypress* key) +void InputLinux::cecKeyPress(void* /* param */, const cec_keypress* key) { - //Log::getInstance()->log("Remote", Log::DEBUG, "Incoming cec key %d %d", key->keycode,key->duration); - if (key->duration == 0) static_cast(Remote::getInstance())->incomingCECkey(key->keycode); + //Log::getInstance()->log("InputLinux", Log::DEBUG, "Incoming cec key %d %d", key->keycode,key->duration); + if (key->duration == 0) static_cast(Input::getInstance())->incomingCECkey(key->keycode); } -void RemoteLinux::cecCommand(void* /* param */, const cec_command* command) +void InputLinux::cecCommand(void* /* param */, const cec_command* command) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECCommand: %d",command->opcode); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECCommand: %d",command->opcode); switch (command->opcode) { case CEC_OPCODE_STANDBY: { if (command->initiator==CECDEVICE_TV) { - static_cast(Remote::getInstance())->incomingPowerkey(POWEROFF); + static_cast(Input::getInstance())->incomingPowerkey(POWEROFF); } } break; case CEC_OPCODE_DECK_CONTROL: { if (command->initiator==CECDEVICE_TV && command->parameters.size == 1 && command->parameters[0]==CEC_DECK_CONTROL_MODE_STOP) { - static_cast(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP); + static_cast(Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP); } @@ -960,9 +856,9 @@ void RemoteLinux::cecCommand(void* /* param */, const cec_command* command) case CEC_OPCODE_PLAY: { if (command->initiator==CECDEVICE_TV && command->parameters.size == 1) { if (command->parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) { - static_cast(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY); + static_cast(Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY); } else if (command->parameters[0]==CEC_PLAY_MODE_PLAY_STILL) { - static_cast(Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE); + static_cast(Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE); } } @@ -973,39 +869,39 @@ void RemoteLinux::cecCommand(void* /* param */, const cec_command* command) }; } -void RemoteLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration*) +void InputLinux::cecConfigurationChanged(void* /* param */, const libcec_configuration*) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config->string()*/); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECConfig:"/*,config->string()*/); } #else -int RemoteLinux::cecLogMessage(void *param, const cec_log_message message) +int InputLinux::cecLogMessage(void *param, const cec_log_message message) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECLOG: %lld %d %s", message.time, message.level, message.message); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECLOG: %lld %d %s", message.time, message.level, message.message); return 0; } -int RemoteLinux::cecKeyPress(void*param, const cec_keypress key) +int InputLinux::cecKeyPress(void*param, const cec_keypress key) { - //Log::getInstance()->log("Remote", Log::DEBUG, "Incoming cec key %d %d", key.keycode,key.duration); - if (key.duration == 0) ((RemoteLinux*)Remote::getInstance())->incomingCECkey(key.keycode); + //Log::getInstance()->log("InputLinux", Log::DEBUG, "Incoming cec key %d %d", key.keycode,key.duration); + if (key.duration == 0) ((InputLinux*)Input::getInstance())->incomingCECkey(key.keycode); return 1; } -int RemoteLinux::cecCommand(void *param, const cec_command command) +int InputLinux::cecCommand(void *param, const cec_command command) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECCommand: %d",command.opcode); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECCommand: %d",command.opcode); switch (command.opcode) { case CEC_OPCODE_STANDBY: { if (command.initiator==CECDEVICE_TV) { - ((RemoteLinux*)Remote::getInstance())->incomingPowerkey(POWEROFF); + ((InputLinux*)Input::getInstance())->incomingPowerkey(POWEROFF); } } break; case CEC_OPCODE_DECK_CONTROL: { if (command.initiator==CECDEVICE_TV && command.parameters.size == 1 && command.parameters[0]==CEC_DECK_CONTROL_MODE_STOP) { - ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP); + ((InputLinux*)Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_STOP); } @@ -1013,9 +909,9 @@ int RemoteLinux::cecCommand(void *param, const cec_command command) case CEC_OPCODE_PLAY: { if (command.initiator==CECDEVICE_TV && command.parameters.size == 1) { if (command.parameters[0]==CEC_PLAY_MODE_PLAY_FORWARD) { - ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY); + ((InputLinux*)Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PLAY); } else if (command.parameters[0]==CEC_PLAY_MODE_PLAY_STILL) { - ((RemoteLinux*)Remote::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE); + ((InputLinux*)Input::getInstance())->incomingCECkey(CEC_USER_CONTROL_CODE_PAUSE); } } @@ -1027,25 +923,25 @@ int RemoteLinux::cecCommand(void *param, const cec_command command) return 1; } -int RemoteLinux::cecConfigurationChanged(void *param, const libcec_configuration config) +int InputLinux::cecConfigurationChanged(void *param, const libcec_configuration config) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECConfig:"/*,config.string()*/); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECConfig:"/*,config.string()*/); return 1; } #endif -void RemoteLinux::cecSourceActivated(void* /* param */, const cec_logical_address address, const uint8_t activated) +void InputLinux::cecSourceActivated(void* /* param */, const cec_logical_address address, const uint8_t activated) { - Log::getInstance()->log("Remote", Log::DEBUG, "CECSourceActivated: %d %d", address, activated); + Log::getInstance()->log("InputLinux", Log::DEBUG, "CECSourceActivated: %d %d", address, activated); if (activated == 1) { - static_cast(Remote::getInstance())->incomingPowerkey(POWERON); + static_cast(Input::getInstance())->incomingPowerkey(POWERON); } } -void RemoteLinux::incomingCECkey(int keys) +void InputLinux::incomingCECkey(int keys) { // Send INPUT message Message* m = new Message(); @@ -1056,7 +952,7 @@ void RemoteLinux::incomingCECkey(int keys) MessageQueue::getInstance()->postMessage(m); } -void RemoteLinux::incomingPowerkey(UCHAR key) +void InputLinux::incomingPowerkey(UCHAR key) { // Send INPUT message Message* m = new Message(); @@ -1067,11 +963,11 @@ void RemoteLinux::incomingPowerkey(UCHAR key) MessageQueue::getInstance()->postMessage(m); } -bool RemoteLinux::loadOptionsfromServer(VDR* vdr) +bool InputLinux::loadOptionsfromServer(VDR* vdr) { // Set remote keys char* name; - name = vdr->configLoad("RemoteLinux", "HandleVolume"); + name = vdr->configLoad("InputLinux", "HandleVolume"); if (name != NULL) { @@ -1079,26 +975,26 @@ bool RemoteLinux::loadOptionsfromServer(VDR* vdr) else if (STRCASECMP(name, "Cec") == 0) cechandlesvolume = true; delete[] name; } - return Remote::loadOptionsfromServer(vdr); + return Input::loadOptionsfromServer(vdr); } -bool RemoteLinux::saveOptionstoServer() +bool InputLinux::saveOptionstoServer() { - if (cechandlesvolume) VDR::getInstance()->configSave("RemoteLinux", "HandleVolume","Cec"); - else VDR::getInstance()->configSave("RemoteLinux", "HandleVolume","Vomp"); + if (cechandlesvolume) VDR::getInstance()->configSave("InputLinux", "HandleVolume","Cec"); + else VDR::getInstance()->configSave("InputLinux", "HandleVolume","Vomp"); - return Remote::saveOptionstoServer(); + return Input::saveOptionstoServer(); } -bool RemoteLinux::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane) +bool InputLinux::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane) { - if (!Remote::addOptionsToPanes(panenumber, options, pane)) return false; + if (!Input::addOptionsToPanes(panenumber, options, pane)) return false; Option* option; if (panenumber == 2) { static const char* volumeopts[]={"Vomp","Cec"}; - option = new Option(100,tr("Volume handled by"), "RemoteLinux","HandleVolume",Option::TYPE_TEXT,/*4,2*/2,0,0,volumeopts,NULL,false,this); + option = new Option(100,tr("Volume handled by"), "InputLinux","HandleVolume",Option::TYPE_TEXT,/*4,2*/2,0,0,volumeopts,NULL,false,this); options->push_back(option); pane->addOptionLine(option); } @@ -1106,9 +1002,9 @@ bool RemoteLinux::addOptionsToPanes(int panenumber,Options *options,WOptionPane* return true; } -bool RemoteLinux::handleOptionChanges(Option* option) +bool InputLinux::handleOptionChanges(Option* option) { - if (Remote::handleOptionChanges(option)) + if (Input::handleOptionChanges(option)) return true; switch (option->id) { case 100: { @@ -1118,7 +1014,7 @@ bool RemoteLinux::handleOptionChanges(Option* option) == 0) { cechandlesvolume=true; } - Log::getInstance()->log("Remote", Log::DEBUG, "Set volume handling to to %s %d",option->options[option->userSetChoice],cechandlesvolume); + Log::getInstance()->log("InputLinux", Log::DEBUG, "Set volume handling to to %s %d",option->options[option->userSetChoice],cechandlesvolume); return true; } break; @@ -1127,17 +1023,17 @@ bool RemoteLinux::handleOptionChanges(Option* option) } -void RemoteLinux::volumeUp() +void InputLinux::volumeUp() { cec_adap->VolumeUp(); } -void RemoteLinux::volumeDown() +void InputLinux::volumeDown() { cec_adap->VolumeDown(); } -void RemoteLinux::volumeMute() +void InputLinux::volumeMute() { #if CEC_LIB_VERSION_MAJOR >= 4 cec_adap->AudioToggleMute(); @@ -1146,24 +1042,24 @@ void RemoteLinux::volumeMute() #endif } -void RemoteLinux::informStopEventLoop() +void InputLinux::informStopEventLoop() { listenLoopStop = true; write(pfds[1], "1", 1); // break the select in getButtonPress } -void RemoteLinux::eventLoop() +void InputLinux::eventLoop() { fd_set readfds; int maxfd; if (pipe2(pfds, O_NONBLOCK) == -1) { - Log::getInstance()->log("RemoteLinux", Log::ERR, "pipe2() fail"); + Log::getInstance()->log("InputLinux", Log::ERR, "pipe2() fail"); return; } - Log::getInstance()->log("RemoteLinux", Log::INFO, "Listen loop"); + Log::getInstance()->log("InputLinux", Log::INFO, "Listen loop"); while(1) { @@ -1187,14 +1083,14 @@ void RemoteLinux::eventLoop() // -1 = error if (select(maxfd + 1, &readfds, NULL, NULL, NULL) < 1) { - Log::getInstance()->log("RemoteLinux", Log::ERR, "Select fail"); + Log::getInstance()->log("InputLinux", Log::ERR, "Select fail"); break; } if (FD_ISSET(pfds[0], &readfds)) { // assume quit signal - Log::getInstance()->log("Remote", Log::NOTICE, "pfds quit"); + Log::getInstance()->log("InputLinux", Log::NOTICE, "pfds quit"); break; // FUTURE: read the byte and do different things? Read listenLoopStop and maybe other bools? diff --git a/remotelinux.h b/inputlinux.h similarity index 95% rename from remotelinux.h rename to inputlinux.h index 7de9e60..bfd293f 100644 --- a/remotelinux.h +++ b/inputlinux.h @@ -17,8 +17,8 @@ along with VOMP. If not, see . */ -#ifndef REMOTELINUX_H -#define REMOTELINUX_H +#ifndef INPUTLINUX_H +#define INPUTLINUX_H #include #include @@ -26,13 +26,13 @@ #include "defines.h" #include "log.h" -#include "remote.h" +#include "input.h" -class RemoteLinux : public Remote +class InputLinux : public Input { public: - RemoteLinux(); - virtual ~RemoteLinux(); + InputLinux(); + virtual ~InputLinux(); int init(const char *devName); int shutdown(); diff --git a/main.cc b/main.cc index f005054..70067d2 100644 --- a/main.cc +++ b/main.cc @@ -51,7 +51,7 @@ #ifdef VOMP_PLATFORM_RASPBERRY -#include "remotelinux.h" +#include "inputlinux.h" #include "ledraspberry.h" #include "osdopenvg.h" #include "audioomx.h" @@ -72,7 +72,7 @@ void shutdown(int code); // Global variables -------------------------------------------------------------------------------------------------- Log* logger; -Remote* remote; +Input* remote; Led* led; Osd* osd; Timers* timers; diff --git a/objects.mk b/objects.mk index 45e88d7..2f63097 100644 --- a/objects.mk +++ b/objects.mk @@ -12,7 +12,7 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o vradiorec.o vaudioselector.o vscreensaver.o vopts.o \ wselectlist.o wjpeg.o wsymbol.o wbutton.o wtextbox.o \ woptionpane.o woptionbox.o wremoteconfig.o wtabbar.o led.o \ - remote.o osd.o surface.o vpicturebanner.o abstractoption.o \ + input.o osd.o surface.o vpicturebanner.o abstractoption.o \ eventdispatcher.o vdrrequestpacket.o vdrresponsepacket.o \ vvideolivetv.o vsleeptimer.o playerlivetv.o playerliveradio.o \ wprogressbar.o bitmap.o dvbsubtitles.o tfeed.o vteletextview.o \ @@ -22,7 +22,7 @@ OBJ_COMMON = command.o tcp.o dsock.o thread.o timers.o i18n.o vdp6.o OBJ_RASPBERRY = main.o threadp.o osdopenvg.o \ ledraspberry.o videoomx.o audioomx.o imageomx.o \ - wjpegsimple.o remotelinux.o signal.o + wjpegsimple.o inputlinux.o signal.o OBJ_WINDOWS = winmain.o threadwin.o remotewin.o ledwin.o videowin.o \ audiowin.o windowsosd.o dsallocator.o dssourcefilter.o dssourcepin.o \ diff --git a/player.cc b/player.cc index be9be81..a65f3df 100644 --- a/player.cc +++ b/player.cc @@ -26,7 +26,7 @@ #include "demuxerts.h" #include "vdr.h" #include "messagequeue.h" -#include "remote.h" +#include "input.h" #include "message.h" #include "dvbsubtitles.h" #include "osdreceiver.h" diff --git a/playerliveradio.cc b/playerliveradio.cc index 95e0f12..54b9c29 100644 --- a/playerliveradio.cc +++ b/playerliveradio.cc @@ -25,7 +25,7 @@ #include "demuxerts.h" #include "vdr.h" #include "messagequeue.h" -#include "remote.h" +#include "input.h" #include "message.h" #include "channel.h" #include "video.h" diff --git a/playerlivetv.cc b/playerlivetv.cc index ce1e5fc..d055dca 100644 --- a/playerlivetv.cc +++ b/playerlivetv.cc @@ -26,7 +26,7 @@ #include "demuxerts.h" #include "vdr.h" #include "messagequeue.h" -#include "remote.h" +#include "input.h" #include "message.h" #include "channel.h" #include "dvbsubtitles.h" diff --git a/playermedia.h b/playermedia.h index 0aac75c..d97e17b 100644 --- a/playermedia.h +++ b/playermedia.h @@ -29,7 +29,7 @@ #include #include "audio.h" -#include "remote.h" +#include "input.h" #include "vdr.h" #include "callback.h" #include "message.h" diff --git a/playerradio.cc b/playerradio.cc index b5f8417..cc184d2 100644 --- a/playerradio.cc +++ b/playerradio.cc @@ -24,7 +24,7 @@ #include "video.h" #include "demuxervdr.h" #include "demuxerts.h" -#include "remote.h" +#include "input.h" #include "vdr.h" #include "message.h" #include "messagequeue.h" diff --git a/remotelirc.h b/remotelirc.h index d681b61..44f4fdb 100644 --- a/remotelirc.h +++ b/remotelirc.h @@ -27,7 +27,7 @@ #include #include -#include "remote.h" +#include "input.h" #include "defines.h" class RemoteLirc : public Remote diff --git a/remotewin.h b/remotewin.h index c866333..3fd5434 100644 --- a/remotewin.h +++ b/remotewin.h @@ -25,7 +25,7 @@ #include "defines.h" #include "log.h" -#include "remote.h" +#include "input.h" #define _WIN32_WINNT 0x501 #include diff --git a/vaudioselector.cc b/vaudioselector.cc index fd80800..2e0d260 100644 --- a/vaudioselector.cc +++ b/vaudioselector.cc @@ -20,7 +20,7 @@ #include "vaudioselector.h" -#include "remote.h" +#include "input.h" #include "colour.h" #include "video.h" #include "audio.h" @@ -468,14 +468,14 @@ int VAudioSelector::handleCommand(int command) { switch (command) { - case Remote::BACK: - case Remote::OK: - case Remote::GREEN: + case Input::BACK: + case Input::OK: + case Input::GREEN: { return 4; } - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (editsubtitles) { ssl.up(); @@ -501,8 +501,8 @@ int VAudioSelector::handleCommand(int command) return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { if (editsubtitles) { ssl.down(); @@ -530,8 +530,8 @@ int VAudioSelector::handleCommand(int command) return 2; } - case Remote::LEFT: - case Remote::DF_LEFT: + case Input::LEFT: + case Input::DF_LEFT: { if (editsubtitles && subtitles) { ssl.setDarkSelOption(true); @@ -543,8 +543,8 @@ int VAudioSelector::handleCommand(int command) } return 2; } - case Remote::RIGHT: - case Remote::DF_RIGHT: + case Input::RIGHT: + case Input::DF_RIGHT: { if (!editsubtitles && subtitles) { ssl.setDarkSelOption(false); @@ -619,7 +619,7 @@ void VAudioSelector::processMessage(Message* m) asl.setDarkSelOption(false); asl.draw(); ssl.draw(); - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else if (ssl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { @@ -628,7 +628,7 @@ void VAudioSelector::processMessage(Message* m) asl.setDarkSelOption(true); asl.draw(); ssl.draw(); - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel @@ -636,7 +636,7 @@ void VAudioSelector::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vchannellist.cc b/vchannellist.cc index 8d6573d..7d1edae 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -20,7 +20,7 @@ #include "vchannellist.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "vvideolivetv.h" #include "colour.h" @@ -186,8 +186,8 @@ int VChannelList::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); quickUpdate(); @@ -195,8 +195,8 @@ int VChannelList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); quickUpdate(); @@ -204,7 +204,7 @@ int VChannelList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); quickUpdate(); @@ -212,7 +212,7 @@ int VChannelList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); quickUpdate(); @@ -220,16 +220,16 @@ int VChannelList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::ZERO: - case Remote::ONE: - case Remote::TWO: - case Remote::THREE: - case Remote::FOUR: - case Remote::FIVE: - case Remote::SIX: - case Remote::SEVEN: - case Remote::EIGHT: - case Remote::NINE: + case Input::ZERO: + case Input::ONE: + case Input::TWO: + case Input::THREE: + case Input::FOUR: + case Input::FIVE: + case Input::SIX: + case Input::SEVEN: + case Input::EIGHT: + case Input::NINE: { VChannelSelect* v = new VChannelSelect(this); v->draw(); @@ -238,8 +238,8 @@ int VChannelList::handleCommand(int command) v->handleCommand(command); return 2; } - case Remote::OK: - case Remote::PLAY: + case Input::OK: + case Input::PLAY: { Channel* chan = NULL; if (chanList) chan = (Channel*)sl.getCurrentOptionData(); @@ -251,7 +251,7 @@ int VChannelList::handleCommand(int command) return 2; } - case Remote::BACK: + case Input::BACK: { return 4; } @@ -282,7 +282,7 @@ void VChannelList::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel @@ -290,7 +290,7 @@ void VChannelList::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - boxstack->handleCommand(Remote::BACK); //simulate cancel press + boxstack->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vchannelselect.cc b/vchannelselect.cc index 1fac3f0..f41b311 100644 --- a/vchannelselect.cc +++ b/vchannelselect.cc @@ -19,7 +19,7 @@ #include "vchannelselect.h" -#include "remote.h" +#include "input.h" #include "message.h" #include "boxstack.h" #include "colour.h" @@ -130,16 +130,16 @@ int VChannelSelect::handleCommand(int command) { switch(command) { - case Remote::ZERO: - case Remote::ONE: - case Remote::TWO: - case Remote::THREE: - case Remote::FOUR: - case Remote::FIVE: - case Remote::SIX: - case Remote::SEVEN: - case Remote::EIGHT: - case Remote::NINE: + case Input::ZERO: + case Input::ONE: + case Input::TWO: + case Input::THREE: + case Input::FOUR: + case Input::FIVE: + case Input::SIX: + case Input::SEVEN: + case Input::EIGHT: + case Input::NINE: { doInput(command); draw(); @@ -148,7 +148,7 @@ int VChannelSelect::handleCommand(int command) else Timers::getInstance()->setTimerD(this, 1, 3); return 2; } - case Remote::OK: + case Input::OK: { changeChannel(); return 2; diff --git a/vcolourtuner.cc b/vcolourtuner.cc index 178c22a..b20a008 100644 --- a/vcolourtuner.cc +++ b/vcolourtuner.cc @@ -20,7 +20,7 @@ #include "vcolourtuner.h" #include "wsymbol.h" -#include "remote.h" +#include "input.h" #include "colour.h" #include "video.h" #include "vinfo.h" @@ -114,56 +114,56 @@ int VColourTuner::handleCommand(int command) { int rt=0; switch(command) { - case Remote::ONE: + case Input::ONE: updateFactor(1,-1); rt=2; hasChanged=true; break; - case Remote::TWO: + case Input::TWO: updateFactor(1,1); rt=2; hasChanged=true; break; - case Remote::FOUR: + case Input::FOUR: updateFactor(2,-1); rt=2; hasChanged=true; break; - case Remote::FIVE: + case Input::FIVE: updateFactor(2,1); rt=2; hasChanged=true; break; - case Remote::SEVEN: + case Input::SEVEN: updateFactor(3,-1); rt=2; hasChanged=true; break; - case Remote::EIGHT: + case Input::EIGHT: updateFactor(3,1); hasChanged=true; rt=2; break; - case Remote::THREE: + case Input::THREE: updateFactor(4,-1); hasChanged=true; rt=2; break; - case Remote::SIX: + case Input::SIX: updateFactor(4,1); hasChanged=true; rt=2; break; - case Remote::NINE: + case Input::NINE: updateFactor(5,0); hasChanged=true; rt=2; break; - case Remote::ZERO: + case Input::ZERO: drawPicture=true; rt=2; break; - case Remote::BACK: + case Input::BACK: vrfactor=rfactor; vgfactor=gfactor; vbfactor=bfactor; @@ -176,7 +176,7 @@ int VColourTuner::handleCommand(int command) #endif rt=4; break; - case Remote::OK: + case Input::OK: rfactor=vrfactor; gfactor=vgfactor; bfactor=vbfactor; @@ -231,7 +231,7 @@ void VColourTuner::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } else if (y>=(int)area.h-24 && y<=(int)area.h-6) { diff --git a/vepg.cc b/vepg.cc index fe338a7..676b896 100644 --- a/vepg.cc +++ b/vepg.cc @@ -32,7 +32,7 @@ #include "vepg.h" -#include "remote.h" +#include "input.h" #include "vchannellist.h" #include "messagequeue.h" #include "video.h" @@ -356,16 +356,16 @@ int VEpg::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { // cursor up the channel list chanListbox.up(); drawData(); boxstack->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { // cursor down the channel list Log::getInstance()->log("VEPG", Log::DEBUG, "Down start"); @@ -376,16 +376,16 @@ int VEpg::handleCommand(int command) return 2; } - case Remote::DF_LEFT: - case Remote::LEFT: + case Input::DF_LEFT: + case Input::LEFT: { // cursor left through time selTime = thisEvent.time - 1; drawData(); boxstack->update(this); return 2; } - case Remote::DF_RIGHT: - case Remote::RIGHT: + case Input::DF_RIGHT: + case Input::RIGHT: { // cursor right through time selTime = thisEvent.time + thisEvent.duration; @@ -393,7 +393,7 @@ int VEpg::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::RED: + case Input::RED: { // cursor up one page chanListbox.pageUp(); @@ -401,7 +401,7 @@ int VEpg::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::GREEN: + case Input::GREEN: { // cursor down one page chanListbox.pageDown(); @@ -409,7 +409,7 @@ int VEpg::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::BLUE: + case Input::BLUE: { // step forward 24 hours selTime += 24 * 60 * 60; @@ -417,7 +417,7 @@ int VEpg::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::YELLOW: + case Input::YELLOW: { // step forward 24 hours selTime -= 24 * 60 * 60; @@ -425,7 +425,7 @@ int VEpg::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::RECORD: + case Input::RECORD: { if (!chanList) return 2; Log::getInstance()->log("VEPG", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", thisEvent.id, thisEvent.time, thisEvent.duration, thisEvent.title); @@ -435,9 +435,9 @@ int VEpg::handleCommand(int command) boxstack->update(vs); return 2; } - case Remote::PLAY: - case Remote::GO: - case Remote::OK: + case Input::PLAY: + case Input::GO: + case Input::OK: { if (!chanList) return 2; @@ -457,16 +457,16 @@ int VEpg::handleCommand(int command) setCurrentChannel(); - if(command == Remote::GO) + if(command == Input::GO) return 2; // GO just changes channel in preview, PLAY changes channel and returns to normal TV } - case Remote::BACK: - case Remote::GUIDE: + case Input::BACK: + case Input::GUIDE: { return 4; } - case Remote::CHANNELUP: + case Input::CHANNELUP: { if (currentChannelIndex == (chanList->size() - 1)) // at the end currentChannelIndex = 0; @@ -487,7 +487,7 @@ int VEpg::handleCommand(int command) return 2; } - case Remote::CHANNELDOWN: + case Input::CHANNELDOWN: { if (currentChannelIndex == 0) // at the start currentChannelIndex = chanList->size() - 1; // so go to end @@ -779,7 +779,7 @@ void VEpg::processMessage(Message* m) { if (chanListbox.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else { @@ -791,39 +791,39 @@ void VEpg::processMessage(Message* m) if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - boxstack->handleCommand(Remote::BACK); //simulate cancel press + boxstack->handleCommand(Input::BACK); //simulate cancel press } else if (x>=(keyx+72) && y>=(keyy+4) &&x<=(keyx+72+104) &&y<=(keyy+4+getFontHeight() + 2)) { - boxstack->handleCommand(Remote::RED); + boxstack->handleCommand(Input::RED); } else if (x>=(keyx+72) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+72+104) &&y<=(keyy+8+2*getFontHeight() + 2)) { - boxstack->handleCommand(Remote::GREEN); + boxstack->handleCommand(Input::GREEN); } else if (x>=(keyx+180) && y>=(keyy+4) &&x<=(keyx+180+104) &&y<=(keyy+4+getFontHeight() + 2)) { - boxstack->handleCommand(Remote::YELLOW); + boxstack->handleCommand(Input::YELLOW); } else if (x>=(keyx+180) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+180+104) &&y<=(keyy+8+2*getFontHeight() + 2)) { - boxstack->handleCommand(Remote::BLUE); + boxstack->handleCommand(Input::BLUE); } else if (x>=(keyx+290) && y>=(keyy+4) &&x<=(keyx+180+290) &&y<=(keyy+4+getFontHeight() + 2)) { - boxstack->handleCommand(Remote::BACK); + boxstack->handleCommand(Input::BACK); } else if (x>=(keyx+290) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+290+180) &&y<=(keyy+8+2*getFontHeight() + 2)) { - boxstack->handleCommand(Remote::RECORD); + boxstack->handleCommand(Input::RECORD); } else if (x>=(keyx+474) && y>=(keyy+4) &&x<=(keyx+128+474) &&y<=(keyy+4+getFontHeight() + 2)) { - boxstack->handleCommand(Remote::PLAY); + boxstack->handleCommand(Input::PLAY); } else if (x>=(keyx+474) && y>=(keyy+ getFontHeight() + 8) &&x<=(keyx+238+474) &&y<=(keyy+8+2*getFontHeight() + 2)) { - boxstack->handleCommand(Remote::GO); + boxstack->handleCommand(Input::GO); } else if ( x>=(chanListbox.getRootBoxOffsetX()) && y>=(chanListbox.getRootBoxOffsetY() + 5) diff --git a/vepglistadvanced.cc b/vepglistadvanced.cc index 3b6f9f8..48f286e 100644 --- a/vepglistadvanced.cc +++ b/vepglistadvanced.cc @@ -20,7 +20,7 @@ #include "vepglistadvanced.h" #include "boxstack.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "vdr.h" @@ -769,8 +769,8 @@ int VEpgListAdvanced::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); quickUpdate(); @@ -778,8 +778,8 @@ int VEpgListAdvanced::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); quickUpdate(); @@ -787,7 +787,7 @@ int VEpgListAdvanced::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); quickUpdate(); @@ -795,7 +795,7 @@ int VEpgListAdvanced::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); quickUpdate(); @@ -803,27 +803,27 @@ int VEpgListAdvanced::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::RED: + case Input::RED: { doRed(); return 2; } - case Remote::GREEN: + case Input::GREEN: { doGreen(); return 2; } - case Remote::YELLOW: + case Input::YELLOW: { doYellow(); return 2; } - case Remote::BLUE: + case Input::BLUE: { doBlue(); return 2; } - case Remote::OK: + case Input::OK: { if (sl.getNumOptions() == 0) return 2; @@ -852,7 +852,7 @@ int VEpgListAdvanced::handleCommand(int command) // should not get to here return 1; } - case Remote::BACK: + case Input::BACK: { return 4; } @@ -877,23 +877,23 @@ void VEpgListAdvanced::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else if (boxRed.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) { - boxstack->handleCommand(Remote::RED); + boxstack->handleCommand(Input::RED); } else if (boxGreen.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) { - boxstack->handleCommand(Remote::GREEN); + boxstack->handleCommand(Input::GREEN); } else if (boxYellow.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) { - boxstack->handleCommand(Remote::GREEN); + boxstack->handleCommand(Input::GREEN); } else if (boxBlue.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) { - boxstack->handleCommand(Remote::GREEN); + boxstack->handleCommand(Input::GREEN); } else { @@ -902,7 +902,7 @@ void VEpgListAdvanced::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - boxstack->handleCommand(Remote::BACK); //simulate cancel press + boxstack->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vepgsettimer.cc b/vepgsettimer.cc index cc0ded6..0725c08 100644 --- a/vepgsettimer.cc +++ b/vepgsettimer.cc @@ -30,7 +30,7 @@ #include "command.h" #include "messagequeue.h" #include "video.h" -#include "remote.h" +#include "input.h" #include "i18n.h" VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel) @@ -210,27 +210,27 @@ int VEpgSetTimer::handleCommand(int command) { switch(command) { - case Remote::DF_LEFT: - case Remote::LEFT: + case Input::DF_LEFT: + case Input::LEFT: { swap(); draw(); boxstack->update(this); return 2; } - case Remote::DF_RIGHT: - case Remote::RIGHT: + case Input::DF_RIGHT: + case Input::RIGHT: { swap(); draw(); boxstack->update(this); return 2; } - case Remote::BACK: + case Input::BACK: { return 4; } - case Remote::OK: + case Input::OK: { if (selectedOption != YES) return 4; doit(); @@ -306,11 +306,11 @@ void VEpgSetTimer::processMessage(Message* m) { if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else { @@ -319,7 +319,7 @@ void VEpgSetTimer::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - boxstack->handleCommand(Remote::BACK); //simulate cancel press + boxstack->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vepgsummary.cc b/vepgsummary.cc index 75c5a3f..6b99822 100644 --- a/vepgsummary.cc +++ b/vepgsummary.cc @@ -20,7 +20,7 @@ #include "vepgsummary.h" -#include "remote.h" +#include "input.h" #include "vquestion.h" #include "vepgsettimer.h" #include "vinfo.h" @@ -167,10 +167,10 @@ VEpgSummary::~VEpgSummary() int VEpgSummary::handleCommand(int command) { - if (command==Remote::BACK) { + if (command==Input::BACK) { return 4; } - if (command==Remote::RED) + if (command==Input::RED) { if (!channel) return 2; Log::getInstance()->log("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", event->id, event->time, event->duration, event->title); @@ -220,7 +220,7 @@ void VEpgSummary::processMessage(Message* m) if ((boxRed.getX() <= x) && (boxRed.getX() + (int)boxRed.getWidth() >= x) && (boxRed.getY() <= y) && (boxRed.getY() + (int)boxRed.getHeight() >= y)) { - BoxStack::getInstance()->handleCommand(Remote::RED); + BoxStack::getInstance()->handleCommand(Input::RED); cancel = false; } @@ -237,7 +237,7 @@ void VEpgSummary::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } else if (m->message == Message::MOUSE_SCROLL) diff --git a/videoomx.cc b/videoomx.cc index 76b6292..da5f26d 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -25,7 +25,7 @@ #include "woptionpane.h" #include "osdopenvg.h" #include "boxstack.h" -#include "remote.h" +#include "input.h" #include @@ -471,7 +471,7 @@ void VideoOMX::selectVideoMode(int interlaced) } } - Remote::getInstance()->shutdown(); + Input::getInstance()->shutdown(); vc_tv_power_off(); if (mymode) { Log::getInstance()->log("Video", Log::NOTICE, "Switch to optimum mode"); @@ -489,7 +489,7 @@ void VideoOMX::selectVideoMode(int interlaced) } else { /* analog tv case */ Log::getInstance()->log("Video", Log::NOTICE, "Analog tv case"); - Remote::getInstance()->shutdown(); + Input::getInstance()->shutdown(); vc_tv_power_off(); SDTV_MODE_T setmode=SDTV_MODE_PAL; SDTV_OPTIONS_T options; @@ -515,7 +515,7 @@ void VideoOMX::selectVideoMode(int interlaced) hdmi=false; } - Remote::getInstance()->init(""); + Input::getInstance()->init(""); signalon=true; @@ -724,9 +724,9 @@ int VideoOMX::signalOff() //TODO reinit osd Log::getInstance()->log("Video", Log::NOTICE, "signalOff"); Osd::getInstance()->stopUpdate(); // turn off drawing thread - Remote::getInstance()->shutdown(); + Input::getInstance()->shutdown(); vc_tv_power_off(); - Remote::getInstance()->init(""); + Input::getInstance()->init(""); signalon=false; return 1; } diff --git a/vinfo.cc b/vinfo.cc index 2889548..f7b89d6 100644 --- a/vinfo.cc +++ b/vinfo.cc @@ -20,7 +20,7 @@ #include "vinfo.h" -#include "remote.h" +#include "input.h" #include "colour.h" #include "i18n.h" #include "boxstack.h" @@ -93,8 +93,8 @@ int VInfo::handleCommand(int command) switch(command) { - case Remote::OK: - case Remote::BACK: + case Input::OK: + case Input::BACK: { if (exitable) return 4; } @@ -115,6 +115,6 @@ void VInfo::processMessage(Message* m) { if (m->message == Message::MOUSE_LBDOWN) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } } diff --git a/vmedialist.cc b/vmedialist.cc index e1001c4..63db05f 100644 --- a/vmedialist.cc +++ b/vmedialist.cc @@ -58,7 +58,7 @@ #include "vmediaview.h" #include "vvideomedia.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "colour.h" @@ -715,7 +715,7 @@ int VMediaList::handleCommand(int command) playingAll=false; switch(command) { - case Remote::ONE: + case Input::ONE: { sl.hintSetCurrent(0); sl.draw(); @@ -724,8 +724,8 @@ int VMediaList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); sl.draw(); @@ -735,8 +735,8 @@ int VMediaList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.draw(); @@ -746,7 +746,7 @@ int VMediaList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); sl.draw(); @@ -756,7 +756,7 @@ int VMediaList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); sl.draw(); @@ -766,7 +766,7 @@ int VMediaList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::BLUE: + case Input::BLUE: { switch(sortOrder) { case SORT_NAME: @@ -783,8 +783,8 @@ int VMediaList::handleCommand(int command) return 2; } } - case Remote::OK: - case Remote::PLAY: + case Input::OK: + case Input::PLAY: { Media* media = NULL; if (dirlist) media = getCurrentMedia(dirlist); @@ -797,12 +797,12 @@ 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 (command == Remote::PLAY) { + if (command == Input::PLAY) { dirlist->setStartLevel(); playingAll=true; } bool rt=changeDirectory(media); - if (command == Remote::PLAY && rt) { + if (command == Input::PLAY && rt) { playAll(); } else { @@ -813,10 +813,10 @@ int VMediaList::handleCommand(int command) case MEDIA_TYPE_AUDIO: Log::getInstance()->log("VMediaList", Log::DEBUG, "play audio file %s", media->getFileName()); - if (dirmode != M_NONE && command == Remote::PLAY) + if (dirmode != M_NONE && command == Input::PLAY) playAll(); else - playAudio(command==Remote::PLAY,true,true); + playAudio(command==Input::PLAY,true,true); break; case MEDIA_TYPE_VIDEO: { #ifndef WIN32 //Only DVB style MPEG is supported by the Windows Part! @@ -846,10 +846,10 @@ int VMediaList::handleCommand(int command) case MEDIA_TYPE_PICTURE: Log::getInstance()->log("VMediaList", Log::DEBUG, "show picture file %s", media->getFileName()); - if (dirmode != M_NONE && command == Remote::PLAY) + if (dirmode != M_NONE && command == Input::PLAY) playAll(); else - getViewer()->showPicture(MV_NONE,command==Remote::PLAY,true); + getViewer()->showPicture(MV_NONE,command==Input::PLAY,true); break; default: Log::getInstance()->log("VMediaList", Log::DEBUG, "unknown media type %d file %s", @@ -868,7 +868,7 @@ int VMediaList::handleCommand(int command) return 2; } - case Remote::BACK: + case Input::BACK: { if (dirlist->getLevel() < 1) return 4; dirlist->dropTop(); @@ -1079,7 +1079,7 @@ void VMediaList::processMessage(Message* m) if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { updateSelection(); - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel @@ -1087,7 +1087,7 @@ void VMediaList::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - boxstack->handleCommand(Remote::BACK); //simulate cancel press + boxstack->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vmediaview.cc b/vmediaview.cc index 6f3f955..cf7874a 100644 --- a/vmediaview.cc +++ b/vmediaview.cc @@ -27,7 +27,7 @@ #include "timers.h" #include "boxx.h" #include "wselectlist.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "vdr.h" @@ -433,7 +433,7 @@ int VMediaView::handleCommand(int command) Log::getInstance()->log("VMediaView::handleCommand", Log::DEBUG, "cmd=%d,p=%p", command,this); if ( !audioEnabled && ! pictureEnabled ) { //only handle YELLOW - if (command == Remote::YELLOW) { + if (command == Input::YELLOW) { setAudioMode(true); return 1; } @@ -445,29 +445,29 @@ int VMediaView::handleCommand(int command) int rt=1; switch(command) { - case Remote::DF_UP: - case Remote::UP: - case Remote::SKIPBACK: + case Input::DF_UP: + case Input::UP: + case Input::SKIPBACK: rotate=WJpegComplex::ROT_0; showPicture(VMediaList::MV_PREV,slideshow,true); rt= 2; break; - case Remote::FORWARD: + case Input::FORWARD: if (showtime > 1) showtime--; updatePictureBanner(true); break; - case Remote::DF_DOWN: - case Remote::DOWN: - case Remote::SKIPFORWARD: + case Input::DF_DOWN: + case Input::DOWN: + case Input::SKIPFORWARD: rotate=WJpegComplex::ROT_0; showPicture(VMediaList::MV_NEXT,slideshow,true); rt= 2; break; - case Remote::REVERSE: + case Input::REVERSE: if (showtime < 50 ) showtime++; updatePictureBanner(true); break; - case Remote::OK: + case Input::OK: { if (pictureBanner) { destroyPictureBanner(); @@ -481,7 +481,7 @@ int VMediaView::handleCommand(int command) rt= 2; } break; - case Remote::PLAY: + case Input::PLAY: { slideshow=true; rotate=WJpegComplex::ROT_0; @@ -489,7 +489,7 @@ int VMediaView::handleCommand(int command) rt= 2; } break; - case Remote::PAUSE: + case Input::PAUSE: if (slideshow) { stopSlideshow(true); updatePictureBanner(); @@ -501,13 +501,13 @@ int VMediaView::handleCommand(int command) } rt= 2; break; - case Remote::STOP: + case Input::STOP: stopSlideshow(true); showtime=INITIAL_SHOWTIME; updatePictureBanner(); rt= 2; break; - case Remote::RED: + case Input::RED: switch(rotate) { case WJpegComplex::ROT_0: rotate=WJpegComplex::ROT_90; @@ -525,12 +525,12 @@ int VMediaView::handleCommand(int command) showPicture(VMediaList::MV_NONE,slideshow,true); rt=2; break; - case Remote::GREEN: + case Input::GREEN: if (info) destroyInfo(); else showPictureInfo(); rt=2; break; - case Remote::BLUE: + case Input::BLUE: switch (cropmode) { case WJpegComplex::CROP: cropmode=WJpegComplex::LETTER; @@ -545,7 +545,7 @@ int VMediaView::handleCommand(int command) showPicture(VMediaList::MV_NONE,slideshow,true); rt=2; break; - case Remote::MENU: { + case Input::MENU: { stopSlideshow(true); destroyPictureBanner(); destroyInfo(); @@ -556,13 +556,13 @@ int VMediaView::handleCommand(int command) rt=2; } break; - case Remote::BACK: + case Input::BACK: { setPictureMode(false); rt= 2; } break; - case Remote::YELLOW: + case Input::YELLOW: { setAudioMode(true); } @@ -576,78 +576,78 @@ int VMediaView::handleCommand(int command) //------------------------- command in mode AUDIO (i.e. audio is on top) ---------------- switch(command) { - case Remote::YELLOW: + case Input::YELLOW: setAudioMode(false); rt=2; break; - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: play(playall,false,VMediaList::MV_PREV); rt= 2; break; - case Remote::FORWARD: + case Input::FORWARD: if (! audioError) getPlayer()->fastForward(); updateInfo=true; rt=2; break; - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: play(playall,false,VMediaList::MV_NEXT); rt= 2; break; - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: if (! audioError) getPlayer()->skipForward(10); rt=2; break; - case Remote::SKIPBACK: + case Input::SKIPBACK: if (! audioError) getPlayer()->skipBackward(10); rt=2; break; - case Remote::REVERSE: + case Input::REVERSE: rt=2; break; - case Remote::ZERO: + case Input::ZERO: if (! audioError) getPlayer()->jumpToPercent(0); rt=2; break; - case Remote::ONE: + case Input::ONE: if (! audioError) getPlayer()->jumpToPercent(10); rt=2; break; - case Remote::TWO: + case Input::TWO: if (! audioError) getPlayer()->jumpToPercent(20); rt=2; break; - case Remote::THREE: + case Input::THREE: if (! audioError) getPlayer()->jumpToPercent(30); rt=2; break; - case Remote::FOUR: + case Input::FOUR: if (! audioError) getPlayer()->jumpToPercent(40); rt=2; break; - case Remote::FIVE: + case Input::FIVE: if (! audioError) getPlayer()->jumpToPercent(50); rt=2; break; - case Remote::SIX: + case Input::SIX: if (! audioError) getPlayer()->jumpToPercent(60); rt=2; break; - case Remote::SEVEN: + case Input::SEVEN: if (! audioError) getPlayer()->jumpToPercent(70); rt=2; break; - case Remote::EIGHT: + case Input::EIGHT: if (! audioError) getPlayer()->jumpToPercent(80); rt=2; break; - case Remote::NINE: + case Input::NINE: if (! audioError) getPlayer()->jumpToPercent(90); rt=2; break; - case Remote::OK: - case Remote::GREEN: + case Input::OK: + case Input::GREEN: { if (info) { destroyInfo(); @@ -663,7 +663,7 @@ int VMediaView::handleCommand(int command) rt= 2; } break; - case Remote::PLAY: + case Input::PLAY: { if (! audioError) getPlayer()->unpause(); updateInfo=true; @@ -672,18 +672,18 @@ int VMediaView::handleCommand(int command) rt= 2; } break; - case Remote::PAUSE: + case Input::PAUSE: if (! audioError) getPlayer()->pause(); updateInfo=true; rt= 2; break; - case Remote::STOP: + case Input::STOP: getPlayer()->stop(); justPlaying=false; updateInfo=true; rt= 2; break; - case Remote::BACK: + case Input::BACK: { getPlayer()->stop(); playall=false; @@ -715,7 +715,7 @@ void VMediaView::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } else if (m->message = Message::PLAYER_EVENT) { diff --git a/vmute.cc b/vmute.cc index 3691253..b2fd4df 100644 --- a/vmute.cc +++ b/vmute.cc @@ -19,7 +19,7 @@ #include "vmute.h" -#include "remote.h" +#include "input.h" #include "audio.h" #include "video.h" #include "wsymbol.h" @@ -79,7 +79,7 @@ int VMute::handleCommand(int command) { switch(command) { - case Remote::MUTE: + case Input::MUTE: { isMuted = Audio::getInstance()->toggleUserMute(); draw(); diff --git a/vopts.cc b/vopts.cc index 1f3e4a3..0ebd83e 100644 --- a/vopts.cc +++ b/vopts.cc @@ -24,7 +24,7 @@ #include "video.h" #include "osd.h" #include "audio.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" #include "woptionpane.h" #include "wremoteconfig.h" @@ -192,14 +192,14 @@ VOpts::VOpts() options.push_back(option); wop->addOptionLine(option); - Remote::getInstance()->addOptionsToPanes(0,&options,wop); + Input::getInstance()->addOptionsToPanes(0,&options,wop); Video::getInstance()->addOptionsToPanes(0,&options,wop); Audio::getInstance()->addOptionsToPanes(0,&options,wop); /* WRemoteConfig* wrc = new WRemoteConfig(); tabbar.addTab(tr("Remote Control"), wrc);*/ - Remote::getInstance()->addOptionPagesToWTB(&tabbar); + Input::getInstance()->addOptionPagesToWTB(&tabbar); // panes[1] = wrc; Video::getInstance()->addOptionPagesToWTB(&tabbar); @@ -226,7 +226,7 @@ VOpts::VOpts() options.push_back(option); wop->addOptionLine(option); - Remote::getInstance()->addOptionsToPanes(1,&options,wop); + Input::getInstance()->addOptionsToPanes(1,&options,wop); Video::getInstance()->addOptionsToPanes(1,&options,wop); Audio::getInstance()->addOptionsToPanes(1,&options,wop); @@ -264,7 +264,7 @@ VOpts::VOpts() wop->addOptionLine(option); #endif - Remote::getInstance()->addOptionsToPanes(2,&options,wop); + Input::getInstance()->addOptionsToPanes(2,&options,wop); Video::getInstance()->addOptionsToPanes(2,&options,wop); Audio::getInstance()->addOptionsToPanes(2,&options,wop); } @@ -282,7 +282,7 @@ VOpts::~VOpts() int VOpts::handleCommand(int command) { // either is active, handle back - if (command == Remote::BACK) + if (command == Input::BACK) { doSave(); return 4; @@ -311,7 +311,7 @@ void VOpts::doSave() { VDR* vdr = VDR::getInstance(); - Remote::getInstance()->saveOptionstoServer(); //Remote + Input::getInstance()->saveOptionstoServer(); //Remote Video::getInstance()->saveOptionstoServer(); //Video Audio::getInstance()->saveOptionstoServer(); //Remote #ifdef VOMP_PLATTFORM_MVP @@ -511,7 +511,7 @@ void VOpts::processMessage(Message* m) } else if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vpicturebanner.cc b/vpicturebanner.cc index c1ceef6..8976198 100644 --- a/vpicturebanner.cc +++ b/vpicturebanner.cc @@ -21,7 +21,7 @@ #include "vpicturebanner.h" #include "wsymbol.h" -#include "remote.h" +#include "input.h" #include "colour.h" #include "video.h" #include "vinfo.h" @@ -109,18 +109,18 @@ void VPictureBanner::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } else if (y>=(int)area.h-24 && y<=(int)area.h-6) { //y coordinate is right! if (x>=7 &&x<=25) { - BoxStack::getInstance()->handleCommand(Remote::RED); //simulate red press + BoxStack::getInstance()->handleCommand(Input::RED); //simulate red press } else if (x>=110 &&x<=128) { - BoxStack::getInstance()->handleCommand(Remote::GREEN); //simulate red press + BoxStack::getInstance()->handleCommand(Input::GREEN); //simulate red press } } } diff --git a/vquestion.cc b/vquestion.cc index d51e0e5..81bc1ed 100644 --- a/vquestion.cc +++ b/vquestion.cc @@ -19,7 +19,7 @@ #include "vquestion.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" #include "colour.h" #include "i18n.h" @@ -81,27 +81,27 @@ int VQuestion::handleCommand(int command) { switch(command) { - case Remote::DF_LEFT: - case Remote::LEFT: + case Input::DF_LEFT: + case Input::LEFT: { swap(); draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::DF_RIGHT: - case Remote::RIGHT: + case Input::DF_RIGHT: + case Input::RIGHT: { swap(); draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::BACK: + case Input::BACK: { return 4; } - case Remote::OK: + case Input::OK: { if (selectedOption != YES) return 4; @@ -145,11 +145,11 @@ void VQuestion::processMessage(Message* m) { if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -158,7 +158,7 @@ void VQuestion::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vradiorec.cc b/vradiorec.cc index 232564c..9b9b5f0 100644 --- a/vradiorec.cc +++ b/vradiorec.cc @@ -32,7 +32,7 @@ #include "timers.h" #include "playerradio.h" #include "boxstack.h" -#include "remote.h" +#include "input.h" #include "vinfo.h" #include "i18n.h" #include "log.h" @@ -186,82 +186,82 @@ int VRadioRec::handleCommand(int command) { switch(command) { - case Remote::PLAY: + case Input::PLAY: { player->play(); doBar(0); return 2; } - case Remote::PLAYPAUSE: + case Input::PLAYPAUSE: { player->playpause(); doBar(0); return 2; } - case Remote::STOP: - case Remote::BACK: - case Remote::MENU: + case Input::STOP: + case Input::BACK: + case Input::MENU: { if (playing) stopPlay(); return 4; } - case Remote::PAUSE: + case Input::PAUSE: { player->pause(); doBar(0); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { doBar(3); player->skipForward(60); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { doBar(4); player->skipBackward(60); return 2; } - case Remote::YELLOW: + case Input::YELLOW: { doBar(2); player->skipBackward(10); return 2; } - case Remote::BLUE: + case Input::BLUE: { doBar(1); player->skipForward(10); return 2; } - case Remote::OK: + case Input::OK: { if (barShowing) removeBar(); else doBar(0); return 2; } - case Remote::ZERO: player->jumpToPercent(0); doBar(0); return 2; - case Remote::ONE: player->jumpToPercent(10); doBar(0); return 2; - case Remote::TWO: player->jumpToPercent(20); doBar(0); return 2; - case Remote::THREE: player->jumpToPercent(30); doBar(0); return 2; - case Remote::FOUR: player->jumpToPercent(40); doBar(0); return 2; - case Remote::FIVE: player->jumpToPercent(50); doBar(0); return 2; - case Remote::SIX: player->jumpToPercent(60); doBar(0); return 2; - case Remote::SEVEN: player->jumpToPercent(70); doBar(0); return 2; - case Remote::EIGHT: player->jumpToPercent(80); doBar(0); return 2; - case Remote::NINE: player->jumpToPercent(90); doBar(0); return 2; + case Input::ZERO: player->jumpToPercent(0); doBar(0); return 2; + case Input::ONE: player->jumpToPercent(10); doBar(0); return 2; + case Input::TWO: player->jumpToPercent(20); doBar(0); return 2; + case Input::THREE: player->jumpToPercent(30); doBar(0); return 2; + case Input::FOUR: player->jumpToPercent(40); doBar(0); return 2; + case Input::FIVE: player->jumpToPercent(50); doBar(0); return 2; + case Input::SIX: player->jumpToPercent(60); doBar(0); return 2; + case Input::SEVEN: player->jumpToPercent(70); doBar(0); return 2; + case Input::EIGHT: player->jumpToPercent(80); doBar(0); return 2; + case Input::NINE: player->jumpToPercent(90); doBar(0); return 2; #ifdef DEV - case Remote::RED: + case Input::RED: { //player->test1(); return 2; } - case Remote::GREEN: + case Input::GREEN: { //player->test2(); return 2; @@ -281,7 +281,7 @@ void VRadioRec::processMessage(Message* m) int y=(m->parameter&0xFFFF)-(int)getScreenY(); if (!barShowing) { - boxstack->handleCommand(Remote::OK); //simulate rok press + boxstack->handleCommand(Input::OK); //simulate rok press } else if ((int)barRegion.x<=x && (int)barRegion.y<=y && ((int)barRegion.x+(int)barRegion.w)>=x && ((int)barRegion.y+(int)barRegion.h)>=y) @@ -303,7 +303,7 @@ void VRadioRec::processMessage(Message* m) } else { - boxstack->handleCommand(Remote::OK); //simulate rok press + boxstack->handleCommand(Input::OK); //simulate rok press } } else if (m->message == Message::PLAYER_EVENT) diff --git a/vrecmove.cc b/vrecmove.cc index b84328c..361b1bf 100644 --- a/vrecmove.cc +++ b/vrecmove.cc @@ -22,7 +22,7 @@ #include "defines.h" #include "recording.h" -#include "remote.h" +#include "input.h" #include "vinfo.h" #include "colour.h" #include "video.h" @@ -109,23 +109,23 @@ int VRecMove::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); sl.draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::OK: + case Input::OK: { Message* m = new Message(); m->message = Message::MOVE_RECORDING; @@ -135,7 +135,7 @@ int VRecMove::handleCommand(int command) return 4; } - case Remote::BACK: + case Input::BACK: { return 4; } @@ -158,7 +158,7 @@ void VRecMove::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -167,7 +167,7 @@ void VRecMove::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vrecording.cc b/vrecording.cc index 6666c7a..cb569d9 100644 --- a/vrecording.cc +++ b/vrecording.cc @@ -19,7 +19,7 @@ #include "vrecording.h" -#include "remote.h" +#include "input.h" #include "recinfo.h" #include "vquestion.h" #include "vinfo.h" @@ -183,31 +183,31 @@ void VRecording::draw() int VRecording::handleCommand(int command) { - if (command==Remote::BACK) { + if (command==Input::BACK) { return 4; } if (buttons) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { tabbar.activateFocus(false); moveCursor(LEFT); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { tabbar.activateFocus(false); moveCursor(RIGHT); return 2; } - case Remote::LEFT: - case Remote::DF_LEFT: - case Remote::RIGHT: - case Remote::DF_RIGHT: + case Input::LEFT: + case Input::DF_LEFT: + case Input::RIGHT: + case Input::DF_RIGHT: { buttons = false; button[selected].setActive(0); @@ -217,7 +217,7 @@ int VRecording::handleCommand(int command) BoxStack::getInstance()->update(this); return 2; } - case Remote::OK: + case Input::OK: { if (selected == PLAY) @@ -336,8 +336,8 @@ int VRecording::handleCommand(int command) else if (retval == 2) { // command was taken and actively ignored - if (command==Remote::LEFT || command==Remote::DF_LEFT - || command==Remote::RIGHT || command==Remote::DF_RIGHT) + if (command==Input::LEFT || command==Input::DF_LEFT + || command==Input::RIGHT || command==Input::DF_RIGHT) { buttons=true; button[selected].setActive(1); @@ -413,7 +413,7 @@ void VRecording::processMessage(Message* m) { if (button[i].mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press buttons = true; cancel = false; break; @@ -434,7 +434,7 @@ void VRecording::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vrecordinglist.cc b/vrecordinglist.cc index f5a66ad..e683440 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -22,7 +22,7 @@ #include "recman.h" #include "directory.h" #include "recording.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "vrecordingmenu.h" @@ -66,7 +66,7 @@ void VRecordingList::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } else { @@ -75,7 +75,7 @@ void VRecordingList::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight()) { - boxstack->handleCommand(Remote::BACK); //simulate cancel press + boxstack->handleCommand(Input::BACK); //simulate cancel press } } } @@ -321,8 +321,8 @@ int VRecordingList::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); quickUpdate(); @@ -330,8 +330,8 @@ int VRecordingList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); quickUpdate(); @@ -339,7 +339,7 @@ int VRecordingList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); quickUpdate(); @@ -347,7 +347,7 @@ int VRecordingList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); quickUpdate(); @@ -355,7 +355,7 @@ int VRecordingList::handleCommand(int command) boxstack->update(this); return 2; } - case Remote::OK: + case Input::OK: { if (sl.getNumOptions() == 0) return 2; @@ -400,7 +400,7 @@ int VRecordingList::handleCommand(int command) // should not get to here return 1; } - case Remote::BACK: + case Input::BACK: { if (recman->isSubDir()) { @@ -415,15 +415,15 @@ int VRecordingList::handleCommand(int command) return 4; } } - case Remote::PLAYPAUSE: - case Remote::PLAY: + case Input::PLAYPAUSE: + case Input::PLAY: { if (doPlay(true)) return 2; return 1; } - case Remote::LEFT: - case Remote::RIGHT: - case Remote::ZERO: + case Input::LEFT: + case Input::RIGHT: + case Input::ZERO: { reSort(); return 2; diff --git a/vrecordinglistadvanced.cc b/vrecordinglistadvanced.cc index 9007d8a..b4e990b 100644 --- a/vrecordinglistadvanced.cc +++ b/vrecordinglistadvanced.cc @@ -24,7 +24,7 @@ #include "directory.h" #include "recording.h" #include "recinfo.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "vrecordingmenu.h" diff --git a/vrecordinglistclassic.cc b/vrecordinglistclassic.cc index 4e08a84..7f92a23 100644 --- a/vrecordinglistclassic.cc +++ b/vrecordinglistclassic.cc @@ -23,7 +23,7 @@ #include "recman.h" #include "directory.h" #include "recording.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "vrecordingmenu.h" diff --git a/vrecordingmenu.cc b/vrecordingmenu.cc index 1af32d8..1a10d67 100644 --- a/vrecordingmenu.cc +++ b/vrecordingmenu.cc @@ -19,7 +19,7 @@ #include "vrecordingmenu.h" -#include "remote.h" +#include "input.h" #include "recinfo.h" #include "vquestion.h" #include "vinfo.h" @@ -84,23 +84,23 @@ int VRecordingMenu::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); sl.draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::OK: + case Input::OK: { if (sl.getCurrentOptionData() == 1) { @@ -185,7 +185,7 @@ int VRecordingMenu::handleCommand(int command) [[fallthrough]]; // it won't, as long as sl.getCurrentOptionData() is 1-5, but keep the compiler happy } - case Remote::BACK: + case Input::BACK: { return 4; } @@ -208,7 +208,7 @@ void VRecordingMenu::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -217,7 +217,7 @@ void VRecordingMenu::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vscreensaver.cc b/vscreensaver.cc index fd5d4ea..6e2e6e3 100644 --- a/vscreensaver.cc +++ b/vscreensaver.cc @@ -22,7 +22,7 @@ #include "defines.h" #include "log.h" -#include "remote.h" +#include "input.h" #include "colour.h" #include "video.h" #include "surface.h" diff --git a/vserverselect.cc b/vserverselect.cc index bddee34..2a7fb39 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -21,7 +21,7 @@ #include "vserverselect.h" #include "defines.h" -#include "remote.h" +#include "input.h" #include "colour.h" #include "video.h" #include "boxstack.h" @@ -77,23 +77,23 @@ int VServerSelect::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); sl.draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.draw(); BoxStack::getInstance()->update(this); return 2; } - case Remote::OK: + case Input::OK: { Message* m = new Message(); // Question/Answer mech. Better being messages m->to = replyTo; @@ -121,7 +121,7 @@ void VServerSelect::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } } } diff --git a/vsleeptimer.cc b/vsleeptimer.cc index 85c3872..7402047 100644 --- a/vsleeptimer.cc +++ b/vsleeptimer.cc @@ -19,7 +19,7 @@ #include "vsleeptimer.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "colour.h" #include "video.h" @@ -238,7 +238,7 @@ int VSleeptimer::handleCommand(int command) { switch(command) { - case Remote::GO: + case Input::GO: { displaySleeptimer = Sleeptimer::getInstance()->SetTime(); draw(); diff --git a/vteletextview.cc b/vteletextview.cc index 975a58a..bc765f6 100644 --- a/vteletextview.cc +++ b/vteletextview.cc @@ -22,7 +22,7 @@ #include "video.h" #include "timers.h" #include "boxstack.h" -#include "remote.h" +#include "input.h" #include "playerlivetv.h" @@ -107,21 +107,21 @@ 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 switch (command) { - case Remote::OK: + case Input::OK: return 2; - case Remote::BACK: + case Input::BACK: if(player) player->tellSubtitlesOSDVisible(false); // Only on liveTV return 4; - case Remote::ZERO: - case Remote::ONE: - case Remote::TWO: - case Remote::THREE: - case Remote::FOUR: - case Remote::FIVE: - case Remote::SIX: - case Remote::SEVEN: - case Remote::EIGHT: - case Remote::NINE: + case Input::ZERO: + case Input::ONE: + case Input::TWO: + case Input::THREE: + case Input::FOUR: + case Input::FIVE: + case Input::SIX: + case Input::SEVEN: + case Input::EIGHT: + case Input::NINE: { // key in teletext page doKey(command); diff --git a/vtimeredit.cc b/vtimeredit.cc index b8dd5f6..480c28c 100644 --- a/vtimeredit.cc +++ b/vtimeredit.cc @@ -19,7 +19,7 @@ #include "vtimeredit.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "boxstack.h" #include "vdr.h" @@ -170,23 +170,23 @@ int VTimerEdit::handleCommand(int command) switch(command) { /* - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { ViewMan::getInstance()->updateView(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { ViewMan::getInstance()->updateView(this); return 2; } */ - case Remote::LEFT: - case Remote::DF_RIGHT: + case Input::LEFT: + case Input::DF_RIGHT: { swap(); buttonBack.draw(); @@ -194,8 +194,8 @@ int VTimerEdit::handleCommand(int command) BoxStack::getInstance()->update(this); return 2; } - case Remote::RIGHT: - case Remote::DF_LEFT: + case Input::RIGHT: + case Input::DF_LEFT: { swap(); buttonBack.draw(); @@ -203,7 +203,7 @@ int VTimerEdit::handleCommand(int command) BoxStack::getInstance()->update(this); return 2; } - case Remote::OK: + case Input::OK: { // Back if (selectedButton == 0) return 4; @@ -226,7 +226,7 @@ int VTimerEdit::handleCommand(int command) BoxStack::getInstance()->update(v); return 2; } - case Remote::BACK: + case Input::BACK: { return 4; } @@ -257,7 +257,7 @@ void VTimerEdit::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else if (m->message == Message::QUESTION_YES) { diff --git a/vtimerlist.cc b/vtimerlist.cc index 2a4f65d..5f4e75e 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -21,7 +21,7 @@ #include "vtimerlist.h" #include "message.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "colour.h" #include "video.h" @@ -265,37 +265,37 @@ int VTimerList::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); quickUpdate(); BoxStack::getInstance()->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); quickUpdate(); BoxStack::getInstance()->update(this); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); quickUpdate(); BoxStack::getInstance()->update(this); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); quickUpdate(); BoxStack::getInstance()->update(this); return 2; } - case Remote::OK: + case Input::OK: { RecTimer* recTimer = NULL; if (recTimerList) recTimer = (RecTimer*)sl.getCurrentOptionData(); @@ -309,7 +309,7 @@ int VTimerList::handleCommand(int command) return 2; } - case Remote::BACK: + case Input::BACK: { return 4; } @@ -332,7 +332,7 @@ void VTimerList::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -341,7 +341,7 @@ void VTimerList::processMessage(Message* m) 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 + BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 48a5b71..29abae0 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -32,7 +32,7 @@ #include "command.h" #include "i18n.h" #include "wtextbox.h" -#include "remote.h" +#include "input.h" #include "vaudioselector.h" #include "colour.h" #include "event.h" @@ -304,7 +304,7 @@ int VVideoLiveTV::handleCommand(int command) { switch(command) { - case Remote::BACK: + case Input::BACK: { if (osd.getVisible() && !textUnavailable.getVisible()) { @@ -314,7 +314,7 @@ int VVideoLiveTV::handleCommand(int command) // else drop through to stop } [[fallthrough]]; - case Remote::STOP: + case Input::STOP: { stop(); vchannelList->highlightChannel((*chanList)[currentChannelIndex]); @@ -322,9 +322,9 @@ int VVideoLiveTV::handleCommand(int command) } // NEW REMOTE ONLY - navigate EPG, bring it onscreen if it's not there - case Remote::UP: + case Input::UP: { - if (Remote::getInstance()->mayHaveFewButtons()) + if (Input::getInstance()->mayHaveFewButtons()) { if (okTriggeredOSD) doUpDown(false); else doChanUpDown(UP); @@ -335,9 +335,9 @@ int VVideoLiveTV::handleCommand(int command) } return 2; } - case Remote::DOWN: + case Input::DOWN: { - if (Remote::getInstance()->mayHaveFewButtons()) + if (Input::getInstance()->mayHaveFewButtons()) { if (okTriggeredOSD) doUpDown(true); else doChanUpDown(DOWN); @@ -348,23 +348,23 @@ int VVideoLiveTV::handleCommand(int command) } return 2; } - case Remote::LEFT: + case Input::LEFT: { doLeftRight(false); return 2; } - case Remote::RIGHT: + case Input::RIGHT: { doLeftRight(true); return 2; } // Continue new remote only... - case Remote::CHANNELUP: + case Input::CHANNELUP: { doChanUpDown(UP); return 2; } - case Remote::CHANNELDOWN: + case Input::CHANNELDOWN: { doChanUpDown(DOWN); return 2; @@ -379,14 +379,14 @@ int VVideoLiveTV::handleCommand(int command) // OK was pressed - osd shown manually, use up/down for epg nav // UP/DOWN was pressed to change channel, osd was shown auto, use up/down for ch+/ch- - case Remote::DF_UP: + case Input::DF_UP: { // Old remote, decide what to do based on okTriggeredOSD if (okTriggeredOSD) doUpDown(false); else doChanUpDown(UP); return 2; } - case Remote::DF_DOWN: + case Input::DF_DOWN: { // Old remote, decide what to do based on okTriggeredOSD if (okTriggeredOSD) doUpDown(true); @@ -396,53 +396,53 @@ int VVideoLiveTV::handleCommand(int command) // END NEW/OLD REMOTE STUFF - case Remote::PREVCHANNEL: + case Input::PREVCHANNEL: { channelChange(PREVIOUS, 0); osdChannelIndex = currentChannelIndex; displayOSD(true); return 2; } - case Remote::OK: + case Input::OK: { doOK(); return 2; } - case Remote::RED: - case Remote::MENU: + case Input::RED: + case Input::MENU: { doSummary(); return 2; } - case Remote::FULL: - case Remote::TV: + case Input::FULL: + case Input::TV: { toggleChopSides(); return 2; } - case Remote::ZERO: - case Remote::ONE: - case Remote::TWO: - case Remote::THREE: - case Remote::FOUR: - case Remote::FIVE: - case Remote::SIX: - case Remote::SEVEN: - case Remote::EIGHT: - case Remote::NINE: + case Input::ZERO: + case Input::ONE: + case Input::TWO: + case Input::THREE: + case Input::FOUR: + case Input::FIVE: + case Input::SIX: + case Input::SEVEN: + case Input::EIGHT: + case Input::NINE: { // key in channel number doKey(command); return 2; } - case Remote::GREEN: + case Input::GREEN: { if (streamType == VDR::VIDEO) doAudioSelector(); return 2; } - case Remote::YELLOW: + case Input::YELLOW: { if (streamType ==VDR::VIDEO) { @@ -450,13 +450,13 @@ int VVideoLiveTV::handleCommand(int command) } return 2; } - case Remote::GUIDE: - case Remote::BLUE: + case Input::GUIDE: + case Input::BLUE: { doEPG(); return 2; } - case Remote::RECORD: + case Input::RECORD: if (streamType == VDR::VIDEO) (static_cast(player))->toggleSubtitles(); return 2; @@ -1033,30 +1033,30 @@ void VVideoLiveTV::processMessage(Message* m) if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) && (boxRed.getY()<=y) && (boxRed.getY()+(int)boxRed.getHeight()>=y )) { - BoxStack::getInstance()->handleCommand(Remote::RED); + 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(Remote::GREEN); + 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(Remote::YELLOW); + 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(Remote::BLUE); + BoxStack::getInstance()->handleCommand(Input::BLUE); } else { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press } } else { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press } } else if (m->message == Message::CHANNEL_CHANGE) diff --git a/vvideomedia.cc b/vvideomedia.cc index c91cda0..d6154f8 100644 --- a/vvideomedia.cc +++ b/vvideomedia.cc @@ -32,7 +32,7 @@ #include "recording.h" #include "vaudioselector.h" #include "message.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" #include "vinfo.h" #include "i18n.h" @@ -202,14 +202,14 @@ int VVideoMedia::handleCommand(int command) { switch(command) { - case Remote::PLAY: + case Input::PLAY: { player->play(); doBar(0); return 2; } - case Remote::BACK: + case Input::BACK: { if (vsummary) { @@ -217,86 +217,86 @@ int VVideoMedia::handleCommand(int command) return 2; } } // DROP THROUGH - case Remote::STOP: - case Remote::MENU: + case Input::STOP: + case Input::MENU: { if (playing) stopPlay(); return 4; } - case Remote::PAUSE: + case Input::PAUSE: { player->pause(); doBar(0); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { doBar(3); player->skipForward(60); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { doBar(4); player->skipBackward(60); return 2; } - case Remote::FORWARD: + case Input::FORWARD: { player->fastForward(); doBar(0); return 2; } - case Remote::REVERSE: + case Input::REVERSE: { player->fastBackward(); doBar(0); return 2; } - case Remote::RED: + case Input::RED: { if (vsummary) removeSummary(); else doSummary(); return 2; } - case Remote::GREEN: + case Input::GREEN: { doAudioSelector(); return 2; } - case Remote::YELLOW: + case Input::YELLOW: { doBar(2); player->skipBackward(10); return 2; } - case Remote::BLUE: + case Input::BLUE: { doBar(1); player->skipForward(10); return 2; } - case Remote::STAR: + case Input::STAR: { doBar(2); player->skipBackward(10); return 2; } - case Remote::HASH: + case Input::HASH: { doBar(1); player->skipForward(10); return 2; } - case Remote::FULL: - case Remote::TV: + case Input::FULL: + case Input::TV: { toggleChopSides(); return 2; } - case Remote::OK: + case Input::OK: { if (vsummary) { @@ -312,16 +312,16 @@ int VVideoMedia::handleCommand(int command) return 2; } - case Remote::ZERO: player->jumpToPercent(0); doBar(0); return 2; - case Remote::ONE: player->jumpToPercent(10); doBar(0); return 2; - case Remote::TWO: player->jumpToPercent(20); doBar(0); return 2; - case Remote::THREE: player->jumpToPercent(30); doBar(0); return 2; - case Remote::FOUR: player->jumpToPercent(40); doBar(0); return 2; - case Remote::FIVE: player->jumpToPercent(50); doBar(0); return 2; - case Remote::SIX: player->jumpToPercent(60); doBar(0); return 2; - case Remote::SEVEN: player->jumpToPercent(70); doBar(0); return 2; - case Remote::EIGHT: player->jumpToPercent(80); doBar(0); return 2; - case Remote::NINE: player->jumpToPercent(90); doBar(0); return 2; + case Input::ZERO: player->jumpToPercent(0); doBar(0); return 2; + case Input::ONE: player->jumpToPercent(10); doBar(0); return 2; + case Input::TWO: player->jumpToPercent(20); doBar(0); return 2; + case Input::THREE: player->jumpToPercent(30); doBar(0); return 2; + case Input::FOUR: player->jumpToPercent(40); doBar(0); return 2; + case Input::FIVE: player->jumpToPercent(50); doBar(0); return 2; + case Input::SIX: player->jumpToPercent(60); doBar(0); return 2; + case Input::SEVEN: player->jumpToPercent(70); doBar(0); return 2; + case Input::EIGHT: player->jumpToPercent(80); doBar(0); return 2; + case Input::NINE: player->jumpToPercent(90); doBar(0); return 2; } @@ -340,7 +340,7 @@ void VVideoMedia::processMessage(Message* m) if (!barShowing) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press } else if (barRegion.x<=x && barRegion.y<=y && (barRegion.x+barRegion.w)>=x && (barRegion.y+barRegion.h)>=y) { @@ -361,7 +361,7 @@ void VVideoMedia::processMessage(Message* m) } else { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press } } else if (m->message == Message::PLAYER_EVENT) diff --git a/vvideorec.cc b/vvideorec.cc index 5b15739..43e4b7b 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -30,7 +30,7 @@ #include "recording.h" #include "vaudioselector.h" #include "message.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" #include "vinfo.h" #include "i18n.h" @@ -223,22 +223,22 @@ int VVideoRec::handleCommand(int command) { switch(command) { - case Remote::UP: - case Remote::PLAY: + case Input::UP: + case Input::PLAY: { player->play(); doBar(0); return 2; } - case Remote::PLAYPAUSE: + case Input::PLAYPAUSE: { player->playpause(); doBar(0); return 2; } - case Remote::BACK: + case Input::BACK: { if (vsummary) { @@ -247,58 +247,58 @@ int VVideoRec::handleCommand(int command) } } [[fallthrough]]; - case Remote::STOP: - case Remote::MENU: + case Input::STOP: + case Input::MENU: { if (playing) stopPlay(); return 4; } - case Remote::DOWN: - case Remote::PAUSE: + case Input::DOWN: + case Input::PAUSE: { player->pause(); doBar(0); return 2; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { doBar(3); player->skipForward(60); return 2; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { doBar(4); player->skipBackward(60); return 2; } - case Remote::RIGHT: - case Remote::FORWARD: + case Input::RIGHT: + case Input::FORWARD: { player->fastForward(); doBar(0); return 2; } - case Remote::LEFT: - case Remote::REVERSE: + case Input::LEFT: + case Input::REVERSE: { player->fastBackward(); doBar(0); return 2; } - case Remote::RED: + case Input::RED: { if (vsummary) removeSummary(); else doSummary(); return 2; } - case Remote::GREEN: + case Input::GREEN: { doAudioSelector(); return 2; } - case Remote::YELLOW: + case Input::YELLOW: { if (myRec->hasMarks()) { @@ -322,7 +322,7 @@ int VVideoRec::handleCommand(int command) } return 2; } - case Remote::BLUE: + case Input::BLUE: { if (myRec->hasMarks()) { @@ -346,31 +346,31 @@ int VVideoRec::handleCommand(int command) } return 2; } - case Remote::PREVCHANNEL: + case Input::PREVCHANNEL: { player->skipBackward(2); return 2; } - case Remote::STAR: + case Input::STAR: { doBar(2); player->skipBackward(10); return 2; } - case Remote::HASH: + case Input::HASH: { doBar(1); player->skipForward(10); return 2; } - case Remote::FULL: - case Remote::TV: + case Input::FULL: + case Input::TV: { toggleChopSides(); return 2; } - case Remote::OK: + case Input::OK: { if (vsummary) { @@ -383,20 +383,20 @@ int VVideoRec::handleCommand(int command) return 2; } - case Remote::ZERO: player->jumpToPercent(0); doBar(0); return 2; - case Remote::ONE: player->jumpToPercent(10); doBar(0); return 2; - case Remote::TWO: player->jumpToPercent(20); doBar(0); return 2; - case Remote::THREE: player->jumpToPercent(30); doBar(0); return 2; - case Remote::FOUR: player->jumpToPercent(40); doBar(0); return 2; - case Remote::FIVE: player->jumpToPercent(50); doBar(0); return 2; - case Remote::SIX: player->jumpToPercent(60); doBar(0); return 2; - case Remote::SEVEN: player->jumpToPercent(70); doBar(0); return 2; - case Remote::EIGHT: player->jumpToPercent(80); doBar(0); return 2; - case Remote::NINE: player->jumpToPercent(90); doBar(0); return 2; - - case Remote::RECORD: player->toggleSubtitles(); return 2; + case Input::ZERO: player->jumpToPercent(0); doBar(0); return 2; + case Input::ONE: player->jumpToPercent(10); doBar(0); return 2; + case Input::TWO: player->jumpToPercent(20); doBar(0); return 2; + case Input::THREE: player->jumpToPercent(30); doBar(0); return 2; + case Input::FOUR: player->jumpToPercent(40); doBar(0); return 2; + case Input::FIVE: player->jumpToPercent(50); doBar(0); return 2; + case Input::SIX: player->jumpToPercent(60); doBar(0); return 2; + case Input::SEVEN: player->jumpToPercent(70); doBar(0); return 2; + 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; #ifdef DEV -// case Remote::RED: +// case Input::RED: // { //Don't use RED for anything. It will eventually be recording summary @@ -458,7 +458,7 @@ void VVideoRec::processMessage(Message* m) if (!barShowing) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press } else if (barRegion.x<=x && barRegion.y<=y && (barRegion.x+barRegion.w)>=x && (barRegion.y+barRegion.h)>=y) { @@ -516,7 +516,7 @@ void VVideoRec::processMessage(Message* m) } else { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate rok press } } else if (m->from == player) diff --git a/vvolume.cc b/vvolume.cc index bf9dce1..eef3899 100644 --- a/vvolume.cc +++ b/vvolume.cc @@ -19,7 +19,7 @@ #include "vvolume.h" -#include "remote.h" +#include "input.h" #include "audio.h" #include "wsymbol.h" #include "colour.h" @@ -95,8 +95,8 @@ int VVolume::handleCommand(int command) { switch(command) { - case Remote::DF_LEFT: - case Remote::VOLUMEDOWN: + case Input::DF_LEFT: + case Input::VOLUMEDOWN: { displayVolume = Audio::getInstance()->volumeDown(); draw(); @@ -104,8 +104,8 @@ int VVolume::handleCommand(int command) // handled return 2; } - case Remote::DF_RIGHT: - case Remote::VOLUMEUP: + case Input::DF_RIGHT: + case Input::VOLUMEUP: { displayVolume = Audio::getInstance()->volumeUp(); draw(); diff --git a/vwelcome.cc b/vwelcome.cc index 5ce34fd..4e0f1e1 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -19,7 +19,7 @@ #include "vwelcome.h" -#include "remote.h" +#include "input.h" #include "vdr.h" #include "vchannellist.h" #include "vrecordinglistclassic.h" @@ -187,60 +187,60 @@ int VWelcome::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { sl.up(); sl.draw(); boxstack->update(this); return 2; } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.draw(); boxstack->update(this); return 2; } - case Remote::ONE: + case Input::ONE: { doChannelsList(); return 2; } - case Remote::TWO: + case Input::TWO: { doRadioList(); return 2; } - case Remote::THREE: + case Input::THREE: { doRecordingsList(); return 2; } - case Remote::FOUR: + case Input::FOUR: { doTimersList(); return 2; } - case Remote::FIVE: + case Input::FIVE: { #ifdef VOMP_PLATTFORM_MVP doMediaList(); #endif return 2; } - case Remote::SIX: + case Input::SIX: { doOptions(); return 2; } - case Remote::SEVEN: + case Input::SEVEN: { Command::getInstance()->doReboot(); return 2; } - case Remote::OK: + case Input::OK: { ULONG option = sl.getCurrentOptionData(); if (option == 1) @@ -281,7 +281,7 @@ int VWelcome::handleCommand(int command) return 2; // never gets here } //#ifdef DEV - case Remote::NINE: + case Input::NINE: { VScreensaver* vscreensaver = new VScreensaver(); boxstack->add(vscreensaver); @@ -293,7 +293,7 @@ int VWelcome::handleCommand(int command) //#endif // Test -// case Remote::BACK: +// case Input::BACK: // { // return 4; // } @@ -407,7 +407,7 @@ void VWelcome::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - boxstack->handleCommand(Remote::OK); //simulate OK press + boxstack->handleCommand(Input::OK); //simulate OK press } } } diff --git a/winmain.cc b/winmain.cc index 8f1ad64..7b1c0e2 100644 --- a/winmain.cc +++ b/winmain.cc @@ -564,7 +564,7 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam) //TODO: call command logger->log("Core", Log::NOTICE, "Window closed, shutting down..."); - ((RemoteWin*)Remote::getInstance())->SendPower(); + ((RemoteWin*)Input::getInstance())->SendPower(); PostQuitMessage(0); }break; case WM_SIZING: { diff --git a/woptionpane.cc b/woptionpane.cc index d2b053b..c2cdd62 100644 --- a/woptionpane.cc +++ b/woptionpane.cc @@ -24,7 +24,7 @@ #include "woptionbox.h" #include "log.h" #include "vdr.h" -#include "remote.h" +#include "input.h" #include "option.h" WOptionPane::WOptionPane() @@ -120,8 +120,8 @@ int WOptionPane::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (selectedOption > 0) { @@ -142,8 +142,8 @@ int WOptionPane::handleCommand(int command) return 1; } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { if (selectedOption < (numOptions - 1)) { @@ -159,19 +159,19 @@ int WOptionPane::handleCommand(int command) return 4; // Signal return control to parent } } - case Remote::DF_LEFT: - case Remote::LEFT: + case Input::DF_LEFT: + case Input::LEFT: { optionBoxes[selectedOption]->left(); return 1; } - case Remote::DF_RIGHT: - case Remote::RIGHT: + case Input::DF_RIGHT: + case Input::RIGHT: { optionBoxes[selectedOption]->right(); return 1; } - case Remote::OK: + case Input::OK: { optionBoxes[selectedOption]->cycle(); return 1; diff --git a/wpictureview.cc b/wpictureview.cc index 50be37c..8a0bc43 100644 --- a/wpictureview.cc +++ b/wpictureview.cc @@ -22,7 +22,7 @@ #include "wpictureview.h" #include "colour.h" -#include "remote.h" +#include "input.h" #include "osd.h" #include "movieinfo.h" #include "seriesinfo.h" @@ -151,8 +151,8 @@ int WPictureView::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (cur_scroll_line > 0) { @@ -165,8 +165,8 @@ int WPictureView::handleCommand(int command) return 4; // Signal return control to parent } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { if (rem_scroll_line > 0) { @@ -177,10 +177,10 @@ int WPictureView::handleCommand(int command) return 4; } } - case Remote::LEFT: - case Remote::RIGHT: - case Remote::DF_LEFT: - case Remote::DF_RIGHT: + case Input::LEFT: + case Input::RIGHT: + case Input::DF_LEFT: + case Input::DF_RIGHT: { return 5; } diff --git a/wremoteconfig.cc b/wremoteconfig.cc index 0d4497a..cb8ddd9 100644 --- a/wremoteconfig.cc +++ b/wremoteconfig.cc @@ -19,7 +19,7 @@ #include "wremoteconfig.h" -#include "remote.h" +#include "input.h" #include "wsymbol.h" #include "colour.h" #include "i18n.h" @@ -27,7 +27,7 @@ WRemoteConfig::WRemoteConfig() { - remote = Remote::getInstance(); + remote = Input::getInstance(); learnmode = false; active = false; @@ -102,7 +102,7 @@ bool WRemoteConfig::mouseLBDOWN(int x, int y) { if (sl.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press return true; } return false; @@ -136,7 +136,7 @@ void WRemoteConfig::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press + ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -145,7 +145,7 @@ void WRemoteConfig::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { - ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } @@ -169,7 +169,7 @@ int WRemoteConfig::handleCommand(int command) if (learnmode) { learnmode = false; - if (command == Remote::NA_LEARN) + if (command == Input::NA_LEARN) { initSelectList(false); } @@ -177,8 +177,8 @@ int WRemoteConfig::handleCommand(int command) } switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (sl.getCurrentOption() != 0) { @@ -192,8 +192,8 @@ int WRemoteConfig::handleCommand(int command) return 4; // return control to vopts } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { if (!active) { @@ -206,23 +206,23 @@ int WRemoteConfig::handleCommand(int command) } return 1; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); return 1; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); return 1; } - case Remote::OK: + case Input::OK: { learnmode = true; remote->EnterLearningMode(sl.getCurrentOptionData()); return 1; } - case Remote::BACK: + case Input::BACK: { return 0; /* @@ -241,7 +241,7 @@ int WRemoteConfig::handleCommand(int command) return 2; */ } - case Remote::MENU: + case Input::MENU: { remote->ResetToDefault(); initSelectList(false); diff --git a/wremoteconfig.h b/wremoteconfig.h index a3caa4c..78006b7 100644 --- a/wremoteconfig.h +++ b/wremoteconfig.h @@ -24,7 +24,7 @@ #include "boxx.h" #include "wselectlist.h" -class Remote; +class Input; class Message; class WRemoteConfig : public Boxx @@ -42,7 +42,7 @@ class WRemoteConfig : public Boxx private: WSelectList sl; - Remote *remote; + Input* remote; bool learnmode; void initSelectList(bool startup); bool active; diff --git a/wtabbar.cc b/wtabbar.cc index dae7390..dd3315e 100644 --- a/wtabbar.cc +++ b/wtabbar.cc @@ -20,7 +20,7 @@ #include "wtabbar.h" #include "surface.h" -#include "remote.h" +#include "input.h" #include "wbutton.h" #include "colour.h" @@ -144,24 +144,24 @@ int WTabBar::handleCommand(int command) { switch(command) { - case Remote::DF_LEFT: - case Remote::LEFT: + case Input::DF_LEFT: + case Input::LEFT: { if (!left()) return 2; draw(); return 1; } - case Remote::DF_RIGHT: - case Remote::RIGHT: + case Input::DF_RIGHT: + case Input::RIGHT: { if (!right()) return 2; draw(); return 1; } - case Remote::UP: - case Remote::DF_UP: - case Remote::DOWN: - case Remote::DF_DOWN: + case Input::UP: + case Input::DF_UP: + case Input::DOWN: + case Input::DF_DOWN: { int handleResult = tabs[visiblePane].pane->handleCommand(command); // A WOptionPane will accept control being passed into it from inactive, up or down (== 1). diff --git a/wtextbox.cc b/wtextbox.cc index a57bfdb..0d1f90e 100644 --- a/wtextbox.cc +++ b/wtextbox.cc @@ -21,7 +21,7 @@ #include "wtextbox.h" #include "colour.h" -#include "remote.h" +#include "input.h" WTextbox::WTextbox(const char* ttext): foreColour(DrawStyle::LIGHTTEXT) @@ -86,8 +86,8 @@ int WTextbox::handleCommand(int command) { switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (cur_scroll_line > 0) { @@ -100,8 +100,8 @@ int WTextbox::handleCommand(int command) return 4; // Signal return control to parent } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { if (rem_scroll_line > 0) { @@ -112,10 +112,10 @@ int WTextbox::handleCommand(int command) return 4; } } - case Remote::LEFT: - case Remote::RIGHT: - case Remote::DF_LEFT: - case Remote::DF_RIGHT: + case Input::LEFT: + case Input::RIGHT: + case Input::DF_LEFT: + case Input::DF_RIGHT: { return 5; } diff --git a/wwinaudiofilter.cc b/wwinaudiofilter.cc index 19a2cd6..c759902 100644 --- a/wwinaudiofilter.cc +++ b/wwinaudiofilter.cc @@ -20,7 +20,7 @@ #include "wwinaudiofilter.h" #include "audiowin.h" #include "i18n.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" WWinAudioFilter::WWinAudioFilter() @@ -112,7 +112,7 @@ bool WWinAudioFilter::mouseLBDOWN(int x, int y) { if (sl.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press return true; } return false; @@ -147,7 +147,7 @@ void WWinAudioFilter::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press + ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -156,7 +156,7 @@ void WWinAudioFilter::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { - ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } @@ -180,8 +180,8 @@ int WWinAudioFilter::handleCommand(int command) switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (sl.getCurrentOption() != 0) { @@ -195,34 +195,34 @@ int WWinAudioFilter::handleCommand(int command) return 4; //Control to vopts control } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { Log::getInstance()->log("P", Log::DEBUG, "1"); sl.down(); sl.setShowSelOption(true); return 1; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); sl.draw(); return 1; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); sl.draw(); return 1; } - case Remote::OK: + case Input::OK: { AudioWin*aw=(AudioWin*)Audio::getInstance(); aw->selectAudioFilter(sl.getCurrentOptionData()); return 1; } - case Remote::BACK: + case Input::BACK: { return 0; diff --git a/wwinmp3audiofilter.cc b/wwinmp3audiofilter.cc index 50392c3..85f5644 100644 --- a/wwinmp3audiofilter.cc +++ b/wwinmp3audiofilter.cc @@ -20,7 +20,7 @@ #include "wwinmp3audiofilter.h" #include "audiowin.h" #include "i18n.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" WWinMp3AudioFilter::WWinMp3AudioFilter() @@ -119,7 +119,7 @@ bool WWinMp3AudioFilter::mouseLBDOWN(int x, int y) { if (sl.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press return true; } return false; @@ -155,7 +155,7 @@ void WWinMp3AudioFilter::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press + ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -164,7 +164,7 @@ void WWinMp3AudioFilter::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { - ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } @@ -188,8 +188,8 @@ int WWinMp3AudioFilter::handleCommand(int command) switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (sl.getCurrentOption() != 0) { @@ -203,22 +203,22 @@ int WWinMp3AudioFilter::handleCommand(int command) return 4; //Control to vpots control } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.setShowSelOption(true); return 1; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); sl.draw(); return 1; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); sl.draw(); @@ -226,14 +226,14 @@ int WWinMp3AudioFilter::handleCommand(int command) return 1; } - case Remote::OK: + case Input::OK: { AudioWin*aw=(AudioWin*)Audio::getInstance(); aw->selectMp3AudioFilter(sl.getCurrentOptionData()); return 1; } - case Remote::BACK: + case Input::BACK: { return 0; diff --git a/wwinvideofilter.cc b/wwinvideofilter.cc index b91f45b..a179816 100644 --- a/wwinvideofilter.cc +++ b/wwinvideofilter.cc @@ -20,7 +20,7 @@ #include "wwinvideofilter.h" #include "videowin.h" #include "i18n.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" WWinVideoFilter::WWinVideoFilter() @@ -111,7 +111,7 @@ bool WWinVideoFilter::mouseLBDOWN(int x, int y) { if (sl.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press return true; } return false; @@ -147,7 +147,7 @@ void WWinVideoFilter::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press + ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -156,7 +156,7 @@ void WWinVideoFilter::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { - ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } @@ -180,8 +180,8 @@ int WWinVideoFilter::handleCommand(int command) switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (sl.getCurrentOption() != 0) { @@ -195,30 +195,30 @@ int WWinVideoFilter::handleCommand(int command) return 4; //Control to vopts control } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.setShowSelOption(true); return 1; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); return 1; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); return 1; } - case Remote::OK: + case Input::OK: { VideoWin*vw=(VideoWin*)Video::getInstance(); vw->selectVideoFilter(sl.getCurrentOptionData()); return 1; } - case Remote::BACK: + case Input::BACK: { return 0; diff --git a/wwinvideoh264filter.cc b/wwinvideoh264filter.cc index 7c6ec07..756cb46 100644 --- a/wwinvideoh264filter.cc +++ b/wwinvideoh264filter.cc @@ -20,7 +20,7 @@ #include "wwinvideoh264filter.h" #include "videowin.h" #include "i18n.h" -#include "remote.h" +#include "input.h" #include "boxstack.h" WWinVideoH264Filter::WWinVideoH264Filter() @@ -111,7 +111,7 @@ bool WWinVideoH264Filter::mouseLBDOWN(int x, int y) { if (sl.mouseLBDOWN(x,y)) { - BoxStack::getInstance()->handleCommand(Remote::OK); //simulate OK press + BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press return true; } return false; @@ -147,7 +147,7 @@ void WWinVideoH264Filter::processMessage(Message* m) { if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) { - ViewMan::getInstance()->handleCommand(Remote::OK); //simulate OK press + ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { @@ -156,7 +156,7 @@ void WWinVideoH264Filter::processMessage(Message* m) int y=(m->parameter&0xFFFF)-getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { - ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press + ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } } @@ -180,8 +180,8 @@ int WWinVideoH264Filter::handleCommand(int command) switch(command) { - case Remote::DF_UP: - case Remote::UP: + case Input::DF_UP: + case Input::UP: { if (sl.getCurrentOption() != 0) { @@ -195,30 +195,30 @@ int WWinVideoH264Filter::handleCommand(int command) return 4; //Control to vopts control } } - case Remote::DF_DOWN: - case Remote::DOWN: + case Input::DF_DOWN: + case Input::DOWN: { sl.down(); sl.setShowSelOption(true); return 1; } - case Remote::SKIPBACK: + case Input::SKIPBACK: { sl.pageUp(); return 1; } - case Remote::SKIPFORWARD: + case Input::SKIPFORWARD: { sl.pageDown(); return 1; } - case Remote::OK: + case Input::OK: { VideoWin*vw=(VideoWin*)Video::getInstance(); vw->selectVideoH264Filter(sl.getCurrentOptionData()); return 1; } - case Remote::BACK: + case Input::BACK: { return 0; -- 2.39.2