]> git.sesse.net Git - vlc/commitdiff
Playing of files is not working yet! But it is getting closer.
authorJean-Paul Saman <jpsaman@videolan.org>
Tue, 1 Oct 2002 21:17:52 +0000 (21:17 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Tue, 1 Oct 2002 21:17:52 +0000 (21:17 +0000)
plugins/familiar/familiar.glade
plugins/familiar/familiar_callbacks.c
plugins/familiar/familiar_callbacks.h
plugins/familiar/familiar_interface.c

index a7167749e7a3518b74ce670b58205e6fd3231958..1d44fe180f87cde89e42dddf83c2ebc47b8bfb7d 100644 (file)
@@ -414,6 +414,11 @@ udpstream://@:1234
          <width>54</width>
          <height>24</height>
          <can_focus>True</can_focus>
+         <signal>
+           <name>clicked</name>
+           <handler>on_buttonSave_clicked</handler>
+           <last_modification_time>Tue, 01 Oct 2002 21:12:20 GMT</last_modification_time>
+         </signal>
          <label>Save</label>
          <relief>GTK_RELIEF_NORMAL</relief>
        </widget>
@@ -426,6 +431,11 @@ udpstream://@:1234
          <width>54</width>
          <height>24</height>
          <can_focus>True</can_focus>
+         <signal>
+           <name>clicked</name>
+           <handler>on_buttonApply_clicked</handler>
+           <last_modification_time>Tue, 01 Oct 2002 21:12:27 GMT</last_modification_time>
+         </signal>
          <label>Apply</label>
          <relief>GTK_RELIEF_NORMAL</relief>
        </widget>
@@ -438,6 +448,11 @@ udpstream://@:1234
          <width>54</width>
          <height>24</height>
          <can_focus>True</can_focus>
+         <signal>
+           <name>clicked</name>
+           <handler>on_buttonCancel_clicked</handler>
+           <last_modification_time>Tue, 01 Oct 2002 21:12:35 GMT</last_modification_time>
+         </signal>
          <label>Cancel</label>
          <relief>GTK_RELIEF_NORMAL</relief>
        </widget>
index ab77666bebf0d86d9c3e3fa7a101b7fdd0319fa1..29ad154e82da9b8dcd6771239fac92e4c7051526 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
+ * familiar_callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: familiar_callbacks.c,v 1.6.2.3 2002/10/01 19:46:47 jpsaman Exp $
+ * $Id: familiar_callbacks.c,v 1.6.2.4 2002/10/01 21:17:52 jpsaman Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -99,32 +99,23 @@ void * __GtkGetIntf( GtkWidget * widget )
  ****************************************************************************/
 static void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
 {
-    intf_thread_t *p_intf = GtkGetIntf( widget );
+//    intf_thread_t *p_intf = GtkGetIntf( widget );
+    int            i_end = p_main->p_playlist->i_size;
 
     intf_ErrMsg( "@@@ MediaURLOpenChanged" );
-    g_print( "%s\n",psz_url );
-    if( p_intf->p_sys->p_input != NULL )
+    // Add p_url to playlist .... but how ?
+    if( p_main->p_playlist )
     {
-        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
-        p_main->p_playlist->b_stopped = 0;
+       intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_url );
     }
-    else
+
+    /* end current item, select added item  */
+    if( p_input_bank->pp_input[0] != NULL )
     {
-        vlc_mutex_lock( &p_main->p_playlist->change_lock );
-        if( p_main->p_playlist->b_stopped )
-        {
-            if( p_main->p_playlist->i_size )
-            {
-                vlc_mutex_unlock( &p_main->p_playlist->change_lock );
-                intf_PlaylistJumpto( p_main->p_playlist,
-                                     p_main->p_playlist->i_index );
-            }
-        }
-        else
-        {
-            vlc_mutex_unlock( &p_main->p_playlist->change_lock );
-        }
+        p_input_bank->pp_input[0]->b_eof = 1;
     }
+
+    intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
 }
 
 /*****************************************************************
@@ -137,7 +128,6 @@ void ReadDirectory( GtkCList *clist, char *psz_dir )
     int n=-1;
     int status=-1;
 
-    intf_ErrMsg( "@@@ ReadDirectory - Enter" );
     if (psz_dir)
     {
        status = chdir(psz_dir);
@@ -156,7 +146,6 @@ void ReadDirectory( GtkCList *clist, char *psz_dir )
 
         gtk_clist_freeze( p_intf->p_sys->p_clist );
         gtk_clist_clear( p_intf->p_sys->p_clist );
-        g_print( "dir entries: %d\n",n );
         for (i=0; i<n; i++)
         {
             /* This is a list of strings. */
