Exemplo n.º 1
0
static int 
keypress(Screen *this_screen, int cur_key){
	switch (cur_key) {
			
		case KEY_Betty:
		case KEY_Menu:
			popup(
				"A  All\n   playlists\n\n"
				"B  Current\n   playlist\n\n"
				"C  Search\n\n"
				"D \n\n"
				"i  Info",
					0, keypress_popup);
			break;
			
		case KEY_Exit:	
			show_screen(TRACKLIST_SCREEN);
			break;
			
		case KEY_A:	
			show_screen(PLAYLIST_SCREEN);
			break;
			
		case KEY_B:	
			show_screen(TRACKLIST_SCREEN);
			break;
			
		case KEY_C:	
			show_screen(SEARCH_SCREEN);
			break;

		case KEY_Info:
			popup("Red = Stop\n"
				"Green = Play\n"
				"Yellow = Pause\n"
				"PiP = Random\n"
				"A/B = Repeat\n"
				"16:9 = Single\n"
				"\xB1 = Seek Back\n"
				"\xB0 = Seek FWD\n"
				"\xB2 = Next Song\n"
				"\xB3 = Prev. Song\n"
				"TV = Version", 
				  0, keypress_info_popup);
			break;
												
		case KEY_Left:
			user_wants_time_add(-10);	
			break;
			
		case KEY_Right:
			user_wants_time_add(+10);	
			break;
			
		case KEY_Up:
		case KEY_Pminus:
			user_wants_song(PREV_SONG);	
			break;
					
		case KEY_Down:
		case KEY_Pplus:
			user_wants_song(NEXT_SONG);
			break;
			

		case KEY_Red:
			user_wants_state(STOP);
			break;
			
		case KEY_Green:
			user_wants_state(PLAY);
			break;
						
		case KEY_Yellow:
			user_toggle_pause();
			break;

			
		case KEY_PiP:
			user_toggle_random();	
			break;
			
		case KEY_AB:
			user_toggle_repeat();	
			break;
			
		case KEY_16_9:
			user_toggle_single();	
			break;

		case KEY_VTX1:
			user_wants_script(1);
			break;
			
		case KEY_VTX3:
			user_wants_script(2);
			break;
				
		case KEY_TV:
			view_message("   McBetty\n\n"
						"Version "VERSION"\n\n\n"
						"  (c) 2010\n   H. Raap",
	  			5 * TICKS_PER_SEC);
			break;
			
		default:
			return cur_key;				// we could not handle key
	};
	return NO_KEY;
};	
Exemplo n.º 2
0
void 
keypress(Screen *this_screen, int cur_key, UserReq *req){
	switch (cur_key) {

		case KEY_Yellow:
			user_toggle_pause();
			break;
			
		case KEY_Green:
			user_wants_state(PLAY);
			break;
			
		case KEY_Left:
			user_wants_time_add(-10);	
			break;
			
		case KEY_Right:
			user_wants_time_add(+10);	
			break;
			
		case KEY_Red:
			user_wants_state(STOP);
			break;

		case KEY_PiP:
			user_toggle_random();	
			break;
			
		case KEY_AB:
			user_toggle_repeat();	
			break;
			
		case KEY_16_9:
			user_toggle_single();	
			break;

			/* Inform the controller that the user wants the next song */

		case KEY_Down:
		case KEY_Pplus:
			user_wants_song(NEXT_SONG);
			break;
			
			/* Inform the controller that the user wants the previous song */
		case KEY_Up:
		case KEY_Pminus:
			user_wants_song(PREV_SONG);	
			break;
			
			/* Show/hide version info */
		case KEY_Info:
			view_version_changed();
			break;
			
		// TODO debug only
		case KEY_VTX3:
			switch_screen(PLAYING_SCREEN, INFO_SCREEN);	
			break;

		case KEY_A:
			user_wants_script(1);
			break;
			
		case KEY_B:
			user_wants_script(2);
			break;
				
		default:
			break;
	};
};