Commit ac4a6e1f authored by Jean-Paul Saman's avatar Jean-Paul Saman

Support for browsing local media (not finished).

parent ce398236
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin. * callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: callbacks.c,v 1.2 2002/08/06 19:31:18 jpsaman Exp $ * $Id: callbacks.c,v 1.3 2002/08/12 20:38:19 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <dirent.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
...@@ -127,6 +128,32 @@ static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data ...@@ -127,6 +128,32 @@ static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data
// gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), item); // gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), item);
} }
/*****************************************************************
* Read directory helper function.
****************************************************************/
static void ReadDirectory( GtkWidget *widget, char *psz_dir)
{
struct dirent **namelist;
int n;
if (psz_dir)
n = scandir(psz_dir, &namelist, 0, alphasort);
else
n = scandir(".", &namelist, 0, alphasort);
if (n<0)
perror("scandir");
else
{
while(n--) /* reverse printed list */
{
/* add list to listMedia widget */
g_print("%s\n",namelist[n]->d_name);
free(namelist[n]);
}
free(namelist);
}
}
/* /*
* Main interface callbacks * Main interface callbacks
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.h : familiar plugin for vlc * callbacks.h : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: callbacks.h,v 1.2 2002/08/06 19:31:18 jpsaman Exp $ * $Id: callbacks.h,v 1.3 2002/08/12 20:38:19 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
gboolean GtkExit ( GtkWidget *, gpointer ); gboolean GtkExit ( GtkWidget *, gpointer );
static void ReadDirectory( GtkWidget *widget, char *psz_dir);
gboolean gboolean
on_familiar_destroy_event (GtkWidget *widget, on_familiar_destroy_event (GtkWidget *widget,
GdkEvent *event, GdkEvent *event,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: familiar.c,v 1.1 2002/08/04 17:23:43 sam Exp $ * $Id: familiar.c,v 1.2 2002/08/12 20:38:19 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -188,12 +188,18 @@ static void Run( intf_thread_t *p_intf ) ...@@ -188,12 +188,18 @@ static void Run( intf_thread_t *p_intf )
GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) ); GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) );
// gtk_widget_hide( GTK_WIDGET(p_intf->p_sys->p_notebook) ); // gtk_widget_hide( GTK_WIDGET(p_intf->p_sys->p_notebook) );
p_intf->p_sys->p_file_list = GTK_LIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_notebook), "listMedia") );
/* Store p_intf to keep an eye on it */ /* Store p_intf to keep an eye on it */
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
"p_intf", p_intf ); "p_intf", p_intf );
/* Show the control window */ /* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window ); gtk_widget_show( p_intf->p_sys->p_window );
/* Testing routine */
// ReadDirectory( GTK_WIDGET(p_intf->p_sys->p_file_list), ".");
/* Enter Gtk mode */ /* Enter Gtk mode */
gtk_main(); gtk_main();
......
...@@ -6,19 +6,13 @@ ...@@ -6,19 +6,13 @@
<program_name>familiar</program_name> <program_name>familiar</program_name>
<directory></directory> <directory></directory>
<source_directory></source_directory> <source_directory></source_directory>
<pixmaps_directory>../../share</pixmaps_directory> <pixmaps_directory>../../../share</pixmaps_directory>
<language>C</language> <language>C</language>
<gnome_support>False</gnome_support> <gnome_support>False</gnome_support>
<gettext_support>True</gettext_support> <gettext_support>True</gettext_support>
<use_widget_names>True</use_widget_names> <use_widget_names>True</use_widget_names>
<output_main_file>False</output_main_file> <output_main_file>False</output_main_file>
<output_build_files>False</output_build_files> <output_build_files>False</output_build_files>
<main_source_file>interface.c</main_source_file>
<main_header_file>interface.h</main_header_file>
<handler_source_file>callbacks.c</handler_source_file>
<handler_header_file>callbacks.h</handler_header_file>
<support_source_file>support.c</support_source_file>
<support_header_file>support.h</support_header_file>
</project> </project>
<widget> <widget>
...@@ -269,7 +263,7 @@ ...@@ -269,7 +263,7 @@
<items>file:// <items>file://
ftp://localhost ftp://localhost
http://localhost http://localhost
udp://localhost:1234/ udpstream://@localhost:1234/
</items> </items>
<widget> <widget>
...@@ -373,7 +367,7 @@ udp://localhost:1234/ ...@@ -373,7 +367,7 @@ udp://localhost:1234/
<items>file:// <items>file://
ftp://localhost ftp://localhost
http://localhost http://localhost
udp://localhost:1234/ udpstream://@localhost:1234/
</items> </items>
<widget> <widget>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.h: private Gtk+ interface description * familiar.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: familiar.h,v 1.1 2002/08/04 17:23:43 sam Exp $ * $Id: familiar.h,v 1.2 2002/08/12 20:38:19 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -34,6 +34,7 @@ struct intf_sys_t ...@@ -34,6 +34,7 @@ struct intf_sys_t
// GtkWidget * p_notebook_about; // GtkWidget * p_notebook_about;
// GtkWidget * p_notebook_open; // GtkWidget * p_notebook_open;
// GtkWidget * p_notebook_preferences; // GtkWidget * p_notebook_preferences;
GtkWidget * p_file_list;
/* The input thread */ /* The input thread */
input_thread_t * p_input; input_thread_t * p_input;
......
...@@ -259,7 +259,7 @@ create_familiar (void) ...@@ -259,7 +259,7 @@ create_familiar (void)
comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://")); comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://localhost")); comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://localhost"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://localhost")); comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://localhost"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp://localhost:1234/")); comboURL_items = g_list_append (comboURL_items, (gpointer) _("udpstream://@localhost:1234/"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items); gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items); g_list_free (comboURL_items);
...@@ -347,7 +347,7 @@ create_familiar (void) ...@@ -347,7 +347,7 @@ create_familiar (void)
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("file://")); comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("file://"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("ftp://localhost")); comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("ftp://localhost"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("http://localhost")); comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("http://localhost"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("udp://localhost:1234/")); comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("udpstream://@localhost:1234/"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboDefaultURL), comboDefaultURL_items); gtk_combo_set_popdown_strings (GTK_COMBO (comboDefaultURL), comboDefaultURL_items);
g_list_free (comboDefaultURL_items); g_list_free (comboDefaultURL_items);
......
...@@ -113,7 +113,7 @@ create_pixmap (GtkWidget *widget, ...@@ -113,7 +113,7 @@ create_pixmap (GtkWidget *widget,
/* If we haven't found the pixmap, try the source directory. */ /* If we haven't found the pixmap, try the source directory. */
if (!found_filename) if (!found_filename)
{ {
found_filename = check_file_exists ("../../share", filename); found_filename = check_file_exists ("../../../share", filename);
} }
if (!found_filename) if (!found_filename)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment