[Diff] Esound personalized

Das Original Benutzerinterface Neutrino-SD incl. zapit, sectionsd, yWeb etc...
GetAway
Contributor
Beiträge: 1509
Registriert: Donnerstag 27. Dezember 2007, 12:59

[Diff] Esound personalized

Beitrag von GetAway »

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.941
diff -U3 -r1.941 neutrino.cpp
--- a/apps/tuxbox/neutrino/src/neutrino.cpp	30 Mar 2009 09:52:35 -0000	1.941
+++ b/apps/tuxbox/neutrino/src/neutrino.cpp	1 Apr 2009 10:37:50 -0000
@@ -483,6 +483,7 @@
 	g_settings.personalize_games = configfile.getInt32("personalize_games", 1);
 	g_settings.personalize_audioplayer = configfile.getInt32("personalize_audioplayer", 1);
 	g_settings.personalize_inetradio = configfile.getInt32("personalize_inetradio", 0);
+	g_settings.personalize_esound = configfile.getInt32("personalize_esound", 0);
 	g_settings.personalize_movieplayer = configfile.getInt32("personalize_movieplayer", 1);
 	g_settings.personalize_pictureviewer = configfile.getInt32("personalize_pictureviewer", 1);
 #if ENABLE_UPNP
@@ -1008,6 +1009,7 @@
 	configfile.setInt32 ( "personalize_games", g_settings.personalize_games );
 	configfile.setInt32 ( "personalize_audioplayer", g_settings.personalize_audioplayer );
 	configfile.setInt32 ( "personalize_inetradio", g_settings.personalize_inetradio );
+	configfile.setInt32 ( "personalize_esound", g_settings.personalize_esound );
 	configfile.setInt32 ( "personalize_movieplayer", g_settings.personalize_movieplayer );
 	configfile.setInt32 ( "personalize_pictureviewer", g_settings.personalize_pictureviewer );
 #if ENABLE_UPNP
Index: apps/tuxbox/neutrino/src/gui/neutrino_menu.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/neutrino_menu.cpp,v
retrieving revision 1.52
diff -U3 -r1.52 neutrino_menu.cpp
--- a/apps/tuxbox/neutrino/src/gui/neutrino_menu.cpp	30 Mar 2009 09:52:37 -0000	1.52
+++ b/apps/tuxbox/neutrino/src/gui/neutrino_menu.cpp	1 Apr 2009 10:37:51 -0000
@@ -161,18 +161,13 @@
 	else if (g_settings.personalize_inetradio == 2)
 		mainMenu.addItem(new CLockedMenuForwarder(LOCALE_INETRADIO_NAME, g_settings.personalize_pincode, true, true, NULL, new CAudioPlayerGui(true), NULL, CRCInput::convertDigitToKey(shortcut++)));
 
-	bool found_esound = false;
-
-	if (access("/bin/esd", X_OK) == 0)
-		found_esound = true;
-
-	if (access("/var/bin/esd", X_OK) == 0)
-		found_esound = true;
-
-	if (found_esound)
+	if (access("/bin/esd", X_OK) == 0 || access("/var/bin/esd", X_OK) == 0)
 	{
-		puts("[neutrino] found esound, adding to mainmenue");
-		mainMenu.addItem(new CMenuForwarder(LOCALE_ESOUND_NAME, true, NULL, new CEsoundGui(), NULL, CRCInput::convertDigitToKey(shortcut++)));
+		puts("[neutrino] found esound, adding to mainmenue/personalize");
+		if (g_settings.personalize_esound == 1)
+			mainMenu.addItem(new CMenuForwarder(LOCALE_ESOUND_NAME, true, NULL, new CEsoundGui(), NULL, CRCInput::convertDigitToKey(shortcut++)));
+		else if (g_settings.personalize_esound == 2)
+			mainMenu.addItem(new CLockedMenuForwarder(LOCALE_ESOUND_NAME, g_settings.personalize_pincode, true, true, NULL, new CEsoundGui(), NULL, CRCInput::convertDigitToKey(shortcut++)));
 	}
 
 	if (g_settings.personalize_movieplayer == 1)
@@ -215,7 +210,7 @@
 		mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, true, NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT), "",
 										CRCInput::convertDigitToKey(shortcut++)));
 
