From 7404f46614032cdf71f201b58f13a02b7cb98c36 Mon Sep 17 00:00:00 2001 From: GetAway Date: Sun, 22 Apr 2018 20:58:31 +0200 Subject: [PATCH] pzapit -gm: reactivate get current TV/Radio mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bda07eeb14ddbcc0619e205d2f58d0da8d1ef693 Author: GetAway Date: 2018-04-22 (Sun, 22 Apr 2018) --- src/zapit/src/pzapit.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/zapit/src/pzapit.cpp b/src/zapit/src/pzapit.cpp index dcd902f31..a318d8a7e 100644 --- a/src/zapit/src/pzapit.cpp +++ b/src/zapit/src/pzapit.cpp @@ -30,6 +30,7 @@ int usage (const char * basename) { + std::cout << "get current TV/Radio mode: " << basename << " -gm" << std::endl; std::cout << "get current channel id: " << basename << " -gi" << std::endl; std::cout << "bouquet list: " << basename << " [-ra]" << std::endl; std::cout << "channel list: " << basename << " [-ra] " << std::endl; @@ -112,6 +113,7 @@ int main (int argc, char** argv) bool sendMotorCommand = false; bool quiet = false; bool getchannel = false; + bool getmode = false; bool aspectratio = false; bool mode43 = false; uint8_t motorCmdType = 0; @@ -335,6 +337,11 @@ int main (int argc, char** argv) continue; } } + else if (!strncmp(argv[i], "-gm", 3)) + { + getmode = true; + continue; + } else if (!strncmp(argv[i], "-gi", 3)) { getchannel = true; @@ -586,6 +593,20 @@ int main (int argc, char** argv) //zapit.startPlayBack(); return 0; } + + if (getmode) + { + int mode = zapit.getMode(); // 1 = TV, 2 = Radio + std::cout << "Mode: " << mode; + if (mode == CZapitClient::MODE_TV) + std::cout << " (TV)" << std::endl; + else if (mode == CZapitClient::MODE_RADIO) + std::cout << " (Radio)" << std::endl; + else + std::cout << " (unknown!)" << std::endl; + return mode; + } + if (getchannel) { t_channel_id channelid = zapit.getCurrentServiceID();