- add webradio; first steps

Conflicts:
	data/Makefile.am
	data/scripts/backup.sh
	src/neutrino.cpp
	src/zapit/include/zapit/zapit.h

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2017-11-03 09:36:19 +01:00
committed by Thilo Graf
parent 9bf563c96c
commit 3fd544737a
26 changed files with 149 additions and 44 deletions

View File

@@ -435,6 +435,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.make_hd_list = configfile.getInt32("make_hd_list", 0);
g_settings.make_webtv_list = configfile.getInt32("make_webtv_list", 1);
g_settings.make_webradio_list = configfile.getInt32("make_webradio_list", 1);
g_settings.make_new_list = configfile.getInt32("make_new_list", 1);
g_settings.make_removed_list = configfile.getInt32("make_removed_list", 1);
g_settings.keep_channel_numbers = configfile.getInt32("keep_channel_numbers", 0);
@@ -700,6 +701,11 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.webtv_xml.push_back(webtv_xml);
}
std::string webradio_xml = configfile.getString("webradio_xml", WEBRADIO_XML);
if (file_size(webradio_xml.c_str()))
g_settings.webradio_xml.push_back(webradio_xml);
loadKeys();
g_settings.timeshift_pause = configfile.getInt32( "timeshift_pause", 1 );
@@ -1148,6 +1154,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "make_hd_list", g_settings.make_hd_list);
configfile.setInt32( "make_webtv_list", g_settings.make_webtv_list);
configfile.setInt32( "make_webradio_list", g_settings.make_webradio_list);
configfile.setInt32( "make_new_list", g_settings.make_new_list);
configfile.setInt32( "make_removed_list", g_settings.make_removed_list);
configfile.setInt32( "keep_channel_numbers", g_settings.keep_channel_numbers);
@@ -1582,19 +1589,18 @@ void CNeutrinoApp::channelsInit(bool bOnly)
if(RADIOwebList) delete RADIOwebList;
TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true);
RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true);
TVbouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS));
TVfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS));
TVwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV));
RADIOwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV));
RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true);
RADIObouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS));
RADIOfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS));
RADIOwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBRADIO));
int tvi = 0, ri = 0;
ZapitChannelList zapitList, webtvList;
ZapitChannelList zapitList, webtvList, webradioList;
/* all TV channels */
CServiceManager::getInstance()->GetAllTvChannels(zapitList);
@@ -1672,6 +1678,20 @@ void CNeutrinoApp::channelsInit(bool bOnly)
printf("[neutrino] got %d WebTV channels\n", (int)webtvList.size()); fflush(stdout);
}
}
/* all WebRadio channels */
if (g_settings.make_webradio_list) {
if (CServiceManager::getInstance()->GetAllWebRadioChannels(webradioList)) {
/* all channels */
CBouquet* webradioBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_WEBRADIO), false, true);
webradioBouquet->channelList->SetChannelList(&webradioList);
RADIOallList->Bouquets.push_back(webradioBouquet);
/* "satellite" */
webradioBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_WEBRADIO), false, true);
webradioBouquet->channelList->SetChannelList(&webradioList);
RADIOsatList->Bouquets.push_back(webradioBouquet);
printf("[neutrino] got %d WebRadio channels\n", (int)webradioList.size()); fflush(stdout);
}
}
/* all HD channels */
if (g_settings.make_hd_list) {
if (CServiceManager::getInstance()->GetAllHDChannels(zapitList)) {
@@ -1742,7 +1762,7 @@ void CNeutrinoApp::channelsInit(bool bOnly)
if (b->getRadioChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) {
if(b->bUser)
tmp = RADIOfavList->addBouquet(b);
else if(b->bWebtv)
else if(b->bWebradio)
tmp = RADIOwebList->addBouquet(b);
else
tmp = RADIObouquetList->addBouquet(b);
@@ -2251,6 +2271,7 @@ TIMER_START();
ZapStart_arg.ci_clock = g_settings.ci_clock;
ZapStart_arg.volume = g_settings.current_volume;
ZapStart_arg.webtv_xml = &g_settings.webtv_xml;
ZapStart_arg.webradio_xml = &g_settings.webradio_xml;
ZapStart_arg.osd_resolution = g_settings.osd_resolution;
@@ -2606,7 +2627,7 @@ void CNeutrinoApp::RealRun()
}
}
if( ( mode == mode_tv ) || ( mode == mode_radio ) || ( mode == mode_webtv ) ) {
if( ( mode == mode_tv ) || ( mode == mode_radio ) || ( mode == mode_webtv ) || ( mode == mode_webradio ) ) {
if( (msg == NeutrinoMessages::SHOW_EPG) /* || (msg == CRCInput::RC_info) */ ) {
InfoClock->enableInfoClock(false);
StopSubtitles();
@@ -2739,7 +2760,18 @@ void CNeutrinoApp::RealRun()
StartSubtitles();
}
else if (((msg == CRCInput::RC_tv) || (msg == CRCInput::RC_radio)) && (g_settings.key_tvradio_mode == (int)CRCInput::RC_nokey)) {
switchTvRadioMode();//used with defined default tv/radio rc key
if (msg == CRCInput::RC_tv)
{
if (mode == mode_radio || mode == mode_webradio)
tvMode();
}
else if (msg == CRCInput::RC_radio)
{
if (mode == mode_tv || mode == mode_webtv)
radioMode();
}
else
switchTvRadioMode(); //used with defined default tv/radio rc key
}
/* in case key_subchannel_up/down redefined */
else if( msg == CRCInput::RC_left || msg == CRCInput::RC_right) {
@@ -3046,7 +3078,11 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
if (CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName()))
delete [] (unsigned char*) data;
else
{
if (mode == mode_webtv || mode == mode_webradio)
videoDecoder->setBlank(true);
g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, data);
}
} else
delete [] (unsigned char*) data;
}
@@ -3135,7 +3171,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
/* ================================== KEYS ================================================ */
if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && CNeutrinoApp::getInstance()->listModeKey(msg))) {
if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) {
if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv) || (mode == mode_webradio)) {
showChannelList(msg);
return messages_return::handled;
}
@@ -3431,7 +3467,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
dvbsub_stop();
if ((!isTVMode) && (mode != mode_radio)) {
if ((!isTVMode) && (mode != mode_radio) && (mode != mode_webradio)) {
radioMode(true);
}
else if (isTVMode && (mode != mode_tv) && (mode != mode_webtv)) {
@@ -3517,8 +3553,9 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
else if( msg == NeutrinoMessages::RELOAD_SETUP ) {
bool tmp1 = g_settings.make_hd_list;
bool tmp2 = g_settings.make_webtv_list;
bool tmp3 = g_settings.make_webradio_list;
loadSetup(NEUTRINO_SETTINGS_FILE);
if(tmp1 != g_settings.make_hd_list || tmp2 != g_settings.make_webtv_list)
if(tmp1 != g_settings.make_hd_list || tmp2 != g_settings.make_webtv_list || tmp3 != g_settings.make_webradio_list)
g_Zapit->reinitChannels();
SendSectionsdConfig();
@@ -3652,9 +3689,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
lastMode=mode;
mode=mode_ts;
}
if((data & mode_mask)== mode_webtv) {
if((data & mode_mask)== mode_webtv || (data & mode_mask)== mode_webradio) {
lastMode=mode;
mode=mode_webtv;
if ((data & mode_mask) == mode_webtv)
mode=mode_webtv;
else
mode=mode_webradio;
if ((data & norezap) != norezap) {
CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel();
if (cc && IS_WEBTV(cc->getChannelID())) {
@@ -4021,7 +4061,7 @@ void CNeutrinoApp::tvMode( bool rezap )
CRecordManager::getInstance()->StopAutoRecord();
}
#endif
if (mode != mode_webtv) {
if (mode != mode_webtv || mode != mode_webradio) {
frameBuffer->useBackground(false);
frameBuffer->paintBackground();
}
@@ -4064,7 +4104,7 @@ void CNeutrinoApp::scartMode( bool bOnOff )
#endif
mode = mode_unknown;
//re-set mode
if( lastMode == mode_radio ) {
if( lastMode == mode_radio || lastMode == mode_webradio) {
radioMode( false );
}
else if( lastMode == mode_tv || lastMode == mode_webtv) {
@@ -4244,7 +4284,7 @@ void CNeutrinoApp::radioMode( bool rezap)
{
//printf("radioMode: rezap %s\n", rezap ? "yes" : "no");
INFO("rezap %d current mode %d", rezap, mode);
if (mode == mode_webtv) {
if (mode == mode_webtv || mode == mode_webradio) {
CMoviePlayerGui::getInstance().setLastMode(mode_unknown);
CMoviePlayerGui::getInstance().stopPlayBack();
CVFD::getInstance()->ShowIcon(FP_ICON_TV, false);
@@ -4269,7 +4309,7 @@ void CNeutrinoApp::radioMode( bool rezap)
#endif
CRecordManager::getInstance()->StopAutoRecord();
if (mode != mode_webtv) {
if (mode != mode_webtv || mode != mode_webradio) {
frameBuffer->useBackground(false);
frameBuffer->paintBackground();
}
@@ -4311,7 +4351,7 @@ void CNeutrinoApp::switchTvRadioMode(const int prev_mode)
else if(prev_mode == mode_radio && mode != mode_radio)
radioMode();
} else {
if (mode == mode_radio )
if (mode == mode_radio || mode == mode_webradio)
tvMode();
else if(mode == mode_tv || mode == mode_webtv)
radioMode();
@@ -5105,7 +5145,8 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id)
TVallList->adjustToChannelID(channel_id);
}
else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) {
else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio
|| CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webradio) {
has_channel = RADIOfavList->adjustToChannelID(channel_id);
if (has_channel && first_mode_found < 0)
first_mode_found = LIST_MODE_FAV;