diff --git a/data/Makefile.am b/data/Makefile.am
index 5c1b89d24..9470c6b06 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -21,7 +21,7 @@ configdir = $(CONFIGDIR)
config_DATA = cables.xml satellites.xml encoding.conf tobackup.conf providermap.xml settingsupdate.conf terrestrial.xml bad_package_pattern.list.sample
#NI
-config_DATA += epglanguages.conf webtv_usr.xml
+config_DATA += epglanguages.conf webtv_usr.xml webradio_usr.xml
install-data-hook:
$(INSTALL) -d $(DESTDIR)/$(CONFIGDIR)/zapit
diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale
index 1cbb07a97..c15fa81b0 100644
--- a/data/locale/deutsch.locale
+++ b/data/locale/deutsch.locale
@@ -233,6 +233,7 @@ bouquetname.new Neue Kanäle
bouquetname.other Unbekannter Provider
bouquetname.removed Gelöschte Kanäle
bouquetname.uhdtv UHD-Kanäle
+bouquetname.webradio WebRadio-Kanäle
bouquetname.webtv WebTV-Kanäle
buildinfo.compiled_on Build Host
buildinfo.compiled_with Compiler Version
diff --git a/data/locale/english.locale b/data/locale/english.locale
index 577e88d57..ab1a180f9 100644
--- a/data/locale/english.locale
+++ b/data/locale/english.locale
@@ -233,6 +233,7 @@ bouquetname.new New channels
bouquetname.other Unknown provider
bouquetname.removed Removed channels
bouquetname.uhdtv UHD channels
+bouquetname.webradio WebRadio channels
bouquetname.webtv WebTV channels
buildinfo.compiled_on Build Host
buildinfo.compiled_with Compiler version
diff --git a/data/scripts/backup.sh b/data/scripts/backup.sh
index 6b84160da..403c4daff 100755
--- a/data/scripts/backup.sh
+++ b/data/scripts/backup.sh
@@ -40,6 +40,7 @@ TOBACKUP="\
/var/tuxbox/config/timerd.conf \
/var/tuxbox/config/tuxcal/ \
/var/tuxbox/config/tuxmail/ \
+ /var/tuxbox/config/webradio_usr.xml \
/var/tuxbox/config/webtv_usr.xml \
/var/tuxbox/config/Y-Web.conf \
/var/tuxbox/config/zapit/ \
diff --git a/data/webradio_usr.xml b/data/webradio_usr.xml
new file mode 100644
index 000000000..723b703af
--- /dev/null
+++ b/data/webradio_usr.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp
index c2d670f5a..e862ca5ca 100644
--- a/src/gui/bedit/bouqueteditor_channels.cpp
+++ b/src/gui/bedit/bouqueteditor_channels.cpp
@@ -174,7 +174,7 @@ std::string CBEChannelWidget::getInfoText(int index)
std::string satname = CServiceManager::getInstance()->GetSatelliteName((*Channels)[index]->getSatellitePosition());
if (IS_WEBTV((*Channels)[index]->getChannelID()))
- satname = "WebTV";
+ satname = "Web-Channel"; // TODO split into WebTV/WebRadio
transponder t;
CServiceManager::getInstance()->GetTransponder((*Channels)[index]->getTransponderId(), t);
std::string desc = t.description();
diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp
index 4ad6606f8..4e035795a 100644
--- a/src/gui/bedit/bouqueteditor_chanselect.cpp
+++ b/src/gui/bedit/bouqueteditor_chanselect.cpp
@@ -178,7 +178,7 @@ std::string CBEChannelSelectWidget::getInfoText(int index)
std::string satname = CServiceManager::getInstance()->GetSatelliteName(Channels[index]->getSatellitePosition());
if (IS_WEBTV(Channels[index]->getChannelID()))
- satname = "WebTV";
+ satname = "Web-Channel"; // TODO split into WebTV/WebRadio
transponder t;
CServiceManager::getInstance()->GetTransponder(Channels[index]->getTransponderId(), t);
std::string desc = t.description();
diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp
index c55fe72c8..25538e9ec 100644
--- a/src/gui/bouquetlist.cpp
+++ b/src/gui/bouquetlist.cpp
@@ -248,9 +248,9 @@ int CBouquetList::doMenu()
/* provider bouquet */
if (zapitBouquet && !zapitBouquet->bUser) {
menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_COPY, true, NULL, selector, cnt, CRCInput::RC_blue), old_selected == i ++);
- if (!zapitBouquet->bWebtv && g_settings.epg_scan == CEpgScan::SCAN_SEL)
+ if ((!zapitBouquet->bWebtv && !zapitBouquet->bWebradio) && g_settings.epg_scan == CEpgScan::SCAN_SEL)
menu->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &zapitBouquet->bScanEpg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
- if (!zapitBouquet->bWebtv)
+ if (!zapitBouquet->bWebtv && !zapitBouquet->bWebradio)
menu->addItem(new CMenuOptionChooser(LOCALE_CI_USE, &zapitBouquet->bUseCI, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu->exec(NULL, "");
delete menu;
@@ -319,9 +319,9 @@ int CBouquetList::doMenu()
} else {
/* user or satellite bouquet */
menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_red), old_selected == i ++);
- if (zapitBouquet && !zapitBouquet->bWebtv && (g_settings.epg_scan == CEpgScan::SCAN_SEL))
+ if (zapitBouquet && (!zapitBouquet->bWebtv && !zapitBouquet->bWebradio) && (g_settings.epg_scan == CEpgScan::SCAN_SEL))
menu->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN, &zapitBouquet->bScanEpg, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
- if (zapitBouquet && !zapitBouquet->bWebtv)
+ if (zapitBouquet && (!zapitBouquet->bWebtv && !zapitBouquet->bWebradio))
menu->addItem(new CMenuOptionChooser(LOCALE_CI_USE, &zapitBouquet->bUseCI, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu->exec(NULL, "");
diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp
index 012b30792..560eff193 100644
--- a/src/gui/channellist.cpp
+++ b/src/gui/channellist.cpp
@@ -329,7 +329,7 @@ int CChannelList::doChannelMenu(void)
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
bool empty = (*chanlist).empty();
- bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && !bouquet->zapitBouquet->bWebtv);
+ bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && (!bouquet->zapitBouquet->bWebtv && !bouquet->zapitBouquet->bWebradio));
bool got_history = (CNeutrinoApp::getInstance()->channelList->getLastChannels().size() > 1);
int i = 0;
diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp
index b2f5601b4..d0ff919ae 100644
--- a/src/gui/infoviewer.cpp
+++ b/src/gui/infoviewer.cpp
@@ -834,7 +834,8 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap
//fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_settings.infobar_show_channellogo, ChannelLogoMode, logo_ok);
if (g_settings.infobar_sat_display) {
- std::string name = (IS_WEBTV(current_channel_id))? "WebTV" : CServiceManager::getInstance()->GetSatelliteName(satellitePosition);
+ // TODO split into WebTV/WebRadio
+ std::string name = (IS_WEBTV(current_channel_id))? "Web-Channel" : CServiceManager::getInstance()->GetSatelliteName(satellitePosition);
int satNameWidth = g_SignalFont->getRenderWidth (name);
std::string satname_tmp = name;
if (satNameWidth > (ChanWidth - numbox_offset*2)) {
diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp
index b1c2910aa..96070beaf 100644
--- a/src/gui/lua/luainstance.cpp
+++ b/src/gui/lua/luainstance.cpp
@@ -380,6 +380,7 @@ static void set_lua_variables(lua_State *L)
{ "TS", (lua_Integer)CNeutrinoApp::mode_ts },
{ "OFF", (lua_Integer)CNeutrinoApp::mode_off },
{ "WEBTV", (lua_Integer)CNeutrinoApp::mode_webtv },
+ { "WEBRADIO", (lua_Integer)CNeutrinoApp::mode_webradio },
{ "MASK", (lua_Integer)CNeutrinoApp::mode_mask },
{ "NOREZAP", (lua_Integer)CNeutrinoApp::norezap },
{ NULL, 0 }
diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp
index ad837bbef..940773f4a 100644
--- a/src/gui/streaminfo2.cpp
+++ b/src/gui/streaminfo2.cpp
@@ -781,7 +781,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT);
- snprintf(buf, sizeof(buf), "%s", IS_WEBTV(channel->getChannelID()) ? g_Locale->getText(LOCALE_WEBTV_HEAD) :
+ // TODO: split info WebTV/WebRadio
+ snprintf(buf, sizeof(buf), "%s", IS_WEBTV(channel->getChannelID()) ? "Web-Channel" :
CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()).c_str());
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT);
diff --git a/src/neutrino.cpp b/src/neutrino.cpp
index a7565ce76..77857cbd1 100644
--- a/src/neutrino.cpp
+++ b/src/neutrino.cpp
@@ -476,6 +476,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);
@@ -756,10 +757,15 @@ int CNeutrinoApp::loadSetup(const char * fname)
if (file_size(webtv_xml.c_str()))
g_settings.webtv_xml.push_back(webtv_xml);
}
+
//NI
CWebTVSetup webtvsetup;
webtvsetup.webtv_xml_auto();
+ 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 );
@@ -1273,6 +1279,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);
@@ -1724,19 +1731,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);
@@ -1814,6 +1820,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)) {
@@ -1884,7 +1904,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);
@@ -2389,6 +2409,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;
@@ -2777,7 +2798,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 ) ) {
//NI
if (blank_screen) {
if (!videoDecoder->getBlank()) {
@@ -2941,7 +2962,7 @@ void CNeutrinoApp::RealRun()
else if (((msg == CRCInput::RC_tv) || (msg == CRCInput::RC_radio)) && (g_settings.key_tvradio_mode == (int)CRCInput::RC_nokey)) {
if (msg == CRCInput::RC_tv)
{
- if (mode == mode_radio)
+ if (mode == mode_radio || mode == mode_webradio)
tvMode();
}
else if (msg == CRCInput::RC_radio)
@@ -3269,7 +3290,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
delete [] (unsigned char*) data;
else
{
- if (mode == mode_webtv)
+ if (mode == mode_webtv || mode == mode_webradio)
videoDecoder->setBlank(true);
g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, data);
}
@@ -3361,7 +3382,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;
}
@@ -3662,7 +3683,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)) {
@@ -3749,8 +3770,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();
@@ -3884,9 +3906,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())) {
@@ -4249,7 +4274,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();
}
@@ -4292,7 +4317,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) {
@@ -4487,7 +4512,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);
@@ -4512,7 +4537,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();
}
@@ -4554,7 +4579,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();
@@ -5435,7 +5460,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;
diff --git a/src/neutrino.h b/src/neutrino.h
index 92b1d6605..79bf0f653 100644
--- a/src/neutrino.h
+++ b/src/neutrino.h
@@ -157,6 +157,7 @@ public:
mode_off = 8,
mode_webtv = 9,
mode_upnp = 10,
+ mode_webradio = 11,
mode_mask = 0xFF,
norezap = 0x100
};
diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h
index 81f77fa6c..d0fa25562 100644
--- a/src/neutrinoMessages.h
+++ b/src/neutrinoMessages.h
@@ -182,6 +182,7 @@ struct NeutrinoMessages {
mode_ts = 7,
mode_webtv = 9,
mode_upnp = 10,
+ mode_webradio = 11,
mode_mask = 0xFF,
norezap = 0x100
};
diff --git a/src/system/locals.h b/src/system/locals.h
index dc90562d6..f2abc9446 100644
--- a/src/system/locals.h
+++ b/src/system/locals.h
@@ -260,6 +260,7 @@ typedef enum
LOCALE_BOUQUETNAME_OTHER,
LOCALE_BOUQUETNAME_REMOVED,
LOCALE_BOUQUETNAME_UHDTV,
+ LOCALE_BOUQUETNAME_WEBRADIO,
LOCALE_BOUQUETNAME_WEBTV,
LOCALE_BUILDINFO_COMPILED_ON,
LOCALE_BUILDINFO_COMPILED_WITH,
diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h
index e82eb53ae..ea31703f1 100644
--- a/src/system/locals_intern.h
+++ b/src/system/locals_intern.h
@@ -260,6 +260,7 @@ const char * locale_real_names[] =
"bouquetname.other",
"bouquetname.removed",
"bouquetname.uhdtv",
+ "bouquetname.webradio",
"bouquetname.webtv",
"buildinfo.compiled_on",
"buildinfo.compiled_with",
diff --git a/src/system/settings.h b/src/system/settings.h
index 95dfdccf2..e6fcc05fa 100644
--- a/src/system/settings.h
+++ b/src/system/settings.h
@@ -264,6 +264,7 @@ struct SNeutrinoSettings
int standby_cpufreq;
int make_hd_list;
int make_webtv_list;
+ int make_webradio_list;
int make_new_list;
int make_removed_list;
int keep_channel_numbers;
@@ -328,6 +329,7 @@ struct SNeutrinoSettings
std::string ifname;
std::list webtv_xml;
+ std::list webradio_xml;
//personalize
enum PERSONALIZE_SETTINGS //settings.h
diff --git a/src/zapit/include/zapit/bouquets.h b/src/zapit/include/zapit/bouquets.h
index 2adc88f4b..49ae8e21a 100644
--- a/src/zapit/include/zapit/bouquets.h
+++ b/src/zapit/include/zapit/bouquets.h
@@ -43,6 +43,7 @@ class CZapitBouquet
bool bOther;
int bScanEpg;
bool bWebtv; // dont save
+ bool bWebradio; // dont save
int bUseCI;
t_satellite_position satellitePosition;
@@ -59,6 +60,7 @@ class CZapitBouquet
bOther = DEFAULT_BQ_OTHER;
bScanEpg = DEFAULT_BQ_SCANEPG;
bWebtv = false;
+ bWebradio = false;
bUseCI = false;
}
@@ -148,6 +150,8 @@ class CBouquetManager
void setBouquetLock(const unsigned int id, bool state);
void setBouquetLock(CZapitBouquet* bouquet, bool state);
void loadWebtv();
+ void loadWebradio();
+ void loadWebchannels(int mode);
//bouquet writeChannelsNames selection options
enum{
BWN_NEVER,
diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h
index bd0973ec4..ba601e27c 100644
--- a/src/zapit/include/zapit/channel.h
+++ b/src/zapit/include/zapit/channel.h
@@ -121,13 +121,13 @@ class CZapitChannel
private:
/* channel name */
std::string name;
- /* scripts for webtv livestreams */
+ /* scripts for webtv/webradio livestreams */
std::string script;
/* TODO : Enable different unames in different bouquets ( generated bouquetID ? ) */
std::string uname;
t_channel_id epg_id;
- /* WebTV */
+ /* WebTV/WebRadio */
std::string url;
std::string desc;
@@ -210,7 +210,7 @@ class CZapitChannel
/* constructor, desctructor */
CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t freq, const std::string script_name="");
CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name="");
- CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid = 0, const char* script_name=NULL);
+ CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid = 0, const char* script_name=NULL, int MODE = 0 /*MODE_WEBTV*/);
~CZapitChannel(void);
/* get methods - read only variables */
diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h
index 8094ea7fa..cbe39c1b0 100644
--- a/src/zapit/include/zapit/getservices.h
+++ b/src/zapit/include/zapit/getservices.h
@@ -145,6 +145,7 @@ class CServiceManager
bool GetAllHDChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
bool GetAllUHDChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
bool GetAllWebTVChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
+ bool GetAllWebRadioChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
bool GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position, int flags = CZapitChannel::PRESENT);
bool GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid, int flags = CZapitChannel::PRESENT);
bool GetAllUnusedChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT);
diff --git a/src/zapit/include/zapit/settings.h b/src/zapit/include/zapit/settings.h
index d22b11ddd..570e0c72a 100644
--- a/src/zapit/include/zapit/settings.h
+++ b/src/zapit/include/zapit/settings.h
@@ -49,6 +49,7 @@
#define SATELLITES_XML CONFIGDIR "/satellites.xml"
#define TERRESTRIAL_XML CONFIGDIR "/terrestrial.xml"
#define WEBTV_XML CONFIGDIR "/webtv_usr.xml"
+#define WEBRADIO_XML CONFIGDIR "/webradio_usr.xml"
#if HAVE_TRIPLEDRAGON == 0
#define AUDIO_DEVICE "/dev/dvb/adapter0/audio0"
diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h
index 530d37675..524e0e67a 100644
--- a/src/zapit/include/zapit/zapit.h
+++ b/src/zapit/include/zapit/zapit.h
@@ -46,8 +46,14 @@ typedef struct ZAPIT_start_arg
int volume;
int ci_clock;
std::list *webtv_xml;
+ std::list *webradio_xml;
} Z_start_arg;
+enum {
+ MODE_WEBTV = 0,
+ MODE_WEBRADIO
+};
+
typedef struct Zapit_config {
int writeChannelsNames;
int makeRemainingChannelsBouquet;
@@ -118,6 +124,7 @@ class CZapit : public OpenThreads::Thread
int volume_percent;
std::list *webtv_xml;
+ std::list *webradio_xml;
int currentMode;
bool playbackStopForced;
@@ -271,6 +278,7 @@ class CZapit : public OpenThreads::Thread
void unlockPlayBack(const bool sendpmt = true);
void Rezap();
std::list *GetWebTVXML(void) { return webtv_xml; }
+ std::list *GetWebRadioXML(void) { return webradio_xml; }
//NI
bool getUseChannelFilter();
void setMoviePlayer(bool enable);
diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp
index 36d5a168a..de28df028 100644
--- a/src/zapit/src/bouquets.cpp
+++ b/src/zapit/src/bouquets.cpp
@@ -273,7 +273,7 @@ void CBouquetManager::saveBouquets(void)
for (unsigned int i = 0; i < Bouquets.size(); i++) {
if (Bouquets[i] != remainChannels) {
DBG("save Bouquets: name %s user: %d\n", Bouquets[i]->Name.c_str(), Bouquets[i]->bUser);
- if(!Bouquets[i]->bUser && !Bouquets[i]->bWebtv) {
+ if(!Bouquets[i]->bUser && (!Bouquets[i]->bWebtv || !Bouquets[i]->bWebradio)) {
writeBouquet(bouq_fd, i,false);
}
}
@@ -508,6 +508,7 @@ void CBouquetManager::loadBouquets(bool ignoreBouquetFile)
}
loadWebtv();
+ loadWebradio();
parseBouquetsXml(UBOUQUETS_XML, true);
renumServices();
CServiceManager::getInstance()->SetCIFilter();
@@ -810,13 +811,23 @@ CZapitBouquet* CBouquetManager::addBouquetIfNotExist(const std::string &name)
void CBouquetManager::loadWebtv()
{
- std::list *webtv_xml = CZapit::getInstance()->GetWebTVXML();
- if (!webtv_xml)
+ loadWebchannels(MODE_WEBTV);
+}
+
+void CBouquetManager::loadWebradio()
+{
+ loadWebchannels(MODE_WEBRADIO);
+}
+
+void CBouquetManager::loadWebchannels(int mode)
+{
+ std::list *webchannels_xml = (mode == MODE_WEBTV) ? CZapit::getInstance()->GetWebTVXML() : CZapit::getInstance()->GetWebRadioXML();
+ if (!webchannels_xml)
return;
- for (std::list::iterator it = webtv_xml->begin(); it != webtv_xml->end(); ++it) {
+ for (std::list::iterator it = webchannels_xml->begin(); it != webchannels_xml->end(); ++it) {
if (!access((*it).c_str(), R_OK)) {
- INFO("Loading webtv from %s ...", (*it).c_str());
+ INFO("Loading %s from %s ...", (mode == MODE_WEBTV) ? "webtv" : "webradio", (*it).c_str());
xmlDocPtr parser = parseXmlFile((*it).c_str());
if (parser == NULL)
continue;
@@ -827,11 +838,14 @@ void CBouquetManager::loadWebtv()
CZapitBouquet* pbouquet = NULL;
const char *prov = xmlGetAttribute(l0, "name");
if (!prov)
- prov = "WebTV";
+ prov = (mode == MODE_WEBTV) ? "WebTV" : "WebRadio";
pbouquet = addBouquetIfNotExist(prov);
- pbouquet->bWebtv = true;
+ if (mode == MODE_WEBTV)
+ pbouquet->bWebtv = true;
+ else
+ pbouquet->bWebradio = true;
- while ((xmlGetNextOccurence(l1, "webtv"))) {
+ while ((xmlGetNextOccurence(l1, (mode == MODE_WEBTV) ? "webtv" : "webradio"))) {
const char *title = xmlGetAttribute(l1, "title");
const char *url = xmlGetAttribute(l1, "url");
const char *desc = xmlGetAttribute(l1, "description");
@@ -859,11 +873,14 @@ void CBouquetManager::loadWebtv()
if (genre) {
std::string bname = prov ? std::string(std::string(prov) + " ") + genre : genre;
gbouquet = addBouquetIfNotExist(bname);
- gbouquet->bWebtv = true;
+ if (mode == MODE_WEBTV)
+ gbouquet->bWebtv = true;
+ else
+ gbouquet->bWebradio = true;
}
if (title && url) {
t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, url);
- CZapitChannel * channel = new CZapitChannel(title, chid, url, desc, epg_id, script);
+ CZapitChannel * channel = new CZapitChannel(title, chid, url, desc, epg_id, script, mode);
CServiceManager::getInstance()->AddChannel(channel);
channel->flags = CZapitChannel::UPDATED;
if (gbouquet)
diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp
index ecf5cbf2a..17c0cf2b8 100644
--- a/src/zapit/src/channel.cpp
+++ b/src/zapit/src/channel.cpp
@@ -58,8 +58,8 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_
Init();
}
-// For WebTV ...
-CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid, const char* script_name)
+// For WebTV/WebRadio ...
+CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid, const char* script_name, int mode)
{
if (!p_name || !p_url)
return;
@@ -71,7 +71,10 @@ CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, cons
service_id = 0;
transport_stream_id = 0;
original_network_id = 0;
- serviceType = ST_DIGITAL_TELEVISION_SERVICE;
+ if (mode == MODE_WEBTV)
+ serviceType = ST_DIGITAL_TELEVISION_SERVICE;
+ else
+ serviceType = ST_DIGITAL_RADIO_SOUND_SERVICE;
satellitePosition = 0;
freq = 0;
epg_id = epgid;
diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp
index 024b19a20..23b2954ed 100644
--- a/src/zapit/src/getservices.cpp
+++ b/src/zapit/src/getservices.cpp
@@ -326,7 +326,17 @@ bool CServiceManager::GetAllWebTVChannels(ZapitChannelList &list, int flags)
{
list.clear();
for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) {
- if ((it->second.flags & flags) && !it->second.getUrl().empty())
+ if ((it->second.flags & flags) && !it->second.getUrl().empty() && (it->second.getServiceType() == ST_DIGITAL_TELEVISION_SERVICE))
+ list.push_back(&(it->second));
+ }
+ return (!list.empty());
+}
+
+bool CServiceManager::GetAllWebRadioChannels(ZapitChannelList &list, int flags)
+{
+ list.clear();
+ for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) {
+ if ((it->second.flags & flags) && !it->second.getUrl().empty() && (it->second.getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE))
list.push_back(&(it->second));
}
return (!list.empty());
diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp
index bf618f3b8..709f5a559 100644
--- a/src/zapit/src/zapit.cpp
+++ b/src/zapit/src/zapit.cpp
@@ -2463,6 +2463,7 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
current_volume = ZapStart_arg->volume;
webtv_xml = ZapStart_arg->webtv_xml;
+ webradio_xml = ZapStart_arg->webradio_xml;
videoDemux = new cDemux();
videoDemux->Open(DMX_VIDEO_CHANNEL);