Commit 7d5b21c4 authored by Jean-Paul Saman's avatar Jean-Paul Saman

PDA Interface:

- Cleanup code
- Cleanup interface
- Adding items to playlist widgets from File, Camera, Transcode tabs.
parent bec4516d
......@@ -2,7 +2,7 @@
* pda.c : PDA Gtk2 plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: pda.c,v 1.8 2003/11/07 13:01:51 jpsaman Exp $
* $Id: pda.c,v 1.9 2003/11/18 20:36:40 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org>
......@@ -148,6 +148,7 @@ static void Run( intf_thread_t *p_intf )
GtkCellRenderer *renderer = NULL;
GtkTreeViewColumn *column = NULL;
GtkListStore *filelist = NULL;
GtkListStore *playlist = NULL;
#ifndef NEED_GTK2_MAIN
gtk_set_locale ();
......@@ -252,7 +253,7 @@ static void Run( intf_thread_t *p_intf )
G_TYPE_UINT64, /* File size */
G_TYPE_STRING, /* Owner */
G_TYPE_STRING);/* Group */
ReadDirectory(filelist, ".");
ReadDirectory(p_intf, filelist, ".");
msg_Dbg(p_intf, "Showing GtkTreeView FileList" );
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(filelist));
g_object_unref(filelist); /* Model will be released by GtkTreeView */
......@@ -267,8 +268,7 @@ static void Run( intf_thread_t *p_intf )
/* BEGIN OF PLAYLIST GTK_TREE_VIEW */
msg_Dbg(p_intf, "Getting GtkTreeView PlayList" );
p_intf->p_sys->p_tvplaylist = NULL;
p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window,
"tvPlaylist");
p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist");
if (NULL == p_intf->p_sys->p_tvplaylist)
msg_Err(p_intf, "Error obtaining pointer to Play List");
......@@ -287,13 +287,13 @@ static void Run( intf_thread_t *p_intf )
/* update the playlist */
msg_Dbg(p_intf, "Populating GtkTreeView Playlist" );
p_intf->p_sys->p_playlist = gtk_list_store_new (2,
playlist = gtk_list_store_new (2,
G_TYPE_STRING, /* Filename */
G_TYPE_STRING);/* Time */
PlaylistRebuildListStore( p_intf->p_sys->p_playlist, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ));
PlaylistRebuildListStore( playlist, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ));
msg_Dbg(p_intf, "Showing GtkTreeView Playlist" );
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_intf->p_sys->p_playlist));
g_object_unref(p_intf->p_sys->p_playlist);
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(playlist));
g_object_unref(playlist);
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
/* Column properties */
......@@ -302,10 +302,6 @@ static void Run( intf_thread_t *p_intf )
gtk_tree_view_set_headers_clickable(p_intf->p_sys->p_tvplaylist, TRUE);
/* END OF PLAYLIST GTK_TREE_VIEW */
/* Save MRL entry object */
p_intf->p_sys->p_mrlentry = GTK_ENTRY( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "mrl_entry" ) );
/* Store p_intf to keep an eye on it */
msg_Dbg( p_intf, "trying to store p_intf pointer ... " );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
......
......@@ -157,7 +157,7 @@
<packing>
<property name="padding">4</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="fill">True</property>
</packing>
</child>
......@@ -209,7 +209,6 @@
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<signal name="row_activated" handler="onFileListRow" last_modification_time="Fri, 26 Sep 2003 13:30:40 GMT"/>
<signal name="select_cursor_row" handler="onFileListRowSelected" last_modification_time="Fri, 26 Sep 2003 13:31:20 GMT"/>
</widget>
</child>
</widget>
......@@ -331,7 +330,6 @@
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<signal name="add" handler="onNetworkMRLAdd" last_modification_time="Fri, 07 Nov 2003 14:35:58 GMT"/>
<child internal-child="entry">
<widget class="GtkEntry" id="entryMRL">
......@@ -505,7 +503,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">1233 0 65535 1 10 10</property>
<property name="adjustment">1234 0 65535 1 10 10</property>
<signal name="changed" handler="NetworkBuildMRL" last_modification_time="Sat, 08 Nov 2003 13:34:10 GMT"/>
</widget>
<packing>
......@@ -573,7 +571,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">unicast</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -653,7 +651,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">udp</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
......@@ -1167,7 +1165,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">/dev/video</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -1231,7 +1229,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">/dev/dsp</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -1325,7 +1323,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">pal</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -1397,7 +1395,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">240x192</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -1561,7 +1559,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">mono</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -1808,7 +1806,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">huffyuv</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -2181,7 +2179,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">127.0.0.1</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -2252,7 +2250,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">udp</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -2299,7 +2297,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">ts</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -2376,7 +2374,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">alaw</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">True</property>
......@@ -2743,7 +2741,30 @@
<property name="spacing">0</property>
<child>
<placeholder/>
<widget class="GtkScrolledWindow" id="scrolledwindowPreference">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="tvPreferences">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
......@@ -2917,15 +2938,15 @@
</child>
<child>
<widget class="GtkLabel" id="labelProgramName">
<property name="width_request">152</property>
<widget class="GtkLabel" id="labelCopyright">
<property name="width_request">208</property>
<property name="height_request">16</property>
<property name="visible">True</property>
<property name="label" translatable="yes">VLC media player</property>
<property name="label" translatable="yes">(C) 1996-2003 the VideoLAN team</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
......@@ -2933,21 +2954,21 @@
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">48</property>
<property name="y">16</property>
<property name="x">16</property>
<property name="y">48</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="labelCopyright">
<property name="width_request">208</property>
<widget class="GtkLabel" id="labelProgramName">
<property name="width_request">152</property>
<property name="height_request">16</property>
<property name="visible">True</property>
<property name="label" translatable="yes">(C) 1996-2003 the VideoLAN team</property>
<property name="label" translatable="yes">VLC media player</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
......@@ -2955,8 +2976,8 @@
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">16</property>
<property name="y">48</property>
<property name="x">48</property>
<property name="y">16</property>
</packing>
</child>
</widget>
......
......@@ -2,7 +2,7 @@
* pda.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: pda.h,v 1.4 2003/11/07 13:01:51 jpsaman Exp $
* $Id: pda.h,v 1.5 2003/11/18 20:36:40 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -33,12 +33,10 @@ struct intf_sys_t
/* windows and widgets */
GtkWidget *p_window; /* main window */
GtkEntry *p_mrlentry;
GtkNotebook *p_notebook;
GtkHScale *p_slider;
GtkTreeView *p_tvfile;
GtkTreeView *p_tvplaylist;
GtkListStore *p_playlist; /* Playlist widget */
/* slider */
GtkLabel * p_slider_label;
......
......@@ -2,7 +2,7 @@
* pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: pda_callbacks.c,v 1.13 2003/11/09 21:29:52 jpsaman Exp $
* $Id: pda_callbacks.c,v 1.14 2003/11/18 20:36:40 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -35,6 +35,8 @@
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
......@@ -49,7 +51,7 @@
#define VLC_MAX_MRL 256
static char* get_file_stat(const char *path, uid_t *uid, gid_t *gid, off_t *size);
static char *get_file_stat(const char *path, off_t *size);
/*****************************************************************************
* Useful function to retrieve p_intf
......@@ -85,7 +87,7 @@ void * E_(__GtkGetIntf)( GtkWidget * widget )
return p_data;
}
void PlaylistAddItem( GtkWidget *widget, gchar *name)
void PlaylistAddItem(GtkWidget *widget, gchar *name)
{
GtkTreeView *p_tvplaylist = NULL;
......@@ -139,7 +141,6 @@ void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
{
intf_thread_t *p_intf = GtkGetIntf( widget );
playlist_t *p_playlist;
GtkTreeView *p_tvplaylist;
p_playlist = (playlist_t *)
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
......@@ -163,13 +164,7 @@ void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
}
vlc_object_release( p_playlist );
p_tvplaylist = (GtkTreeView*) lookup_widget( GTK_WIDGET(widget), "tvPlaylist" );
if (p_tvplaylist)
{
GtkListStore *p_liststore;
p_liststore = (GtkListStore *) gtk_tree_view_get_model(p_tvplaylist);
PlaylistRebuildListStore(p_liststore, p_playlist);
}
PlaylistAddItem(GTK_WIDGET(widget), psz_url);
}
}
#endif
......@@ -177,18 +172,18 @@ void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
/*****************************************************************
* Read directory helper function.
****************************************************************/
void ReadDirectory(GtkListStore *p_list, char *psz_dir )
void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
{
GtkTreeIter iter;
struct dirent **namelist;
int n=-1, status=-1;
g_print("changing to dir %s\n", psz_dir);
msg_Dbg(p_intf, "Changing to dir %s", psz_dir);
if (psz_dir)
{
status = chdir(psz_dir);
if (status<0)
g_print( "permision denied\n" );
msg_Dbg(p_intf, "permision denied" );
}
n = scandir(".", &namelist, 0, alphasort);
......@@ -197,17 +192,14 @@ void ReadDirectory(GtkListStore *p_list, char *psz_dir )
else
{
int i;
uint32_t uid;
uint32_t gid;
off_t size;
gchar *ppsz_text[5];
gchar *ppsz_text[4];
/* XXX : kludge temporaire pour yopy */
ppsz_text[0]="..";
ppsz_text[1] = get_file_stat("..", &uid, &gid, &size);
ppsz_text[2] = "";
ppsz_text[3] = "";
ppsz_text[4] = "";
ppsz_text[0] = "..";
ppsz_text[1] = get_file_stat("..", &size);
ppsz_text[2] = "?";
ppsz_text[3] = "?";
/* Add a new row to the model */
gtk_list_store_append (p_list, &iter);
......@@ -215,8 +207,8 @@ void ReadDirectory(GtkListStore *p_list, char *psz_dir )
0, ppsz_text[0],
1, ppsz_text[1],
2, size,
3, ppsz_text[3],
4, ppsz_text[4],
3, ppsz_text[2],
4, ppsz_text[3],
-1);
if (ppsz_text[1]) free(ppsz_text[1]);
......@@ -228,20 +220,19 @@ void ReadDirectory(GtkListStore *p_list, char *psz_dir )
{
/* This is a list of strings. */
ppsz_text[0] = namelist[i]->d_name;
ppsz_text[1] = get_file_stat(namelist[i]->d_name, &uid, &gid, &size);
ppsz_text[2] = "";
ppsz_text[3] = "";
ppsz_text[4] = "";
#if 0
g_print( "(%d) file: %s permission: %s user: %ull group: %ull size: %ull\n", i, ppsz_text[0], ppsz_text[1], uid, gid, size );
ppsz_text[1] = get_file_stat(namelist[i]->d_name, &size);
ppsz_text[2] = "?";
ppsz_text[3] = "?";
#if 1
msg_Dbg(p_intf, "(%d) file: %s permission: %s user: %s group: %s size: %ull", i, ppsz_text[0], ppsz_text[1], ppsz_text[2], ppsz_text[3], (unsigned long long) size );
#endif
gtk_list_store_append (p_list, &iter);
gtk_list_store_set (p_list, &iter,
0, ppsz_text[0],
1, ppsz_text[1],
2, size,
3, ppsz_text[3],
4, ppsz_text[4],
3, ppsz_text[2],
4, ppsz_text[3],
-1);
if (ppsz_text[1]) free(ppsz_text[1]);
......@@ -251,19 +242,18 @@ void ReadDirectory(GtkListStore *p_list, char *psz_dir )
}
}
static char* get_file_stat(const char *path, uid_t *uid, gid_t *gid, off_t *size)
static char *get_file_stat(const char *path, off_t *size)
{
struct passwd *pw = NULL;
struct group *grp = NULL;
struct stat st;
char *perm;
int ret = -1;
perm = (char *) malloc(sizeof(char)*10);
strncpy( perm, "----------", sizeof("----------"));
if (lstat(path, &st)==0)
{
/* user, group, filesize */
*uid = st.st_uid;
*gid = st.st_gid;
*size = st.st_size;
/* determine permission modes */
if (S_ISLNK(st.st_mode))
perm[0]= 'l';
......@@ -325,6 +315,24 @@ static char* get_file_stat(const char *path, uid_t *uid, gid_t *gid, off_t *size
}
else if (st.st_mode &S_ISVTX)
perm[9]= 'T';
#if 0
*permission = perm;
/* user, group, filesize */
pw = getpwuid(st.st_uid);
grp = getgrgid(st.st_gid);
if (NULL == pw)
return -1;
*uid = (char*) malloc( sizeof(char) * strlen(pw->pw_name) );
strcpy(path[2],pw->pw_name);
if (NULL == grp)
return -1;
*gid = (char*) malloc( sizeof(char) * strlen(grp->gr_name) );
strcpy(path[3], grp->gr_name);
#endif
*size = st.st_size;
ret = 0;
}
return perm;
}
......@@ -481,7 +489,6 @@ void addSelectedToPlaylist(GtkTreeModel *model,
gtk_tree_model_get(model, iter, 0, &filename, -1);
/* Add to playlist object. */
PlaylistAddItem(GTK_WIDGET(userdata), filename);
}
......@@ -491,6 +498,7 @@ onFileListRow (GtkTreeView *treeview,
GtkTreeViewColumn *column,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(treeview) );
GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
if (gtk_tree_selection_count_selected_rows(selection) == 1)
......@@ -503,9 +511,28 @@ onFileListRow (GtkTreeView *treeview,
/* This might be a directory selection */
model = gtk_tree_view_get_model(treeview);
if (!model)
g_print( "Error: model is a null pointer\n" );
msg_Err(p_intf, "PDA: Filelist model contains a NULL pointer\n" );
if (path == NULL )
{
#if 0
GList* list;
list = gtk_tree_selection_get_selected_rows(selection,model);
if (g_list_length(list) == 1)
{
filename = (gchar *) g_list_nth_data(list,0);
msg_Dbg(p_intf, "PDA: filename = %s", (gchar*) filename );
PlaylistAddItem(GTK_WIDGET(treeview), filename);
}
g_list_foreach (list, gtk_tree_path_free, NULL);
g_list_free (list);
#endif
}
else
{
if (!gtk_tree_model_get_iter(model, &iter, path))
g_print( "Error: could not get iter from model\n" );
msg_Err( p_intf, "PDA: Could not get iter from model" );
gtk_tree_model_get(model, &iter, 0, &filename, -1);
......@@ -524,7 +551,7 @@ onFileListRow (GtkTreeView *treeview,
G_TYPE_STRING);
if (p_model)
{
ReadDirectory(p_model, filename);
ReadDirectory(p_intf, p_model, filename);
/* Update TreeView with new model */
gtk_tree_view_set_model(treeview, (GtkTreeModel*) p_model);
......@@ -537,31 +564,13 @@ onFileListRow (GtkTreeView *treeview,
}
}
}
}
else
{
gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc) &addSelectedToPlaylist, (gpointer) treeview);
}
}
void
onFileListColumns (GtkTreeView *treeview,
gpointer user_data)
{
g_print("onFileListColumn\n");
}
gboolean
onFileListRowSelected (GtkTreeView *treeview,
gboolean start_editing,
gpointer user_data)
{
g_print("onFileListRowSelected\n");
return FALSE;
}
void
onAddFileToPlaylist (GtkButton *button,
gpointer user_data)
......@@ -630,7 +639,7 @@ onAddNetworkPlaylist (GtkButton *button,
{
mrl_name = gtk_entry_get_text(p_mrl);
PlaylistAddItem(GTK_WIDGET(button), (gchar *)p_mrl);
PlaylistAddItem(GTK_WIDGET(button), (gchar *)mrl_name);
}
}
......@@ -639,6 +648,8 @@ void
onAddCameraToPlaylist (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
GtkSpinButton *entryV4LChannel = NULL;
GtkSpinButton *entryV4LFrequency = NULL;
GtkSpinButton *entryV4LSampleRate = NULL;
......@@ -721,9 +732,10 @@ onAddCameraToPlaylist (GtkButton *button,
/* end MJPEG only */
if (pos >= VLC_MAX_MRL)
{
v4l_mrl[VLC_MAX_MRL-1]='\0';
g_print( "%s\n", v4l_mrl );
msg_Err(p_intf, "Media Resource Locator is truncated to: %s", v4l_mrl);
}
PlaylistAddItem(GTK_WIDGET(button), (gchar*) &v4l_mrl);
}
......@@ -734,7 +746,6 @@ PlaylistEvent (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
g_print("onPlaylistEvent\n");
return FALSE;
}
......@@ -743,7 +754,6 @@ void
onPlaylistColumnsChanged (GtkTreeView *treeview,
gpointer user_data)
{
g_print("onPlaylistColumnsChanged\n");
}
......@@ -752,7 +762,6 @@ onPlaylistRowSelected (GtkTreeView *treeview,
gboolean start_editing,
gpointer user_data)
{
g_print("onPlaylistRowSelected\n");
return FALSE;
}
......@@ -763,7 +772,6 @@ onPlaylistRow (GtkTreeView *treeview,
GtkTreeViewColumn *column,
gpointer user_data)
{
g_print("onPlaylistRow\n");
}
......@@ -787,7 +795,9 @@ void
onClearPlaylist (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Clear playlist" );
}
......@@ -795,7 +805,9 @@ void
onPreferenceSave (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Preferences Save" );
}
......@@ -803,7 +815,9 @@ void
onPreferenceApply (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Preferences Apply" );
}
......@@ -811,23 +825,18 @@ void
onPreferenceCancel (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
msg_Dbg(p_intf, "Preferences Cancel" );
}
void
onNetworkMRLAdd (GtkContainer *container,
GtkWidget *widget,
gpointer user_data)
{
}
void
onAddTranscodeToPlaylist (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
GtkEntry *entryVideoCodec = NULL;
GtkSpinButton *entryVideoBitrate = NULL;
GtkSpinButton *entryVideoBitrateTolerance = NULL;
......@@ -907,11 +916,11 @@ onAddTranscodeToPlaylist (GtkButton *button,
pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, " --ttl=%d", (int)i_std_ttl);
if (pos >= VLC_MAX_MRL)
_mrl[VLC_MAX_MRL-1]='\0';
g_print( "%s\n", mrl );
{
mrl[VLC_MAX_MRL-1]='\0';
msg_Err(p_intf, "Media Resource Locator is truncated to: %s", mrl );
}
PlaylistAddItem(GTK_WIDGET(button), (gchar*) &mrl);
}
......
......@@ -2,7 +2,7 @@
* callbacks.h : pda plugin for vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: pda_callbacks.h,v 1.8 2003/11/09 21:29:52 jpsaman Exp $
* $Id: pda_callbacks.h,v 1.9 2003/11/18 20:36:40 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -26,7 +26,7 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
void ReadDirectory( GtkListStore *p_list, char *psz_dir );
void ReadDirectory( intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir );
#if 0
void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url );
#endif
......@@ -78,15 +78,6 @@ onFileListRow (GtkTreeView *treeview,
GtkTreeViewColumn *column,
gpointer user_data);
void
onFileListColumns (GtkTreeView *treeview,
gpointer user_data);
gboolean
onFileListRowSelected (GtkTreeView *treeview,
gboolean start_editing,
gpointer user_data);
void
onAddFileToPlaylist (GtkButton *button,
gpointer user_data);
......@@ -144,11 +135,6 @@ onPreferenceCancel (GtkButton *button,
gpointer user_data);
void
onNetworkMRLAdd (GtkContainer *container,
GtkWidget *widget,
gpointer user_data);
void
NetworkBuildMRL (GtkEditable *editable,
gpointer user_data);
......
......@@ -176,6 +176,8 @@ create_pda (void)
GtkWidget *ClearPlaylist;
GtkWidget *playlist;
GtkWidget *vbox2;
GtkWidget *scrolledwindowPreference;
GtkWidget *tvPreferences;
GtkWidget *hbox2;
GtkWidget *PreferenceSave;
GtkWidget *PreferenceApply;
......@@ -187,8 +189,8 @@ create_pda (void)
GtkWidget *aboutImage;
GtkWidget *labelDescription;
GtkWidget *labelAuthors;
GtkWidget *labelProgramName;
GtkWidget *labelCopyright;
GtkWidget *labelProgramName;
GtkWidget *about;
GtkTooltips *tooltips;
......@@ -303,7 +305,7 @@ create_pda (void)
timeSlider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (3, 0, 100, 1, 6.25, 0)));
gtk_widget_set_name (timeSlider, "timeSlider");
gtk_widget_show (timeSlider);
gtk_box_pack_start (GTK_BOX (vbox), timeSlider, FALSE, FALSE, 4);
gtk_box_pack_start (GTK_BOX (vbox), timeSlider, FALSE, TRUE, 4);
gtk_scale_set_draw_value (GTK_SCALE (timeSlider), FALSE);
gtk_scale_set_value_pos (GTK_SCALE (timeSlider), GTK_POS_RIGHT);
gtk_scale_set_digits (GTK_SCALE (timeSlider), 3);
......@@ -426,7 +428,7 @@ create_pda (void)
gtk_label_set_justify (GTK_LABEL (labelNetworkAddress), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labelNetworkAddress), 0, 0.5);
entryNetworkPort_adj = gtk_adjustment_new (1233, 0, 65535, 1, 10, 10);
entryNetworkPort_adj = gtk_adjustment_new (1234, 0, 65535, 1, 10, 10);
entryNetworkPort = gtk_spin_button_new (GTK_ADJUSTMENT (entryNetworkPort_adj), 1, 0);
gtk_widget_set_name (entryNetworkPort, "entryNetworkPort");
gtk_widget_show (entryNetworkPort);
......@@ -464,7 +466,6 @@ create_pda (void)
entryNetworkType = GTK_COMBO (comboNetworkType)->entry;
gtk_widget_set_name (entryNetworkType, "entryNetworkType");
gtk_widget_show (entryNetworkType);
gtk_entry_set_text (GTK_ENTRY (entryNetworkType), _("unicast"));
gtk_entry_set_activates_default (GTK_ENTRY (entryNetworkType), TRUE);
labelNetworkType = gtk_label_new (_("Network: "));
......@@ -498,7 +499,6 @@ create_pda (void)
entryNetworkProtocolType = GTK_COMBO (comboNetworkProtocolType)->entry;
gtk_widget_set_name (entryNetworkProtocolType, "entryNetworkProtocolType");
gtk_widget_show (entryNetworkProtocolType);
gtk_entry_set_text (GTK_ENTRY (entryNetworkProtocolType), _("udp"));
labelNetworkProtocol = gtk_label_new (_("Protocol:"));
gtk_widget_set_name (labelNetworkProtocol, "labelNetworkProtocol");
......@@ -672,7 +672,6 @@ create_pda (void)
entryV4LVideoDevice = GTK_COMBO (comboV4lVideoDevice)->entry;
gtk_widget_set_name (entryV4LVideoDevice, "entryV4LVideoDevice");
gtk_widget_show (entryV4LVideoDevice);
gtk_entry_set_text (GTK_ENTRY (entryV4LVideoDevice), _("/dev/video"));
gtk_entry_set_activates_default (GTK_ENTRY (entryV4LVideoDevice), TRUE);
comboV4lAudioDevice = gtk_combo_new ();
......@@ -693,7 +692,6 @@ create_pda (void)
entryV4LAudioDevice = GTK_COMBO (comboV4lAudioDevice)->entry;
gtk_widget_set_name (entryV4LAudioDevice, "entryV4LAudioDevice");
gtk_widget_show (entryV4LAudioDevice);
gtk_entry_set_text (GTK_ENTRY (entryV4LAudioDevice), _("/dev/dsp"));
gtk_entry_set_activates_default (GTK_ENTRY (entryV4LAudioDevice), TRUE);
entryV4LChannel_adj = gtk_adjustment_new (0, 0, 100, 1, 10, 10);
......@@ -723,7 +721,6 @@ create_pda (void)
entryV4LNorm = GTK_COMBO (comboV4LNorm)->entry;
gtk_widget_set_name (entryV4LNorm, "entryV4LNorm");
gtk_widget_show (entryV4LNorm);
gtk_entry_set_text (GTK_ENTRY (entryV4LNorm), _("pal"));
gtk_entry_set_activates_default (GTK_ENTRY (entryV4LNorm), TRUE);
comboV4LSize = gtk_combo_new ();
......@@ -747,7 +744,6 @@ create_pda (void)
entryV4LSize = GTK_COMBO (comboV4LSize)->entry;
gtk_widget_set_name (entryV4LSize, "entryV4LSize");
gtk_widget_show (entryV4LSize);
gtk_entry_set_text (GTK_ENTRY (entryV4LSize), _("240x192"));
gtk_entry_set_activates_default (GTK_ENTRY (entryV4LSize), TRUE);
entryV4LFrequency_adj = gtk_adjustment_new (8692, 0, 65535, 1, 10, 10);
......@@ -797,7 +793,6 @@ create_pda (void)
entryV4LSoundDirection = GTK_COMBO (comboV4LSoundDirection)->entry;
gtk_widget_set_name (entryV4LSoundDirection, "entryV4LSoundDirection");
gtk_widget_show (entryV4LSoundDirection);
gtk_entry_set_text (GTK_ENTRY (entryV4LSoundDirection), _("mono"));
gtk_entry_set_activates_default (GTK_ENTRY (entryV4LSoundDirection), TRUE);
entryV4LTuner_adj = gtk_adjustment_new (0, -1, 100, 1, 10, 10);
......@@ -896,7 +891,6 @@ create_pda (void)
entryVideoCodec = GTK_COMBO (comboVideoCodec)->entry;
gtk_widget_set_name (entryVideoCodec, "entryVideoCodec");
gtk_widget_show (entryVideoCodec);
gtk_entry_set_text (GTK_ENTRY (entryVideoCodec), _("huffyuv"));
gtk_entry_set_activates_default (GTK_ENTRY (entryVideoCodec), TRUE);
labelVideoBitrate = gtk_label_new (_("Video Bitrate:"));
......@@ -1006,7 +1000,6 @@ create_pda (void)
entryStdURL = GTK_COMBO (comboStdURL)->entry;
gtk_widget_set_name (entryStdURL, "entryStdURL");
gtk_widget_show (entryStdURL);
gtk_entry_set_text (GTK_ENTRY (entryStdURL), _("127.0.0.1"));
gtk_entry_set_activates_default (GTK_ENTRY (entryStdURL), TRUE);
comboStdMuxer = gtk_combo_new ();
......@@ -1024,7 +1017,6 @@ create_pda (void)
entryStdMuxer = GTK_COMBO (comboStdMuxer)->entry;
gtk_widget_set_name (entryStdMuxer, "entryStdMuxer");
gtk_widget_show (entryStdMuxer);
gtk_entry_set_text (GTK_ENTRY (entryStdMuxer), _("udp"));
gtk_entry_set_activates_default (GTK_ENTRY (entryStdMuxer), TRUE);
comboStdAccess = gtk_combo_new ();
......@@ -1043,7 +1035,6 @@ create_pda (void)
entryStdAccess = GTK_COMBO (comboStdAccess)->entry;
gtk_widget_set_name (entryStdAccess, "entryStdAccess");
gtk_widget_show (entryStdAccess);
gtk_entry_set_text (GTK_ENTRY (entryStdAccess), _("ts"));
gtk_entry_set_activates_default (GTK_ENTRY (entryStdAccess), TRUE);
entryAudioBitrate_adj = gtk_adjustment_new (256, 0, 65535, 1, 10, 10);
......@@ -1074,7 +1065,6 @@ create_pda (void)
entryAudioCodec = GTK_COMBO (comboAudioCodec)->entry;
gtk_widget_set_name (entryAudioCodec, "entryAudioCodec");
gtk_widget_show (entryAudioCodec);
gtk_entry_set_text (GTK_ENTRY (entryAudioCodec), _("alaw"));
gtk_entry_set_activates_default (GTK_ENTRY (entryAudioCodec), TRUE);
checkVideoDeinterlace = gtk_check_button_new_with_mnemonic (_("enable"));
......@@ -1185,6 +1175,17 @@ create_pda (void)
gtk_widget_show (vbox2);
gtk_container_add (GTK_CONTAINER (notebook), vbox2);
scrolledwindowPreference = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_name (scrolledwindowPreference, "scrolledwindowPreference");
gtk_widget_show (scrolledwindowPreference);
gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindowPreference, TRUE, TRUE, 0);
tvPreferences = gtk_tree_view_new ();
gtk_widget_set_name (tvPreferences, "tvPreferences");
gtk_widget_show (tvPreferences);
gtk_container_add (GTK_CONTAINER (scrolledwindowPreference), tvPreferences);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tvPreferences), FALSE);
hbox2 = gtk_hbox_new (TRUE, 0);
gtk_widget_set_name (hbox2, "hbox2");
gtk_widget_show (hbox2);
......@@ -1249,6 +1250,12 @@ create_pda (void)
gtk_label_set_justify (GTK_LABEL (labelAuthors), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (labelAuthors), TRUE);
labelCopyright = gtk_label_new (_("(C) 1996-2003 the VideoLAN team"));
gtk_widget_set_name (labelCopyright, "labelCopyright");
gtk_widget_show (labelCopyright);
gtk_fixed_put (GTK_FIXED (fixed2), labelCopyright, 16, 48);
gtk_widget_set_size_request (labelCopyright, 208, 16);
labelProgramName = gtk_label_new (_("VLC media player"));
gtk_widget_set_name (labelProgramName, "labelProgramName");
gtk_widget_show (labelProgramName);
......@@ -1256,12 +1263,6 @@ create_pda (void)
gtk_widget_set_size_request (labelProgramName, 152, 16);
gtk_label_set_line_wrap (GTK_LABEL (labelProgramName), TRUE);
labelCopyright = gtk_label_new (_("(C) 1996-2003 the VideoLAN team"));
gtk_widget_set_name (labelCopyright, "labelCopyright");
gtk_widget_show (labelCopyright);
gtk_fixed_put (GTK_FIXED (fixed2), labelCopyright, 16, 48);
gtk_widget_set_size_request (labelCopyright, 208, 16);
about = gtk_label_new (_("About"));
gtk_widget_set_name (about, "about");
gtk_widget_show (about);
......@@ -1297,15 +1298,9 @@ create_pda (void)
g_signal_connect ((gpointer) tvFileList, "row_activated",
G_CALLBACK (onFileListRow),
NULL);
g_signal_connect ((gpointer) tvFileList, "select_cursor_row",
G_CALLBACK (onFileListRowSelected),
NULL);
g_signal_connect ((gpointer) AddFileToPlaylist, "pressed",
G_CALLBACK (onAddFileToPlaylist),
NULL);
g_signal_connect ((gpointer) comboMRL, "add",
G_CALLBACK (onNetworkMRLAdd),
NULL);
g_signal_connect ((gpointer) entryNetworkPort, "changed",
G_CALLBACK (NetworkBuildMRL),
NULL);
......@@ -1479,6 +1474,8 @@ create_pda (void)
GLADE_HOOKUP_OBJECT (pda, ClearPlaylist, "ClearPlaylist");
GLADE_HOOKUP_OBJECT (pda, playlist, "playlist");
GLADE_HOOKUP_OBJECT (pda, vbox2, "vbox2");
GLADE_HOOKUP_OBJECT (pda, scrolledwindowPreference, "scrolledwindowPreference");
GLADE_HOOKUP_OBJECT (pda, tvPreferences, "tvPreferences");
GLADE_HOOKUP_OBJECT (pda, hbox2, "hbox2");
GLADE_HOOKUP_OBJECT (pda, PreferenceSave, "PreferenceSave");
GLADE_HOOKUP_OBJECT (pda, PreferenceApply, "PreferenceApply");
......@@ -1490,8 +1487,8 @@ create_pda (void)
GLADE_HOOKUP_OBJECT (pda, aboutImage, "aboutImage");
GLADE_HOOKUP_OBJECT (pda, labelDescription, "labelDescription");
GLADE_HOOKUP_OBJECT (pda, labelAuthors, "labelAuthors");
GLADE_HOOKUP_OBJECT (pda, labelProgramName, "labelProgramName");
GLADE_HOOKUP_OBJECT (pda, labelCopyright, "labelCopyright");
GLADE_HOOKUP_OBJECT (pda, labelProgramName, "labelProgramName");
GLADE_HOOKUP_OBJECT (pda, about, "about");
GLADE_HOOKUP_OBJECT_NO_REF (pda, tooltips, "tooltips");
......
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