1 /*****************************************************************************
2 * pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
3 *****************************************************************************
4 * Copyright (C) 2000, 2001 VideoLAN
5 * $Id: pda_callbacks.c,v 1.13 2003/11/09 21:29:52 jpsaman Exp $
7 * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <sys/types.h> /* off_t */
45 #include "pda_callbacks.h"
46 #include "pda_interface.h"
47 #include "pda_support.h"
50 #define VLC_MAX_MRL 256
52 static char* get_file_stat(const char *path, uid_t *uid, gid_t *gid, off_t *size);
54 /*****************************************************************************
55 * Useful function to retrieve p_intf
56 ****************************************************************************/
57 void * E_(__GtkGetIntf)( GtkWidget * widget )
61 if( GTK_IS_MENU_ITEM( widget ) )
63 /* Look for a GTK_MENU */
64 while( widget->parent && !GTK_IS_MENU( widget ) )
66 widget = widget->parent;
69 /* Maybe this one has the data */
70 p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
76 /* Otherwise, the parent widget has it */
77 widget = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
80 /* We look for the top widget */
81 widget = gtk_widget_get_toplevel( GTK_WIDGET( widget ) );
83 p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
88 void PlaylistAddItem( GtkWidget *widget, gchar *name)
90 GtkTreeView *p_tvplaylist = NULL;
92 /* Add to playlist object. */
93 p_tvplaylist = (GtkTreeView *) lookup_widget( GTK_WIDGET(widget), "tvPlaylist");
96 GtkTreeModel *p_play_model;
97 GtkTreeIter p_play_iter;
99 p_play_model = gtk_tree_view_get_model(p_tvplaylist);
103 /* Add a new row to the playlist treeview model */
104 gtk_list_store_append (GTK_LIST_STORE(p_play_model), &p_play_iter);
105 gtk_list_store_set (GTK_LIST_STORE(p_play_model), &p_play_iter,
106 0, name, /* Add path to it !!! */
113 void PlaylistRebuildListStore( GtkListStore * p_list, playlist_t * p_playlist )
117 gchar * ppsz_text[2];
123 vlc_mutex_lock( &p_playlist->object_lock );
124 for( i_dummy = p_playlist->i_size ; i_dummy-- ; )
126 ppsz_text[0] = p_playlist->pp_items[i_dummy]->psz_name;
127 ppsz_text[1] = "no info";
128 gtk_list_store_append (p_list, &iter);
129 gtk_list_store_set (p_list, &iter,
134 vlc_mutex_unlock( &p_playlist->object_lock );
138 void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
140 intf_thread_t *p_intf = GtkGetIntf( widget );
141 playlist_t *p_playlist;
142 GtkTreeView *p_tvplaylist;
144 p_playlist = (playlist_t *)
145 vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
147 if( p_playlist == NULL)
154 if (p_intf->p_sys->b_autoplayfile)
156 playlist_Add( p_playlist, (char*)psz_url, 0, 0,
157 PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END);
161 playlist_Add( p_playlist, (char*)psz_url, 0, 0,
162 PLAYLIST_APPEND, PLAYLIST_END );
164 vlc_object_release( p_playlist );
166 p_tvplaylist = (GtkTreeView*) lookup_widget( GTK_WIDGET(widget), "tvPlaylist" );
169 GtkListStore *p_liststore;
170 p_liststore = (GtkListStore *) gtk_tree_view_get_model(p_tvplaylist);
171 PlaylistRebuildListStore(p_liststore, p_playlist);
177 /*****************************************************************
178 * Read directory helper function.
179 ****************************************************************/
180 void ReadDirectory(GtkListStore *p_list, char *psz_dir )
183 struct dirent **namelist;
186 g_print("changing to dir %s\n", psz_dir);
189 status = chdir(psz_dir);
191 g_print( "permision denied\n" );
193 n = scandir(".", &namelist, 0, alphasort);
205 /* XXX : kludge temporaire pour yopy */
207 ppsz_text[1] = get_file_stat("..", &uid, &gid, &size);
212 /* Add a new row to the model */
213 gtk_list_store_append (p_list, &iter);
214 gtk_list_store_set (p_list, &iter,
222 if (ppsz_text[1]) free(ppsz_text[1]);
227 if (namelist[i]->d_name[0] != '.')
229 /* This is a list of strings. */
230 ppsz_text[0] = namelist[i]->d_name;
231 ppsz_text[1] = get_file_stat(namelist[i]->d_name, &uid, &gid, &size);
236 g_print( "(%d) file: %s permission: %s user: %ull group: %ull size: %ull\n", i, ppsz_text[0], ppsz_text[1], uid, gid, size );
238 gtk_list_store_append (p_list, &iter);
239 gtk_list_store_set (p_list, &iter,
247 if (ppsz_text[1]) free(ppsz_text[1]);
254 static char* get_file_stat(const char *path, uid_t *uid, gid_t *gid, off_t *size)
259 perm = (char *) malloc(sizeof(char)*10);
260 strncpy( perm, "----------", sizeof("----------"));
261 if (lstat(path, &st)==0)
263 /* user, group, filesize */
267 /* determine permission modes */
268 if (S_ISLNK(st.st_mode))
270 else if (S_ISDIR(st.st_mode))
272 else if (S_ISCHR(st.st_mode))
274 else if (S_ISBLK(st.st_mode))
276 else if (S_ISFIFO(st.st_mode))
278 else if (S_ISSOCK(st.st_mode))
280 else if (S_ISREG(st.st_mode))
282 else /* Unknown type is an error */
284 /* Get file permissions */
286 if (st.st_mode & S_IRUSR)
288 if (st.st_mode & S_IWUSR)
290 if (st.st_mode & S_IXUSR)
292 if (st.st_mode & S_ISUID)
297 else if (st.st_mode & S_ISUID)
300 if (st.st_mode & S_IRGRP)
302 if (st.st_mode & S_IWGRP)
304 if (st.st_mode & S_IXGRP)
306 if (st.st_mode & S_ISGID)
311 else if (st.st_mode & S_ISGID)
314 if (st.st_mode & S_IROTH)
316 if (st.st_mode & S_IWOTH)
318 if (st.st_mode & S_IXOTH)
321 if (st.st_mode &S_ISVTX)
326 else if (st.st_mode &S_ISVTX)
333 * Main interface callbacks
337 onPDADeleteEvent (GtkWidget *widget,
341 intf_thread_t *p_intf = GtkGetIntf( widget );
343 msg_Dbg( p_intf, "about to exit vlc ... " );
344 vlc_mutex_lock( &p_intf->change_lock );
345 p_intf->p_vlc->b_die = VLC_TRUE;
346 vlc_mutex_unlock( &p_intf->change_lock );
347 msg_Dbg( p_intf, "about to exit vlc ... signalled" );
354 onRewind (GtkButton *button,
357 intf_thread_t * p_intf = GtkGetIntf( button );
359 if (p_intf->p_sys->p_input != NULL)
361 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER );
367 onPause (GtkButton *button,
370 intf_thread_t * p_intf = GtkGetIntf( button );
372 if (p_intf->p_sys->p_input != NULL)
374 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
380 onPlay (GtkButton *button,
383 intf_thread_t * p_intf = GtkGetIntf( GTK_WIDGET( button ) );
384 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
388 vlc_mutex_lock( &p_playlist->object_lock );
389 if (p_playlist->i_size)
391 vlc_mutex_unlock( &p_playlist->object_lock );
392 playlist_Play( p_playlist );
396 vlc_mutex_unlock( &p_playlist->object_lock );
398 vlc_object_release( p_playlist );
404 onStop (GtkButton *button,
407 intf_thread_t * p_intf = GtkGetIntf( GTK_WIDGET( button ) );
408 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
412 playlist_Stop( p_playlist );
413 vlc_object_release( p_playlist );
419 onForward (GtkButton *button,
422 intf_thread_t *p_intf = GtkGetIntf( button );
424 if (p_intf->p_sys->p_input != NULL)
426 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_FASTER );
432 onAbout (GtkButton *button,
435 intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(button) );
438 if (p_intf->p_sys->p_notebook)
440 gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
441 gtk_notebook_set_page(p_intf->p_sys->p_notebook,6);
447 SliderRelease (GtkWidget *widget,
448 GdkEventButton *event,
451 intf_thread_t *p_intf = GtkGetIntf( widget );
453 vlc_mutex_lock( &p_intf->change_lock );
454 p_intf->p_sys->b_slider_free = 1;
455 vlc_mutex_unlock( &p_intf->change_lock );
462 SliderPress (GtkWidget *widget,
463 GdkEventButton *event,
466 intf_thread_t *p_intf = GtkGetIntf( widget );
468 vlc_mutex_lock( &p_intf->change_lock );
469 p_intf->p_sys->b_slider_free = 0;
470 vlc_mutex_unlock( &p_intf->change_lock );
475 void addSelectedToPlaylist(GtkTreeModel *model,
482 gtk_tree_model_get(model, iter, 0, &filename, -1);
484 /* Add to playlist object. */
485 PlaylistAddItem(GTK_WIDGET(userdata), filename);
489 onFileListRow (GtkTreeView *treeview,
491 GtkTreeViewColumn *column,
494 GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
496 if (gtk_tree_selection_count_selected_rows(selection) == 1)
503 /* This might be a directory selection */
504 model = gtk_tree_view_get_model(treeview);
506 g_print( "Error: model is a null pointer\n" );
507 if (!gtk_tree_model_get_iter(model, &iter, path))
508 g_print( "Error: could not get iter from model\n" );
510 gtk_tree_model_get(model, &iter, 0, &filename, -1);
512 if (stat((char*)filename, &st)==0)
514 if (S_ISDIR(st.st_mode))
516 GtkListStore *p_model = NULL;
518 /* Get new directory listing */
519 p_model = gtk_list_store_new (5,
527 ReadDirectory(p_model, filename);
529 /* Update TreeView with new model */
530 gtk_tree_view_set_model(treeview, (GtkTreeModel*) p_model);
531 g_object_unref(p_model);
536 gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc) &addSelectedToPlaylist, (gpointer) treeview);
542 gtk_tree_selection_selected_foreach(selection, (GtkTreeSelectionForeachFunc) &addSelectedToPlaylist, (gpointer) treeview);
548 onFileListColumns (GtkTreeView *treeview,
551 g_print("onFileListColumn\n");
556 onFileListRowSelected (GtkTreeView *treeview,
557 gboolean start_editing,
560 g_print("onFileListRowSelected\n");
566 onAddFileToPlaylist (GtkButton *button,
569 GtkTreeView *treeview = NULL;
571 treeview = (GtkTreeView *) lookup_widget( GTK_WIDGET(button), "tvFileList");
574 onFileListRow(treeview, NULL, NULL, NULL );
580 NetworkBuildMRL (GtkEditable *editable,
583 GtkSpinButton *networkPort = NULL;
584 GtkEntry *entryMRL = NULL;
585 GtkEntry *networkType = NULL;
586 GtkEntry *networkAddress = NULL;
587 GtkEntry *networkProtocol = NULL;
588 const gchar *mrlNetworkType;
589 const gchar *mrlAddress;
590 const gchar *mrlProtocol;
592 char text[VLC_MAX_MRL];
595 entryMRL = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryMRL" );
597 networkType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkType" );
598 networkAddress = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkAddress" );
599 networkPort = (GtkSpinButton*) lookup_widget( GTK_WIDGET(editable), "entryNetworkPort" );
600 networkProtocol = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkProtocolType" );
602 mrlNetworkType = gtk_entry_get_text(GTK_ENTRY(networkType));
603 mrlAddress = gtk_entry_get_text(GTK_ENTRY(networkAddress));
604 mrlPort = gtk_spin_button_get_value_as_int(networkPort);
605 mrlProtocol = gtk_entry_get_text(GTK_ENTRY(networkProtocol));
607 /* Build MRL from parts ;-) */
608 pos = snprintf( &text[0], VLC_MAX_MRL, "%s://", (char*)mrlProtocol);
609 if (strncasecmp( (char*)mrlNetworkType, "multicast",9)==0)
611 pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "@" );
613 pos += snprintf( &text[pos], VLC_MAX_MRL - pos, "%s:%d", (char*)mrlAddress, (int)mrlPort );
615 if (pos >= VLC_MAX_MRL)
616 text[VLC_MAX_MRL-1]='\0';
618 gtk_entry_set_text(entryMRL,text);
622 onAddNetworkPlaylist (GtkButton *button,
625 GtkEntry *p_mrl = NULL;
626 const gchar *mrl_name;
628 p_mrl = (GtkEntry*) lookup_widget(GTK_WIDGET(button),"entryMRL" );
631 mrl_name = gtk_entry_get_text(p_mrl);
633 PlaylistAddItem(GTK_WIDGET(button), (gchar *)p_mrl);
639 onAddCameraToPlaylist (GtkButton *button,
642 GtkSpinButton *entryV4LChannel = NULL;
643 GtkSpinButton *entryV4LFrequency = NULL;
644 GtkSpinButton *entryV4LSampleRate = NULL;
645 GtkSpinButton *entryV4LQuality = NULL;
646 GtkSpinButton *entryV4LTuner = NULL;
648 gint i_v4l_frequency;
649 gint i_v4l_samplerate;
653 GtkEntry *entryV4LVideoDevice = NULL;
654 GtkEntry *entryV4LAudioDevice = NULL;
655 GtkEntry *entryV4LNorm = NULL;
656 GtkEntry *entryV4LSize = NULL;
657 GtkEntry *entryV4LSoundDirection = NULL;
658 const gchar *p_v4l_video_device;
659 const gchar *p_v4l_audio_device;
660 const gchar *p_v4l_norm;
661 const gchar *p_v4l_size;
662 const gchar *p_v4l_sound_direction;
665 GtkCheckButton *checkV4LMJPEG = NULL;
666 GtkSpinButton *entryV4LDecimation = NULL;
667 gboolean b_v4l_mjpeg;
668 gint i_v4l_decimation;
671 char v4l_mrl[VLC_MAX_MRL];
674 pos = snprintf( &v4l_mrl[0], VLC_MAX_MRL, "v4l://");
676 entryV4LChannel = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LChannel" );
677 entryV4LFrequency = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LFrequency" );
678 entryV4LSampleRate = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LSampleRate" );
679 entryV4LQuality = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LQuality" );
680 entryV4LTuner = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LTuner" );
682 entryV4LVideoDevice = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LVideoDevice" );
683 entryV4LAudioDevice = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LAudioDevice" );
684 entryV4LNorm = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LNorm" );
685 entryV4LSize = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LSize" );
686 entryV4LSoundDirection = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LSoundDirection" );
688 i_v4l_channel = gtk_spin_button_get_value_as_int(entryV4LChannel);
689 i_v4l_frequency = gtk_spin_button_get_value_as_int(entryV4LFrequency);
690 i_v4l_samplerate = gtk_spin_button_get_value_as_int(entryV4LSampleRate);
691 i_v4l_quality = gtk_spin_button_get_value_as_int(entryV4LQuality);
692 i_v4l_tuner = gtk_spin_button_get_value_as_int(entryV4LTuner);
694 p_v4l_video_device = gtk_entry_get_text(GTK_ENTRY(entryV4LVideoDevice));
695 p_v4l_audio_device = gtk_entry_get_text(GTK_ENTRY(entryV4LAudioDevice));
696 p_v4l_norm = gtk_entry_get_text(GTK_ENTRY(entryV4LNorm));
697 p_v4l_size = gtk_entry_get_text(GTK_ENTRY(entryV4LSize));
698 p_v4l_sound_direction = gtk_entry_get_text(GTK_ENTRY(entryV4LSoundDirection));
700 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":%s", (char*)p_v4l_video_device );
701 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":adev=%s", (char*)p_v4l_audio_device );
702 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":norm=%s", (char*)p_v4l_norm );
703 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":size=%s", (char*)p_v4l_size );
704 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":%s", (char*)p_v4l_sound_direction );
706 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":channel=%d", (int)i_v4l_channel );
707 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":frequency=%d", (int)i_v4l_frequency );
708 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":samplerate=%d", (int)i_v4l_samplerate );
709 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":quality=%d", (int)i_v4l_quality );
710 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":tuner=%d", (int)i_v4l_tuner );
713 checkV4LMJPEG = (GtkCheckButton*) lookup_widget( GTK_WIDGET(button), "checkV4LMJPEG" );
714 b_v4l_mjpeg = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkV4LMJPEG));
717 entryV4LDecimation = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LDecimation" );
718 i_v4l_decimation = gtk_spin_button_get_value_as_int(entryV4LDecimation);
719 pos += snprintf( &v4l_mrl[pos], VLC_MAX_MRL - pos, ":mjpeg:%d", (int)i_v4l_decimation );
723 if (pos >= VLC_MAX_MRL)
724 v4l_mrl[VLC_MAX_MRL-1]='\0';
726 g_print( "%s\n", v4l_mrl );
728 PlaylistAddItem(GTK_WIDGET(button), (gchar*) &v4l_mrl);
733 PlaylistEvent (GtkWidget *widget,
737 g_print("onPlaylistEvent\n");
743 onPlaylistColumnsChanged (GtkTreeView *treeview,
746 g_print("onPlaylistColumnsChanged\n");
751 onPlaylistRowSelected (GtkTreeView *treeview,
752 gboolean start_editing,
755 g_print("onPlaylistRowSelected\n");
761 onPlaylistRow (GtkTreeView *treeview,
763 GtkTreeViewColumn *column,
766 g_print("onPlaylistRow\n");
771 onUpdatePlaylist (GtkButton *button,
779 onDeletePlaylist (GtkButton *button,
787 onClearPlaylist (GtkButton *button,
795 onPreferenceSave (GtkButton *button,
803 onPreferenceApply (GtkButton *button,
811 onPreferenceCancel (GtkButton *button,
820 onNetworkMRLAdd (GtkContainer *container,
828 onAddTranscodeToPlaylist (GtkButton *button,
831 GtkEntry *entryVideoCodec = NULL;
832 GtkSpinButton *entryVideoBitrate = NULL;
833 GtkSpinButton *entryVideoBitrateTolerance = NULL;
834 GtkSpinButton *entryVideoKeyFrameInterval = NULL;
835 GtkCheckButton *checkVideoDeinterlace = NULL;
836 GtkEntry *entryAudioCodec = NULL;
837 GtkSpinButton *entryAudioBitrate = NULL;
838 const gchar *p_video_codec;
839 gint i_video_bitrate;
840 gint i_video_bitrate_tolerance;
841 gint i_video_keyframe_interval;
842 gboolean b_video_deinterlace;
843 const gchar *p_audio_codec;
844 gint i_audio_bitrate;
846 GtkEntry *entryStdAccess = NULL;
847 GtkEntry *entryStdMuxer = NULL;
848 GtkEntry *entryStdURL = NULL;
849 GtkSpinButton *entryStdTTL = NULL;
850 const gchar *p_std_access;
851 const gchar *p_std_muxer;
852 const gchar *p_std_url;
855 gchar mrl[VLC_MAX_MRL];
858 pos = snprintf( &mrl[0], VLC_MAX_MRL, "--sout '#transcode{");
860 entryVideoCodec = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryVideoCodec" );
861 entryVideoBitrate = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryVideoBitrate" );
862 entryVideoBitrateTolerance = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryVideoBitrateTolerance" );
863 entryVideoKeyFrameInterval = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryVideoKeyFrameInterval" );
865 p_video_codec = gtk_entry_get_text(GTK_ENTRY(entryVideoCodec));
866 i_video_bitrate = gtk_spin_button_get_value_as_int(entryVideoBitrate);
867 i_video_bitrate_tolerance = gtk_spin_button_get_value_as_int(entryVideoBitrateTolerance);
868 i_video_keyframe_interval = gtk_spin_button_get_value_as_int(entryVideoKeyFrameInterval);
870 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "vcodec=%s,", (char*)p_video_codec );
871 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "vb=%d,", (int)i_video_bitrate );
872 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "vt=%d,", (int)i_video_bitrate_tolerance );
873 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "keyint=%d,", (int)i_video_keyframe_interval );
875 checkVideoDeinterlace = (GtkCheckButton*) lookup_widget( GTK_WIDGET(button), "checkVideoDeinterlace" );
876 b_video_deinterlace = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkVideoDeinterlace));
877 if (b_video_deinterlace)
879 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "deinterlace," );
881 entryAudioCodec = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryAudioCodec" );
882 entryAudioBitrate = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryAudioBitrate" );
884 p_audio_codec = gtk_entry_get_text(GTK_ENTRY(entryAudioCodec));
885 i_audio_bitrate = gtk_spin_button_get_value_as_int(entryAudioBitrate);
887 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "acodec=%s,", (char*)p_audio_codec );
888 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "ab=%d", (int)i_audio_bitrate );
890 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "}:std{" );
892 entryStdAccess = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdAccess" );
893 entryStdMuxer = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdMuxer" );
894 entryStdURL = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryStdURL" );
895 entryStdTTL = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryStdTTL" );
897 p_std_access = gtk_entry_get_text(GTK_ENTRY(entryStdAccess));
898 p_std_muxer = gtk_entry_get_text(GTK_ENTRY(entryStdMuxer));
899 p_std_url = gtk_entry_get_text(GTK_ENTRY(entryStdURL));
901 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "access=%s,", (char*)p_std_access);
902 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "mux=%s,", (char*)p_std_muxer);
903 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "url=%s", (char*)p_std_url);
904 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, "}'");
906 i_std_ttl = gtk_spin_button_get_value_as_int(entryStdTTL);
908 pos += snprintf( &mrl[pos], VLC_MAX_MRL - pos, " --ttl=%d", (int)i_std_ttl);
911 if (pos >= VLC_MAX_MRL)
912 _mrl[VLC_MAX_MRL-1]='\0';
914 g_print( "%s\n", mrl );
916 PlaylistAddItem(GTK_WIDGET(button), (gchar*) &mrl);