Index: src/fb/actions.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/fb/actions.c,v retrieving revision 1.6 diff -u -p -r1.6 actions.c --- src/fb/actions.c 1 Dec 2003 17:23:27 -0000 1.6 +++ src/fb/actions.c 4 Feb 2004 23:39:26 -0000 @@ -342,6 +342,44 @@ void change_spu(void *data) osd_display_spu_lang(); } +void change_volume(int how) +{ + if(how == ACTID_MUTE) { + int mute = xine_get_param(fbxine.stream, XINE_PARAM_AUDIO_MUTE); + xine_set_param(fbxine.stream, XINE_PARAM_AUDIO_MUTE, 1-mute); + } else { + int volume = xine_get_param(fbxine.stream, XINE_PARAM_AUDIO_VOLUME); + if(how == ACTID_pVOLUME) + volume++; + else + volume--; + if(volume < 0) + volume = 0; + else if(volume > 100) + volume = 100; + xine_set_param(fbxine.stream, XINE_PARAM_AUDIO_VOLUME, volume); + osd_display_volume(volume); + } +} + +void toggle_aspect(void) { + static char *ratios[XINE_VO_ASPECT_NUM_RATIOS + 1] = { + "Auto", + "Square", + "4:3", + "Anamorphic", + "DVB", + NULL + }; + + int aspect = xine_get_param(fbxine.stream, XINE_PARAM_VO_ASPECT_RATIO) + 1; + + xine_set_param(fbxine.stream, XINE_PARAM_VO_ASPECT_RATIO, aspect); + + osd_display_info("Aspect ratio: %s", + ratios[xine_get_param(fbxine.stream, XINE_PARAM_VO_ASPECT_RATIO)]); +} + void do_action(int action) { if(action & ACTID_IS_INPUT_EVENT) @@ -441,11 +479,28 @@ void do_action(int action) case ACTID_QUIT: fbxine_exit(); break; + case ACTID_pVOLUME: + case ACTID_mVOLUME: + case ACTID_MUTE: + change_volume(action); + break; + case ACTID_MRL_NEXT: + pthread_cond_signal(&fbxine.exit_cond); + break; + case ACTID_MRL_PRIOR: + fbxine.current_mrl -= 2; + if(fbxine.current_mrl < -1) + fbxine.current_mrl = -1; + pthread_cond_signal(&fbxine.exit_cond); + break; case ACTID_TOGGLE_INTERLEAVE: fbxine.deinterlace_enable = !fbxine.deinterlace_enable; osd_display_info("Deinterlace: %s", (fbxine.deinterlace_enable) ? "enabled" : "disabled"); post_deinterlace(); break; + case ACTID_TOGGLE_ASPECT_RATIO: + toggle_aspect(); + break; } } Index: src/fb/keys.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/fb/keys.c,v retrieving revision 1.3 diff -u -p -r1.3 keys.c --- src/fb/keys.c 1 Dec 2003 17:23:27 -0000 1.3 +++ src/fb/keys.c 4 Feb 2004 23:39:26 -0000 @@ -130,7 +130,7 @@ int fbxine_init_keyboard(void) if(ioctl(fbxine.tty_fd, KDSETMODE, KD_GRAPHICS) == -1) { perror("Failed to set /dev/tty to graphics mode"); - return 0; +// return 0; } #endif pthread_create(&fbxine.keyboard_thread, 0, fbxine_keyboard_loop, 0); Index: src/fb/main.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/fb/main.c,v retrieving revision 1.17 diff -u -p -r1.17 main.c --- src/fb/main.c 1 Dec 2003 17:23:27 -0000 1.17 +++ src/fb/main.c 4 Feb 2004 23:39:26 -0000 @@ -132,7 +132,7 @@ static int init_video(void) fbxine_register_exit(&exit_callback, (fbxine_callback_t)exit_video); - if (!strcmp(fbxine.video_port_id, "dxr3")) + if (!strcmp(fbxine.video_port_id, "dxr3") || !strcmp(fbxine.video_port_id, "xv")) fbxine.video_port = xine_open_video_driver(fbxine.xine, fbxine.video_port_id, XINE_VISUAL_TYPE_X11, NULL); @@ -317,7 +317,7 @@ int main(int argc, char *argv[]) install_abort(); - pthread_mutex_lock(&fbxine.mutex); +// pthread_mutex_lock(&fbxine.mutex); if(fbxine_init(argc, argv)) { while(fbxine.current_mrl < fbxine.num_mrls) @@ -332,7 +332,7 @@ int main(int argc, char *argv[]) exit_code = 0; } fbxine_do_exit(); - pthread_mutex_unlock(&fbxine.mutex); +// pthread_mutex_unlock(&fbxine.mutex); return exit_code; } Index: src/fb/osd.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/fb/osd.c,v retrieving revision 1.4 diff -u -p -r1.4 osd.c --- src/fb/osd.c 1 Dec 2003 17:23:27 -0000 1.4 +++ src/fb/osd.c 4 Feb 2004 23:39:26 -0000 @@ -563,6 +563,10 @@ void osd_stream_position() { } } +void osd_display_volume(int volume) { + osd_draw_bar("Volume", 0, 100, volume, OSD_BAR_STEPPER); +} + void osd_display_spu_lang(void) { char buffer[32]; char lang_buffer[XINE_LANG_MAX]; Index: src/fb/osd.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/fb/osd.h,v retrieving revision 1.2 diff -u -p -r1.2 osd.h --- src/fb/osd.h 9 Nov 2003 13:07:59 -0000 1.2 +++ src/fb/osd.h 4 Feb 2004 23:39:26 -0000 @@ -41,4 +41,5 @@ void osd_display_info(char *info, ...); /* see OSD_BAR_* */ void osd_stream_infos(void); void osd_draw_bar(char *title, int min, int max, int val, int type); +void osd_display_volume(int volume); #endif