From: <za...@ke...> - 2007-05-17 15:06:35
|
CVS Root: /cvs/gstreamer Module: gst-phonon Changes by: zapek Date: Thu May 17 2007 15:06:25 UTC Log message: Tick support and position query. Fixed the 'mixer' GUI a bit. Modified files: . : ChangeLog gst-phonon : gpho-mediaproducer.c tests/examples/mixer: mixer.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-phonon/ChangeLog.diff?r1=1.39&r2=1.40 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-phonon/gst-phonon/gpho-mediaproducer.c.diff?r1=1.30&r2=1.31 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-phonon/tests/examples/mixer/mixer.c.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-phonon/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- ChangeLog 17 May 2007 12:10:02 -0000 1.39 +++ ChangeLog 17 May 2007 15:06:13 -0000 1.40 @@ -1,5 +1,13 @@ 2007-05-17 David Gerber <david at fluendo dot com> + * gst-phonon/gpho-mediaproducer.c: + (gpho_media_producer_get_current_time): + * tests/examples/mixer/mixer.c: (bt_path_clicked), + (bt_pause_clicked), (bt_stop_clicked), (main): + Tick support and position query. Fixed the 'mixer' GUI a bit. + +2007-05-17 David Gerber <david at fluendo dot com> * gst-phonon/gpho-mediaproducer.c: (gpho_media_producer_seek): Reimplemented seeking. Index: gpho-mediaproducer.c RCS file: /cvs/gstreamer/gst-phonon/gst-phonon/gpho-mediaproducer.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- gpho-mediaproducer.c 17 May 2007 12:10:02 -0000 1.30 +++ gpho-mediaproducer.c 17 May 2007 15:06:13 -0000 1.31 @@ -1990,13 +1990,20 @@ gpho_media_producer_get_current_time (GPhoMediaProducer * prod) { gint64 result; + GstFormat fmt = GST_FORMAT_TIME; g_return_val_if_fail (GPHO_IS_MEDIA_PRODUCER (prod), 0); GPHO_OBJECT_LOCK (prod); - //result = gpho_pipeline_get_current_time (prod->priv->pipeline); - result = 0; + if (G_LIKELY(gst_element_query_position(prod->priv->pipeline->pipeline, &fmt, &result))) + { + result /= GST_MSECOND; + } + else + result = -1; GPHO_OBJECT_UNLOCK (prod); Index: mixer.c RCS file: /cvs/gstreamer/gst-phonon/tests/examples/mixer/mixer.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mixer.c 24 Apr 2007 17:32:27 -0000 1.2 +++ mixer.c 17 May 2007 15:06:13 -0000 1.3 @@ -13,7 +13,7 @@ static GtkWidget *bt_play[DECKS], *bt_pause[DECKS], *bt_stop[DECKS]; static char *file[DECKS]; static GPhoMediaObject *media_object[DECKS]; -static GPhoAudioPath *audio_path; +static GPhoAudioPath *audio_path[DECKS]; static GPhoAudioOutput *audio_output; static void bt_path_clicked(GtkWidget *w, guint type) @@ -26,15 +26,11 @@ switch (type) { case DECK_A: - s = &file[type]; deckname = "Deck A"; - m = media_object[type]; break; case DECK_B: deckname = "Deck B"; default: @@ -42,6 +38,9 @@ } + s = &file[type]; + m = media_object[type]; d = gtk_file_chooser_dialog_new(deckname, NULL, GTK_FILE_CHOOSER_ACTION_OPEN, @@ -96,6 +95,15 @@ } +static void bt_pause_clicked(GtkWidget *w, guint type) +{ + gpho_media_producer_pause(GPHO_MEDIA_PRODUCER(media_object[type])); +} +static void bt_stop_clicked(GtkWidget *w, guint type) + gpho_media_producer_stop(GPHO_MEDIA_PRODUCER(media_object[type])); int main(int argc, char **argv) @@ -183,13 +191,25 @@ "clicked", G_CALLBACK(bt_path_clicked), (gpointer)i - ); + ); /* play buttons connections */ g_signal_connect(G_OBJECT(bt_play[i]), G_CALLBACK(bt_play_clicked), + /* pause buttons connections */ + g_signal_connect(G_OBJECT(bt_pause[i]), + "clicked", + G_CALLBACK(bt_pause_clicked), + (gpointer)i + /* stop buttons connections */ + g_signal_connect(G_OBJECT(bt_stop[i]), + G_CALLBACK(bt_stop_clicked), /* quit */ @@ -203,13 +223,17 @@ media_object[DECK_A] = gpho_media_object_new(); media_object[DECK_B] = gpho_media_object_new(); - audio_path = gpho_audio_path_new(); + audio_path[DECK_A] = gpho_audio_path_new(); + audio_path[DECK_B] = gpho_audio_path_new(); audio_output = gpho_audio_output_new(GPHO_CATEGORY_MUSIC); - gpho_media_producer_add_audio_path(GPHO_MEDIA_PRODUCER(media_object[DECK_A]), audio_path); + gpho_media_producer_add_audio_path(GPHO_MEDIA_PRODUCER(media_object[DECK_A]), audio_path[DECK_A]); + gpho_media_producer_add_audio_path(GPHO_MEDIA_PRODUCER(media_object[DECK_B]), audio_path[DECK_B]); - gpho_audio_path_add_output(audio_path, GPHO_ABSTRACT_AUDIO_OUTPUT(audio_output)); + gpho_audio_path_add_output(audio_path[DECK_A], GPHO_ABSTRACT_AUDIO_OUTPUT(audio_output)); + /* XXX: fix that one */ + //gpho_audio_path_add_output(audio_path[DECK_B], GPHO_ABSTRACT_AUDIO_OUTPUT(audio_output)); /* XXX: connect the finished signal somewhere to change the deck status */ |