Commit 5f02f262 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Updated PDA interface.

parent 9e8b6d1f
......@@ -2,7 +2,7 @@
* pda.c : PDA Gtk2 plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: pda.c,v 1.21 2004/02/13 10:09:46 jpsaman Exp $
* $Id: pda.c,v 1.22 2004/02/29 22:59:59 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org>
......@@ -63,7 +63,7 @@ gint E_(GtkModeManage) ( intf_thread_t * p_intf );
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("PDA Linux Gtk2+ interface") );
set_description( N_("PDA Linux Gtk2+ interface") );
// add_bool( "pda-autoplayfile", 1, GtkAutoPlayFile, AUTOPLAYFILE_TEXT, AUTOPLAYFILE_LONGTEXT, VLC_TRUE );
set_capability( "interface", 70 );
set_callbacks( Open, Close );
......@@ -214,31 +214,31 @@ static void Run( intf_thread_t *p_intf )
/* Insert columns 0 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 0, _("Filename"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 0, (gchar *) N_("Filename"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 0 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
gtk_tree_view_column_set_sort_column_id(p_column, 0);
/* Insert columns 1 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 1, _("Permissions"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 1, (gchar *) N_("Permissions"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 1 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(p_column, 1);
/* Insert columns 2 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 2, _("Size"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 2, (gchar *) N_("Size"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 2 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(p_column, 2);
/* Insert columns 3 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 3, _("Owner"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 3, (gchar *) N_("Owner"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 3 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 3 );
gtk_tree_view_column_set_sort_column_id(p_column, 3);
/* Insert columns 4 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 4, _("Group"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 4, (gchar *) N_("Group"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 4 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 4 );
gtk_tree_view_column_set_sort_column_id(p_column, 4);
......@@ -269,20 +269,20 @@ static void Run( intf_thread_t *p_intf )
/* Columns 1 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 0, _("Filename"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 0, (gchar *) N_("Filename"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 0 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
gtk_tree_view_column_set_sort_column_id(p_column, 0);
/* Column 2 */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 1, _("Time"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 1, (gchar *) N_("Time"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(p_column, 1);
#if 0
/* Column 3 - is a hidden column used for reliable deleting items from the underlying playlist */
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, _("Index"), p_renderer, NULL);
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, (gchar *) N_("Index"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(p_column, 2);
......
This diff is collapsed.
......@@ -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.28 2004/02/13 10:09:46 jpsaman Exp $
* $Id: pda_callbacks.c,v 1.29 2004/02/29 22:59:59 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -321,7 +321,7 @@ static char *get_file_perms(const struct stat st)
psz_perm[8]= 'w';
if (st.st_mode & S_IXOTH)
{
// 'sticky' bit
/* 'sticky' bit */
if (st.st_mode &S_ISVTX)
psz_perm[9] = 't';
else
......@@ -424,7 +424,7 @@ void onAbout(GtkButton *button, gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(button) );
// Toggle notebook
/* Toggle notebook */
if (p_intf->p_sys->p_notebook)
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
......@@ -588,17 +588,27 @@ void NetworkBuildMRL(GtkEditable *editable, gpointer user_data)
void onAddNetworkPlaylist(GtkButton *button, gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
GtkEntry *p_mrl = NULL;
GtkCheckButton *p_network_transcode = NULL;
gboolean b_network_transcode;
const gchar *psz_mrl_name;
p_mrl = (GtkEntry*) lookup_widget(GTK_WIDGET(button),"entryMRL" );
if (p_mrl)
{
psz_mrl_name = gtk_entry_get_text(p_mrl);
if (psz_mrl_name != NULL)
p_network_transcode = (GtkCheckButton*) lookup_widget(GTK_WIDGET(button), "checkNetworkTranscode" );
b_network_transcode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_network_transcode));
if (b_network_transcode)
{
PlaylistAddItem(GTK_WIDGET(button), (gchar *)psz_mrl_name, 0, 0);
msg_Dbg( p_intf, "Network transcode option selected." );
onAddTranscodeToPlaylist(GTK_WIDGET(button), (gchar *)psz_mrl_name);
}
else
{
msg_Dbg( p_intf, "Network receiving selected." );
PlaylistAddItem(GTK_WIDGET(button), (gchar *)psz_mrl_name, 0, 0);
}
}
......@@ -636,6 +646,9 @@ void onAddCameraToPlaylist(GtkButton *button, gpointer user_data)
gint i_v4l_decimation;
/* end MJPEG only */
GtkCheckButton *p_check_v4l_transcode = NULL;
gboolean b_v4l_transcode;
char **ppsz_options = NULL; /* list of options */
int i_options=0;
char v4l_mrl[6];
......@@ -723,7 +736,18 @@ void onAddCameraToPlaylist(GtkButton *button, gpointer user_data)
}
/* end MJPEG only */
p_check_v4l_transcode = (GtkCheckButton*) lookup_widget(GTK_WIDGET(button), "checkV4LTranscode" );
b_v4l_transcode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_check_v4l_transcode));
if (b_v4l_transcode)
{
msg_Dbg( p_intf, "Camera transcode option selected." );
onAddTranscodeToPlaylist(GTK_WIDGET(button), (gchar *)v4l_mrl);
}
else
{
msg_Dbg( p_intf, "Camera reception option selected." );
PlaylistAddItem(GTK_WIDGET(button), (gchar*) &v4l_mrl, ppsz_options, i_options);
}
}
......@@ -1018,6 +1042,11 @@ void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data)
}
}
/* Update the playlist */
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL ) return;
/* Get all the options. */
i_pos = snprintf( &mrl[0], VLC_MAX_MRL, "sout");
mrl[6] = '\0';
/* option 1 */
......@@ -1065,7 +1094,7 @@ void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data)
/* option 2 */
i_pos = 0;
i_pos = snprintf( &ppsz_options[i_options++][i_pos], VLC_MAX_MRL - i_pos, "dst=" );
i_pos = snprintf( &ppsz_options[i_options++][i_pos], VLC_MAX_MRL - i_pos, "#" );
if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0';
p_entryStdAccess = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdAccess" );
......@@ -1081,13 +1110,6 @@ void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data)
b_sap_announce = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_checkSAP));
b_slp_announce = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_checkSLP));
if ( strncasecmp( (const char*)p_std_access, "display", 7 ) == 0)
{
i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "%s,", (char*)p_std_access);
if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0';
}
else
{
i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "std{access=%s,", (char*)p_std_access);
if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0';
i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "mux=%s,", (char*)p_std_muxer);
......@@ -1108,20 +1130,23 @@ void onAddTranscodeToPlaylist(GtkButton *button, gpointer user_data)
if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0';
}
}
i_pos += snprintf( &ppsz_options[i_options][i_pos], VLC_MAX_MRL - i_pos, "}");
if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0';
i_std_ttl = gtk_spin_button_get_value_as_int(p_entryStdTTL);
i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "ttl=%d", (int)i_std_ttl);
i_pos += snprintf( &ppsz_options[i_options++][i_pos], VLC_MAX_MRL - i_pos, "ttl=%d}", (int)i_std_ttl);
if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0';
}
if (user_data != NULL)
{
msg_Dbg(p_intf, "Adding transcoding options to playlist item." );
}
else
{
msg_Dbg(p_intf, "Adding --sout to playlist." );
PlaylistAddItem(GTK_WIDGET(button), (gchar*) &mrl, ppsz_options, i_options);
}
}
void onEntryStdAccessChanged(GtkEditable *editable, gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( editable );
......
This diff is collapsed.
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