?? pda_callbacks.c
字號:
else { vlc_object_unlock( p_playlist ); } pl_Release( p_intf ); }}void onStop(GtkButton *button, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) ); playlist_t *p_playlist = pl_Yield( p_intf ); if (p_playlist) { playlist_Stop( p_playlist ); pl_Release( p_intf ); gdk_window_raise( p_intf->p_sys->p_window->window ); }}void onForward(GtkButton *button, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( button ); if (p_intf->p_sys->p_input != NULL) { var_SetVoid( p_intf->p_sys->p_input, "rate-faster" ); }}void onAbout(GtkButton *button, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(button) ); /* Toggle notebook */ if (p_intf->p_sys->p_notebook) { gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) ); gtk_notebook_set_page(p_intf->p_sys->p_notebook,6); }}gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( widget ); msg_Dbg( p_intf, "SliderButton Release" ); vlc_mutex_lock( &p_intf->change_lock ); p_intf->p_sys->b_slider_free = 1; vlc_mutex_unlock( &p_intf->change_lock ); return TRUE;}gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( widget ); msg_Dbg( p_intf, "SliderButton Press" ); vlc_mutex_lock( &p_intf->change_lock ); p_intf->p_sys->b_slider_free = 0; vlc_mutex_unlock( &p_intf->change_lock ); return FALSE;}void SliderMove(GtkRange *range, GtkScrollType scroll, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( range ); msg_Dbg( p_intf, "SliderButton Move" );}static void addSelectedToPlaylist(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer *userdata){ gchar *psz_filename; gtk_tree_model_get(model, iter, 0, &psz_filename, -1); PlaylistAddItem(GTK_WIDGET(userdata), psz_filename, 0, 0);}void onFileListRow(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(treeview) ); GtkTreeSelection *p_selection = gtk_tree_view_get_selection(treeview); if (gtk_tree_selection_count_selected_rows(p_selection) == 1) { struct stat st; GtkTreeModel *p_model; GtkTreeIter iter; char *psz_filename; /* This might be a directory selection */ p_model = gtk_tree_view_get_model(treeview); if (!p_model) { msg_Err(p_intf, "PDA: Filelist model contains a NULL pointer\n" ); return; } if (!gtk_tree_model_get_iter(p_model, &iter, path)) { msg_Err( p_intf, "PDA: Could not get iter from model" ); return; } gtk_tree_model_get(p_model, &iter, 0, &psz_filename, -1); if (stat((char*)psz_filename, &st)==0) { if (S_ISDIR(st.st_mode)) { GtkListStore *p_store = NULL; /* Get new directory listing */ p_store = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_STRING, G_TYPE_STRING); if (p_store) { ReadDirectory(p_intf, p_store, psz_filename); /* Update TreeView with new model */ gtk_tree_view_set_model(treeview, (GtkTreeModel*) p_store); g_object_unref(p_store); } } } }}void onAddFileToPlaylist(GtkButton *button, gpointer user_data){ GtkTreeView *p_treeview = NULL; p_treeview = (GtkTreeView *) lookup_widget( GTK_WIDGET(button), "tvFileList"); if (p_treeview) { GtkTreeSelection *p_selection = gtk_tree_view_get_selection(p_treeview); gtk_tree_selection_selected_foreach(p_selection, (GtkTreeSelectionForeachFunc) &addSelectedToPlaylist, (gpointer) p_treeview); }}void NetworkBuildMRL(GtkEditable *editable, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(editable) ); GtkSpinButton *p_networkPort = NULL; GtkEntry *p_entryMRL = NULL; GtkEntry *p_networkType = NULL; GtkEntry *p_networkAddress = NULL; GtkEntry *p_networkProtocol = NULL; const gchar *psz_mrlNetworkType; const gchar *psz_mrlAddress; const gchar *psz_mrlProtocol; gint i_mrlPort; char text[VLC_MAX_MRL]; int i_pos = 0; p_entryMRL = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryMRL" ); p_networkType = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkType" ); p_networkAddress = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkAddress" ); p_networkPort = (GtkSpinButton*) lookup_widget( GTK_WIDGET(editable), "entryNetworkPort" ); p_networkProtocol = (GtkEntry*) lookup_widget( GTK_WIDGET(editable), "entryNetworkProtocolType" ); psz_mrlNetworkType = gtk_entry_get_text(GTK_ENTRY(p_networkType)); psz_mrlAddress = gtk_entry_get_text(GTK_ENTRY(p_networkAddress)); i_mrlPort = gtk_spin_button_get_value_as_int(p_networkPort); psz_mrlProtocol = gtk_entry_get_text(GTK_ENTRY(p_networkProtocol)); /* Build MRL from parts ;-) */ i_pos = snprintf( &text[0], VLC_MAX_MRL, "%s://", (char*)psz_mrlProtocol); if (strncasecmp( (char*)psz_mrlNetworkType, "multicast",9)==0) { i_pos += snprintf( &text[i_pos], VLC_MAX_MRL - i_pos, "@" ); } i_pos += snprintf( &text[i_pos], VLC_MAX_MRL - i_pos, "%s:%d", (char*)psz_mrlAddress, (int)i_mrlPort ); if (i_pos >= VLC_MAX_MRL) { text[VLC_MAX_MRL-1]='\0'; msg_Err( p_intf, "Media Resource Locator is truncated to: %s", text); } gtk_entry_set_text(p_entryMRL,text);}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" ); psz_mrl_name = gtk_entry_get_text(p_mrl); 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) { msg_Dbg( p_intf, "Network transcode option selected." ); onAddTranscodeToPlaylist(button, (gchar *)psz_mrl_name); } else { msg_Dbg( p_intf, "Network receiving selected." ); PlaylistAddItem(GTK_WIDGET(button), (gchar *)psz_mrl_name, 0, 0); }}void onAddCameraToPlaylist(GtkButton *button, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( button ); GtkSpinButton *entryV4LChannel = NULL; GtkSpinButton *entryV4LFrequency = NULL; GtkSpinButton *entryV4LSampleRate = NULL; GtkSpinButton *entryV4LQuality = NULL; GtkSpinButton *entryV4LTuner = NULL; gint i_v4l_channel; gint i_v4l_frequency; gint i_v4l_samplerate; gint i_v4l_quality; gint i_v4l_tuner; GtkEntry *entryV4LVideoDevice = NULL; GtkEntry *entryV4LAudioDevice = NULL; GtkEntry *entryV4LNorm = NULL; GtkEntry *entryV4LSize = NULL; GtkEntry *entryV4LSoundDirection = NULL; const gchar *p_v4l_video_device; const gchar *p_v4l_audio_device; const gchar *p_v4l_norm; const gchar *p_v4l_size; const gchar *p_v4l_sound_direction; /* MJPEG only */ GtkCheckButton *checkV4LMJPEG = NULL; GtkSpinButton *entryV4LDecimation = NULL; gboolean b_v4l_mjpeg; 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]; int i_pos; int i; ppsz_options = (char **) malloc(11 *sizeof(char*)); if (ppsz_options == NULL) { msg_Err(p_intf, "No memory to allocate for v4l options."); return; } for (i=0; i<11; i++) { ppsz_options[i] = (char *) malloc(VLC_MAX_MRL * sizeof(char)); if (ppsz_options[i] == NULL) { msg_Err(p_intf, "No memory to allocate for v4l options string %i.", i); for (i-=1; i>=0; i--) free(ppsz_options[i]); free(ppsz_options); return; } } i_pos = snprintf( &v4l_mrl[0], 6, "v4l"); v4l_mrl[5]='\0'; entryV4LChannel = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LChannel" ); entryV4LFrequency = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LFrequency" ); entryV4LSampleRate = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LSampleRate" ); entryV4LQuality = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LQuality" ); entryV4LTuner = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LTuner" ); entryV4LVideoDevice = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LVideoDevice" ); entryV4LAudioDevice = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LAudioDevice" ); entryV4LNorm = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LNorm" ); entryV4LSize = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LSize" ); entryV4LSoundDirection = (GtkEntry*) lookup_widget( GTK_WIDGET(button), "entryV4LSoundDirection" ); i_v4l_channel = gtk_spin_button_get_value_as_int(entryV4LChannel); i_v4l_frequency = gtk_spin_button_get_value_as_int(entryV4LFrequency); i_v4l_samplerate = gtk_spin_button_get_value_as_int(entryV4LSampleRate); i_v4l_quality = gtk_spin_button_get_value_as_int(entryV4LQuality); i_v4l_tuner = gtk_spin_button_get_value_as_int(entryV4LTuner); p_v4l_video_device = gtk_entry_get_text(GTK_ENTRY(entryV4LVideoDevice)); p_v4l_audio_device = gtk_entry_get_text(GTK_ENTRY(entryV4LAudioDevice)); p_v4l_norm = gtk_entry_get_text(GTK_ENTRY(entryV4LNorm)); p_v4l_size = gtk_entry_get_text(GTK_ENTRY(entryV4LSize)); p_v4l_sound_direction = gtk_entry_get_text(GTK_ENTRY(entryV4LSoundDirection)); i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "%s", (char*)p_v4l_video_device ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "adev=%s", (char*)p_v4l_audio_device ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "norm=%s", (char*)p_v4l_norm ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "size=%s", (char*)p_v4l_size ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "%s", (char*)p_v4l_sound_direction ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "channel=%d", (int)i_v4l_channel ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "frequency=%d", (int)i_v4l_frequency ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "samplerate=%d", (int)i_v4l_samplerate ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "quality=%d", (int)i_v4l_quality ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "tuner=%d", (int)i_v4l_tuner ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; /* MJPEG only */ checkV4LMJPEG = (GtkCheckButton*) lookup_widget( GTK_WIDGET(button), "checkV4LMJPEG" ); b_v4l_mjpeg = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkV4LMJPEG)); if (b_v4l_mjpeg) { entryV4LDecimation = (GtkSpinButton*) lookup_widget( GTK_WIDGET(button), "entryV4LDecimation" ); i_v4l_decimation = gtk_spin_button_get_value_as_int(entryV4LDecimation); i_pos = snprintf( &ppsz_options[i_options++][0], VLC_MAX_MRL, "mjpeg:%d", (int)i_v4l_decimation ); if (i_pos>=VLC_MAX_MRL) ppsz_options[i_options][VLC_MAX_MRL-1] = '\0'; } /* 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(button, (gchar *)v4l_mrl); } else { msg_Dbg( p_intf, "Camera reception option selected." ); PlaylistAddItem(GTK_WIDGET(button), (gchar*) &v4l_mrl, ppsz_options, i_options); }}gboolean PlaylistEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data){ return FALSE;}void onPlaylistColumnsChanged(GtkTreeView *treeview, gpointer user_data){}gboolean onPlaylistRowSelected(GtkTreeView *treeview, gboolean start_editing, gpointer user_data){ return FALSE;}void onPlaylistRow(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data){ intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(treeview) ); GtkTreeSelection *p_selection = gtk_tree_view_get_selection(treeview); playlist_t * p_playlist = pl_Yield( p_intf ); if( p_playlist == NULL ) { return; // FALSE; } if (gtk_tree_selection_count_selected_rows(p_selection) == 1) {
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -