コード例 #1
0
ファイル: video_setup.cpp プロジェクト: UkCvs/commando
bool CVideoSetup::changeNotify(const neutrino_locale_t OptionName, void *)
{
	bool ret = false;
 	CNeutrinoApp * neutrino = CNeutrinoApp::getInstance();

 	if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_VIDEOSIGNAL))
 	{
		while ((vcr_video_out_signal) == CControldClient::VIDEOOUTPUT_SVIDEO && (video_out_signal != CControldClient::VIDEOOUTPUT_SVIDEO) && (video_out_signal != CControldClient::VIDEOOUTPUT_COMPOSITE) )
		{
			video_out_signal = (video_out_signal + 1) % VIDEOMENU_VIDEOSIGNAL_OPTION_COUNT;
			ret = true;
		}
		g_Controld->setVideoOutput(video_out_signal);
		if (VcrVideoOutSignalOptionChooser)
			VcrVideoOutSignalOptionChooser->setActive((video_out_signal == CControldClient::VIDEOOUTPUT_COMPOSITE) || (video_out_signal == CControldClient::VIDEOOUTPUT_SVIDEO));
#ifdef HAVE_DBOX_HARDWARE
		SyncControlerForwarder->setActive((video_out_signal == CControldClient::VIDEOOUTPUT_RGB) || (video_out_signal == CControldClient::VIDEOOUTPUT_YUV_VBS) || (video_out_signal == CControldClient::VIDEOOUTPUT_YUV_CVBS));
#endif
	}
	else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_VCRSIGNAL))
	{
		g_Controld->setVCROutput(vcr_video_out_signal);
	}
	else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_VIDEOFORMAT) && (neutrino->getMode() != NeutrinoMessages::mode_radio))
	{
		g_Controld->setVideoFormat(g_settings.video_Format);
	}
	else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_VIDEOFORMAT_BG) && (neutrino->getMode() == NeutrinoMessages::mode_radio))
	{
		g_Controld->setVideoFormat(g_settings.video_backgroundFormat);
	}

	return ret;
}
コード例 #2
0
void CAudioMute::AudioMute(int newValue, bool isEvent)
{
	CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();
	bool doInit = newValue != (int) neutrino->isMuted();

	CVFD::getInstance()->setMuted(newValue);
	neutrino->setCurrentMuted(newValue);
	g_Zapit->muteAudio(newValue);

	if( isEvent && ( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_pic))
	{
		if (doInit)
			CVolumeHelper::getInstance()->refresh();

		CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
		if ((y_old != y)) {
			if (do_paint_mute_icon)
			{
				frameBuffer->fbNoCheck(true);
				this->hide();
				frameBuffer->fbNoCheck(false);
			}
			frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1);
			y_old = y;
		}

		/* Infoclock should be blocked in all windows and clean the clock
		 * display with ClearDisplay() by itself before paint,
		 * so we don't do this here.
		*/
		if (!CInfoClock::getInstance()->isBlocked()){
			CInfoClock::getInstance()->ClearDisplay();
		}

		frameBuffer->fbNoCheck(true);
		if (newValue) {
			if (do_paint_mute_icon)
				this->paint();
			frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1, x, y, width, height);
		}
		else {
			if (!CInfoClock::getInstance()->isBlocked()){
				CInfoClock::getInstance()->ClearDisplay();
				this->kill();
				clearSavedScreen();
			}else
				this->hide();
			frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1);
		}
		frameBuffer->fbNoCheck(false);
		frameBuffer->blit();
	}
}
コード例 #3
0
ファイル: audiomute.cpp プロジェクト: dbt1/neutrino-mp
void CAudioMute::enableMuteIcon(bool enable)
{
	CNeutrinoApp *neutrino = CNeutrinoApp::getInstance();
	CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
	frameBuffer->fbNoCheck(true);
	if (enable) {
		frameBuffer->doPaintMuteIcon(true);
		do_paint_mute_icon = true;
		if (neutrino->isMuted())
			this->paint();
	}
	else {
		if (!neutrino->isMuted())
			this->kill();
		frameBuffer->doPaintMuteIcon(false);
		do_paint_mute_icon = false;
	}
	frameBuffer->fbNoCheck(false);
}
コード例 #4
0
//init current position of form
void CVolumeBar::initVolumeBarPosition()
{
	CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();

	switch (g_settings.volume_pos)
	{
		case VOLUMEBAR_POS_TOP_RIGHT:{
			int x_corr 	= 0;
			if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) {
				if ((neutrino->isMuted()) && (!g_settings.mode_clock))
					x_corr = mute_dx + h_spacer;
				if (CNeutrinoApp::getInstance()->getChannellistIsVisible() == true)
					y += std::max(39, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()) + v_spacer;
				else if (g_settings.mode_clock)
					y = clock_y + clock_height + v_spacer + OFFSET_SHADOW;
			}
			x = sw - width - x_corr;
			break;
		}
		case VOLUMEBAR_POS_TOP_LEFT:
			if (FileTimeOSD->IsVisible())
				y = clock_y + clock_height + v_spacer + OFFSET_SHADOW;
			break;
		case VOLUMEBAR_POS_BOTTOM_LEFT:
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_BOTTOM_RIGHT:
			x = sw - width;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_TOP_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			break;
		case VOLUMEBAR_POS_BOTTOM_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_HIGHER_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - sh/10;
			break;
	}
}
コード例 #5
0
//init current position of form
void CVolumeBar::initVolumeBarPosition()
{
	CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();

	switch (g_settings.volume_pos)
	{
		case VOLUMEBAR_POS_TOP_RIGHT:{
			int x_corr 	= 0;
			if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) {
				if ((neutrino->isMuted()) && (!g_settings.mode_clock))
					x_corr = mute_dx + h_spacer;
				if (g_settings.mode_clock)
					y += max(clock_y + clock_height, mute_ay + mute_dy);
			}
			x = sw - width - x_corr;
			break;
		}
		case VOLUMEBAR_POS_TOP_LEFT:
			break;
		case VOLUMEBAR_POS_BOTTOM_LEFT:
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_BOTTOM_RIGHT:
			x = sw - width;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_TOP_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			break;
		case VOLUMEBAR_POS_BOTTOM_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_HIGHER_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - sh/10;
			break;
	}
}
コード例 #6
0
bool CUserMenu::showUserMenu(neutrino_msg_t msg)
{
	int button = -1;
	int dummy = 0;
	unsigned ums = g_settings.usermenu.size();
	for (unsigned int i = 0; i < ums; i++)
		if (g_settings.usermenu[i]->key == msg) {
			button = i;
			break;
		}

	if (button < 0)
		return false;

	int pers = -1;
	switch(msg) {
		case CRCInput::RC_red:
			pers = SNeutrinoSettings::P_MAIN_RED_BUTTON;
			button = SNeutrinoSettings::BUTTON_RED;
			break;
		case CRCInput::RC_green:
			pers = SNeutrinoSettings::P_MAIN_GREEN_BUTTON;
			button = SNeutrinoSettings::BUTTON_GREEN;
			break;
		case CRCInput::RC_yellow:
			pers = SNeutrinoSettings::P_MAIN_YELLOW_BUTTON;
			button = SNeutrinoSettings::BUTTON_YELLOW;
			break;
		case CRCInput::RC_blue:
			pers = SNeutrinoSettings::P_MAIN_BLUE_BUTTON;
			button = SNeutrinoSettings::BUTTON_BLUE;
			break;
	}

	CNeutrinoApp::getInstance()->StopSubtitles();

	if (pers > -1 && (g_settings.personalize[pers] != CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)) {
		ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT),450, 10);
		CNeutrinoApp::getInstance()->StartSubtitles();
		return true;
	}

	width = 40;

	CMenuItem* menu_item = NULL;
	CMenuItem* last_menu_item = NULL;
	CColorKeyHelper keyhelper;
	
	//set default feature key
	neutrino_msg_t key = feat_key[CPersonalizeGui::PERSONALIZE_FEAT_KEY_AUTO].key; //CRCInput::RC_nokey

	const char * icon = NULL;
	int menu_items = 0;

	// define classes
	CSubChannelSelectMenu subchanselect;
	CNeutrinoApp * neutrino	= CNeutrinoApp::getInstance();
	
	std::string txt = g_settings.usermenu[button]->title;
	if (button < COL_BUTTONMAX && txt.empty())
		txt = g_Locale->getText(user_menu[button].caption);

	CMenuWidget *menu = new CMenuWidget(txt, (button < COL_BUTTONMAX) ? user_menu[button].menu_icon_def : "", width);
	if (menu == NULL)
		return true;

	if (button < COL_BUTTONMAX)	
		menu->setSelected(user_menu[button].selected);
	
	//show cancel button if configured
	if (g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL])
		menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
	else
		menu->addItem(GenericMenuSeparator);
	
	std::string itemstr_last("1");

	std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
	for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it) {
		if (it->empty())
			continue;
		if (*it == itemstr_last)
			continue;
		int item = -1;
		if (it->find_first_not_of("0123456789") == std::string::npos)
			item = atoi(*it);
		menu_item = NULL;
		switch (item) {
		case SNeutrinoSettings::ITEM_NONE:
			continue;
		case SNeutrinoSettings::ITEM_BAR:
			menu->addItem(GenericMenuSeparatorLine);
			break;
		case SNeutrinoSettings::ITEM_FAVORITS:
			keyhelper.get(&key,&icon,feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_FAVORIT]].key); //CRCInput::RC_green
			menu_item = new CMenuDForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, new CFavorites, "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_RECORD:
			if (g_settings.recording_type == RECORDING_OFF)
				break;
			keyhelper.get(&key,&icon,CRCInput::RC_red);
			menu_item = new CMenuForwarder(LOCALE_MAINMENU_RECORDING, true, NULL, CRecordManager::getInstance(), "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_MOVIEPLAYER_MB:
			if (g_settings.recording_type == RECORDING_OFF)
				break;
			keyhelper.get(&key,&icon,CRCInput::RC_green);
			menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, neutrino, "tsmoviebrowser", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB);
			break;
		case SNeutrinoSettings::ITEM_TIMERLIST:
			keyhelper.get(&key,&icon,feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_TIMERLIST]].key); //CRCInput::RC_yellow
			menu_item = new CMenuDForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList, "-1", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_TIMERS, LOCALE_MENU_HINT_TIMERS);
			break;
		case SNeutrinoSettings::ITEM_REMOTE:
			keyhelper.get(&key,&icon,feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_RC_LOCK]].key); //CRCInput::RC_nokey);
			menu_item = new CMenuDForwarder(LOCALE_RCLOCK_MENUEADD, true, NULL, new CRCLock, "-1" , key, icon );
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_SUPER:
			keyhelper.get(&key,&icon,CRCInput::RC_green);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_EPGPLUS   , true, NULL, new CEPGplusHandler,  "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_LIST:
			keyhelper.get(&key,&icon,CRCInput::RC_red);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_EVENTLIST , true, NULL, new CEventListHandler,  "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_INFO:
			keyhelper.get(&key,&icon,CRCInput::RC_yellow);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_EVENTINFO , true, NULL, new CEPGDataHandler,  "-1", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_EPG_MISC:
		{
			dummy = g_Sectionsd->getIsScanningActive();
			keyhelper.get(&key,&icon);
			//          new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOMODE, &g_settings.video_Mode, VIDEOMENU_VIDEOMODE_OPTIONS, VIDEOMENU_VIDEOMODE_OPTION_COUNT, true, this, CRCInput::RC_nokey, "", true);
			menu_item = new CMenuOptionChooser(LOCALE_MAINMENU_PAUSESECTIONSD, &dummy, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this , key, icon );
			menu->addItem(menu_item, false);

			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MAINMENU_CLEARSECTIONSD, true, NULL, neutrino, "clearSectionsd", key,icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		}
		case SNeutrinoSettings::ITEM_AUDIO_SELECT:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, true, NULL, new CAudioSelectMenuHandler, "-1", key,icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_SUBCHANNEL:
		{
			if (g_RemoteControl->subChannels.empty())
				break;
			// NVOD/SubService- Kanal!
			CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, NEUTRINO_ICON_VIDEO);
			if (!subchanselect.getNVODMenu(tmpNVODSelector)) {
				delete tmpNVODSelector;
				break;
			}
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_HEAD, true, NULL, tmpNVODSelector, "-1", key,icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		}
		case SNeutrinoSettings::ITEM_TECHINFO:
			keyhelper.get(&key,&icon,CRCInput::RC_blue);
			menu_item = new CMenuDForwarder(LOCALE_EPGMENU_STREAMINFO, !neutrino->channelList->isEmpty(), NULL, new CStreamInfo2, "-1", key, icon );
			menu_item->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO);
			break;
		case SNeutrinoSettings::ITEM_GAMES:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "-1", key, icon );
			menu_item->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES);
			break;
                case SNeutrinoSettings::ITEM_TOOLS:
			keyhelper.get(&key,&icon);
                        menu_item = new CMenuDForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL), "-1", key, icon );
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
                        break;
		case SNeutrinoSettings::ITEM_SCRIPTS:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT), "-1", key, icon );
			menu_item->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS);
			break;
		case SNeutrinoSettings::ITEM_LUA:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA), "-1", key, icon );
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_PLUGIN_TYPES:
		{
			unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins();
			if (!number_of_plugins)
				continue;
			for (unsigned int count = 0; count < number_of_plugins; count++)
			{
#if 0
				bool show = g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL ||
					g_PluginList->getType(count) == CPlugins::P_TYPE_LUA;
#endif
				bool show = false;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_GAME;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_SCRIPT;
				if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA])
					show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA;

				if (show && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED))
				{
					menu_items++;
					neutrino_msg_t d_key = g_PluginList->getKey(count);
					//printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count));
					keyhelper.get(&key,&icon, d_key);
					menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon);
					menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));

					menu->addItem(menu_item, false);
				}
			}
			menu_item = NULL;
			break;
		}
		case SNeutrinoSettings::ITEM_VTXT:
			keyhelper.get(&key,&icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_VTXT]].key); //CRCInput::RC_blue
			menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_VTXT, true, NULL, CPluginsExec::getInstance(), "teletext", key, icon);
			// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
			break;
		case SNeutrinoSettings::ITEM_IMAGEINFO:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_IMAGEINFO,  true, NULL, new CImageInfo, NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_IMAGEINFO);
			break;
		case SNeutrinoSettings::ITEM_BOXINFO:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_DBOXINFO, LOCALE_MENU_HINT_DBOXINFO);
			break;