-	if (g_settings.personalize_audioplayer==0 && g_settings.personalize_inetradio==0 && g_settings.personalize_movieplayer==0 && g_settings.personalize_pictureviewer==0 && g_settings.personalize_upnpbrowser==0)
+	if (g_settings.personalize_audioplayer==0 && g_settings.personalize_inetradio==0 && g_settings.personalize_esound==0 && g_settings.personalize_movieplayer==0 && g_settings.personalize_pictureviewer==0 && g_settings.personalize_upnpbrowser==0)
 		;// Stop seperator from appearing when menu entries have been hidden
 	else
 		mainMenu.addItem(GenericMenuSeparatorLine); 
Index: apps/tuxbox/neutrino/src/gui/personalize.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/personalize.cpp,v
retrieving revision 1.7
diff -U3 -r1.7 personalize.cpp
--- a/apps/tuxbox/neutrino/src/gui/personalize.cpp	1 May 2008 21:53:12 -0000	1.7
+++ b/apps/tuxbox/neutrino/src/gui/personalize.cpp	1 Apr 2009 10:37:51 -0000
@@ -179,17 +179,18 @@
 	int old_scartmode	= g_settings.personalize_scartmode;
 	int old_games		= g_settings.personalize_games;
 	int old_audioplayer	= g_settings.personalize_audioplayer;
-	int old_inetradio		= g_settings.personalize_inetradio;
+	int old_inetradio	= g_settings.personalize_inetradio;
+	int old_esound		= g_settings.personalize_esound;
 	int old_movieplayer	= g_settings.personalize_movieplayer;
 	int old_pictureviewer	= g_settings.personalize_pictureviewer;
 #ifdef ENABLE_UPNP
 	int old_upnpbrowser	= g_settings.personalize_upnpbrowser;
 #endif
-	int old_settings		= g_settings.personalize_settings;
+	int old_settings	= g_settings.personalize_settings;
 	int old_service		= g_settings.personalize_service;
 	int old_sleeptimer	= g_settings.personalize_sleeptimer;
 	int old_reboot		= g_settings.personalize_reboot;
-	int old_shutdown		= g_settings.personalize_shutdown;
+	int old_shutdown	= g_settings.personalize_shutdown;
 
 	int shortcut = 1;
 
@@ -207,6 +208,10 @@
 
 	pMMMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_AUDIOPLAYER, (int *)&g_settings.personalize_audioplayer,PERSONALIZE_STD_OPTIONS, PERSONALIZE_STD_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
 	pMMMenu->addItem(new CMenuOptionChooser(LOCALE_INETRADIO_NAME, (int *)&g_settings.personalize_inetradio,PERSONALIZE_STD_OPTIONS, PERSONALIZE_STD_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
+	//check if esound is available	
+	if (access("/bin/esd", X_OK) == 0 || access("/var/bin/esd", X_OK) == 0) {
+		pMMMenu->addItem(new CMenuOptionChooser(LOCALE_ESOUND_NAME, (int *)&g_settings.personalize_esound,PERSONALIZE_STD_OPTIONS, PERSONALIZE_STD_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
+	}	
 	pMMMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_MOVIEPLAYER, (int *)&g_settings.personalize_movieplayer, PERSONALIZE_STD_OPTIONS, PERSONALIZE_STD_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
 	pMMMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_PICTUREVIEWER, (int *)&g_settings.personalize_pictureviewer, PERSONALIZE_STD_OPTIONS, PERSONALIZE_STD_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)));
 #ifdef ENABLE_UPNP
@@ -230,6 +235,7 @@
 		|| old_games != g_settings.personalize_games
 		|| old_audioplayer != g_settings.personalize_audioplayer
 		|| old_inetradio != g_settings.personalize_inetradio
+		|| old_esound != g_settings.personalize_esound
 		|| old_movieplayer != g_settings.personalize_movieplayer
 		|| old_pictureviewer != g_settings.personalize_pictureviewer
 #ifdef ENABLE_UPNP
Index: apps/tuxbox/neutrino/src/system/settings.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/system/settings.h,v
retrieving revision 1.204
diff -U3 -r1.204 settings.h
--- a/apps/tuxbox/neutrino/src/system/settings.h	25 Mar 2009 14:08:08 -0000	1.204
+++ b/apps/tuxbox/neutrino/src/system/settings.h	1 Apr 2009 10:37:51 -0000
@@ -199,6 +199,7 @@
 	int personalize_games;
 	int personalize_audioplayer;
 	int personalize_inetradio;
+	int personalize_esound;
 	int personalize_movieplayer;
 	int personalize_pictureviewer;
 	int personalize_upnpbrowser;
http://www.file-upload.net/download-156 ... ar.gz.html
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: [Diff] Esound personalized

Beitrag von rhabarber1848 »

committed to CVS, danke!