@@ -170,7 +159,6 @@ void ReadDirectory( GtkCList *clist, char *psz_dir )
         gtk_clist_thaw( p_intf->p_sys->p_clist );
         free(namelist);
     }
-    intf_ErrMsg( "@@@ ReadDirectory - Exit" );
 }
 
 static char* get_file_perm(const char *path)
@@ -533,3 +521,38 @@ on_clistmedia_enter_notify_event       (GtkWidget       *widget,
   return FALSE;
 }
 
+
+void
+on_buttonSave_clicked                  (GtkButton       *button,
+                                        gpointer         user_data)
+{
+    on_buttonApply_clicked( button, user_data );
+    config_SaveConfigFile( NULL );
+}
+
+
+void
+on_buttonApply_clicked                 (GtkButton       *button,
+                                        gpointer         user_data)
+{
+//    GHashTable *hash_table;
+//    GtkWidget *apply_button;
+//
+//    hash_table = (GHashTable *)gtk_object_get_data( GTK_OBJECT(user_data),
+//                                                    "config_hash_table" );
+//    g_hash_table_foreach_remove( hash_table, GtkSaveHashValue, NULL );
+//
+//    /* change the highlight status of the Apply button */
+//    apply_button = (GtkWidget *)gtk_object_get_data( GTK_OBJECT(user_data),
+//                                                    "apply_button" );
+//    gtk_widget_set_sensitive( apply_button, FALSE );
+}
+
+
+void
+on_buttonCancel_clicked                (GtkButton       *button,
+                                        gpointer         user_data)
+{
+    //gtk_widget_destroy( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
+}
+
index e8c5d94cc2deb47cb5fcbc99d193601ba7a2cb86..132f17001cfc9b95447440d6f5239b74484ec849 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * callbacks.h : familiar plugin for vlc
+ * familiar_callbacks.h : familiar plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: familiar_callbacks.h,v 1.7.2.3 2002/10/01 19:46:47 jpsaman Exp $
+ * $Id: familiar_callbacks.h,v 1.7.2.4 2002/10/01 21:17:52 jpsaman Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -100,3 +100,15 @@ gboolean
 on_clistmedia_enter_notify_event       (GtkWidget       *widget,
                                         GdkEventCrossing *event,
                                         gpointer         user_data);
+
+void
+on_buttonSave_clicked                  (GtkButton       *button,
+                                        gpointer         user_data);
+
+void
+on_buttonApply_clicked                 (GtkButton       *button,
+                                        gpointer         user_data);
+
+void
+on_buttonCancel_clicked                (GtkButton       *button,
+                                        gpointer         user_data);
index 7192ea52d1f7fe5ba2067680f55893e030024fcc..206926732a291eedaafd5477dca3f66c68c5bd1a 100644 (file)
@@ -498,6 +498,15 @@ create_familiar (void)
   gtk_signal_connect (GTK_OBJECT (clistmedia), "enter_notify_event",
                       GTK_SIGNAL_FUNC (on_clistmedia_enter_notify_event),
                       NULL);
+  gtk_signal_connect (GTK_OBJECT (buttonSave), "clicked",
+                      GTK_SIGNAL_FUNC (on_buttonSave_clicked),
+                      NULL);
+  gtk_signal_connect (GTK_OBJECT (buttonApply), "clicked",
+                      GTK_SIGNAL_FUNC (on_buttonApply_clicked),
+                      NULL);
+  gtk_signal_connect (GTK_OBJECT (buttonCancel), "clicked",
+                      GTK_SIGNAL_FUNC (on_buttonCancel_clicked),
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (cbautoplay), "toggled",
                       GTK_SIGNAL_FUNC (on_cbautoplay_toggled),
                       NULL);