From fd0dcf2ba5dbd8a57e289e60019e0673b1dfa45d Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 15 Jan 2010 15:25:18 +0000 Subject: [PATCH] add zap by channel id git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@159 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/zapit/src/pzapit.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/zapit/src/pzapit.cpp b/src/zapit/src/pzapit.cpp index 01c864da1..9ff9407ee 100644 --- a/src/zapit/src/pzapit.cpp +++ b/src/zapit/src/pzapit.cpp @@ -35,6 +35,7 @@ int usage (const char * basename) std::cout << "channel list: " << basename << " [-ra] " << std::endl; std::cout << "zap by number: " << basename << " [-ra] " << std::endl; std::cout << "zap by name: " << basename << " [-ra] -n " << std::endl; + std::cout << "zap by channel id: " << basename << " -zi " << std::endl; std::cout << "set diseqc type: " << basename << " -dt " << std::endl; std::cout << "set diseqc repeats: " << basename << " -dr " << std::endl; std::cout << "(-ra toggles radio mode)" << std::endl; @@ -111,7 +112,7 @@ int main (int argc, char** argv) uint32_t diseqc[5]; unsigned int tmp; int scan_mode = 1; - + t_channel_id zapsid = 0; /* command line */ for (i = 1; i < argc; i++) { @@ -311,6 +312,14 @@ int main (int argc, char** argv) getchannel = true; continue; } + else if (!strncmp(argv[i], "-zi", 3)) + { + if (i < argc - 1) + { + sscanf(argv[++i], "%llx", &zapsid); + continue; + } + } else if (i < argc - 1) { if ((sscanf(argv[i], "%d", &bouquet) > 0) && (sscanf(argv[++i], "%u", &channel) > 0)) @@ -521,6 +530,15 @@ int main (int argc, char** argv) /* choose source mode */ zapit.setMode(radio ? CZapitClient::MODE_RADIO : CZapitClient::MODE_TV); + if (zapsid > 0) + { + printf("Zapping to: %llx (%s) ", zapsid, (zapit.getChannelName(zapsid)).c_str()); + tmp = zapit.zapTo_serviceID(zapsid); + if (!tmp) + printf("failed"); + printf("\n"); + return tmp; + } /* set audio channel */ if (audio) {