From b94e0edacfcc4fe413048923b714008e7f48d689 Mon Sep 17 00:00:00 2001 From: striper Date: Thu, 26 Jan 2012 19:01:49 +0000 Subject: [PATCH 01/10] - extend debug output git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2077 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- lib/connection/basicserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection/basicserver.cpp b/lib/connection/basicserver.cpp index 903e3ccee..d391d65ff 100644 --- a/lib/connection/basicserver.cpp +++ b/lib/connection/basicserver.cpp @@ -135,7 +135,7 @@ bool CBasicServer::parse(bool (parse_command)(CBasicMessage::Header &rmsg, int c if (rmsg.version == version) parse_another_command = parse_command(rmsg, conn_fd); else - printf("[%s] Command ignored: cmd version %d received - server cmd version is %d\n", name.c_str(), rmsg.version, version); + printf("[%s] Command ignored: cmd %x version %d received - server cmd version is %d\n", name.c_str(), rmsg.cmd, rmsg.version, version); close(conn_fd); From 5f8fd9b42e0ed6f8c17a91925ae4fff807359e08 Mon Sep 17 00:00:00 2001 From: thilo Date: Sat, 28 Jan 2012 15:28:13 +0000 Subject: [PATCH 02/10] *neutrino personalize: add observed option choosers in personalize menu Add new parameter 'observer_Item'. If you want to observe an item with another item (observer), then use this new prameter. Effect: While user sets an option of an observer item to 'visible' or 'pin-protected', the observed items are deactivated. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2078 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/personalize.cpp | 136 +++++++++++++++++++++++++++++++++++----- src/gui/personalize.h | 30 ++++++--- 2 files changed, 140 insertions(+), 26 deletions(-) diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 12880afee..7cec2bbb7 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -56,6 +56,8 @@ CMenuItem *menuItem = pointer to a menuitem object, can be forwarders, locked forwarders and separators...NO CHOOSERS! const int *personalize_mode = optional, default NULL, pointer to a specified personalize setting look at: PERSONALIZE_MODE, this regulates the personalize mode const bool item_mode = optional, default true, if you don't want to see this item in personalize menue, then set it to false + CMenuItem *observer_Item = optional, default NULL, if you want to observe this item with another item (observer), then use this prameter. + Effect: this observed item will be deactivated, if observer is set to 'visible' or 'pin-protected' Icon handling: If you define an icon in the item object, this will be shown in the personalized menu but not the personilazitions menue itself, otherwise a shortcut will be create @@ -203,14 +205,18 @@ CPersonalizeGui::CPersonalizeGui() shortcut = 1; show_usermenu = false; show_pin_setup = false; - pers_notifier = NULL; + user_menu_notifier = NULL; fkeyMenu = NULL; plMenu = NULL; + tmpW = NULL; + v_observ.clear(); + options_count = 0; } CPersonalizeGui::~CPersonalizeGui() { v_widget.clear(); + v_observ.clear(); } int CPersonalizeGui::exec(CMenuTarget* parent, const string & actionKey) @@ -310,7 +316,7 @@ int CPersonalizeGui::ShowPersonalizationMenu() delete fkeyMenu; delete plMenu; v_userMenuSetup.clear(); - delete pers_notifier; + delete user_menu_notifier; return res; } @@ -367,15 +373,15 @@ void CPersonalizeGui::ShowUserMenu(CMenuWidget* p_widget, vectoraddItem(new CMenuOptionChooser(usermenu[0].menue_title, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RED_BUTTON], PERSONALIZE_ACTIVE_MODE_OPTIONS, PERSONALIZE_ACTIVE_MODE_MAX, true, pers_notifier));/*LOCALE_INFOVIEWER_EVENTLIST*/ + p_widget->addItem(new CMenuOptionChooser(usermenu[0].menue_title, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RED_BUTTON], PERSONALIZE_ACTIVE_MODE_OPTIONS, PERSONALIZE_ACTIVE_MODE_MAX, true, user_menu_notifier));/*LOCALE_INFOVIEWER_EVENTLIST*/ //blue - p_widget->addItem(new CMenuOptionChooser(usermenu[3].menue_title, &g_settings.personalize[SNeutrinoSettings::P_MAIN_BLUE_BUTTON], PERSONALIZE_ACTIVE_MODE_OPTIONS, PERSONALIZE_ACTIVE_MODE_MAX, true, pers_notifier));/*LOCALE_INFOVIEWER_STREAMINFO*/ + p_widget->addItem(new CMenuOptionChooser(usermenu[3].menue_title, &g_settings.personalize[SNeutrinoSettings::P_MAIN_BLUE_BUTTON], PERSONALIZE_ACTIVE_MODE_OPTIONS, PERSONALIZE_ACTIVE_MODE_MAX, true, user_menu_notifier));/*LOCALE_INFOVIEWER_STREAMINFO*/ //add usermenu items p_widget->addItem(new CMenuSeparator(CMenuSeparator::ALIGN_RIGHT | CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_USERMENU_NAME)); - pers_notifier->changeNotify(); + user_menu_notifier->changeNotify(); for (uint j = 0; jaddItem(v_umenu_fw[j]); @@ -413,9 +419,13 @@ void CPersonalizeGui::ShowMenuOptions(const int& widget) { string mn_name = v_widget[widget]->getName(); printf("[neutrino-personalize] exec %s...\n", __FUNCTION__); - + mn_widget_id_t w_index = widget+MN_WIDGET_ID_PERSONALIZE_MAIN; CMenuWidget* pm = new CMenuWidget(LOCALE_PERSONALIZE_HEAD, NEUTRINO_ICON_PERSONALIZE, width, w_index); + //reuqired in changeNotify() + options_count = 0; + tmpW = pm; + //************************* //subhead CMenuSeparator * pm_subhead = new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING); @@ -435,10 +445,29 @@ void CPersonalizeGui::ShowMenuOptions(const int& widget) if (i_mode != PERSONALIZE_SHOW_NO) { + //add items to the options menu if (i_mode == PERSONALIZE_SHOW_AS_ITEM_OPTION) { if (v_item[i].personalize_mode != NULL) //option chooser - pm->addItem(new CMenuOptionChooser(v_item[i].locale_name, v_item[i].personalize_mode, PERSONALIZE_MODE_OPTIONS, PERSONALIZE_MODE_MAX, v_item[i].menuItem->active)); + { + //get locale name and personalize mode + neutrino_locale_t name = v_item[i].locale_name; + int* p_mode = v_item[i].personalize_mode; + + //found observer item and if found, then define 'this' as observer for current option chooser and run changeNotify + bool is_observer = isObserver(v_item[i].widget, v_item[i].menuItem) ? true : false; + CChangeObserver* observer = is_observer ? this : NULL; + CMenuOptionChooser * opt = new CMenuOptionChooser(name, p_mode, PERSONALIZE_MODE_OPTIONS, PERSONALIZE_MODE_MAX, v_item[i].menuItem->active, observer); + if (is_observer) + changeNotify(name, (void*)p_mode); + + //required for first view: check active mode of option chooser and disable if it's an observed item and item mode is set to 'not visible' + for (uint j = 0; j < v_observ.size(); j++) + if (opt->getOptionName()== g_Locale->getText(v_observ[j].to_observ_locale) && *p_mode == PERSONALIZE_MODE_NOTVISIBLE) + opt->setActive(false); + + pm->addItem(opt); //add option chooser + } else pm->addItem(v_item[i].menuItem); //separator } @@ -459,14 +488,76 @@ void CPersonalizeGui::ShowMenuOptions(const int& widget) pm->addItem(v_item[i].menuItem); } } + } - + options_count = pm->getItemsCount(); pm->exec (NULL, ""); pm->hide (); delete pm; } +//returns true, if found an observer item +bool CPersonalizeGui::isObserver(CMenuWidget* widget, CMenuItem *item) +{ + for (uint i = 0; i < v_observ.size(); i++) + { + if (v_observ[i].widget == widget) + { + CMenuForwarder* fw = static_cast (item); + if (fw->getTextLocale() == v_observ[i].observer_locale) + return true; + } + } + return false; +} + + +bool CPersonalizeGui::changeNotify(const neutrino_locale_t locale, void *data) +{ + int opt_val = *(int*) data; + + //exit if no options found + int opt_count = options_count; + if (opt_count == 0 && locale == NONEXISTANT_LOCALE) + return true; + + //if found an option and handle + for (int i = 0; i < opt_count; i++){ + + //get current item + CMenuItem* item = tmpW->getItem(i); + if (item->isMenueOptionChooser()) + { + //if found an optionchooser, then extract option name + CMenuOptionChooser* chooser = static_cast (item); + string opt_name = chooser->getOptionName(); + + for (uint j = 0; j < v_observ.size(); j++) + { + //if found the same option name for an observer item then... + if (locale == v_observ[j].observer_locale) + { + //...compare for observed item + if (opt_name == g_Locale->getText(v_observ[j].to_observ_locale)) + { + //and if found an observed item, then set properties + if (opt_val == PERSONALIZE_MODE_VISIBLE || opt_val == PERSONALIZE_MODE_PIN) + { + chooser->setActive(false); + chooser->setOptionValue(PERSONALIZE_MODE_NOTVISIBLE); + }else{ + chooser->setActive(true); + chooser->setOptionValue(PERSONALIZE_MODE_VISIBLE); + } + } + } + } + } + } + return true; +} + //shows a short help message void CPersonalizeGui::ShowHelpPersonalize() { @@ -539,6 +630,14 @@ int CPersonalizeGui::getWidgetId(CMenuWidget *widget) return -1; } +void CPersonalizeGui::addObservedItem(CMenuWidget *widget, CMenuItem* observer_Item, CMenuItem* to_observ_Item) +{ + CMenuForwarder *fw[2] = { static_cast (observer_Item), + static_cast (to_observ_Item)}; + observ_menu_item_t item = {widget, fw[0]->getTextLocale(), fw[1]->getTextLocale()}; + v_observ.push_back(item); +} + //adds non personalized menu intro items objects with separator, back button and separator line to menu without personalizing parameters void CPersonalizeGui::addIntroItems(const int& widget_id) @@ -555,17 +654,20 @@ void CPersonalizeGui::addIntroItems(CMenuWidget *widget) //overloaded version from 'addItem', first parameter is an id from widget collection 'v_widget' -void CPersonalizeGui::addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode) +void CPersonalizeGui::addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode, CMenuItem *observer_Item) { - addItem(v_widget[widget_id], menu_Item, personalize_mode, defaultselected, item_mode); + addItem(v_widget[widget_id], menu_Item, personalize_mode, defaultselected, item_mode, observer_Item); } //adds a personalized menu item object to menu with personalizing parameters -void CPersonalizeGui::addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode) +void CPersonalizeGui::addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode, CMenuItem *observer_Item) { + if (observer_Item != NULL) + addObservedItem(widget, observer_Item, menu_Item); + CMenuForwarder *fw = static_cast (menu_Item); - menu_item_t item = {widget, menu_Item, defaultselected, fw->getTextLocale(), (int*)personalize_mode, item_mode}; + menu_item_t item = {widget, menu_Item, defaultselected, fw->getTextLocale(), (int*)personalize_mode, item_mode, observer_Item}; if (item_mode == PERSONALIZE_SHOW_AS_ACCESS_OPTION) { @@ -592,8 +694,8 @@ void CPersonalizeGui::addSeparator(const int& widget_id, const neutrino_locale_t //expands with parameter within you can show or hide this item in personalize options void CPersonalizeGui::addSeparator(CMenuWidget &widget, const neutrino_locale_t locale_text, const int& item_mode) { - menu_item_t to_add_sep[2] = { {&widget, GenericMenuSeparatorLine, false, locale_text, NULL, item_mode}, - {&widget, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, locale_text), false, locale_text, NULL, item_mode}}; + menu_item_t to_add_sep[2] = { {&widget, GenericMenuSeparatorLine, false, locale_text, NULL, item_mode, NULL}, + {&widget, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, locale_text), false, locale_text, NULL, item_mode, NULL}}; if (locale_text == NONEXISTANT_LOCALE) v_item.push_back(to_add_sep[0]); @@ -776,13 +878,13 @@ void CPersonalizeGui::restoreSettings() //helper class to enable/disable some items in usermenu setup -CPersonalizeNotifier::CPersonalizeNotifier( CMenuItem* i1, CMenuItem* i2) +CUserMenuNotifier::CUserMenuNotifier( CMenuItem* i1, CMenuItem* i2) { toDisable[0]=i1; toDisable[1]=i2; } -bool CPersonalizeNotifier::changeNotify(const neutrino_locale_t, void *) +bool CUserMenuNotifier::changeNotify(const neutrino_locale_t, void *) { toDisable[0]->setActive(g_settings.personalize[SNeutrinoSettings::P_MAIN_RED_BUTTON]); toDisable[1]->setActive(g_settings.personalize[SNeutrinoSettings::P_MAIN_BLUE_BUTTON]); diff --git a/src/gui/personalize.h b/src/gui/personalize.h index c78ead1e4..6c9b79045 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -65,12 +65,12 @@ extern CPlugins * g_PluginList; /* neutrino.cpp */ //helper class to enable/disable some items in usermenu setup -class CPersonalizeNotifier : public CChangeObserver +class CUserMenuNotifier : public CChangeObserver { private: CMenuItem* toDisable[2]; public: - CPersonalizeNotifier( CMenuItem*, CMenuItem*); + CUserMenuNotifier( CMenuItem*, CMenuItem*); bool changeNotify(const neutrino_locale_t = NONEXISTANT_LOCALE, void *data = NULL); }; @@ -97,8 +97,16 @@ typedef struct menu_item_t neutrino_locale_t locale_name; int* personalize_mode; int item_mode; + CMenuItem *observer_Item; }menu_item_struct_t; +typedef struct observ_menu_item_t +{ + CMenuWidget *widget; + neutrino_locale_t observer_locale; + neutrino_locale_t to_observ_locale; +}observ_menu_item_struct_t; + typedef struct raw_item_t { CMenuItem* menuItem; @@ -114,14 +122,15 @@ typedef struct personalize_settings_t } personalize_settings_struct_t; -class CPersonalizeGui : public CMenuTarget +class CPersonalizeGui : public CMenuTarget, public CChangeObserver { private: - CPersonalizeNotifier *pers_notifier; + CUserMenuNotifier *user_menu_notifier; CMenuWidget* fkeyMenu; CMenuWidget* plMenu; + CMenuWidget* tmpW; - int width, widget_count, shortcut; + int width, widget_count, shortcut, options_count; bool show_usermenu, show_pin_setup; //stuff for settings handlers @@ -133,7 +142,8 @@ class CPersonalizeGui : public CMenuTarget std::vector v_item; std::vector v_widget; - + std::vector v_observ; + int ShowPersonalizationMenu(); void ShowMenuOptions(const int& menu); void ShowHelpPersonalize(); @@ -146,7 +156,9 @@ class CPersonalizeGui : public CMenuTarget bool hasPinItems(); neutrino_msg_t getShortcut(const int & shortcut_num, neutrino_msg_t alternate_rc_key = CRCInput::RC_nokey); - + void addObservedItem(CMenuWidget *widget, CMenuItem *observer_Item, CMenuItem *to_observ_Item); + bool changeNotify(const neutrino_locale_t locale= NONEXISTANT_LOCALE, void *data = NULL); + bool isObserver(CMenuWidget* widget, CMenuItem * item); public: //general options for personalized items enum PERSONALIZE_MODE @@ -211,8 +223,8 @@ class CPersonalizeGui : public CMenuTarget int getItemsCount(CMenuWidget *widget); int getItemsCount(const int& widget_id); void setShortcut(const int& short_cut = 1) {shortcut = short_cut;}; - void addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION); - void addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION); + void addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION, CMenuItem *observer_Item = NULL); + void addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode = NULL, const bool defaultselected = false, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION, CMenuItem *observer_Item = NULL); void addIntroItems(CMenuWidget *widget); void addIntroItems(const int& widget_id); void addSeparator(CMenuWidget &menu, const neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const int& item_mode = PERSONALIZE_SHOW_AS_ITEM_OPTION); From 5ac1ce2690eaf42fe9bc05d096dac1945bbab1c3 Mon Sep 17 00:00:00 2001 From: thilo Date: Sat, 28 Jan 2012 15:28:18 +0000 Subject: [PATCH 03/10] *neutrino-menu: change order of tv/radio items and add observe parameters Required for personalize the tv/radio toggle option. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2079 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/neutrino_menue.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index bf952fde2..b08ec7797 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -142,24 +142,24 @@ void CNeutrinoApp::InitMenuMain() //1st section*************************************************************************************************** - //tv-mode - CMenuItem *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); - personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE]); - - //radio-mode - CMenuItem *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); - personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE]); - //tv <-> radio toggle - CMenuItem *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE]); + //tv-mode + CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch); //observed + + //radio-mode + CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch); //observed + //timer - CMenuItem *timerlist = new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); + CMenuForwarder *timerlist = new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); personalize.addItem(MENU_MAIN, timerlist, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TIMER]); //multimedia menu - CMenuItem *media = new CMenuForwarder(LOCALE_MAINMENU_MEDIA, true, NULL, CMediaPlayerMenu::getInstance(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); + CMenuForwarder *media = new CMenuForwarder(LOCALE_MAINMENU_MEDIA, true, NULL, CMediaPlayerMenu::getInstance(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); personalize.addItem(MENU_MAIN, media, &g_settings.personalize[SNeutrinoSettings::P_MAIN_MEDIA]); //separator From 369e67d26c37d0a1f2f233d6a5e0388a7c55a753 Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 1 Feb 2012 13:00:25 +0000 Subject: [PATCH 04/10] sectionsd: remove never used var &6 init var git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2080 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/sectionsd/SIevents.cpp | 6 ++++-- src/sectionsd/SIevents.hpp | 1 + src/sectionsd/SIsections.cpp | 8 ++++---- src/sectionsd/SIservices.hpp | 1 + src/sectionsd/sectionsd.cpp | 16 +++++----------- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/sectionsd/SIevents.cpp b/src/sectionsd/SIevents.cpp index bc18c0ada..28808a185 100644 --- a/src/sectionsd/SIevents.cpp +++ b/src/sectionsd/SIevents.cpp @@ -81,6 +81,7 @@ SIevent::SIevent(const t_original_network_id _original_network_id, const t_trans eventID = _event_id; table_id = 0xFF; /* not set */ version = 0xFF; + running = 0; /* contentClassification = ""; userClassification = ""; itemDescription = ""; @@ -336,7 +337,7 @@ void SIevent::dump(void) const for_each(ratings.begin(), ratings.end(), printSIparentalRating()); for_each(linkage_descs.begin(), linkage_descs.end(), printSIlinkage()); } - +#if 0 void SIevent::dumpSmall(void) const { for (std::map::const_iterator it = langName.begin() ; @@ -358,6 +359,7 @@ void SIevent::dumpSmall(void) const for_each(ratings.begin(), ratings.end(), printSIparentalRating()); for_each(linkage_descs.begin(), linkage_descs.end(), printSIlinkage()); } +#endif /* // Liest n Bytes aus einem Socket per read inline int readNbytes(int fd, char *buf, int n) @@ -520,7 +522,7 @@ void SIevents::removeOldEvents(long seconds) // Set has the important property that inserting a new element into a set does not // invalidate iterators that point to existing elements. - if (copy_of_event.times.size() != 0) + if (!copy_of_event.times.empty()) #ifdef DEBUG assert((++insert(it, copy_of_event)) == it); #else diff --git a/src/sectionsd/SIevents.hpp b/src/sectionsd/SIevents.hpp index 679fe881f..962da26b2 100644 --- a/src/sectionsd/SIevents.hpp +++ b/src/sectionsd/SIevents.hpp @@ -355,6 +355,7 @@ public: vps = 0; table_id = 0xFF; /* 0xFF means "not set" */ version = 0xFF; + running = 0; // dauer=0; // startzeit=0; } diff --git a/src/sectionsd/SIsections.cpp b/src/sectionsd/SIsections.cpp index 3c9a5d722..fa5d7aa43 100644 --- a/src/sectionsd/SIsections.cpp +++ b/src/sectionsd/SIsections.cpp @@ -91,7 +91,7 @@ struct service_list_entry { unsigned service_id_lo : 8; unsigned service_type : 8; } __attribute__ ((packed)) ; - +#if 0 struct digplus_order_entry { unsigned service_id_hi : 8; unsigned service_id_lo : 8; @@ -115,7 +115,7 @@ struct bskyb_bid { unsigned unknown1 : 8; unsigned unknown2 : 8; } __attribute__ ((packed)) ; - +#endif struct private_data_specifier { unsigned byte1 : 8; unsigned byte2 : 8; @@ -1510,13 +1510,13 @@ int SIsections :: readSections(const unsigned short pid, const unsigned char fil // Jetzt erstellen wir eine Liste der fehlenden Sections unsigned short actualTableIDextension = (unsigned short) -1; unsigned char actualTableID = (unsigned char) -1; - unsigned char maxNr = 0; +// unsigned char maxNr = 0; unsigned char lastNr = 0; for (SIsections::iterator k = begin(); k != end(); k++) { if ((k->tableIDextension() != actualTableIDextension) || (k->tableID() != actualTableID)) { // Neue Table-ID-Extension - maxNr = k->lastSectionNumber(); +// maxNr = k->lastSectionNumber(); actualTableIDextension = k->tableIDextension(); actualTableID = k->tableID(); } diff --git a/src/sectionsd/SIservices.hpp b/src/sectionsd/SIservices.hpp index 1baae63ab..07d4894ae 100644 --- a/src/sectionsd/SIservices.hpp +++ b/src/sectionsd/SIservices.hpp @@ -137,6 +137,7 @@ public: original_network_id = _original_network_id; transport_stream_id = _transport_stream_id; serviceTyp=0; + is_actual =0; memset(&flags, 0, sizeof(flags)); } // Std-Copy diff --git a/src/sectionsd/sectionsd.cpp b/src/sectionsd/sectionsd.cpp index c116d6aa0..0849cdd59 100644 --- a/src/sectionsd/sectionsd.cpp +++ b/src/sectionsd/sectionsd.cpp @@ -803,7 +803,7 @@ static void addEvent(const SIevent &evt, const time_t zeit, bool cn = false) on one German Sky channel and incomplete on another one. So we make sure to keep the complete event, if applicable. */ - if ((already_exists) && (evt.components.size() > 0)) { + if ((already_exists) && ( !evt.components.empty() )) { if (si->second->components.size() != evt.components.size()) already_exists = false; else { @@ -823,7 +823,7 @@ static void addEvent(const SIevent &evt, const time_t zeit, bool cn = false) } } - if ((already_exists) && (evt.linkage_descs.size() > 0)) { + if ((already_exists) && ( !evt.linkage_descs.empty() )) { if (si->second->linkage_descs.size() != evt.linkage_descs.size()) already_exists = false; else { @@ -843,7 +843,7 @@ static void addEvent(const SIevent &evt, const time_t zeit, bool cn = false) } } - if ((already_exists) && (evt.ratings.size() > 0)) { + if ((already_exists) && ( !evt.ratings.empty() )) { if (si->second->ratings.size() != evt.ratings.size()) already_exists = false; else { @@ -2296,14 +2296,14 @@ static void findPrevNextSIevent(const event_id_t uniqueKey, SItime &zeit, SIeven // connection-thread // handles incoming requests //--------------------------------------------------------------------- - +#if 0 struct connectionData { int connectionSocket; struct sockaddr_in clientAddr; }; - +#endif static void commandPauseScanning(int connfd, char *data, const unsigned dataLength) { if (dataLength != 4) @@ -9443,7 +9443,6 @@ static void *cnThread(void *) t_channel_id uniqueOld = 0; bool found_already = false; time_t azeit = time(NULL); - std::string sname; if(tv_mode) { serviceTyp1 = 0x01; @@ -9471,7 +9470,6 @@ static void *cnThread(void *) { if (s->second->serviceTyp == serviceTyp1 || (serviceTyp2 && s->second->serviceTyp == serviceTyp2)) { - sname = s->second->serviceName; found_already = false; } } @@ -9488,10 +9486,6 @@ static void *cnThread(void *) if ( !found_already ) { - std::string eName = (*e)->getName(); - std::string eText = (*e)->getText(); - std::string eExtendedText = (*e)->getExtendedText(); - for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t) { if (t->startzeit <= azeit && azeit <= (long)(t->startzeit + t->dauer)) From e65cd22ebed8e20cde9fcf2996931495af780b19 Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 1 Feb 2012 13:07:42 +0000 Subject: [PATCH 05/10] sectionsd: delete events with vector list git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2081 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/sectionsd/sectionsd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sectionsd/sectionsd.cpp b/src/sectionsd/sectionsd.cpp index 0849cdd59..4b6992e41 100644 --- a/src/sectionsd/sectionsd.cpp +++ b/src/sectionsd/sectionsd.cpp @@ -1259,6 +1259,7 @@ xmlNodePtr FindTransponder(xmlNodePtr provider, const t_original_network_id onid static void removeOldEvents(const long seconds) { bool goodtimefound; + std::vector to_delete; // Alte events loeschen time_t zeit = time(NULL); @@ -1268,7 +1269,6 @@ static void removeOldEvents(const long seconds) MySIeventsOrderFirstEndTimeServiceIDEventUniqueKey::iterator e = mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.begin(); while ((e != mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.end()) && (!messaging_zap_detected)) { - unlockEvents(); goodtimefound = false; for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); t++) { if (t->startzeit + (long)t->dauer >= zeit - seconds) { @@ -1279,13 +1279,14 @@ static void removeOldEvents(const long seconds) } if (false == goodtimefound) - deleteEvent((*(e++))->uniqueKey()); - else - ++e; - readLockEvents(); + to_delete.push_back((*e)->uniqueKey()); + e++; } unlockEvents(); + for (std::vector::iterator i = to_delete.begin(); i != to_delete.end(); i++) + deleteEvent(*i); + return; } @@ -1341,7 +1342,6 @@ static void removeDupEvents(void) /* clean up outside of the iterator loop */ for (std::vector::iterator i = to_delete.begin(); i != to_delete.end(); i++) deleteEvent(*i); - to_delete.clear(); /* needed? can't hurt... */ return; } From 6bbef9a0f62eff11dc7b9c13292bad782cfb2c0b Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 7 Feb 2012 11:12:45 +0000 Subject: [PATCH 06/10] * Add paint background to paintIcon() / DisplayImage() - paint background before display icon in CFrameBuffer::paintIcon() - paint background before display image in CPictureViewer::DisplayImage() git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2082 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/framebuffer.cpp | 4 +++- src/driver/framebuffer.h | 4 ++-- src/driver/pictureviewer/pictureviewer.cpp | 15 ++++++++++++++- src/driver/pictureviewer/pictureviewer.h | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index d4ae3c40f..5f84f50f4 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -956,7 +956,7 @@ bool CFrameBuffer::blitToPrimary(unsigned int *, int, int, int, int) if height h is given, center vertically between y and y+h offset is a color offset (probably only useful with palette) */ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const int y, - const int h, const unsigned char offset, bool paint) + const int h, const unsigned char offset, bool paint, bool paintBg, const fb_pixel_t colBg) { struct rawHeader header; int width, height; @@ -1053,6 +1053,8 @@ _display: if (h != 0) yy += (h - height) / 2; + if (paintBg) + paintBoxRel(x, yy, width, height, colBg); blit2FB(data, width, height, x, yy, 0, 0, true); return true; diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index d9a498b1c..c042c4d01 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -177,8 +177,8 @@ class CFrameBuffer void getIconSize(const char * const filename, int* width, int *height); /* h is the height of the target "window", if != 0 the icon gets centered in that window */ - bool paintIcon (const std::string & filename, const int x, const int y, - const int h = 0, const unsigned char offset = 1, bool paint = true); + bool paintIcon (const std::string & filename, const int x, const int y, + const int h = 0, const unsigned char offset = 1, bool paint = true, bool paintBg = false, const fb_pixel_t colBg = 0); bool paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset = 0); void loadPal (const std::string & filename, const unsigned char offset = 0, const unsigned char endidx = 255); diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 83e678220..44209f8ad 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -548,12 +548,25 @@ void CPictureViewer::rescaleImageDimensions(int *width, int *height, const int m } bool CPictureViewer::DisplayImage (const std::string & name, int posx, int posy, int width, int height) +{ + return int_DisplayImage(name, posx, posy, width, height, false); +} + +bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, const fb_pixel_t colBg) +{ + return int_DisplayImage(name, posx, posy, width, height, true, colBg); +} + +bool CPictureViewer::int_DisplayImage(const std::string & name, int posx, int posy, int width, int height, bool paintBg, const fb_pixel_t colBg) { /* TODO: cache or check for same */ fb_pixel_t * data = getImage(name, width, height); if(data) { - CFrameBuffer::getInstance()->blit2FB(data, width, height, posx, posy); + CFrameBuffer* frameBuffer = CFrameBuffer::getInstance(); + if (paintBg) + frameBuffer->paintBoxRel(posx, posy, width, height, colBg); + frameBuffer->blit2FB(data, width, height, posx, posy); cs_free_uncached(data); return true; } diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index bd7c8f295..eb1619ce5 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -64,6 +64,7 @@ class CPictureViewer void SetVisible(int startx, int endx, int starty, int endy); static double m_aspect_ratio_correction; bool DisplayImage (const std::string & name, int posx, int posy, int width, int height); + bool DisplayImage (const std::string & name, int posx, int posy, int width, int height, const fb_pixel_t colBg); bool DisplayLogo (uint64_t channel_id, int posx, int posy, int width, int height); bool GetLogoName(uint64_t channel_id, std::string ChanName, std::string & name, int *width = NULL, int *height = NULL); fb_pixel_t * getImage (const std::string & name, int width, int height); @@ -111,6 +112,7 @@ class CPictureViewer void add_format(int (*picsize)(const char *,int *,int*,int,int),int (*picread)(const char *,unsigned char **,int*,int*), int (*id)(const char*)); unsigned char * int_Resize(unsigned char *orgin, int ox, int oy, int dx, int dy, ScalingMode type, unsigned char * dst, bool alpha); fb_pixel_t * int_getImage(const std::string & name, int *width, int *height, bool GetImage); + bool int_DisplayImage (const std::string & name, int posx, int posy, int width, int height, bool paintBg, const fb_pixel_t colBg=0); }; From cce30fb30127f4c220d7f199d3aa0b2d81160878 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 7 Feb 2012 11:12:52 +0000 Subject: [PATCH 07/10] * Custom Menu Icons - Use paint background to draw the icons in the info bar. - Scale down var/hdd fill level in the info bar if larger icons are used. - No change to use the original icons. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2083 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/infoviewer.cpp | 29 +++++++++++++++++++---------- src/gui/infoviewer.h | 2 +- src/gui/osd_setup.cpp | 11 ++++++++++- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 22c0ea7b9..b09c83c54 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -236,8 +236,18 @@ void CInfoViewer::changePB() const short red_bar = 40; const short yellow_bar = 70; const short green_bar = 100; + int w = 0, h = 0; - hddwidth = frameBuffer->getScreenWidth(true) * 10 / 128; /* 100 pix if screen is 1280 wide */ + frameBuffer->getIconSize(NEUTRINO_ICON_16_9, &w, &h); + if (w > 26) { // larger icons + if (g_settings.screen_preset == 1) + w = (g_settings.casystem_display == 2) ? 6 : 10; // LCD + else + w = (g_settings.casystem_display == 2) ? 4 : 7; // CRT + } + else // org. icons + w = 10; + hddwidth = frameBuffer->getScreenWidth(true) * w / 128; /* 40...100 pix if screen is 1280 wide */ if (sigscale != NULL) delete sigscale; sigscale = new CProgressBar(true, bar_width, 10, red_bar, green_bar, yellow_bar); @@ -1078,14 +1088,14 @@ void CInfoViewer::showIcon_16_9 () } frameBuffer->paintIcon((aspectRatio > 2) ? NEUTRINO_ICON_16_9 : NEUTRINO_ICON_16_9_GREY, BoxEndX - (2*icon_large_width + 2*icon_small_width + 4*2), BBarY, - InfoHeightY_Info); + InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } } void CInfoViewer::showIcon_VTXT () const { frameBuffer->paintIcon((g_RemoteControl->current_PIDs.PIDs.vtxtpid != 0) ? NEUTRINO_ICON_VTXT : NEUTRINO_ICON_VTXT_GREY, - BoxEndX - (2*icon_small_width + 2*2), BBarY, InfoHeightY_Info); + BoxEndX - (2*icon_small_width + 2*2), BBarY, InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::showIcon_Resolution() const @@ -1168,10 +1178,9 @@ void CInfoViewer::showIcon_Resolution() const } } } - if (g_settings.infobar_show_res < 2) { - frameBuffer->paintBoxRel(BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, icon_large_width, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM); - frameBuffer->paintIcon(icon_name, BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, InfoHeightY_Info); - } + if (g_settings.infobar_show_res < 2) + frameBuffer->paintIcon(icon_name, BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, + InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::showIcon_SubT() const @@ -1182,7 +1191,7 @@ void CInfoViewer::showIcon_SubT() const have_sub = true; frameBuffer->paintIcon(have_sub ? NEUTRINO_ICON_SUBT : NEUTRINO_ICON_SUBT_GREY, BoxEndX - (icon_small_width + 2), - BBarY, InfoHeightY_Info); + BBarY, InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::showFailure () @@ -1968,7 +1977,7 @@ void CInfoViewer::showButton_Audio () dd_icon = NEUTRINO_ICON_DD_GREY; frameBuffer->paintIcon(dd_icon, BoxEndX - (icon_large_width + 2*icon_small_width + 3*2), - BBarY, InfoHeightY_Info); + BBarY, InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::killTitle() @@ -2241,7 +2250,7 @@ void CInfoViewer::paint_ca_icons(int caid, char * icon, int &icon_space_offset) void CInfoViewer::showOne_CAIcon(bool fta) { frameBuffer->paintIcon(fta ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2, BoxEndX - (icon_xres_width + icon_crypt_width + 2*icon_large_width + 2*icon_small_width + 6*2), BBarY, - InfoHeightY_Info); + InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::showIcon_CA_Status (int notfirst) diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index fca649661..a3490a47c 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -118,7 +118,6 @@ class CInfoViewer int lastsnr, lastsig, lasthdd, lastvar, lasttime; CProgressBar *snrscale, *sigscale, *hddscale, *varscale, *timescale; int hddwidth; - void changePB(); bool casysChange; bool channellogoChange; void paintBackground(int col_Numbox); @@ -183,6 +182,7 @@ class CInfoViewer int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); void clearVirtualZapMode() {virtual_zap_mode = false;} + void changePB(); }; class CInfoViewerHandler : public CMenuTarget diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index b17dec81c..2bebb555e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -603,7 +603,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) { menu_infobar->addIntroItems(LOCALE_MISCSETTINGS_INFOBAR); - menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true)); + menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true, this)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, &g_settings.infobar_show_channellogo, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT, true)); menu_infobar->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR_LOGO_HDD_DIR, true, g_settings.logo_hdd_dir, this, "logo_dir")); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); @@ -633,6 +633,12 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) osd_menu->hide(); return true; } + else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY)) { + if (g_InfoViewer == NULL) + g_InfoViewer = new CInfoViewer; + g_InfoViewer->changePB(); + return true; + } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_PRESET)) { int preset = * (int *) data; printf("preset %d (setting %d)\n", preset, g_settings.screen_preset); @@ -642,6 +648,9 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt; g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; osd_menu->hide(); + if (g_InfoViewer == NULL) + g_InfoViewer = new CInfoViewer; + g_InfoViewer->changePB(); return true; } return false; From 6c4dfd57ae74c9f30eb0f1b529a353bd355ed3ef Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 10 Feb 2012 13:33:25 +0000 Subject: [PATCH 08/10] controlapi: -add relodplugins git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2084 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 9 +++++++++ src/nhttpd/tuxboxapi/coolstream/controlapi.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 02fbee42a..36a1d79f7 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "gui/plugins.h"//for relodplugins // yhttpd #include "yhttpd.h" #include "ytypes_globals.h" @@ -49,6 +50,7 @@ void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSections bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); +extern CPlugins *g_PluginList;//for relodplugins extern CBouquetManager *g_bouquetManager; #define EVENTDEV "/dev/input/input0" @@ -172,6 +174,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"info", &CControlAPI::InfoCGI, "text/plain"}, {"version", &CControlAPI::VersionCGI, ""}, {"reloadsetup", &CControlAPI::ReloadNutrinoSetupfCGI, ""}, + {"relodplugins", &CControlAPI::ReloadPluginsCGI, ""}, // boxcontrol - devices {"volume", &CControlAPI::VolumeCGI, "text/plain"}, {"lcd", &CControlAPI::LCDAction, "text/plain"}, @@ -1439,6 +1442,12 @@ void CControlAPI::ReloadNutrinoSetupfCGI(CyhookHandler *hh) hh->SendOk(); } +void CControlAPI::ReloadPluginsCGI(CyhookHandler *hh) +{ + g_PluginList->loadPlugins(); + hh->SendOk(); +} + //----------------------------------------------------------------------------- void CControlAPI::ZaptoCGI(CyhookHandler *hh) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index fe7be648d..91ab2792e 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -81,6 +81,7 @@ private: void EpgCGI(CyhookHandler *hh); void VersionCGI(CyhookHandler *hh); void ReloadNutrinoSetupfCGI(CyhookHandler *hh); + void ReloadPluginsCGI(CyhookHandler *hh); void ZaptoCGI(CyhookHandler *hh); void StartPluginCGI(CyhookHandler *hh); void LCDAction(CyhookHandler *hh); @@ -121,7 +122,7 @@ public: // virtual functions for HookHandler/Hook virtual std::string getHookName(void) {return std::string("mod_ControlAPI");} - virtual std::string getHookVersion(void) {return std::string("$Revision: 976 $");} + virtual std::string getHookVersion(void) {return std::string("$Revision$");} virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); }; From 7df5f6394b98355e9c758f1bb3c6590f95b3f65f Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 10 Feb 2012 14:58:21 +0000 Subject: [PATCH 09/10] typo git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2085 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 36a1d79f7..0ae8be66b 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -174,7 +174,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"info", &CControlAPI::InfoCGI, "text/plain"}, {"version", &CControlAPI::VersionCGI, ""}, {"reloadsetup", &CControlAPI::ReloadNutrinoSetupfCGI, ""}, - {"relodplugins", &CControlAPI::ReloadPluginsCGI, ""}, + {"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""}, // boxcontrol - devices {"volume", &CControlAPI::VolumeCGI, "text/plain"}, {"lcd", &CControlAPI::LCDAction, "text/plain"}, From fbd5554af25eb2f1a8fefe3b998e23c6e355d392 Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 10 Feb 2012 15:02:53 +0000 Subject: [PATCH 10/10] controlapi: -add doc relodplugins git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2086 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/nhttpd/doc/nhttpd_controlapi.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 296145147..f6d69dfda 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -189,6 +189,11 @@ http://dbox/control/changebouquet + + 41. Plugins neu laden + + http://dbox/control/reloadplugins +     @@ -1767,6 +1772,19 @@ ok
  +
+ + +
41. Plugins neu laden
+
Handler: http://dbox/control/reloadplugins
+
+Parameter: keine
+Rückgabe: ok
+
+Die Pluginliste wird neu geladen. + + +