another and come back to the first one.
* Added gtk and gnome interfaces for satellite input. We should find a
way to hide the button if satellite support is not compiled.
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.12 2002/03/11 20:14:16 gbazin Exp $
+ * $Id: gnome.c,v 1.13 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
p_intf->p_sys->p_fileopen = NULL;
p_intf->p_sys->p_disc = NULL;
p_intf->p_sys->p_network = NULL;
+ p_intf->p_sys->p_sat = NULL;
p_intf->p_sys->p_jump = NULL;
/* Store p_intf to keep an eye on it */
<stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap>
</widget>
+ <widget>
+ <class>GtkButton</class>
+ <child_name>Toolbar:button</child_name>
+ <name>toolbar_sat</name>
+ <tooltip>Open a Satellite Card</tooltip>
+ <signal>
+ <name>button_press_event</name>
+ <handler>GtkSatOpenShow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Mon, 25 Mar 2002 01:02:49 GMT</last_modification_time>
+ </signal>
+ <label>Sat</label>
+ <stock_pixmap>GNOME_STOCK_PIXMAP_MIC</stock_pixmap>
+ </widget>
+
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
</signal>
<label>Slow</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_TIMER_STOP</stock_pixmap>
+ <child>
+ <new_group>True</new_group>
+ </child>
</widget>
<widget>
</signal>
<label>Playlist</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_INDEX</stock_pixmap>
- <child>
- <new_group>True</new_group>
- </child>
</widget>
<widget>
</widget>
</widget>
+<widget>
+ <class>GnomeDialog</class>
+ <name>intf_sat</name>
+ <title>Open Satellite Card</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>False</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>vbox15</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>hbuttonbox2</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>sat_ok</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>GtkSatOpenOk</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Mon, 25 Mar 2002 01:11:40 GMT</last_modification_time>
+ </signal>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>sat_cancel</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>GtkSatOpenCancel</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Mon, 25 Mar 2002 01:31:00 GMT</last_modification_time>
+ </signal>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox10</name>
+ <homogeneous>False</homogeneous>
+ <spacing>5</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame13</name>
+ <label>Transponder Settings</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table5</name>
+ <border_width>5</border_width>
+ <rows>4</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>5</row_spacing>
+ <column_spacing>5</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label30</name>
+ <label>Frequency</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>sat_freq</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>12553</value>
+ <lower>1</lower>
+ <upper>65536</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label31</name>
+ <label>Polarization</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>sat_pol_hor</name>
+ <can_focus>True</can_focus>
+ <label>Horizontal</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>sat_pol_vert</name>
+ <can_focus>True</can_focus>
+ <label>Vertical</label>
+ <active>True</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label33</name>
+ <label>Symbol Rate</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>sat_srate</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>27500</value>
+ <lower>0</lower>
+ <upper>100</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
</GTK-Interface>
{
GtkMessagesShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
}
-
void
GnomeMenubarMessagesActivate (GtkMenuItem *menuitem,
gpointer user_data);
+
+gboolean
+GtkSatOpenShow (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+
+void
+GtkSatOpenOk (GtkButton *button,
+ gpointer user_data);
+
+void
+GtkSatOpenCancel (GtkButton *button,
+ gpointer user_data);
GtkWidget *toolbar_file;
GtkWidget *toolbar_disc;
GtkWidget *toolbar_network;
+ GtkWidget *toolbar_sat;
GtkWidget *toolbar_back;
GtkWidget *toolbar_stop;
GtkWidget *toolbar_eject;
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_network);
+ tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_MIC);
+ toolbar_sat = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
+ GTK_TOOLBAR_CHILD_BUTTON,
+ NULL,
+ _("Sat"),
+ _("Open a Satellite Card"), NULL,
+ tmp_toolbar_icon, NULL, NULL);
+ gtk_widget_ref (toolbar_sat);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_sat", toolbar_sat,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (toolbar_sat);
+
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_BACK);
gtk_widget_show (toolbar_pause);
gtk_widget_set_sensitive (toolbar_pause, FALSE);
+ gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
+
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_TIMER_STOP);
toolbar_slow = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
gtk_widget_show (toolbar_fast);
gtk_widget_set_sensitive (toolbar_fast, FALSE);
- gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_INDEX);
toolbar_playlist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
gtk_signal_connect (GTK_OBJECT (toolbar_network), "button_press_event",
GTK_SIGNAL_FUNC (GtkNetworkOpenShow),
"intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_sat), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkSatOpenShow),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (toolbar_back), "button_press_event",
GTK_SIGNAL_FUNC (GtkControlBack),
"intf_window");
return intf_messages;
}
+GtkWidget*
+create_intf_sat (void)
+{
+ GtkWidget *intf_sat;
+ GtkWidget *vbox15;
+ GtkWidget *hbox10;
+ GtkWidget *frame13;
+ GtkWidget *table5;
+ GtkWidget *label30;
+ GtkObject *sat_freq_adj;
+ GtkWidget *sat_freq;
+ GtkWidget *label31;
+ GSList *table5_group = NULL;
+ GtkWidget *sat_pol_hor;
+ GtkWidget *sat_pol_vert;
+ GtkWidget *label33;
+ GtkObject *sat_srate_adj;
+ GtkWidget *sat_srate;
+ GtkWidget *hbuttonbox2;
+ GtkWidget *sat_ok;
+ GtkWidget *sat_cancel;
+
+ intf_sat = gnome_dialog_new (_("Open Satellite Card"), NULL);
+ gtk_object_set_data (GTK_OBJECT (intf_sat), "intf_sat", intf_sat);
+ gtk_window_set_modal (GTK_WINDOW (intf_sat), TRUE);
+ gtk_window_set_policy (GTK_WINDOW (intf_sat), FALSE, FALSE, FALSE);
+
+ vbox15 = GNOME_DIALOG (intf_sat)->vbox;
+ gtk_object_set_data (GTK_OBJECT (intf_sat), "vbox15", vbox15);
+ gtk_widget_show (vbox15);
+
+ hbox10 = gtk_hbox_new (FALSE, 5);
+ gtk_widget_ref (hbox10);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "hbox10", hbox10,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (hbox10);
+ gtk_box_pack_start (GTK_BOX (vbox15), hbox10, TRUE, TRUE, 0);
+
+ frame13 = gtk_frame_new (_("Transponder Settings"));
+ gtk_widget_ref (frame13);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "frame13", frame13,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (frame13);
+ gtk_box_pack_start (GTK_BOX (hbox10), frame13, TRUE, TRUE, 0);
+
+ table5 = gtk_table_new (4, 2, FALSE);
+ gtk_widget_ref (table5);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "table5", table5,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (table5);
+ gtk_container_add (GTK_CONTAINER (frame13), table5);
+ gtk_container_set_border_width (GTK_CONTAINER (table5), 5);
+ gtk_table_set_row_spacings (GTK_TABLE (table5), 5);
+ gtk_table_set_col_spacings (GTK_TABLE (table5), 5);
+
+ label30 = gtk_label_new (_("Frequency"));
+ gtk_widget_ref (label30);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label30", label30,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label30);
+ gtk_table_attach (GTK_TABLE (table5), label30, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5);
+
+ sat_freq_adj = gtk_adjustment_new (12553, 1, 65536, 1, 10, 10);
+ sat_freq = gtk_spin_button_new (GTK_ADJUSTMENT (sat_freq_adj), 1, 0);
+ gtk_widget_ref (sat_freq);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_freq", sat_freq,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_freq);
+ gtk_table_attach (GTK_TABLE (table5), sat_freq, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ label31 = gtk_label_new (_("Polarization"));
+ gtk_widget_ref (label31);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label31", label31,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label31);
+ gtk_table_attach (GTK_TABLE (table5), label31, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label31), 0, 0.5);
+
+ sat_pol_hor = gtk_radio_button_new_with_label (table5_group, _("Horizontal"));
+ table5_group = gtk_radio_button_group (GTK_RADIO_BUTTON (sat_pol_hor));
+ gtk_widget_ref (sat_pol_hor);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_pol_hor", sat_pol_hor,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_pol_hor);
+ gtk_table_attach (GTK_TABLE (table5), sat_pol_hor, 1, 2, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ sat_pol_vert = gtk_radio_button_new_with_label (table5_group, _("Vertical"));
+ table5_group = gtk_radio_button_group (GTK_RADIO_BUTTON (sat_pol_vert));
+ gtk_widget_ref (sat_pol_vert);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_pol_vert", sat_pol_vert,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_pol_vert);
+ gtk_table_attach (GTK_TABLE (table5), sat_pol_vert, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sat_pol_vert), TRUE);
+
+ label33 = gtk_label_new (_("Symbol Rate"));
+ gtk_widget_ref (label33);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label33", label33,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label33);
+ gtk_table_attach (GTK_TABLE (table5), label33, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label33), 0, 0.5);
+
+ sat_srate_adj = gtk_adjustment_new (27500, 0, 100, 1, 10, 10);
+ sat_srate = gtk_spin_button_new (GTK_ADJUSTMENT (sat_srate_adj), 1, 0);
+ gtk_widget_ref (sat_srate);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_srate", sat_srate,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_srate);
+ gtk_table_attach (GTK_TABLE (table5), sat_srate, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ hbuttonbox2 = GNOME_DIALOG (intf_sat)->action_area;
+ gtk_object_set_data (GTK_OBJECT (intf_sat), "hbuttonbox2", hbuttonbox2);
+ gtk_widget_show (hbuttonbox2);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END);
+ gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox2), 8);
+
+ gnome_dialog_append_button (GNOME_DIALOG (intf_sat), GNOME_STOCK_BUTTON_OK);
+ sat_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_sat)->buttons)->data);
+ gtk_widget_ref (sat_ok);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_ok", sat_ok,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_ok);
+ GTK_WIDGET_SET_FLAGS (sat_ok, GTK_CAN_DEFAULT);
+
+ gnome_dialog_append_button (GNOME_DIALOG (intf_sat), GNOME_STOCK_BUTTON_CANCEL);
+ sat_cancel = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_sat)->buttons)->data);
+ gtk_widget_ref (sat_cancel);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_cancel", sat_cancel,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_cancel);
+ GTK_WIDGET_SET_FLAGS (sat_cancel, GTK_CAN_DEFAULT);
+
+ gtk_signal_connect (GTK_OBJECT (sat_ok), "clicked",
+ GTK_SIGNAL_FUNC (GtkSatOpenOk),
+ "intf_disc");
+ gtk_signal_connect (GTK_OBJECT (sat_cancel), "clicked",
+ GTK_SIGNAL_FUNC (GtkSatOpenCancel),
+ "intf_disc");
+
+ return intf_sat;
+}
+
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_open (void);
GtkWidget* create_intf_messages (void);
+GtkWidget* create_intf_sat (void);
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.14 2002/03/11 20:14:16 gbazin Exp $
+ * $Id: gtk.c,v 1.15 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
p_intf->p_sys->p_modules = NULL;
p_intf->p_sys->p_fileopen = NULL;
p_intf->p_sys->p_disc = NULL;
+ p_intf->p_sys->p_sat = NULL;
p_intf->p_sys->p_network = NULL;
p_intf->p_sys->p_jump = NULL;
<label>Net</label>
</widget>
+ <widget>
+ <class>GtkButton</class>
+ <child_name>Toolbar:button</child_name>
+ <name>toolbar_sat</name>
+ <tooltip>Open a Satellite Card</tooltip>
+ <signal>
+ <name>button_press_event</name>
+ <handler>GtkSatOpenShow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sun, 24 Mar 2002 15:08:57 GMT</last_modification_time>
+ </signal>
+ <label>Sat</label>
+ </widget>
+
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
<last_modification_time>Sun, 13 May 2001 15:11:20 GMT</last_modification_time>
</signal>
<label>Slow</label>
+ <child>
+ <new_group>True</new_group>
+ </child>
</widget>
<widget>
<last_modification_time>Sun, 13 May 2001 15:11:38 GMT</last_modification_time>
</signal>
<label>Playlist</label>
- <child>
- <new_group>True</new_group>
- </child>
</widget>
<widget>
</widget>
</widget>
+<widget>
+ <class>GtkDialog</class>
+ <name>intf_sat</name>
+ <title>Open Satellite card</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>False</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>Dialog:vbox</child_name>
+ <name>vbox10</name>
+ <border_width>5</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <child_name>Dialog:action_area</child_name>
+ <name>hbox15</name>
+ <border_width>5</border_width>
+ <homogeneous>True</homogeneous>
+ <spacing>5</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox16</name>
+ <homogeneous>True</homogeneous>
+ <spacing>5</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>sat_ok</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>GtkSatOpenOk</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Sun, 24 Mar 2002 15:36:12 GMT</last_modification_time>
+ </signal>
+ <label>OK</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>sat_cancel</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>GtkSatOpenCancel</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Sun, 24 Mar 2002 15:36:03 GMT</last_modification_time>
+ </signal>
+ <label>Cancel</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox11</name>
+ <border_width>5</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>5</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox17</name>
+ <homogeneous>False</homogeneous>
+ <spacing>5</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame8</name>
+ <label>Transponder settings</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table3</name>
+ <border_width>5</border_width>
+ <rows>4</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>5</row_spacing>
+ <column_spacing>5</column_spacing>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>sat_freq</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>12553</value>
+ <lower>1</lower>
+ <upper>65536</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>sat_srate</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>27500</value>
+ <lower>1</lower>
+ <upper>65536</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label24</name>
+ <label>Symbol Rate</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label25</name>
+ <label>Frequency</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label26</name>
+ <label>Polarization</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>sat_pol_vert</name>
+ <can_focus>True</can_focus>
+ <label>Vertical</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>sat_pol_hor</name>
+ <can_focus>True</can_focus>
+ <label>Horizontal</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>3</top_attach>
+ <bottom_attach>4</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
</GTK-Interface>
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.c,v 1.33 2002/02/20 05:56:17 sam Exp $
+ * $Id: gtk_callbacks.c,v 1.34 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
return TRUE;
}
+
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.h,v 1.17 2002/02/19 03:54:55 sam Exp $
+ * $Id: gtk_callbacks.h,v 1.18 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
GtkMessagesDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
+
+gboolean
+GtkSatOpenShow (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+
+void
+GtkSatOpenOk (GtkButton *button,
+ gpointer user_data);
+
+void
+GtkSatOpenCancel (GtkButton *button,
+ gpointer user_data);
* gtk_common.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_common.h,v 1.5 2002/03/11 20:14:16 gbazin Exp $
+ * $Id: gtk_common.h,v 1.6 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
GtkWidget * p_about; /* about window */
GtkWidget * p_fileopen; /* file open window */
GtkWidget * p_disc; /* disc selection window */
+ GtkWidget * p_sat; /* sat selection window */
GtkWidget * p_network; /* network stream window */
GtkWidget * p_jump; /* jump window */
GtkWidget *toolbar_open;
GtkWidget *toolbar_disc;
GtkWidget *toolbar_network;
+ GtkWidget *toolbar_sat;
GtkWidget *toolbar_back;
GtkWidget *toolbar_stop;
GtkWidget *toolbar_eject;
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_network);
+ toolbar_sat = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
+ GTK_TOOLBAR_CHILD_BUTTON,
+ NULL,
+ _("Sat"),
+ _("Open a Satellite Card"), NULL,
+ NULL, NULL, NULL);
+ gtk_widget_ref (toolbar_sat);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_sat", toolbar_sat,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (toolbar_sat);
+
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
toolbar_back = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
gtk_widget_show (toolbar_pause);
gtk_widget_set_sensitive (toolbar_pause, FALSE);
+ gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
+
toolbar_slow = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
gtk_widget_show (toolbar_fast);
gtk_widget_set_sensitive (toolbar_fast, FALSE);
- gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
toolbar_playlist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
gtk_signal_connect (GTK_OBJECT (toolbar_network), "button_press_event",
GTK_SIGNAL_FUNC (GtkNetworkOpenShow),
"intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_sat), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkSatOpenShow),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (toolbar_back), "button_press_event",
GTK_SIGNAL_FUNC (GtkControlBack),
"intf_window");
return intf_messages;
}
+GtkWidget*
+create_intf_sat (void)
+{
+ GtkWidget *intf_sat;
+ GtkWidget *vbox10;
+ GtkWidget *vbox11;
+ GtkWidget *hbox17;
+ GtkWidget *frame8;
+ GtkWidget *table3;
+ GtkObject *sat_freq_adj;
+ GtkWidget *sat_freq;
+ GtkObject *sat_srate_adj;
+ GtkWidget *sat_srate;
+ GtkWidget *label24;
+ GtkWidget *label25;
+ GtkWidget *label26;
+ GSList *table3_group = NULL;
+ GtkWidget *sat_pol_vert;
+ GtkWidget *sat_pol_hor;
+ GtkWidget *hbox15;
+ GtkWidget *hbox16;
+ GtkWidget *sat_ok;
+ GtkWidget *sat_cancel;
+
+ intf_sat = gtk_dialog_new ();
+ gtk_object_set_data (GTK_OBJECT (intf_sat), "intf_sat", intf_sat);
+ gtk_window_set_title (GTK_WINDOW (intf_sat), _("Open Satellite card"));
+ gtk_window_set_modal (GTK_WINDOW (intf_sat), TRUE);
+ gtk_window_set_policy (GTK_WINDOW (intf_sat), FALSE, FALSE, FALSE);
+
+ vbox10 = GTK_DIALOG (intf_sat)->vbox;
+ gtk_object_set_data (GTK_OBJECT (intf_sat), "vbox10", vbox10);
+ gtk_widget_show (vbox10);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox10), 5);
+
+ vbox11 = gtk_vbox_new (FALSE, 5);
+ gtk_widget_ref (vbox11);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "vbox11", vbox11,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (vbox11);
+ gtk_box_pack_start (GTK_BOX (vbox10), vbox11, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox11), 5);
+
+ hbox17 = gtk_hbox_new (FALSE, 5);
+ gtk_widget_ref (hbox17);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "hbox17", hbox17,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (hbox17);
+ gtk_box_pack_start (GTK_BOX (vbox11), hbox17, TRUE, TRUE, 0);
+
+ frame8 = gtk_frame_new (_("Transponder settings"));
+ gtk_widget_ref (frame8);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "frame8", frame8,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (frame8);
+ gtk_box_pack_start (GTK_BOX (hbox17), frame8, TRUE, TRUE, 0);
+
+ table3 = gtk_table_new (4, 2, FALSE);
+ gtk_widget_ref (table3);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "table3", table3,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (table3);
+ gtk_container_add (GTK_CONTAINER (frame8), table3);
+ gtk_container_set_border_width (GTK_CONTAINER (table3), 5);
+ gtk_table_set_row_spacings (GTK_TABLE (table3), 5);
+ gtk_table_set_col_spacings (GTK_TABLE (table3), 5);
+
+ sat_freq_adj = gtk_adjustment_new (12553, 1, 65536, 1, 10, 10);
+ sat_freq = gtk_spin_button_new (GTK_ADJUSTMENT (sat_freq_adj), 1, 0);
+ gtk_widget_ref (sat_freq);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_freq", sat_freq,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_freq);
+ gtk_table_attach (GTK_TABLE (table3), sat_freq, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ sat_srate_adj = gtk_adjustment_new (27500, 1, 65536, 1, 10, 10);
+ sat_srate = gtk_spin_button_new (GTK_ADJUSTMENT (sat_srate_adj), 1, 0);
+ gtk_widget_ref (sat_srate);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_srate", sat_srate,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_srate);
+ gtk_table_attach (GTK_TABLE (table3), sat_srate, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ label24 = gtk_label_new (_("Symbol Rate"));
+ gtk_widget_ref (label24);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label24", label24,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label24);
+ gtk_table_attach (GTK_TABLE (table3), label24, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label24), 0, 0.5);
+
+ label25 = gtk_label_new (_("Frequency"));
+ gtk_widget_ref (label25);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label25", label25,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label25);
+ gtk_table_attach (GTK_TABLE (table3), label25, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5);
+
+ label26 = gtk_label_new (_("Polarization"));
+ gtk_widget_ref (label26);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "label26", label26,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label26);
+ gtk_table_attach (GTK_TABLE (table3), label26, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label26), 0, 0.5);
+
+ sat_pol_vert = gtk_radio_button_new_with_label (table3_group, _("Vertical"));
+ table3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (sat_pol_vert));
+ gtk_widget_ref (sat_pol_vert);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_pol_vert", sat_pol_vert,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_pol_vert);
+ gtk_table_attach (GTK_TABLE (table3), sat_pol_vert, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ sat_pol_hor = gtk_radio_button_new_with_label (table3_group, _("Horizontal"));
+ table3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (sat_pol_hor));
+ gtk_widget_ref (sat_pol_hor);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_pol_hor", sat_pol_hor,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_pol_hor);
+ gtk_table_attach (GTK_TABLE (table3), sat_pol_hor, 1, 2, 3, 4,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ hbox15 = GTK_DIALOG (intf_sat)->action_area;
+ gtk_object_set_data (GTK_OBJECT (intf_sat), "hbox15", hbox15);
+ gtk_widget_show (hbox15);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox15), 5);
+
+ hbox16 = gtk_hbox_new (TRUE, 5);
+ gtk_widget_ref (hbox16);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "hbox16", hbox16,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (hbox16);
+ gtk_box_pack_end (GTK_BOX (hbox15), hbox16, FALSE, TRUE, 0);
+
+ sat_ok = gtk_button_new_with_label (_("OK"));
+ gtk_widget_ref (sat_ok);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_ok", sat_ok,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_ok);
+ gtk_box_pack_start (GTK_BOX (hbox16), sat_ok, FALSE, TRUE, 0);
+
+ sat_cancel = gtk_button_new_with_label (_("Cancel"));
+ gtk_widget_ref (sat_cancel);
+ gtk_object_set_data_full (GTK_OBJECT (intf_sat), "sat_cancel", sat_cancel,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (sat_cancel);
+ gtk_box_pack_start (GTK_BOX (hbox16), sat_cancel, FALSE, TRUE, 0);
+
+ gtk_signal_connect (GTK_OBJECT (sat_ok), "clicked",
+ GTK_SIGNAL_FUNC (GtkSatOpenOk),
+ "intf_disc");
+ gtk_signal_connect (GTK_OBJECT (sat_cancel), "clicked",
+ GTK_SIGNAL_FUNC (GtkSatOpenCancel),
+ "intf_disc");
+
+ return intf_sat;
+}
+
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_messages (void);
+GtkWidget* create_intf_sat (void);
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_open.c,v 1.19 2002/03/11 07:23:09 gbazin Exp $
+ * $Id: gtk_open.c,v 1.20 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
"network_broadcast" ), b_broadcast && ! b_channel );
}
+/*****************************************************************************
+ * Open satellite callbacks
+ *****************************************************************************
+ * The following callbacks are related to the satellite card manager.
+ *****************************************************************************/
+gboolean GtkSatOpenShow( GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
+
+ if( !GTK_IS_WIDGET( p_intf->p_sys->p_sat ) )
+ {
+ p_intf->p_sys->p_sat = create_intf_sat();
+ gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_sat ),
+ "p_intf", p_intf );
+ }
+
+ gtk_widget_show( p_intf->p_sys->p_sat );
+ gdk_window_raise( p_intf->p_sys->p_sat->window );
+
+ return TRUE;
+}
+
+void GtkSatOpenOk( GtkButton * button, gpointer user_data )
+{
+ intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_sat" );
+ GtkCList * p_playlist_clist;
+ char * psz_source;
+ int i_end = p_main->p_playlist->i_size;
+ int i_freq, i_srate;
+ boolean_t b_pol;
+
+ gtk_widget_hide( p_intf->p_sys->p_sat );
+
+ /* Check which polarization was activated */
+ if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
+ "sat_pol_vert" ) )->active )
+ {
+ b_pol = 0;
+ }
+ else
+ {
+ b_pol = 1;
+ }
+
+ /* Select frequency and symbol rate */
+ i_freq = gtk_spin_button_get_value_as_int(
+ GTK_SPIN_BUTTON( lookup_widget(
+ GTK_WIDGET(button), "sat_freq" ) ) );
+
+ i_srate = gtk_spin_button_get_value_as_int(
+ GTK_SPIN_BUTTON( lookup_widget(
+ GTK_WIDGET(button), "sat_srate" ) ) );
+
+ psz_source = malloc( 22 );
+ if( psz_source == NULL )
+ {
+ return;
+ }
+
+ /* Build source name and add it to playlist */
+ sprintf( psz_source, "%s:%d,%d,%d",
+ "satellite", i_freq, b_pol, i_srate );
+ intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
+ free( psz_source );
+
+ /* catch the GTK CList */
+ p_playlist_clist = GTK_CLIST( gtk_object_get_data(
+ GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
+
+ /* update the display */
+ GtkRebuildCList( p_playlist_clist, p_main->p_playlist );
+
+ /* stop current item, select added item */
+ if( p_input_bank->pp_input[0] != NULL )
+ {
+ p_input_bank->pp_input[0]->b_eof = 1;
+ }
+
+ intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
+}
+
+
+void GtkSatOpenCancel( GtkButton * button, gpointer user_data )
+{
+ gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
+}
/****************************************************************************
* Callbacks for menuitem
static int SatelliteOpen( input_thread_t * p_input )
{
input_socket_t * p_satellite;
- char * psz_parser;
+ char * psz_parser;
char * psz_next;
int i_fd = 0;
int i_freq = 0;
boolean_t b_pol = 0;
/* parse the options passed in command line : */
-
+
psz_parser = strdup( p_input->psz_name );
-
+
if( !psz_parser )
{
return( -1 );
}
-
+
i_freq = (int)strtol( psz_parser, &psz_next, 10 );
-
+
if ( *psz_next )
{
psz_parser = psz_next + 1;
}
-
+ i_freq = i_freq ? i_freq : config_GetIntVariable( "sat_frequency" );
+ i_srate = i_srate ? i_srate : config_GetIntVariable( "sat_symbol_rate" );
+ if ( !b_pol && b_pol != 1 )
+ b_pol = config_GetIntVariable( "sat_polarization" );
+
+
/* Initialise structure */
p_satellite = malloc( sizeof( input_socket_t ) );
-
+
if( p_satellite == NULL )
{
intf_ErrMsg( "input: satellite: Out of memory" );
}
p_input->p_access_data = (void *)p_satellite;
-
+
/* Open the DVR device */
-
+
intf_WarnMsg( 2, "input: opening file `%s'", DVR);
-
+
if( (p_satellite->i_handle = open( DVR,
/*O_NONBLOCK | O_LARGEFILE*/0 )) == (-1) )
{
return -1;
}
-
+
/* Initialize the Satellite Card */
intf_WarnMsg( 2, "Initializing Sat Card with Freq: %d, Pol: %d, Srate: %d",
i_freq, b_pol, i_srate );
-
+
if ( ioctl_SECControl( i_freq * 1000, b_pol, LNB_SLOF, DISEQC ) < 0 )
{
intf_ErrMsg("input: satellite: An error occured when controling SEC");
return -1;
}
-
+
intf_WarnMsg( 3, "Initializing Frontend device" );
switch (ioctl_SetQPSKFrontend ( i_freq * 1000, i_srate* 1000, FEC,
LNB_LOF_1, LNB_LOF_2, LNB_SLOF))
{
case -2:
- intf_ErrMsg( "input: satellite: Frontend returned
+ intf_ErrMsg( "input: satellite: Frontend returned\
an unexpected event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
break;
case -3:
- intf_ErrMsg( "input: satellite: Frontend returned
+ intf_ErrMsg( "input: satellite: Frontend returned\
no event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
break;
case -4:
- intf_ErrMsg( "input: satellite: Frontend: time out
+ intf_ErrMsg( "input: satellite: Frontend: time out\
when polling for event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
break;
case -5:
- intf_ErrMsg( "input: satellite: An error occured when polling
+ intf_ErrMsg( "input: satellite: An error occured when polling\
Frontend device" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
break;
case -1:
- intf_ErrMsg( "input: satellite: Frontend returned
+ intf_ErrMsg( "input: satellite: Frontend returned\
an failure event" );
close( p_satellite->i_handle );
free( p_satellite );
}
intf_WarnMsg( 3, " Setting filter on PAT " );
-
+
if ( ioctl_SetDMXFilter( 0, &i_fd, 3 ) < 0 )
{
- intf_ErrMsg( "input: satellite: An error occured when setting
+ intf_ErrMsg( "input: satellite: An error occured when setting\
filter on PAT" );
return -1;
}
if( input_InitStream( p_input, sizeof( stream_ts_data_t ) ) == -1 )
{
- intf_ErrMsg( "input: satellite: Not enough memory to allow stream
+ intf_ErrMsg( "input: satellite: Not enough memory to allow stream\
structure" );
return( -1 );
}
-
+
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 0;
p_input->stream.p_selected_area->i_tell = 0;
-
+
vlc_mutex_unlock( &p_input->stream.stream_lock );
p_input->i_mtu = SATELLITE_READ_ONCE * TS_PACKET_SIZE;
p_input->stream.i_method = INPUT_METHOD_SATELLITE;
p_input->psz_demux = "satellite";
-
+
return 0;
-
+
}
/*****************************************************************************
{
for ( i_es_index = 1 ;
i_es_index < p_input->stream.p_selected_program->
- i_es_number ;
+ i_es_number ;
i_es_index ++ )
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
#undef p_es
}
}
-
+
p_satellite = (input_socket_t *)p_input;
close( p_satellite->i_handle );
}
-
+
/*****************************************************************************
* SatelliteSetArea : Does nothing
*****************************************************************************/
}
/*****************************************************************************
- * SatelliteSetProgram : Sets the card filters according to the
+ * SatelliteSetProgram : Sets the card filters according to the
* selected program,
* and makes the appropriate changes to stream structure.
*****************************************************************************/
-int SatelliteSetProgram( input_thread_t * p_input,
+int SatelliteSetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_new_prg )
{
int i_es_index;
if ( p_input->stream.p_selected_program )
{
- for ( i_es_index = 1 ;
+ for ( i_es_index = 1 ; /* 0 should be the PMT */
i_es_index < p_input->stream.p_selected_program->
- i_es_number ;
+ i_es_number ;
i_es_index ++ )
{
#define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
if ( p_es->p_decoder_fifo )
{
input_UnselectES( p_input , p_es );
+ p_es->p_pes = NULL; /* FIXME */
+ }
+ if ( p_es->i_dmx_fd )
+ {
+ ioctl_UnsetDMXFilter( p_es->i_dmx_fd );
+ p_es->i_dmx_fd = 0;
}
- ioctl_UnsetDMXFilter( p_es->i_dmx_fd );
#undef p_es
}
}
-
+
for (i_es_index = 1 ; i_es_index < p_new_prg->i_es_number ; i_es_index ++ )
{
#define p_es p_new_prg->pp_es[i_es_index]
3 );
}
}
-
-
+
+
for( i = 0; i < SATELLITE_READ_ONCE; i++ )
{
data_packet_t * p_data;
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.167 2002/03/21 22:10:33 gbazin Exp $
+ * $Id: main.c,v 1.168 2002/03/25 02:06:24 jobi Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#define VCD_DEV_TEXT "VCD device"
#define VCD_DEV_LONGTEXT NULL
+#define SAT_FREQ_TEXT "Satellite transponder frequency"
+#define SAT_FREQ_LONGTEXT NULL
+
+#define SAT_POL_TEXT "Satellite transponder polarization"
+#define SAT_POL_LONGTEXT NULL
+
+#define SAT_SRATE_TEXT "Satellite transponder symbol rate"
+#define SAT_SRATE_LONGTEXT NULL
+
#define IPV6_TEXT "force IPv6"
#define IPV6_LONGTEXT NULL
ADD_STRING ( "dvd_device", "/dev/dvd", NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT )
ADD_STRING ( "vcd_device", "/dev/cdrom", NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT )
+#ifdef HAVE_SATELLITE
+ADD_INTEGER ( "sat_frequency", 12553, NULL, SAT_FREQ_TEXT, SAT_FREQ_LONGTEXT )
+ADD_INTEGER ( "sat_polarization", 0, NULL, SAT_POL_TEXT, SAT_POL_LONGTEXT )
+ADD_INTEGER ( "sat_symbol_rate", 27500, NULL, SAT_SRATE_TEXT,
+ SAT_SRATE_LONGTEXT )
+#endif
+
ADD_BOOL ( "ipv6", NULL, IPV6_TEXT, IPV6_LONGTEXT )
ADD_BOOL ( "ipv4", NULL, IPV4_TEXT, IPV4_LONGTEXT )