Code: Alles auswählen
Index: apps/tuxbox/neutrino/src/neutrino.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/neutrino.cpp,v
retrieving revision 1.838
diff -u -b -B -r1.838 neutrino.cpp
--- apps/tuxbox/neutrino/src/neutrino.cpp 24 Jan 2007 02:23:36 -0000 1.838
+++ apps/tuxbox/neutrino/src/neutrino.cpp 25 Jan 2007 22:51:46 -0000
@@ -72,6 +72,13 @@
#include <driver/shutdown_count.h>
#include <irsend/irsend.h>
+
+// USERMENU
+#include <gui/eventlist.h>
+#include <gui/infoviewer.h>
+#include <gui/epgplus.h>
+#include <gui/streaminfo2.h>
+
#include "gui/widget/colorchooser.h"
#include "gui/widget/menue.h"
#include "gui/widget/messagebox.h"
@@ -843,6 +850,42 @@
g_settings.filebrowser_sortmethod = 0;
g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false);
+// USERMENU
+ const int user_menu_default[SNeutrinoSettings::BUTTON_MAX][SNeutrinoSettings::ITEM_MAX] =
+
+// EPG_LIST EPG_SUPER EPG_INFO EPG_MISC AUDIO SUBCHANNEL PLUGIN RECORD TS MB TIMERLIST REMOTE FAVORITS TECHINFO,
+// default mask for colored key menus (red, green yellow, blue)
+// 0: OFF , >0 relativ position in Menu (max number is the number of items ITEM_MAX).
+// if there is one item for a colored key menu only, this item is called directly (without main menu)
+// ----------------------------------------------------------
+// E E E E
+// P P P P P R F
+// G G G G A S L T E A
+// L S I M U U U I M V I
+// I U N I D B G R M O O N
+// S P F S I C I E T M E T R F
+// T E O C O H N C S B R E I O
+// ----------------------------------------------------------
+ { { 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}, // BUTTON_RED
+ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // BUTTON_GREEN
+ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, // BUTTON_YELLOW
+ { 0, 0, 0, 7, 0, 0, 1, 2, 3, 0, 4, 5, 6, 0} // BUTTON_BLUE
+ };
+
+ char tmp_key[81];
+ for (int key = 0; key < SNeutrinoSettings::BUTTON_MAX; key++)
+ {
+ snprintf(tmp_key,80,"usermenu_text_%d",key);
+ tmp_key[80] = 0; // terminate for sure
+ g_settings.usermenu_text[key] = configfile.getString(tmp_key, "" );
+ for (int item = 0; item < SNeutrinoSettings::ITEM_MAX; item++)
+ {
+ snprintf(tmp_key,80,"usermenu_pos_%d_%02d",key,item);
+ tmp_key[80] = 0; // terminate for sure
+ g_settings.usermenu_pos[key][item] = configfile.getInt32(tmp_key, user_menu_default[key][item]);
+ }
+ }
+
if(configfile.getUnknownKeyQueryedFlag() && (erg==0))
{
erg = 2;
@@ -1200,6 +1243,22 @@
configfile.setInt32("filebrowser_sortmethod", g_settings.filebrowser_sortmethod);
configfile.setBool("filebrowser_denydirectoryleave", g_settings.filebrowser_denydirectoryleave);
+// USERMENU
+ char tmp_key[81];
+ for (int key = 0; key < SNeutrinoSettings::BUTTON_MAX; key++)
+ {
+ snprintf(tmp_key,80,"usermenu_text_%d",key);
+ tmp_key[80] = 0; // terminate for sure
+ configfile.setString( tmp_key, g_settings.usermenu_text[key]);
+ for (int item = 0; item < SNeutrinoSettings::ITEM_MAX; item++)
+ {
+ snprintf(tmp_key,80,"usermenu_pos_%d_%02d",key,item);
+ tmp_key[80] = 0; // terminate for sure
+ configfile.setInt32(tmp_key, g_settings.usermenu_pos[key][item]);
+ }
+ }
+
+
if (configfile.getModifiedFlag())
{
dprintf(DEBUG_INFO, "saving neutrino txt-config\n");
@@ -3192,14 +3251,28 @@
keySettings.addItem(new CMenuForwarder(keydescription[KEY_LASTCHANNEL], true, NULL, keychooser[KEY_LASTCHANNEL]));
}
+// USERMENU
+// leave this functions, somebody might want to use it in the future again
void CNeutrinoApp::SelectNVOD()
{
if (!(g_RemoteControl->subChannels.empty()))
{
// NVOD/SubService- Kanal!
CMenuWidget NVODSelector(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, "video.raw", 350);
+ if(getNVODMenu(&NVODSelector))
+ NVODSelector.exec(NULL, "");
+ }
+}
- NVODSelector.addItem(GenericMenuSeparator);
+
+bool CNeutrinoApp::getNVODMenu(CMenuWidget* menu)
+{
+ if(menu == NULL)
+ return false;
+ if (g_RemoteControl->subChannels.empty())
+ return false;
+
+ menu->addItem(GenericMenuSeparator);
int count = 0;
char nvod_id[5];
@@ -3237,11 +3310,11 @@
nvod_time_x[0]= 0;
sprintf(nvod_s, "%s - %s %s", nvod_time_a, nvod_time_e, nvod_time_x);
- NVODSelector.addItem(new CMenuForwarderNonLocalized(nvod_s, true, NULL, NVODChanger, nvod_id), (count == g_RemoteControl->selected_subchannel));
+ menu->addItem(new CMenuForwarderNonLocalized(nvod_s, true, NULL, NVODChanger, nvod_id), (count == g_RemoteControl->selected_subchannel));
}
else
{
- NVODSelector.addItem(new CMenuForwarderNonLocalized((Latin1_to_UTF8(e->subservice_name)).c_str(), true, NULL, NVODChanger, nvod_id, CRCInput::convertDigitToKey(count)), (count == g_RemoteControl->selected_subchannel));
+ menu->addItem(new CMenuForwarderNonLocalized((Latin1_to_UTF8(e->subservice_name)).c_str(), true, NULL, NVODChanger, nvod_id, CRCInput::convertDigitToKey(count)), (count == g_RemoteControl->selected_subchannel));
}
count++;
@@ -3249,14 +3322,13 @@
if( g_RemoteControl->are_subchannels )
{
- NVODSelector.addItem(GenericMenuSeparatorLine);
+ menu->addItem(GenericMenuSeparatorLine);
CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_NVODSELECTOR_DIRECTORMODE, &g_RemoteControl->director_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
- NVODSelector.addItem(oj);
+ menu->addItem(oj);
}
- NVODSelector.exec(NULL, "");
+ return true;
}
-}
@@ -3267,6 +3339,366 @@
{ 1, LOCALE_MAINMENU_RECORDING_STOP }
};
+// USERMENU
+
+// This is just a quick helper for the usermenu only. I already made it a class for future use.
+#define BUTTONDEF_MAX 4
+const neutrino_msg_t key_helper_msg_def[BUTTONDEF_MAX]={CRCInput::RC_red,CRCInput::RC_green,CRCInput::RC_yellow,CRCInput::RC_blue};
+const char * key_helper_icon_def[BUTTONDEF_MAX]={NEUTRINO_ICON_BUTTON_RED,NEUTRINO_ICON_BUTTON_GREEN,NEUTRINO_ICON_BUTTON_YELLOW,NEUTRINO_ICON_BUTTON_BLUE};
+class CKeyHelper
+{
+ private:
+ int number_key;
+ bool color_key_used[BUTTONDEF_MAX];
+ public:
+ CKeyHelper(){reset();};
+ void reset(void)
+ {
+ number_key = 1;
+ for(int i = 0; i < BUTTONDEF_MAX; i++ )
+ color_key_used[i] = false;
+ };
+
+ /* Returns the next available button, to be used in menu as 'direct' keys. Appropriate
+ * definitions are returnd in msp and icon
+ * A color button could be requested as prefered button (other buttons are not supported yet).
+ * If the appropriate button is already in used, the next number_key button is returned instead
+ * (first 1-9 and than 0). */
+ bool get(neutrino_msg_t* msg, const char** icon, neutrino_msg_t prefered_key = CRCInput::RC_nokey)
+ {
+ bool result = false;
+ int button = -1;
+ if(prefered_key == CRCInput::RC_red) button = 0;
+ if(prefered_key == CRCInput::RC_green) button = 1;
+ if(prefered_key == CRCInput::RC_yellow) button = 2;
+ if(prefered_key == CRCInput::RC_blue) button = 3;
+
+ *msg = CRCInput::RC_nokey;
+ *icon = "";
+ if(button >= 0 && button < BUTTONDEF_MAX)
+ { // try to get color button
+ if( color_key_used[button] == false)
+ {
+ color_key_used[button] = true;
+ *msg = key_helper_msg_def[button];
+ *icon = key_helper_icon_def[button];
+ result = true;
+ }
+ }
+
+ if( result == false && number_key < 10) // no key defined yet, at least try to get a numbered key
+ {
+ // there is still a available number_key
+ *msg = CRCInput::convertDigitToKey(number_key);
+ *icon = "";
+ if(number_key == 9)
+ number_key = 0;
+ else if(number_key == 0)
+ number_key = 10;
+ else
+ number_key++;
+
+ result = true;
+ }
+ return (result);
+ };
+};
+
+
+// USERMENU
+bool CNeutrinoApp::showUserMenu(int button)
+{
+ if(button < 0 || button >= SNeutrinoSettings::BUTTON_MAX)
+ return false;
+
+ CMenuItem* menu_item = NULL;
+ CMenuWidget *menu = new CMenuWidget(LOCALE_STREAMFEATURES_HEAD, "features.raw", 350);
+ if (menu == NULL)
+ return 0;
+ menu->addItem(GenericMenuSeparator);
+
+ CKeyHelper keyhelper;
+
+ neutrino_msg_t key = CRCInput::RC_nokey;
+ const char * icon = NULL;
+
+ char id[5];
+ int menu_items = 0;
+ int menu_prev = -1;
+ int cnt = 0;
+
+ // define classes
+ CFavorites* tmpFavorites = NULL;
+ CTimerList* tmpTimerlist = NULL;
+ CPauseSectionsdNotifier* tmpPauseSectionsdNotifier = NULL;
+ CAudioSelectMenuHandler* tmpAudioSelectMenuHandler = NULL;
+ CMenuWidget* tmpNVODSelector = NULL;
+ CStreamInfo2Handler* tmpStreamInfo2Handler = NULL;
+ CEventListHandler* tmpEventListHandler = NULL;
+ CEPGplusHandler* tmpEPGplusHandler = NULL;
+ CEPGDataHandler* tmpEPGDataHandler = NULL;
+
+ // search for any position number
+ for(int pos = 1; pos < SNeutrinoSettings::ITEM_MAX ; pos++)
+ {
+ // now compare pos with the position of any item. Add this item if position is the same
+ for(int item = 0; item < SNeutrinoSettings::ITEM_MAX ; item++)
+ {
+ if( pos == g_settings.usermenu_pos[button][item])
+ {
+ switch(item)
+ {
+ case SNeutrinoSettings::ITEM_PLUGIN:
+ for(unsigned int count = 0; count < (unsigned int) g_PluginList->getNumberOfPlugins(); count++)
+ {
+ if (g_PluginList->getType(count)== CPlugins::P_TYPE_TOOL && !g_PluginList->isHidden(count))
+ {
+ // zB vtxt-plugins
+ if(menu_prev != -1 && cnt == 0)
+ menu->addItem(GenericMenuSeparatorLine);
+ sprintf(id, "%d", count);
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_PLUGIN;
+
+ keyhelper.get(&key,&icon,CRCInput::RC_blue);
+ menu_item = new CMenuForwarderNonLocalized(g_PluginList->getName(count), true, NULL, StreamFeaturesChanger, id, key, icon);
+ menu->addItem(menu_item, (cnt == 0));
+ cnt++;
+ }
+ }
+ break;
+
+ case SNeutrinoSettings::ITEM_FAVORITS:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_REMOTE)
+ menu->addItem(GenericMenuSeparatorLine);
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_FAVORITS;
+ tmpFavorites = new CFavorites;
+ keyhelper.get(&key,&icon);
+ menu_item = new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, tmpFavorites, "-1", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_RECORD:
+ if (g_settings.recording_type != RECORDING_OFF)
+ {
+ if(menu_prev != -1 && menu_prev != RECORDING_OFF && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_TS && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_MB && menu_prev != SNeutrinoSettings::ITEM_TIMERLIST)
+ menu->addItem(GenericMenuSeparatorLine);
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_RECORD;
+ keyhelper.get(&key,&icon,CRCInput::RC_red);
+ menu_item = new CMenuOptionChooser(LOCALE_MAINMENU_RECORDING, &recordingstatus, MAINMENU_RECORDING_OPTIONS, MAINMENU_RECORDING_OPTION_COUNT, true, this, key, icon);
+ menu->addItem(menu_item, false);
+ }
+ break;
+
+ case SNeutrinoSettings::ITEM_MOVIEPLAYER_TS:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_RECORD && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_TS && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_MB && menu_prev != SNeutrinoSettings::ITEM_TIMERLIST)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_MOVIEPLAYER_TS;
+ keyhelper.get(&key,&icon,CRCInput::RC_green);
+ menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_TSPLAYBACK, true, NULL, this->moviePlayerGui, "tsplayback", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_MOVIEPLAYER_MB:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_RECORD && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_TS && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_MB && menu_prev != SNeutrinoSettings::ITEM_TIMERLIST)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_MOVIEPLAYER_MB;
+ keyhelper.get(&key,&icon,CRCInput::RC_green);
+ menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_TSPLAYBACK, true, NULL, this->moviePlayerGui, "tsmoviebrowser", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_TIMERLIST:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_RECORD && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_TS && menu_prev != SNeutrinoSettings::ITEM_MOVIEPLAYER_MB && menu_prev != SNeutrinoSettings::ITEM_TIMERLIST)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_TIMERLIST;
+ tmpTimerlist = new CTimerList;
+ keyhelper.get(&key,&icon,CRCInput::RC_yellow);
+ menu_item = new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, tmpTimerlist, "-1", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_REMOTE:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_FAVORITS)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_REMOTE;
+ //keyhelper.get(&key,&icon);
+ menu_item = new CMenuForwarder(LOCALE_RCLOCK_MENUEADD, true, NULL, this->rcLock, "-1" /*, key, icon */);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_EPG_SUPER:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_EPG_SUPER && menu_prev != SNeutrinoSettings::ITEM_EPG_LIST && menu_prev != SNeutrinoSettings::ITEM_EPG_MISC && menu_prev != SNeutrinoSettings::ITEM_EPG_INFO)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_EPG_SUPER;
+ tmpEPGplusHandler = new CEPGplusHandler();
+ keyhelper.get(&key,&icon,CRCInput::RC_green);
+ menu_item = new CMenuForwarder(LOCALE_EPGMENU_EPGPLUS , true, NULL, tmpEPGplusHandler , "-1", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_EPG_LIST:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_EPG_SUPER && menu_prev != SNeutrinoSettings::ITEM_EPG_LIST && menu_prev != SNeutrinoSettings::ITEM_EPG_MISC && menu_prev != SNeutrinoSettings::ITEM_EPG_INFO)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_EPG_LIST;
+ tmpEventListHandler = new CEventListHandler();
+ keyhelper.get(&key,&icon,CRCInput::RC_red);
+ menu_item = new CMenuForwarder(LOCALE_EPGMENU_EVENTLIST , true, NULL, tmpEventListHandler, "-1", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_EPG_INFO:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_EPG_SUPER && menu_prev != SNeutrinoSettings::ITEM_EPG_LIST && menu_prev != SNeutrinoSettings::ITEM_EPG_MISC && menu_prev != SNeutrinoSettings::ITEM_EPG_INFO)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_EPG_INFO;
+ tmpEPGDataHandler = new CEPGDataHandler();
+ keyhelper.get(&key,&icon,CRCInput::RC_yellow);
+ menu_item = new CMenuForwarder(LOCALE_EPGMENU_EVENTINFO , true, NULL, tmpEPGDataHandler , "-1", key, icon);
+ menu->addItem(menu_item, false);
+ break;
+
+ case SNeutrinoSettings::ITEM_EPG_MISC:
+ if(menu_prev != -1 && menu_prev != SNeutrinoSettings::ITEM_EPG_SUPER && menu_prev != SNeutrinoSettings::ITEM_EPG_LIST && menu_prev != SNeutrinoSettings::ITEM_EPG_MISC)
+ menu->addItem(GenericMenuSeparatorLine);
+
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_EPG_MISC;
+ int dummy = g_Sectionsd->getIsScanningActive();
+ tmpPauseSectionsdNotifier = new CPauseSectionsdNotifier;
+ //keyhelper.get(&key,&icon);
+ menu_item = new CMenuOptionChooser(LOCALE_MAINMENU_PAUSESECTIONSD, &dummy, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, tmpPauseSectionsdNotifier /*, key, icon */);
+ menu->addItem(menu_item, false);
+ #if 0 // next times feature?
+ menu_items++;
+ keyhelper.get(&key,&icon);
+ menu_item = new CMenuForwarderNonLocalized("L�che EPG Daten", true, NULL, this, "clearSectionsd", key,icon);
+ //menu_item = new CMenuForwarder(LOCALE_MAINMENU_CLEARSECTIONSD, true, NULL, this, "clearSectionsd", key,icon);
+ menu->addItem(menu_item, false);
+ #endif
+ break;
+
+ case SNeutrinoSettings::ITEM_AUDIO_SELECT:
+ // -- new Audio Selector Menu (rasc 2005-08-30)
+ if (g_settings.audio_left_right_selectable ||
+ g_RemoteControl->current_PIDs.APIDs.size() > 1)
+ {
+ if(menu_prev != -1)
+ menu->addItem(GenericMenuSeparatorLine);
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_AUDIO_SELECT;
+ tmpAudioSelectMenuHandler = new CAudioSelectMenuHandler;
+ keyhelper.get(&key,&icon);
+ menu_item = new CMenuForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, true, NULL, tmpAudioSelectMenuHandler, "-1", key,icon);
+ menu->addItem(menu_item, false);
+ }
+ break;
+
+ case SNeutrinoSettings::ITEM_SUBCHANNEL:
+ if (!(g_RemoteControl->subChannels.empty()))
+ {
+ // NVOD/SubService- Kanal!
+ tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, "video.raw", 350);
+ if(getNVODMenu(tmpNVODSelector))
+ {
+ if(menu_prev != -1)
+ menu->addItem(GenericMenuSeparatorLine);
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_SUBCHANNEL;
+ keyhelper.get(&key,&icon);
+ menu_item = new CMenuForwarder(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, true, NULL, tmpNVODSelector, "-1", key,icon);
+ menu->addItem(menu_item, false);
+ }
+ }
+ break;
+
+ case SNeutrinoSettings::ITEM_TECHINFO:
+ if(menu_prev != -1)
+ menu->addItem(GenericMenuSeparatorLine);
+ menu_items++;
+ menu_prev = SNeutrinoSettings::ITEM_TECHINFO;
+ tmpStreamInfo2Handler = new CStreamInfo2Handler();
+ keyhelper.get(&key,&icon,CRCInput::RC_blue);
+ menu_item = new CMenuForwarder(LOCALE_EPGMENU_STREAMINFO, true, NULL, tmpStreamInfo2Handler , "-1", key, icon );
+ menu->addItem(menu_item, false);
+ break;
+
+ default:
+ printf("[neutrino] WARNING! menu wrong item!!\n");
+ break;
+ }
+ }
+ }
+ }
+
+ // Allow some tailoring for privat image bakers ;)
+ if (button == SNeutrinoSettings::BUTTON_RED)
+ {
+ }
+ else if( button == SNeutrinoSettings::BUTTON_GREEN)
+ {
+ }
+ else if( button == SNeutrinoSettings::BUTTON_YELLOW)
+ {
+ }
+ else if( button == SNeutrinoSettings::BUTTON_BLUE)
+ {
+#ifdef _EXPERIMENTAL_SETTINGS_
+ //Experimental Settings
+ if(menu_prev != -1)
+ menu->addItem(GenericMenuSeparatorLine);
+ menu_items ++;
+ menu_key++;
+ // FYI: there is a memory leak with 'new CExperimentalSettingsMenuHandler()
+ menu_item = new CMenuForwarder(LOCALE_EXPERIMENTALSETTINGS, true, NULL, new CExperimentalSettingsMenuHandler(), "-1", CRCInput::convertDigitToKey(menu_key), "");
+ menu->addItem(menu_item, false);
+#endif
+ }
+
+ if(menu_items > 1 ) // show menu if there are more than 2 items only
+ {
+ menu->exec(NULL,"");
+ }
+ else if (menu_item != NULL) // otherwise, we start the item directly (must be the last one)
+ {
+ menu_item->exec( NULL );
+ } // neither nor, we do nothing
+
+ // restore mute symbol
+ AudioMute(current_muted, true);
+
+ // clear the heap
+ if(menu) delete menu;
+ if(tmpFavorites) delete tmpFavorites;
+ if(tmpTimerlist) delete tmpTimerlist;
+ if(tmpPauseSectionsdNotifier) delete tmpPauseSectionsdNotifier;
+ if(tmpAudioSelectMenuHandler) delete tmpAudioSelectMenuHandler;
+ if(tmpNVODSelector) delete tmpNVODSelector;
+ if(tmpStreamInfo2Handler) delete tmpStreamInfo2Handler;
+ if(tmpEventListHandler) delete tmpEventListHandler;
+ if(tmpEPGplusHandler) delete tmpEPGplusHandler;
+ if(tmpEPGDataHandler) delete tmpEPGDataHandler;
+
+ return true;
+}
+
+
+// should be remove, now just for reference
void CNeutrinoApp::ShowStreamFeatures()
{
char id[5];
@@ -3907,34 +4339,19 @@
}
else if( msg == CRCInput::RC_red )
{ // eventlist
- // -- !! obsolete (2004-03-06 rasc)
- // g_EventList->exec(channelList->getActiveChannel_ChannelID(), channelList->getActiveChannelName()); // UTF-8
-
- // -- new EPG Menu (rasc 2004-03-06)
- CEPGMenuHandler *epg_menu;
- epg_menu = new CEPGMenuHandler;
- epg_menu->doMenu();
- delete epg_menu;
+ showUserMenu(SNeutrinoSettings::BUTTON_RED);
}
else if( msg == CRCInput::RC_blue )
{ // streaminfo
- ShowStreamFeatures();
+ showUserMenu(SNeutrinoSettings::BUTTON_BLUE);
}
else if( msg == CRCInput::RC_green )
{
- // -- new Audio Selector Menu (rasc 2005-08-30)
- if (g_settings.audio_left_right_selectable ||
- g_RemoteControl->current_PIDs.APIDs.size() > 1)
- {
- CAudioSelectMenuHandler *audio_menu;
- audio_menu = new CAudioSelectMenuHandler;
- audio_menu-> doMenu();
- delete audio_menu;
- }
+ showUserMenu(SNeutrinoSettings::BUTTON_GREEN);
}
else if( msg == CRCInput::RC_yellow )
{ // NVODs
- SelectNVOD();
+ showUserMenu(SNeutrinoSettings::BUTTON_YELLOW);
}
else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode )
{
Index: apps/tuxbox/neutrino/src/neutrino.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/neutrino.h,v
retrieving revision 1.183
diff -u -b -B -r1.183 neutrino.h
--- apps/tuxbox/neutrino/src/neutrino.h 20 Jan 2007 20:19:34 -0000 1.183
+++ apps/tuxbox/neutrino/src/neutrino.h 25 Jan 2007 22:51:46 -0000
@@ -132,6 +132,10 @@
CRCLock *rcLock;
CMenuTarget* moviePlayerGui;
+// USERMENU
+ bool showUserMenu(int button);
+ bool getNVODMenu(CMenuWidget* menu);
+
bool ucodes_available(void);
void firstChannel();
void setupColors_classic();
Index: apps/tuxbox/neutrino/src/gui/infoviewer.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/infoviewer.cpp,v
retrieving revision 1.202
diff -u -b -B -r1.202 infoviewer.cpp
--- apps/tuxbox/neutrino/src/gui/infoviewer.cpp 22 Aug 2006 21:50:23 -0000 1.202
+++ apps/tuxbox/neutrino/src/gui/infoviewer.cpp 25 Jan 2007 22:51:49 -0000
@@ -46,6 +46,7 @@
#include <neutrino.h>
#include <string>
+#include <system/settings.h>
#include <sys/timeb.h>
#include <time.h>
@@ -291,9 +292,19 @@
frameBuffer->paintBox(ChanInfoX, BoxEndInfoY+ BOTTOM_BAR_OFFSET, BoxEndX, BoxEndY, COL_INFOBAR_BUTTONS_BACKGROUND);
- // blau
+ // show blue button
+ // USERMENU
+ const char* txt = NULL;
+ if( !g_settings.usermenu_text[SNeutrinoSettings::BUTTON_BLUE].empty() )
+ txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_BLUE].c_str();
+ else
+ txt = g_Locale->getText(LOCALE_INFOVIEWER_STREAMINFO);
+
+ if ( txt != NULL )
+ {
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, BoxEndX- ICON_OFFSET- ButtonWidth + 2, BoxEndY- ((InfoHeightY_Info+ 16)>>1) );
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_BLUE_WIDTH + 2), BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_BLUE_WIDTH + 2 + 2), g_Locale->getText(LOCALE_INFOVIEWER_STREAMINFO), COL_INFOBAR_BUTTONS, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_BLUE_WIDTH + 2), BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_BLUE_WIDTH + 2 + 2), txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8
+ }
showButton_Audio();
showButton_SubServices();
@@ -617,10 +628,18 @@
frameBuffer->paintBoxRel(x, y, dx, dy, COL_MENUCONTENT_PLUS_0);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(x+10, y+ 30, dx-20, text, COL_MENUCONTENT, 0, subChannelNameIsUTF); // UTF-8
- if ( g_RemoteControl->director_mode )
+ // show yellow button
+ // USERMENU
+ const char* txt = NULL;
+ if( !g_settings.usermenu_text[SNeutrinoSettings::BUTTON_YELLOW].empty() )
+ txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_YELLOW].c_str();
+ else if(g_RemoteControl->director_mode)
+ txt = g_Locale->getText(LOCALE_NVODSELECTOR_DIRECTORMODE);
+
+ if ( txt != NULL )
{
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+ 8, y+ dy- 20 );
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 30, y+ dy- 2, dx- 40, g_Locale->getText(LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 30, y+ dy- 2, dx- 40, txt, COL_MENUCONTENT, 0, true); // UTF-8
}
unsigned long long timeoutEnd = CRCInput::calcTimeoutEnd( 2 );
@@ -836,12 +855,19 @@
void CInfoViewer::showButton_SubServices()
{
- if (!(g_RemoteControl->subChannels.empty()))
+ // show yellow button
+ // USERMENU
+ const char* txt = NULL;
+ if( !g_settings.usermenu_text[SNeutrinoSettings::BUTTON_YELLOW].empty() )
+ txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_YELLOW].c_str();
+ else if( !(g_RemoteControl->subChannels.empty()) )
+ txt = g_Locale->getText((g_RemoteControl->are_subchannels) ? LOCALE_INFOVIEWER_SUBSERVICE : LOCALE_INFOVIEWER_SELECTTIME);
+
+ if ( txt != NULL )
{
// yellow button for subservices / NVODs
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, BoxEndX- ICON_OFFSET- 2* ButtonWidth + 2, BoxEndY- ((InfoHeightY_Info+ 16)>>1) );
-
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- 2* ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_YELLOW_WIDTH + 2), BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_YELLOW_WIDTH + 2 + 2), g_Locale->getText((g_RemoteControl->are_subchannels) ? LOCALE_INFOVIEWER_SUBSERVICE : LOCALE_INFOVIEWER_SELECTTIME), COL_INFOBAR_BUTTONS, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- 2* ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_YELLOW_WIDTH + 2), BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_YELLOW_WIDTH + 2 + 2), txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8
}
}
@@ -951,10 +977,18 @@
else
frameBuffer->paintBackgroundBoxRel(BoxEndX-114, posy, 2+100+2, height2);
- if ( info_CurrentNext.flags & CSectionsdClient::epgflags::has_anything )
+ // show red button
+ // USERMENU
+ const char* txt = NULL;
+ if( !g_settings.usermenu_text[SNeutrinoSettings::BUTTON_RED].empty() )
+ txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_RED].c_str();
+ else if( info_CurrentNext.flags & CSectionsdClient::epgflags::has_anything )
+ txt = g_Locale->getText(LOCALE_INFOVIEWER_EVENTLIST);
+
+ if ( txt != NULL )
{
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, BoxEndX- ICON_OFFSET- 4* ButtonWidth + 2, BoxEndY- ((InfoHeightY_Info+ 16)>>1) );
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- 4* ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 2), BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 2 + 2) + 8, g_Locale->getText(LOCALE_INFOVIEWER_EVENTLIST), COL_INFOBAR_BUTTONS, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- 4* ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 2), BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 2 + 2) + 8, txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8
}
}
@@ -1051,10 +1085,19 @@
// green, in case of several APIDs
// -- always show Audio Option, due to audio option restructuring (2005-08-31 rasc)
uint count = g_RemoteControl->current_PIDs.APIDs.size();
- if ( g_settings.audio_left_right_selectable || count > 1 )
+
+ // show green button
+ // USERMENU
+ const char* txt = NULL;
+ if( !g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN].empty() )
+ txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN].c_str();
+ else if( g_settings.audio_left_right_selectable || count > 1 )
+ txt = g_Locale->getText(LOCALE_INFOVIEWER_LANGUAGES);
+
+ if ( txt != NULL )
{
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, BoxEndX- ICON_OFFSET- 3* ButtonWidth + 2 + 8, BoxEndY- ((InfoHeightY_Info+ 16)>>1) );
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- 3* ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 2) + 8, BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 2 + 2), g_Locale->getText(LOCALE_INFOVIEWER_LANGUAGES), COL_INFOBAR_BUTTONS, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(BoxEndX- ICON_OFFSET- 3* ButtonWidth + (2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 2) + 8, BoxEndY - 2, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 2 + 2), txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8
};
const char * dd_icon;
Index: apps/tuxbox/neutrino/src/system/settings.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/system/settings.h,v
retrieving revision 1.171
diff -u -b -B -r1.171 settings.h
--- apps/tuxbox/neutrino/src/system/settings.h 24 Jan 2007 02:18:42 -0000 1.171
+++ apps/tuxbox/neutrino/src/system/settings.h 25 Jan 2007 22:51:50 -0000
@@ -356,6 +356,38 @@
int uboot_lcd_contrast;
int uboot_console;
int uboot_console_bak;
+
+// USERMENU
+ typedef enum
+ {
+ BUTTON_RED = 0, // Do not change ordering of members, add new item just before BUTTON_MAX!!!
+ BUTTON_GREEN = 1,
+ BUTTON_YELLOW = 2,
+ BUTTON_BLUE = 3,
+ BUTTON_MAX // MUST be always the last in the list
+ }USER_BUTTON;
+
+ typedef enum
+ {
+ ITEM_EPG_LIST = 0,
+ ITEM_EPG_SUPER = 1,
+ ITEM_EPG_INFO = 2,
+ ITEM_EPG_MISC = 3,
+ ITEM_AUDIO_SELECT = 4,
+ ITEM_SUBCHANNEL = 5,
+ ITEM_PLUGIN = 6, // Do not change ordering of members, add new item just before ITEM_MAX!!!
+ ITEM_RECORD = 7,
+ ITEM_MOVIEPLAYER_TS = 8,
+ ITEM_MOVIEPLAYER_MB = 9,
+ ITEM_TIMERLIST = 10,
+ ITEM_REMOTE = 11,
+ ITEM_FAVORITS = 12,
+ ITEM_TECHINFO = 13,
+ ITEM_MAX // MUST be always the last in the list
+ }USER_ITEM;
+ std::string usermenu_text[BUTTON_MAX];
+ int usermenu_pos[BUTTON_MAX][ITEM_MAX];
+
};
/* some default Values */