#if !HAVE_SPARK_HARDWARE
		case SNeutrinoSettings::ITEM_CAM:
			//if(cs_get_revision() == 10) continue;
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler, NULL, key, icon);
			break;
#endif
		case SNeutrinoSettings::ITEM_CLOCK:
			keyhelper.get(&key,&icon); 
			menu_item = new CMenuForwarder(!g_settings.mode_clock ? LOCALE_CLOCK_SWITCH_ON:LOCALE_CLOCK_SWITCH_OFF, true, NULL, neutrino, "clock_switch", key, icon);
			menu_item->setHint("", LOCALE_MENU_HINT_CLOCK_MODE);
			break;
#if 0
		case SNeutrinoSettings::ITEM_ADZAP:
			keyhelper.get(&key,&icon,CRCInput::RC_blue);
			menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, NULL, neutrino, "adzap", key, icon);
			menu_item->setHint("", LOCALE_MENU_HINT_ADZAP);
			break;
		case SNeutrinoSettings::ITEM_TUNER_RESTART:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART_TUNER, true, NULL, neutrino, "restarttuner", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RESTART_TUNER);
			break;
		case SNeutrinoSettings::ITEM_RASS:
			if (!(neutrino->getMode() == CNeutrinoApp::mode_radio && g_Radiotext && g_Radiotext->haveRASS()))
				continue;
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_RASS_HEAD, true, NULL, neutrino, "rass", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_RASS, LOCALE_MENU_HINT_RASS);
			break;
		case SNeutrinoSettings::ITEM_NETZKINO:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_NKPLAYBACK, true, NULL, neutrino, "nkplayback", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_NKPLAY, LOCALE_MENU_HINT_NKPLAY);
			break;
