1
mirror of https://code.videolan.org/videolan/vlc synced 2024-07-21 07:24:15 +02:00

Playing video from within the interface works.

This commit is contained in:
Jean-Paul Saman 2002-08-06 19:12:07 +00:00
parent 9c383652e8
commit f66d8124c9
4 changed files with 138 additions and 24 deletions

View File

@ -275,8 +275,13 @@ udp://localhost:1234/
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>combo-entry1</name>
<name>comboURL-entry</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_comboURL-entry_changed</handler>
<last_modification_time>Thu, 01 Aug 2002 19:37:06 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
@ -357,7 +362,7 @@ udp://localhost:1234/
<class>GtkCombo</class>
<name>comboDefaultURL</name>
<x>8</x>
<y>4</y>
<y>8</y>
<width>200</width>
<height>24</height>
<value_in_list>False</value_in_list>
@ -374,8 +379,13 @@ udp://localhost:1234/
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>combo-entry2</name>
<name>comboPrefs-entry</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_comboPrefs-entry_changed</handler>
<last_modification_time>Thu, 01 Aug 2002 20:11:46 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>

View File

@ -2,7 +2,7 @@
* familiar_callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: familiar_callbacks.c,v 1.4 2002/07/24 20:46:08 jpsaman Exp $
* $Id: familiar_callbacks.c,v 1.5 2002/08/06 19:12:07 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
@ -47,6 +47,9 @@
//#include "netutils.h"
static void MediaURLOpenChanged( GtkEditable *editable, gpointer user_data );
static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data );
/*****************************************************************************
* Useful function to retrieve p_intf
****************************************************************************/
@ -81,6 +84,50 @@ void * __GtkGetIntf( GtkWidget * widget )
return p_data;
}
/*****************************************************************************
* Helper functions for URL changes in Media and Preferences notebook pages.
****************************************************************************/
static void MediaURLOpenChanged( GtkEditable *editable, gpointer user_data )
{
intf_thread_t *p_intf = GtkGetIntf( editable );
playlist_t *p_playlist;
gchar * psz_url;
psz_url = gtk_entry_get_text(GTK_ENTRY(editable));
g_print( "%s\n",psz_url );
// p_url = gtk_editable_get_chars(editable,0,-1);
// Add p_url to playlist .... but how ?
if (p_intf)
{
p_playlist = (playlist_t *)
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist )
{
playlist_Add( p_playlist, (char*)psz_url,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
vlc_object_release( p_playlist );
}
}
}
static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data )
{
gchar * p_url;
// GtkWidget * item;
p_url = gtk_entry_get_text(GTK_ENTRY(editable) );
g_print( "%s\n",p_url );
// p_url = gtk_editable_get_chars(editable,0,-1);
// item = gtk_list_item_new();
// gtk_widget_show (item);
// gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (item), p_url);
// /* Now we simply add the item to the combo's list. */
// gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), item);
}
/*
* Main interface callbacks
*/
@ -113,7 +160,10 @@ on_toolbar_open_clicked (GtkButton *button,
{
intf_thread_t *p_intf = GtkGetIntf( button );
if (p_intf)
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gdk_window_raise( p_intf->p_sys->p_window->window );
}
}
@ -122,8 +172,10 @@ on_toolbar_preferences_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
if (p_intf)
if (p_intf) {
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gdk_window_raise( p_intf->p_sys->p_window->window );
}
}
@ -168,6 +220,11 @@ on_toolbar_play_clicked (GtkButton *button,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
if( p_intf )
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gdk_window_raise( p_intf->p_sys->p_window->window );
}
// Display open page
}
@ -178,6 +235,7 @@ on_toolbar_play_clicked (GtkButton *button,
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
gdk_window_lower( p_intf->p_sys->p_window->window );
}
else
{
@ -195,10 +253,11 @@ on_toolbar_stop_clicked (GtkButton *button,
intf_thread_t * p_intf = GtkGetIntf( button );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
if( p_playlist)
{
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
gdk_window_raise( p_intf->p_sys->p_window->window );
}
}
@ -225,11 +284,41 @@ on_toolbar_about_clicked (GtkButton *button,
{
intf_thread_t *p_intf = GtkGetIntf( button );
if (p_intf)
{ // Toggle notebook
{// Toggle notebook
if (p_intf->p_sys->p_notebook)
{
// if ( gtk_get_data( GTK_WIDGET(p_intf->p_sys->p_notebook), "visible" ) )
// gtk_widget_hide( GTK_WIDGET(p_intf->p_sys->p_notebook) );
// else
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
}
gdk_window_raise( p_intf->p_sys->p_window->window );
}
}
void
on_comboURL_entry_changed (GtkEditable *editable,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( editable );
if (p_intf)
{
MediaURLOpenChanged( editable, NULL );
}
}
void
on_comboPrefs_entry_changed (GtkEditable *editable,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( editable );
if (p_intf)
{
PreferencesURLOpenChanged( editable, NULL );
}
}

View File

@ -2,7 +2,7 @@
* familiar_callbacks.h : familiar plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: familiar_callbacks.h,v 1.5 2002/07/24 20:46:08 jpsaman Exp $
* $Id: familiar_callbacks.h,v 1.6 2002/08/06 19:12:07 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
@ -61,3 +61,12 @@ on_toolbar_forward_clicked (GtkButton *button,
void
on_toolbar_about_clicked (GtkButton *button,
gpointer user_data);
void
on_comboURL_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_comboPrefs_entry_changed (GtkEditable *editable,
gpointer user_data);

View File

@ -40,7 +40,7 @@ create_familiar (void)
GtkWidget *listMedia;
GtkWidget *comboURL;
GList *comboURL_items = NULL;
GtkWidget *combo_entry1;
GtkWidget *comboURL_entry;
GtkWidget *media;
GtkWidget *fixedPreferences;
GtkWidget *buttonSave;
@ -50,7 +50,7 @@ create_familiar (void)
GtkWidget *fixed3;
GtkWidget *comboDefaultURL;
GList *comboDefaultURL_items = NULL;
GtkWidget *combo_entry2;
GtkWidget *comboPrefs_entry;
GtkWidget *frameIP;
GtkWidget *fixed2;
GSList *fixed2_group = NULL;
@ -263,13 +263,13 @@ create_familiar (void)
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items);
combo_entry1 = GTK_COMBO (comboURL)->entry;
gtk_widget_set_name (combo_entry1, "combo_entry1");
gtk_widget_ref (combo_entry1);
gtk_object_set_data_full (GTK_OBJECT (familiar), "combo_entry1", combo_entry1,
comboURL_entry = GTK_COMBO (comboURL)->entry;
gtk_widget_set_name (comboURL_entry, "comboURL_entry");
gtk_widget_ref (comboURL_entry);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL_entry", comboURL_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo_entry1);
gtk_entry_set_text (GTK_ENTRY (combo_entry1), _("file://"));
gtk_widget_show (comboURL_entry);
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), _("file://"));
media = gtk_label_new (_("Media"));
gtk_widget_set_name (media, "media");
@ -341,8 +341,8 @@ create_familiar (void)
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboDefaultURL", comboDefaultURL,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboDefaultURL);
gtk_fixed_put (GTK_FIXED (fixed3), comboDefaultURL, 8, 4);
gtk_widget_set_uposition (comboDefaultURL, 8, 4);
gtk_fixed_put (GTK_FIXED (fixed3), comboDefaultURL, 8, 8);
gtk_widget_set_uposition (comboDefaultURL, 8, 8);
gtk_widget_set_usize (comboDefaultURL, 200, 24);
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("file://"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("ftp://localhost"));
@ -351,13 +351,13 @@ create_familiar (void)
gtk_combo_set_popdown_strings (GTK_COMBO (comboDefaultURL), comboDefaultURL_items);
g_list_free (comboDefaultURL_items);
combo_entry2 = GTK_COMBO (comboDefaultURL)->entry;
gtk_widget_set_name (combo_entry2, "combo_entry2");
gtk_widget_ref (combo_entry2);
gtk_object_set_data_full (GTK_OBJECT (familiar), "combo_entry2", combo_entry2,
comboPrefs_entry = GTK_COMBO (comboDefaultURL)->entry;
gtk_widget_set_name (comboPrefs_entry, "comboPrefs_entry");
gtk_widget_ref (comboPrefs_entry);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboPrefs_entry", comboPrefs_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo_entry2);
gtk_entry_set_text (GTK_ENTRY (combo_entry2), _("file://"));
gtk_widget_show (comboPrefs_entry);
gtk_entry_set_text (GTK_ENTRY (comboPrefs_entry), _("file://"));
frameIP = gtk_frame_new (_("IP version:"));
gtk_widget_set_name (frameIP, "frameIP");
@ -508,6 +508,12 @@ create_familiar (void)
gtk_signal_connect (GTK_OBJECT (toolbar_about), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_about_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (comboURL_entry), "changed",
GTK_SIGNAL_FUNC (on_comboURL_entry_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (comboPrefs_entry), "changed",
GTK_SIGNAL_FUNC (on_comboPrefs_entry_changed),
NULL);
gtk_object_set_data (GTK_OBJECT (familiar), "tooltips", tooltips);