]> git.sesse.net Git - vlc/blob - modules/gui/familiar/network.c
Fixed superflous tuning ;-)
[vlc] / modules / gui / familiar / network.c
1 /*****************************************************************************
2  * network.c : Network interface of the gtk-familiar plugin.
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 VideoLAN
5  * $Id: network.c,v 1.1 2003/03/13 15:50:17 marcari Exp $
6  *
7  * Authors: Marc Ariberti <marcari@videolan.org>
8  *      
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28 #include <sys/types.h>                                              /* off_t */
29 #include <stdlib.h>
30
31 #include <vlc/vlc.h>
32 #include <vlc/intf.h>
33 #include <vlc/vout.h>
34
35 #include <stdio.h>
36 #include <string.h>
37 #include <dirent.h>
38 #include <sys/stat.h>
39 #include <unistd.h>
40
41 #ifdef HAVE_CONFIG_H
42 #  include <config.h>
43 #endif
44
45 #include <gtk/gtk.h>
46
47 #include "callbacks.h"
48 #include "interface.h"
49 #include "support.h"
50 #include "familiar.h"
51
52 static void update_network_multicast(GtkWidget * widget);
53
54 static void update_network_multicast(GtkWidget * widget)
55 {
56     intf_thread_t *  p_intf = GtkGetIntf( widget );
57     GtkToggleButton * p_network_multicast = 
58         GTK_GET( TOGGLE_BUTTON, "network_multicast" );
59     GtkEditable * p_network_multicast_address = 
60         GTK_GET( EDITABLE, "network_multicast_address" );
61     GtkEditable * p_network_multicast_port = 
62         GTK_GET( EDITABLE, "network_multicast_port" );
63         
64     if (gtk_toggle_button_get_active(p_network_multicast))
65     {
66         gchar * str = g_strconcat( "udp://@",
67             gtk_editable_get_chars(p_network_multicast_address, 0, -1), ":",
68             gtk_editable_get_chars(p_network_multicast_port, 0, -1), NULL );
69         gtk_entry_set_text(p_intf->p_sys->p_mrlentry, str);
70         g_free( str );
71     }
72 }
73
74
75 void
76 on_network_multicast_toggled           (GtkToggleButton *togglebutton,
77                                         gpointer         user_data)
78 {
79     update_network_multicast(GTK_WIDGET(togglebutton));
80 }
81
82
83 void
84 on_network_multicast_port_changed      (GtkEditable     *editable,
85                                         gpointer         user_data)
86 {
87     update_network_multicast(GTK_WIDGET(editable));
88 }
89
90
91 void
92 on_network_multicast_address_changed   (GtkEditable     *editable,
93                                         gpointer         user_data)
94 {
95     update_network_multicast(GTK_WIDGET(editable));
96 }
97
98
99 void
100 on_network_http_toggled                (GtkToggleButton *togglebutton,
101                                         gpointer         user_data)
102 {
103     intf_thread_t *  p_intf = GtkGetIntf( togglebutton );
104
105     if (gtk_toggle_button_get_active(togglebutton))
106     {
107         gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "http://");
108     }
109 }
110
111
112 void
113 on_network_ftp_toggled                 (GtkToggleButton *togglebutton,
114                                         gpointer         user_data)
115 {
116     intf_thread_t *  p_intf = GtkGetIntf( togglebutton );
117     
118     if (gtk_toggle_button_get_active(togglebutton))
119     {
120         gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "ftp://");
121     }
122 }
123
124
125 void
126 on_network_mms_toggled                 (GtkToggleButton *togglebutton,
127                                         gpointer         user_data)
128 {
129     intf_thread_t *  p_intf = GtkGetIntf( togglebutton );
130     
131     if (gtk_toggle_button_get_active(togglebutton))
132     {
133         gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "mms://");
134     }
135 }
136