#endif
#if HAVE_SPARK_HARDWARE
		case SNeutrinoSettings::ITEM_THREE_D_MODE:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_THREE_D_SETTINGS, true, NULL, neutrino, "3dmode", key, icon);
			menu_item->setHint("", LOCALE_MENU_HINT_VIDEO_THREE_D);
			break;
#endif
		case SNeutrinoSettings::ITEM_YOUTUBE:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, true, NULL, neutrino, "ytplayback", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY);
			break;
		case SNeutrinoSettings::ITEM_FILEPLAY:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, true, NULL, neutrino, "fileplayback", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY);
			break;
		case SNeutrinoSettings::ITEM_AUDIOPLAY:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY);
			break;
		case SNeutrinoSettings::ITEM_INETPLAY:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO);
			break;
		case SNeutrinoSettings::ITEM_HDDMENU:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, CHDDMenuHandler::getInstance(), NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_HDD, LOCALE_MENU_HINT_HDD);
			break;
		case SNeutrinoSettings::ITEM_NETSETTINGS:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuForwarder(LOCALE_MAINSETTINGS_NETWORK, true, NULL, CNetworkSetup::getInstance(), NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_NETWORK, LOCALE_MENU_HINT_NETWORK);
			break;
		case SNeutrinoSettings::ITEM_SWUPDATE:
			keyhelper.get(&key,&icon);
			menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate(), NULL, key, icon);
			menu_item->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE);
			break;
		case -1: // plugin
		    {
			int number_of_plugins = g_PluginList->getNumberOfPlugins();
			if (!number_of_plugins)
				continue;
			int count = 0;
			for(; count < number_of_plugins; count++) {
				const char *pname = g_PluginList->getFileName(count);
				if (pname && (std::string(pname) == *it) && !g_PluginList->isHidden(count)) {
					neutrino_msg_t d_key = g_PluginList->getKey(count);
					keyhelper.get(&key,&icon, d_key);
					menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon);
					menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));
					break;
				}
			}
			if (count == number_of_plugins)
				continue;
		    }
		}
			
		itemstr_last = *it;
		if (menu_item) {
			menu_items++;
			menu->addItem(menu_item, false);
			last_menu_item = menu_item;
		}
	}

	extern CInfoClock *InfoClock;
	InfoClock->enableInfoClock(false);

	// show menu if there are more than 2 items only
	// otherwise, we start the item directly (must be the last one)
	if (menu_items > 1 )
		menu->exec(NULL, "");
	else if (last_menu_item)
		last_menu_item->exec( NULL );
	
	InfoClock->enableInfoClock(true);
	CNeutrinoApp::getInstance()->StartSubtitles();

	if (button < COL_BUTTONMAX)
		user_menu[button].selected = menu->getSelected();

	delete menu;

	return true;
}
コード例 #7
0
void CInfoViewerBB::getBBIconInfo()
{
	bbIconMaxH 		= 0;
	BBarY 			= g_InfoViewer->BoxEndY + bottom_bar_offset;
	BBarFontY 		= BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) / 2; /* center in buttonbar */
	bbIconMinX 		= g_InfoViewer->BoxEndX;
	CNeutrinoApp* neutrino	= CNeutrinoApp::getInstance();

	for (int i = 0; i < CInfoViewerBB::ICON_MAX; i++) {
		int w = 0, h = 0;
		bool iconView = false;
		switch (i) {
		case CInfoViewerBB::ICON_SUBT:  //no radio
			if (neutrino->getMode() != NeutrinoMessages::mode_radio)
				iconView = checkBBIcon(NEUTRINO_ICON_SUBT, &w, &h);
			break;
		case CInfoViewerBB::ICON_VTXT:  //no radio
			if (neutrino->getMode() != NeutrinoMessages::mode_radio)
				iconView = checkBBIcon(NEUTRINO_ICON_VTXT, &w, &h);
			break;
#ifdef SHOW_RADIOTEXT_ICON
		case CInfoViewerBB::ICON_RT:
			if (neutrino->getMode() == NeutrinoMessages::mode_radio)
				iconView = checkBBIcon(NEUTRINO_ICON_RT, &w, &h);
			break;
#endif
		case CInfoViewerBB::ICON_DD:
			if( g_settings.infobar_show_dd_available )
				iconView = checkBBIcon(NEUTRINO_ICON_DD, &w, &h);
			break;
		case CInfoViewerBB::ICON_16_9:  //no radio
			if (neutrino->getMode() != NeutrinoMessages::mode_radio)
				iconView = checkBBIcon(NEUTRINO_ICON_16_9, &w, &h);
			break;
		case CInfoViewerBB::ICON_RES:  //no radio
			if ((g_settings.infobar_show_res < 2) && (neutrino->getMode() != NeutrinoMessages::mode_radio))
				iconView = checkBBIcon(NEUTRINO_ICON_RESOLUTION_1280, &w, &h);
			break;
		case CInfoViewerBB::ICON_CA:
			if (g_settings.casystem_display == 2)
				iconView = checkBBIcon(NEUTRINO_ICON_SCRAMBLED2, &w, &h);
			break;
		case CInfoViewerBB::ICON_TUNER:
			if (CFEManager::getInstance()->getEnabledCount() > 1 && g_settings.infobar_show_tuner == 1)
				iconView = checkBBIcon(NEUTRINO_ICON_TUNER_1, &w, &h);
			break;
		default:
			break;
		}
		if (iconView) {
			bbIconMinX -= w + 2;
			bbIconInfo[i].x = bbIconMinX;
			bbIconInfo[i].h = h;
		}
		else
			bbIconInfo[i].x = -1;
	}
	for (int i = 0; i < CInfoViewerBB::ICON_MAX; i++) {
		if (bbIconInfo[i].x != -1)
			bbIconMaxH = std::max(bbIconMaxH, bbIconInfo[i].h);
	}
	if (g_settings.infobar_show_sysfs_hdd)
		bbIconMinX -= hddwidth + 2;
}