void CLCD::showMenuText(const int position, const char * text, const int highlight, const bool utf_encoded)
{
	/* hack, to not have to patch too much in movieplayer.cpp */
	if (mode == MODE_MOVIE) {
		size_t p;
		AUDIOMODES m = movie_playmode;
		std::string mytext = text;
		if (mytext.find("> ") == 0) {
			mytext = mytext.substr(2);
			m = AUDIO_MODE_PLAY;
		} else if (mytext.find("|| ") == 0) {
			mytext = mytext.substr(3);
			m = AUDIO_MODE_PAUSE;
		} else if ((p = mytext.find("s||> ")) < 3) {
			mytext = mytext.substr(p + 5);
			m = AUDIO_MODE_PLAY;
		} else if ((p = mytext.find("x>> ")) < 3) {
			mytext = mytext.substr(p + 4);
			m = AUDIO_MODE_FF;
		} else if ((p = mytext.find("x<< ")) < 3) {
			mytext = mytext.substr(p + 4);
			m = AUDIO_MODE_REV;
		}
		setMovieInfo(m, "", mytext, false);
		return;
	}

	if (mode != MODE_MENU_UTF8)
		return;

	// reload specified line
	display.draw_fill_rect(-1, 35+14*position, LCD_COLS, 35+14+14*position, CLCDDisplay::PIXEL_OFF);
	fonts.menu->RenderString(0,35+11+14*position, LCD_COLS + 20, text, CLCDDisplay::PIXEL_INV, highlight, utf_encoded);
	wake_up();
	displayUpdate();

}
Beispiel #2
0
void CLCD::setMode(const MODES m, const char * const title)
{
	mode = m;
	menutitle = title;
	setlcdparameter();

	switch (m)
	{
	case MODE_TVRADIO:
	case MODE_MOVIE:
		switch (g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME])
		{
		case STATUSLINE_PLAYTIME:
			display.load_screen(&(background[BACKGROUND_LCD2]));
			showPercentOver(percentOver, false, mode);
			break;
		case STATUSLINE_VOLUME:
			display.load_screen(&(background[BACKGROUND_LCD]));
			showVolume(volume, false);
			break;
		case STATUSLINE_BOTH:
			display.load_screen(&(background[BACKGROUND_LCD3]));
			showVolume(volume, false);
			showPercentOver(percentOver, false, mode);
			break;
		case STATUSLINE_BOTH_AUDIO:
			display.load_screen(&(background[BACKGROUND_LCD4]));
			showVolume(volume, false);
			showPercentOver(percentOver, false, mode);
			break;
		default:
			break;
		}
		if (mode == MODE_TVRADIO)
			showServicename(servicename);
		else
		{
			setMoviePlaymode(movie_playmode);
			setMovieInfo(movie_big, movie_small);
			setMovieAudio(movie_is_ac3);
		}
		showclock = true;
		showTime();      /* "showclock = true;" implies that "showTime();" does a "displayUpdate();" */
		break;
	case MODE_AUDIO:
	{
		display.load_screen(&(background[BACKGROUND_LCD]));
		display.draw_fill_rect(0, 14, LCD_COLS, 48, CLCDDisplay::PIXEL_OFF);
		
		showAudioPlayMode(PLAYMODE_STOP);
		showVolume(volume, false);
		showclock = true;
		showTime();      /* "showclock = true;" implies that "showTime();" does a "displayUpdate();" */
		break;
	}
	case MODE_SCART:
		display.load_screen(&(background[BACKGROUND_LCD]));
		showVolume(volume, false);
		showclock = true;
		showTime();      /* "showclock = true;" implies that "showTime();" does a "displayUpdate();" */
		break;
	case MODE_MENU_UTF8:
		showclock = false;
		display.load_screen(&(background[BACKGROUND_SETUP]));
		fonts.menutitle->RenderString(0, 28, LCD_COLS + 20, title, CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
		displayUpdate();
		break;
	case MODE_SHUTDOWN:
		showclock = false;
		display.load_screen(&(background[BACKGROUND_POWER]));
		displayUpdate();
		break;
	case MODE_STANDBY:
		showclock = true;
		showTime();      /* "showclock = true;" implies that "showTime();" does a "displayUpdate();" */
		                 /* "showTime()" clears the whole lcd in MODE_STANDBY                         */
		break;
#ifdef LCD_UPDATE
	case MODE_FILEBROWSER:
		showclock = true;
		display.draw_fill_rect(-1, -1, LCD_COLS, 64, CLCDDisplay::PIXEL_OFF); // clear lcd
		showFilelist();
		break;
	case MODE_PROGRESSBAR:
		showclock = false;
		display.load_screen(&(background[BACKGROUND_SETUP]));
		showProgressBar();
		break;
	case MODE_PROGRESSBAR2:
		showclock = false;
		display.load_screen(&(background[BACKGROUND_SETUP]));
		showProgressBar2();
		break;
	case MODE_INFOBOX:
		showclock = false;
		showInfoBox();
		break;
#endif // LCD_UPDATE
	}
	wake_up();
}