1 /*****************************************************************************
2 * gnome_callbacks.c : Callbacks for the Gnome plugin.
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: gnome_callbacks.c,v 1.27 2001/05/07 03:14:09 stef Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 * Stéphane Borel <stef@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 #define MODULE_NAME gnome
26 #include "modules_inner.h"
28 /*****************************************************************************
30 *****************************************************************************/
40 #include "stream_control.h"
41 #include "input_ext-intf.h"
43 #include "interface.h"
44 #include "intf_playlist.h"
48 #include "video_output.h"
49 #include "audio_output.h"
51 #include "gnome_callbacks.h"
52 #include "gnome_playlist.h"
53 #include "gnome_interface.h"
54 #include "gnome_support.h"
55 #include "intf_gnome.h"
59 /*****************************************************************************
61 *****************************************************************************
62 * The following callbacks are related to the main interface window.
63 *****************************************************************************/
65 on_intf_window_destroy (GtkObject *object,
68 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" );
70 vlc_mutex_lock( &p_intf->change_lock );
72 vlc_mutex_unlock( &p_intf->change_lock );
77 on_slider_button_press_event (GtkWidget *widget,
78 GdkEventButton *event,
81 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
83 vlc_mutex_lock( &p_intf->change_lock );
84 p_intf->p_sys->b_slider_free = 0;
85 vlc_mutex_unlock( &p_intf->change_lock );
92 on_slider_button_release_event (GtkWidget *widget,
93 GdkEventButton *event,
96 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
98 vlc_mutex_lock( &p_intf->change_lock );
99 p_intf->p_sys->b_slider_free = 1;
100 vlc_mutex_unlock( &p_intf->change_lock );
107 on_intf_window_drag_data_received (GtkWidget *widget,
108 GdkDragContext *drag_context,
111 GtkSelectionData *data,
117 char *psz_text = data->data;
118 int i_len = strlen( psz_text );
122 case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */
129 /* get rid of ' ' at the end */
130 *( psz_text + i_len - 1 ) = 0;
132 intf_WarnMsg( 3, "intf: dropped text/uri-list data `%s'", psz_text );
133 intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
137 case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */
144 /* get rid of \r\n at the end */
145 *( psz_text + i_len - 2 ) = 0;
147 intf_WarnMsg( 3, "intf: dropped text/uri-list data `%s'", psz_text );
148 intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
153 intf_ErrMsg( "intf error: unknown dropped type");
157 intf_thread_t * p_intf = GetIntf( GTK_WIDGET( widget ), "intf_window" );
158 int i_end = p_main->p_playlist->i_size;
160 GnomeDropDataReceived( p_intf, data, info, PLAYLIST_END );
162 if( p_intf->p_input != NULL )
164 /* FIXME: temporary hack */
165 p_intf->p_input->b_eof = 1;
168 intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
175 on_button_title_prev_clicked (GtkButton *button,
178 intf_thread_t * p_intf;
179 input_area_t * p_area;
182 p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
183 i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
187 p_area = p_intf->p_input->stream.pp_areas[i_id];
188 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
190 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
192 p_intf->p_sys->b_title_update = 1;
198 on_button_title_next_clicked (GtkButton *button,
201 intf_thread_t * p_intf;
202 input_area_t * p_area;
205 p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
206 i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
208 if( i_id < p_intf->p_input->stream.i_area_nb )
210 p_area = p_intf->p_input->stream.pp_areas[i_id];
211 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
213 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
215 p_intf->p_sys->b_title_update = 1;
221 on_button_chapter_prev_clicked (GtkButton *button,
224 intf_thread_t * p_intf;
225 input_area_t * p_area;
227 p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
228 p_area = p_intf->p_input->stream.p_selected_area;
230 if( p_area->i_part > 0 )
233 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
235 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
237 p_intf->p_sys->b_chapter_update = 1;
243 on_button_chapter_next_clicked (GtkButton *button,
246 intf_thread_t * p_intf;
247 input_area_t * p_area;
249 p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
250 p_area = p_intf->p_input->stream.p_selected_area;
252 if( p_area->i_part < p_area->i_part_nb )
255 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
257 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
259 p_intf->p_sys->b_chapter_update = 1;
264 /*****************************************************************************
266 *****************************************************************************
267 * The following callbacks are related to the menubar of the main
269 *****************************************************************************/
271 on_menubar_open_activate (GtkMenuItem *menuitem,
274 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
276 /* If we have never used the file selector, open it */
277 if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
279 p_intf->p_sys->p_fileopen = create_intf_fileopen();
280 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
283 gtk_file_selection_set_filename ( GTK_FILE_SELECTION(
284 p_intf->p_sys->p_fileopen ),
285 main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
288 gtk_widget_show( p_intf->p_sys->p_fileopen );
289 gdk_window_raise( p_intf->p_sys->p_fileopen->window );
294 on_menubar_disc_activate (GtkMenuItem *menuitem,
297 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
299 /* If we have never used the file selector, open it */
300 if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
302 p_intf->p_sys->p_disc = create_intf_disc();
303 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
307 gtk_widget_show( p_intf->p_sys->p_disc );
308 gdk_window_raise( p_intf->p_sys->p_disc->window );
313 on_menubar_network_activate (GtkMenuItem *menuitem,
316 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
318 /* If we have never used the file selector, open it */
319 if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
321 p_intf->p_sys->p_network = create_intf_network();
322 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
326 gtk_widget_show( p_intf->p_sys->p_network );
327 gdk_window_raise( p_intf->p_sys->p_network->window );
332 on_menubar_exit_activate (GtkMenuItem *menuitem,
335 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
337 vlc_mutex_lock( &p_intf->change_lock );
339 vlc_mutex_unlock( &p_intf->change_lock );
344 on_menubar_playlist_activate (GtkMenuItem *menuitem,
347 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
348 playlist_t * p_playlist ;
351 if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
353 p_intf->p_sys->p_playlist = create_intf_playlist();
354 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
358 vlc_mutex_lock( &p_main->p_playlist->change_lock );
359 if( p_main->p_playlist->i_size > 0 )
361 p_playlist = p_main->p_playlist;
362 p_list = GTK_CLIST( lookup_widget( p_intf->p_sys->p_playlist,
363 "playlist_clist" ) );
364 GnomeRebuildCList( p_list, p_playlist );
366 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
368 gtk_widget_show( p_intf->p_sys->p_playlist );
369 gdk_window_raise( p_intf->p_sys->p_playlist->window );
374 on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
377 intf_thread_t * p_intf;
378 es_descriptor_t * p_es;
380 p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
382 if( !p_intf->p_sys->b_audio_update )
384 p_es = (es_descriptor_t*)user_data;
386 input_ToggleES( p_intf->p_input, p_es, menuitem->active );
388 p_intf->p_sys->b_audio_update = menuitem->active;
394 on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
397 intf_thread_t * p_intf;
398 es_descriptor_t * p_es;
400 p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
402 if( !p_intf->p_sys->b_spu_update )
404 p_es = (es_descriptor_t*)user_data;
406 input_ToggleES( p_intf->p_input, p_es, menuitem->active );
408 p_intf->p_sys->b_spu_update = menuitem->active;
414 on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
417 if( p_vout_bank->i_count )
419 vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
420 if( p_vout_bank->pp_vout[0]->b_fullscreen ==
421 !GTK_CHECK_MENU_ITEM( menuitem )->active )
422 p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
423 vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
430 on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
433 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
435 if( menuitem->active && !p_intf->p_sys->b_title_update )
437 gint i_title = (gint)user_data;
438 p_intf->p_input->pf_set_area( p_intf->p_input,
439 p_intf->p_input->stream.pp_areas[i_title] );
441 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
443 p_intf->p_sys->b_title_update = 1;
449 on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
452 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
453 input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
454 gint i_chapter = (gint)user_data;
457 if( menuitem->active && !p_intf->p_sys->b_chapter_update )
459 p_area->i_part = i_chapter;
460 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
462 snprintf( psz_chapter, 3, "%02d", p_area->i_part );
463 gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
465 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
467 p_intf->p_sys->b_chapter_update = 1;
474 on_menubar_angle_toggle (GtkCheckMenuItem *menuitem,
477 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
478 input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
479 gint i_angle = (gint)user_data;
481 if( menuitem->active && !p_intf->p_sys->b_angle_update )
483 p_area->i_angle = i_angle;
484 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
486 p_intf->p_sys->b_angle_update = 1;
492 on_menubar_modules_activate (GtkMenuItem *menuitem,
495 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
497 if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
499 p_intf->p_sys->p_modules = create_intf_modules();
500 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ),
503 gtk_widget_show( p_intf->p_sys->p_modules );
504 gdk_window_raise( p_intf->p_sys->p_modules->window );
509 on_menubar_preferences_activate (GtkMenuItem *menuitem,
512 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
514 /* If we have never used the file selector, open it */
515 if( !GTK_IS_WIDGET( p_intf->p_sys->p_preferences ) )
517 p_intf->p_sys->p_preferences = create_intf_preferences();
518 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_preferences ),
521 #define ASSIGN_PSZ_ENTRY( var, default, name ) \
522 gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( \
523 p_intf->p_sys->p_preferences ), name ) ), \
524 main_GetPszVariable( var, default ) )
526 #define ASSIGN_INT_VALUE( var, default, name ) \
527 gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data( \
528 GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
529 main_GetIntVariable( var, default ) )
531 #define ASSIGN_INT_TOGGLE( var, default, name ) \
532 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( gtk_object_get_data( \
533 GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
534 main_GetIntVariable( var, default ) )
537 ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, INTF_PATH_DEFAULT,
538 "preferences_file_entry" );
541 ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,INPUT_DVD_DEVICE_DEFAULT,
542 "preferences_disc_dvd_entry" );
545 ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, INPUT_VCD_DEVICE_DEFAULT,
546 "preferences_disc_vcd_entry" );
549 ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, INPUT_SERVER_DEFAULT,
550 "preferences_network_server_entry" );
553 ASSIGN_INT_VALUE( INPUT_PORT_VAR, INPUT_PORT_DEFAULT,
554 "preferences_network_port_spinbutton" );
556 /* Broadcast address */
557 ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADRR_VAR, INPUT_BCAST_ADDR_DEFAULT,
558 "preferences_network_broadcast_entry" );
560 /* Broadcast stream by default ? */
561 ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR, INPUT_BROADCAST_DEFAULT,
562 "preferences_network_broadcast_checkbutton" );
566 /* Default interface */
567 ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, INTF_METHOD_DEFAULT,
568 "preferences_interface_entry" );
570 /* Default video output */
571 ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, VOUT_METHOD_DEFAULT,
572 "preferences_video_output_entry" );
574 /* Default output width */
575 ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT,
576 "preferences_video_width_spinbutton" );
578 /* Default output height */
579 ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT,
580 "preferences_video_height_spinbutton" );
582 /* XXX Default screen depth */
584 /* XXX Default fullscreen depth */
586 /* XXX Default gamma */
588 /* Fullscreen on play */
589 ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT,
590 "preferences_video_fullscreen_checkbutton" );
592 /* Grayscale display */
593 ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT,
594 "preferences_video_grayscale_checkbutton" );
596 /* Default audio output */
597 ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, AOUT_METHOD_DEFAULT,
598 "preferences_audio_output_entry" );
600 /* Default audio device */
601 ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, AOUT_DSP_DEFAULT,
602 "preferences_audio_device_entry" );
604 /* XXX Default frequency */
606 /* XXX Default quality */
608 /* XXX Default number of channels */
610 /* Use spdif output ? */
611 ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, AOUT_SPDIF_DEFAULT,
612 "preferences_audio_spdif_checkbutton" );
614 /* Launch playlist on startup */
615 ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR, PLAYLIST_STARTUP_DEFAULT,
616 "preferences_playlist_launch_on_startup_checkbutton" );
618 /* Enqueue drag'n dropped item as default */
619 ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR, PLAYLIST_ENQUEUE_DEFAULT,
620 "preferences_playlist_enqueue_as_default_checkbutton" );
622 /* Loop on playlist end */
623 ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR, PLAYLIST_LOOP_DEFAULT,
624 "preferences_playlist_loop_checkbutton" );
626 /* Verbosity of warning messages */
627 ASSIGN_INT_VALUE( INTF_WARNING_VAR, INTF_WARNING_DEFAULT,
628 "preferences_misc_messages_spinbutton" );
629 #undef ASSIGN_PSZ_ENTRY
630 #undef ASSIGN_INT_VALUE
631 #undef ASSIGN_INT_TOGGLE
635 gtk_widget_show( p_intf->p_sys->p_preferences );
636 gdk_window_raise( p_intf->p_sys->p_preferences->window );
641 on_menubar_about_activate (GtkMenuItem *menuitem,
644 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
646 if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
648 p_intf->p_sys->p_about = create_intf_about();
649 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ),
652 gtk_widget_show( p_intf->p_sys->p_about );
653 gdk_window_raise( p_intf->p_sys->p_about->window );
657 /*****************************************************************************
659 *****************************************************************************
660 * The following callbacks are related to the toolbar of the main
662 *****************************************************************************/
664 on_toolbar_open_clicked (GtkButton *button,
667 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
669 /* If we have never used the file selector, open it */
670 if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
672 p_intf->p_sys->p_fileopen = create_intf_fileopen();
673 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
676 if( main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) != NULL )
678 gtk_file_selection_set_filename( GTK_FILE_SELECTION(
679 p_intf->p_sys->p_fileopen ),
680 main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
684 gtk_widget_show( p_intf->p_sys->p_fileopen );
685 gdk_window_raise( p_intf->p_sys->p_fileopen->window );
690 on_toolbar_disc_clicked (GtkButton *button,
693 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
695 /* If we have never used the file selector, open it */
696 if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
698 p_intf->p_sys->p_disc = create_intf_disc();
699 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
703 gtk_widget_show( p_intf->p_sys->p_disc );
704 gdk_window_raise( p_intf->p_sys->p_disc->window );
709 on_toolbar_network_clicked (GtkButton *button,
712 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
714 /* If we have never used the file selector, open it */
715 if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
717 p_intf->p_sys->p_network = create_intf_network();
718 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
722 gtk_widget_show( p_intf->p_sys->p_network );
723 gdk_window_raise( p_intf->p_sys->p_network->window );
728 on_toolbar_back_clicked (GtkButton *button,
736 on_toolbar_stop_clicked (GtkButton *button,
739 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
741 if( p_intf->p_input != NULL )
743 p_vout_bank->pp_vout[0]->b_die = 1;
744 p_aout_bank->pp_aout[0]->b_die = 1;
745 p_intf->p_input->b_die = 1;
751 on_toolbar_play_clicked (GtkButton *button,
754 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
756 if( p_intf->p_input != NULL )
758 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
764 on_toolbar_pause_clicked (GtkButton *button,
767 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
769 if( p_intf->p_input != NULL )
771 input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
777 on_toolbar_slow_clicked (GtkButton *button,
780 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
782 if( p_intf->p_input != NULL )
784 input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
790 on_toolbar_fast_clicked (GtkButton *button,
793 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
795 if( p_intf->p_input != NULL )
797 input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
803 on_toolbar_playlist_clicked (GtkButton *button,
806 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
808 if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
810 p_intf->p_sys->p_playlist = create_intf_playlist();
811 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
815 if( GTK_WIDGET_VISIBLE( p_intf->p_sys->p_playlist ) )
817 gtk_widget_hide( p_intf->p_sys->p_playlist );
823 p_clist = GTK_CLIST( gtk_object_get_data(
824 GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
825 GnomeRebuildCList( p_clist , p_main->p_playlist );
826 gtk_widget_show( p_intf->p_sys->p_playlist );
827 gdk_window_raise( p_intf->p_sys->p_playlist->window );
833 on_toolbar_prev_clicked (GtkButton *button,
836 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
838 if( p_intf->p_input != NULL )
840 /* FIXME: temporary hack */
841 intf_PlaylistPrev( p_main->p_playlist );
842 intf_PlaylistPrev( p_main->p_playlist );
843 p_intf->p_input->b_eof = 1;
846 p_intf->p_sys->b_mode_changed = 1;
851 on_toolbar_next_clicked (GtkButton *button,
854 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
856 if( p_intf->p_input != NULL )
858 /* FIXME: temporary hack */
859 p_intf->p_input->b_eof = 1;
862 p_intf->p_sys->b_mode_changed = 1;
866 /*****************************************************************************
868 *****************************************************************************
869 * The following callbacks are related to the popup menu. The popup
870 * menu is activated when right-clicking on the video output window.
871 *****************************************************************************/
873 on_popup_play_activate (GtkMenuItem *menuitem,
876 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
878 if( p_intf->p_input != NULL )
880 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
886 on_popup_back_activate (GtkMenuItem *menuitem,
894 on_popup_pause_activate (GtkMenuItem *menuitem,
897 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
899 if( p_intf->p_input != NULL )
901 input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
907 on_popup_slow_activate (GtkMenuItem *menuitem,
910 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
912 if( p_intf->p_input != NULL )
914 input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
920 on_popup_fast_activate (GtkMenuItem *menuitem,
923 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
925 if( p_intf->p_input != NULL )
927 input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
933 on_popup_fullscreen_activate (GtkMenuItem *menuitem,
936 if( p_vout_bank->i_count )
938 vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
939 if( p_vout_bank->pp_vout[0]->b_fullscreen ==
940 !GTK_CHECK_MENU_ITEM( menuitem )->active )
941 p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
942 vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
948 on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
951 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
952 es_descriptor_t * p_es;
954 p_es = (es_descriptor_t*)user_data;
956 if( !p_intf->p_sys->b_audio_update )
958 input_ToggleES( p_intf->p_input, p_es, menuitem->active );
960 p_intf->p_sys->b_audio_update = menuitem->active;
966 on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
969 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
970 es_descriptor_t * p_es;
972 p_es = (es_descriptor_t*)user_data;
974 if( !p_intf->p_sys->b_spu_update )
976 input_ToggleES( p_intf->p_input, p_es, menuitem->active );
978 p_intf->p_sys->b_spu_update = menuitem->active;
984 on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
987 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
989 if( menuitem->active &&
990 !p_intf->p_sys->b_title_update &&
991 !p_intf->p_sys->b_chapter_update )
993 input_area_t * p_area;
997 i_title = (gint)(user_data) / 100;
998 i_chapter = (gint)(user_data) - ( 100 * i_title );
999 p_area = p_intf->p_input->stream.p_selected_area;
1002 if( p_area != p_intf->p_input->stream.pp_areas[i_title] )
1004 p_area = p_intf->p_input->stream.pp_areas[i_title];
1005 p_intf->p_sys->b_title_update = 1;
1008 p_area->i_part = i_chapter;
1009 p_intf->p_sys->b_chapter_update = 1;
1011 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
1013 input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
1019 on_popup_angle_toggle (GtkCheckMenuItem *menuitem,
1022 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1023 input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
1024 gint i_angle = (gint)user_data;
1026 if( menuitem->active && !p_intf->p_sys->b_angle_update )
1028 p_area->i_angle = i_angle;
1029 p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
1031 p_intf->p_sys->b_angle_update = 1;
1037 on_popup_open_activate (GtkMenuItem *menuitem,
1040 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1042 /* If we have never used the file selector, open it */
1043 if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
1045 p_intf->p_sys->p_fileopen = create_intf_fileopen();
1046 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
1049 if( main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) != NULL )
1051 gtk_file_selection_set_filename( GTK_FILE_SELECTION(
1052 p_intf->p_sys->p_fileopen ),
1053 main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
1057 gtk_widget_show( p_intf->p_sys->p_fileopen );
1058 gdk_window_raise( p_intf->p_sys->p_fileopen->window );
1063 on_popup_disc_activate (GtkMenuItem *menuitem,
1066 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1068 gtk_widget_show( p_intf->p_sys->p_disc );
1069 gdk_window_raise( p_intf->p_sys->p_disc->window );
1074 on_popup_network_activate (GtkMenuItem *menuitem,
1077 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1079 gtk_widget_show( p_intf->p_sys->p_network );
1080 gdk_window_raise( p_intf->p_sys->p_network->window );
1085 on_popup_about_activate (GtkMenuItem *menuitem,
1088 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1090 if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
1092 p_intf->p_sys->p_about = create_intf_about();
1093 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ),
1096 gtk_widget_show( p_intf->p_sys->p_about );
1097 gdk_window_raise( p_intf->p_sys->p_about->window );
1102 on_popup_exit_activate (GtkMenuItem *menuitem,
1105 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1107 vlc_mutex_lock( &p_intf->change_lock );
1109 vlc_mutex_unlock( &p_intf->change_lock );
1114 on_popup_stop_activate (GtkMenuItem *menuitem,
1117 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1119 if( p_intf->p_input != NULL )
1121 p_intf->p_input->b_die = 1;
1127 on_popup_playlist_activate (GtkMenuItem *menuitem,
1130 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
1132 if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
1134 p_intf->p_sys->p_playlist = create_intf_playlist();
1135 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
1138 gtk_widget_show( p_intf->p_sys->p_playlist );
1139 gdk_window_raise( p_intf->p_sys->p_playlist->window );
1144 on_popup_jump_activate (GtkMenuItem *menuitem,
1147 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1149 if( !GTK_IS_WIDGET( p_intf->p_sys->p_jump ) )
1151 p_intf->p_sys->p_jump = create_intf_jump();
1152 gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_jump ),
1156 gtk_widget_show( p_intf->p_sys->p_jump );
1157 gdk_window_raise( p_intf->p_sys->p_jump->window );
1162 on_popup_preferences_activate (GtkMenuItem *menuitem,
1165 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
1167 gtk_widget_show( p_intf->p_sys->p_preferences );
1168 gdk_window_raise( p_intf->p_sys->p_preferences->window );
1173 /*****************************************************************************
1174 * Fileopen callbacks
1175 *****************************************************************************
1176 * The following callbacks are related to the file requester.
1177 *****************************************************************************/
1179 on_intf_fileopen_destroy (GtkObject *object,
1182 gtk_widget_hide( GTK_WIDGET( object ) );
1187 on_fileopen_ok_clicked (GtkButton *button,
1190 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_fileopen" );
1191 GtkCList * p_playlist_clist;
1192 GtkWidget * p_filesel;
1193 gchar * psz_filename;
1194 int i_end = p_main->p_playlist->i_size;
1196 p_filesel = gtk_widget_get_toplevel( GTK_WIDGET(button) );
1197 gtk_widget_hide( p_filesel );
1199 gtk_file_selection_get_filename( GTK_FILE_SELECTION( p_filesel ) );
1201 intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_filename );
1203 /* catch the GTK CList */
1204 p_playlist_clist = GTK_CLIST( gtk_object_get_data(
1205 GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
1206 /* update the display */
1207 GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
1209 /* Select added item and switch to file interface */
1210 if( p_intf->p_input != NULL )
1212 p_intf->p_input->b_eof = 1;
1215 intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
1220 on_fileopen_cancel_clicked (GtkButton *button,
1223 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1227 /*****************************************************************************
1228 * Module manager callbacks
1229 *****************************************************************************
1230 * The following callbacks are related to the module manager.
1231 *****************************************************************************/
1233 on_intf_modules_destroy (GtkObject *object,
1241 on_modules_ok_clicked (GtkButton *button,
1244 intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
1246 gtk_widget_hide( p_intf->p_sys->p_modules );
1251 on_modules_apply_clicked (GtkButton *button,
1259 on_modules_cancel_clicked (GtkButton *button,
1262 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1266 /*****************************************************************************
1267 * Open disc callbacks
1268 *****************************************************************************
1269 * The following callbacks are related to the disc manager.
1270 *****************************************************************************/
1272 on_disc_dvd_toggled (GtkToggleButton *togglebutton,
1275 if( togglebutton->active )
1277 gtk_entry_set_text( GTK_ENTRY( lookup_widget(
1278 GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/dvd" );
1284 on_disc_vcd_toggled (GtkToggleButton *togglebutton,
1287 if( togglebutton->active )
1289 gtk_entry_set_text( GTK_ENTRY( lookup_widget(
1290 GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/cdrom" );
1296 on_disc_ok_clicked (GtkButton *button,
1299 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_disc" );
1300 GtkCList * p_playlist_clist;
1301 char * psz_device, *psz_source, *psz_method;
1302 int i_end = p_main->p_playlist->i_size;
1304 gtk_widget_hide( p_intf->p_sys->p_disc );
1305 psz_device = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
1306 GTK_WIDGET(button), "disc_name" ) ) );
1308 /* "dvd:foo" has size 5 + strlen(foo) */
1309 psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
1310 + strlen( psz_device ) + 1 /* "\0" */ );
1311 if( psz_source == NULL )
1316 /* Check which method was activated */
1317 if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
1318 "disc_dvd" ) )->active )
1321 p_intf->p_sys->i_intf_mode = DVD_MODE;
1323 else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
1324 "disc_vcd" ) )->active )
1330 intf_ErrMsg( "intf error: unknown disc type toggle button position" );
1335 /* Select title and chapter */
1336 main_PutIntVariable( INPUT_TITLE_VAR, gtk_spin_button_get_value_as_int(
1337 GTK_SPIN_BUTTON( lookup_widget(
1338 GTK_WIDGET(button), "disc_title" ) ) ) );
1340 main_PutIntVariable( INPUT_CHAPTER_VAR, gtk_spin_button_get_value_as_int(
1341 GTK_SPIN_BUTTON( lookup_widget(
1342 GTK_WIDGET(button), "disc_chapter" ) ) ) );
1344 /* Build source name and add it to playlist */
1345 sprintf( psz_source, "%s:%s", psz_method, psz_device );
1346 intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
1349 /* catch the GTK CList */
1350 p_playlist_clist = GTK_CLIST( gtk_object_get_data(
1351 GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
1352 /* update the display */
1353 GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
1355 /* Select added item and switch to DVD interface */
1356 if( p_intf->p_input != NULL )
1358 p_intf->p_input->b_eof = 1;
1361 intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
1366 on_disc_cancel_clicked (GtkButton *button,
1369 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1373 /*****************************************************************************
1374 * Network stream callbacks
1375 *****************************************************************************
1376 * The following callbacks are related to the network stream manager.
1377 *****************************************************************************/
1379 on_network_ok_clicked (GtkButton *button,
1382 intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_network" );
1383 GtkCList * p_playlist_clist;
1384 char * psz_source, *psz_server, *psz_protocol;
1385 unsigned int i_port;
1386 boolean_t b_broadcast;
1387 int i_end = p_main->p_playlist->i_size;
1389 gtk_widget_hide( p_intf->p_sys->p_network );
1390 psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
1391 GTK_WIDGET(button), "network_server" ) ) );
1393 /* Check which protocol was activated */
1394 if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
1395 "network_ts" ) )->active )
1397 psz_protocol = "ts";
1399 else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
1400 "network_rtp" ) )->active )
1402 psz_protocol = "rtp";
1406 intf_ErrMsg( "intf error: unknown protocol toggle button position" );
1410 /* Get the port number and make sure it will not overflow 5 characters */
1411 i_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
1412 lookup_widget( GTK_WIDGET(button), "network_port" ) ) );
1413 if( i_port > 65535 )
1415 intf_ErrMsg( "intf error: invalid port %i", i_port );
1418 /* do we have a broadcast address */
1419 b_broadcast = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
1420 lookup_widget( GTK_WIDGET(button), "broadcast_check" ) ) );
1423 char * psz_broadcast;
1424 psz_broadcast = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
1425 GTK_WIDGET(button), "network_broadcast" ) ) );
1426 /* Allocate room for "protocol://server:port" */
1427 psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
1428 + strlen( psz_server ) + 1 /* ":" */
1430 + strlen( psz_broadcast ) + 2 /* "::" */
1432 if( psz_source == NULL )
1437 /* Build source name and add it to playlist */
1438 sprintf( psz_source, "%s://%s:%i::%s", psz_protocol,
1445 /* Allocate room for "protocol://server:port" */
1446 psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
1447 + strlen( psz_server ) + 1 /* ":" */
1448 + 5 /* 0-65535 */ + 1 /* "\0" */ );
1449 if( psz_source == NULL )
1454 /* Build source name and add it to playlist */
1455 sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port );
1458 intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
1461 /* catch the GTK CList */
1462 p_playlist_clist = GTK_CLIST( gtk_object_get_data(
1463 GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
1464 /* update the display */
1465 GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
1467 /* Select added item and switch to network interface */
1468 if( p_intf->p_input != NULL )
1470 p_intf->p_input->b_eof = 1;
1473 intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
1478 on_network_cancel_clicked (GtkButton *button,
1481 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1486 on_broadcast_check_toggled (GtkToggleButton *togglebutton,
1489 GtkWidget * p_network;
1491 p_network = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
1492 gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
1493 "network_broadcast_combo" ),
1494 gtk_toggle_button_get_active( togglebutton ) );
1495 gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
1496 "network_broadcast" ),
1497 gtk_toggle_button_get_active( togglebutton ) );
1501 /****************************************************************************
1503 ****************************************************************************
1504 * Those callback are received from the jump window that allow to select
1505 * an arbitrary position of the stream.
1506 ****************************************************************************/
1508 on_jump_ok_clicked (GtkButton *button,
1511 on_jump_apply_clicked( button, user_data );
1512 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1517 on_jump_apply_clicked (GtkButton *button,
1521 intf_thread_t * p_intf;
1528 p_intf = GetIntf( GTK_WIDGET( button ), "intf_jump" );
1530 #define GET_VALUE( name ) \
1531 gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( gtk_object_get_data( \
1532 GTK_OBJECT( p_intf->p_sys->p_jump ), name ) ) )
1534 i_hours = GET_VALUE( "jump_hour_spinbutton" );
1535 i_minutes = GET_VALUE( "jump_minute_spinbutton" );
1536 i_seconds = GET_VALUE( "jump_second_spinbutton" );
1540 i_seconds += 60 *i_minutes + 3600* i_hours;
1542 vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
1543 i_seek = i_seconds * 50 * p_intf->p_input->stream.i_mux_rate;
1544 i_size = p_intf->p_input->stream.p_selected_area->i_size;
1545 vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
1547 if( i_seek < i_size )
1549 input_Seek( p_intf->p_input, i_seek );
1556 on_jump_cancel_clicked (GtkButton *button,
1559 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1563 /****************************************************************************
1564 * Preferences window callbacks
1565 ****************************************************************************/
1567 on_preferences_ok_clicked (GtkButton *button,
1570 on_preferences_apply_clicked( button, user_data );
1571 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
1576 on_preferences_apply_clicked (GtkButton *button,
1580 GtkWidget * p_preferences;
1582 /* get preferences window */
1583 p_preferences = gtk_widget_get_toplevel( GTK_WIDGET( button ) );
1585 #define ASSIGN_PSZ_ENTRY( var, name ) \
1586 main_PutPszVariable( var, gtk_entry_get_text( \
1587 GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( p_preferences ), name ) ) ) )
1589 #define ASSIGN_INT_VALUE( var, name ) \
1590 main_PutIntVariable( var, gtk_spin_button_get_value_as_int( \
1591 GTK_SPIN_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
1594 #define ASSIGN_INT_TOGGLE( var, name ) \
1595 main_PutIntVariable( var, gtk_toggle_button_get_active( \
1596 GTK_TOGGLE_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
1600 ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, "preferences_file_entry" );
1603 ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR, "preferences_disc_dvd_entry" );
1606 ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, "preferences_disc_vcd_entry" );
1608 /* Default server */
1609 ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, "preferences_network_server_entry" );
1612 ASSIGN_INT_VALUE( INPUT_PORT_VAR, "preferences_network_port_spinbutton" );
1614 /* Broadcast address */
1615 ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADRR_VAR,
1616 "preferences_network_broadcast_entry" );
1618 /* Broadcast stream by default ? */
1619 ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR,
1620 "preferences_network_broadcast_checkbutton" );
1624 /* Default interface */
1625 ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, "preferences_interface_entry" );
1627 /* Default video output */
1628 ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, "preferences_video_output_entry" );
1630 /* Default output width */
1631 ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, "preferences_video_width_spinbutton" );
1633 /* Default output height */
1634 ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, "preferences_video_height_spinbutton" );
1636 /* XXX Default screen depth */
1638 /* XXX Default fullscreen depth */
1640 /* XXX Default gamma */
1642 /* Fullscreen on play */
1643 ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR,
1644 "preferences_video_fullscreen_checkbutton" );
1646 /* Grayscale display */
1647 ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR,
1648 "preferences_video_grayscale_checkbutton" );
1650 /* Default audio output */
1651 ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, "preferences_audio_output_entry" );
1653 /* Default audio device */
1654 ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, "preferences_audio_device_entry" );
1656 /* XXX Default frequency */
1658 /* XXX Default quality */
1660 /* XXX Default number of channels */
1662 /* Use spdif output ? */
1663 ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, "preferences_audio_spdif_checkbutton" );
1665 /* Launch playlist on startup */
1666 ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR,
1667 "preferences_playlist_launch_on_startup_checkbutton" );
1669 /* Enqueue drag'n dropped item as default */
1670 ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR,
1671 "preferences_playlist_enqueue_as_default_checkbutton" );
1673 /* Loop on playlist end */
1674 ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR,
1675 "preferences_playlist_loop_checkbutton" );
1677 /* Verbosity of warning messages */
1678 ASSIGN_INT_VALUE( INTF_WARNING_VAR,
1679 "preferences_misc_messages_spinbutton" );
1680 #undef ASSIGN_PSZ_ENTRY
1681 #undef ASSIGN_INT_VALUE
1682 #undef ASSIGN_INT_TOGGLE
1688 on_preferences_cancel_clicked (GtkButton *button,
1691 gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );