diff options
author | Radek Doulik <rodo@ximian.com> | 2004-10-26 00:37:25 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2004-10-26 00:37:25 +0800 |
commit | 0e92e94b3800d682a3a74da8cef3d928b8d891f2 (patch) | |
tree | 0e04761e57091c4662f45606105776a83fae4ce2 /plugins/audio-inline | |
parent | 35f50e44ed36185c64dffb6380b69ddc8542258c (diff) | |
download | gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar.gz gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar.bz2 gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar.lz gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar.xz gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar.zst gsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.zip |
removed unused enum declaration (org_gnome_audio_inline_play_clicked):
2004-10-25 Radek Doulik <rodo@ximian.com>
* audio-inline.c: removed unused enum declaration
(org_gnome_audio_inline_play_clicked): added cast to &argv to
quiet compiler
handle more mime types
* org-gnome-audio-inline.eplug.in: handle application/x-ogg mime
type
handle more mime types
svn path=/trunk/; revision=27721
Diffstat (limited to 'plugins/audio-inline')
-rw-r--r-- | plugins/audio-inline/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/audio-inline/audio-inline.c | 43 | ||||
-rw-r--r-- | plugins/audio-inline/org-gnome-audio-inline.eplug.in | 7 |
3 files changed, 44 insertions, 12 deletions
diff --git a/plugins/audio-inline/ChangeLog b/plugins/audio-inline/ChangeLog index e26ec48280..82368d8c64 100644 --- a/plugins/audio-inline/ChangeLog +++ b/plugins/audio-inline/ChangeLog @@ -1,7 +1,13 @@ 2004-10-25 Radek Doulik <rodo@ximian.com> + * audio-inline.c: removed unused enum declaration + (org_gnome_audio_inline_play_clicked): added cast to &argv to + quiet compiler + handle more mime types + * org-gnome-audio-inline.eplug.in: handle application/x-ogg mime type + handle more mime types * audio-inline.c: handle application/x-ogg mime type diff --git a/plugins/audio-inline/audio-inline.c b/plugins/audio-inline/audio-inline.c index 9ddafb4670..e7cdc3575f 100644 --- a/plugins/audio-inline/audio-inline.c +++ b/plugins/audio-inline/audio-inline.c @@ -33,12 +33,6 @@ void org_gnome_audio_inline_format (void *ep, EMFormatHookTarget *t); volatile static int org_gnome_audio_class_id_counter = 0; -enum _org_gnome_audio_inline_button_type { - ORG_GNOME_AUDIO_INLINE_BUTTON_PLAY, - ORG_GNOME_AUDIO_INLINE_BUTTON_PAUSE, - ORG_GNOME_AUDIO_INLINE_BUTTON_STOP -}; - struct _org_gnome_audio_inline_pobject { EMFormatHTMLPObject object; @@ -141,6 +135,7 @@ org_gnome_audio_inline_gst_ogg_thread (GstElement *filesrc) /* add objects to the thread */ gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, converter, audiosink, NULL); + /* link them in the logical order */ gst_element_link_many (filesrc, demuxer, decoder, converter, audiosink, NULL); @@ -170,6 +165,29 @@ org_gnome_audio_inline_gst_flac_thread (GstElement *filesrc) return thread; } +static GstElement * +org_gnome_audio_inline_gst_mod_thread (GstElement *filesrc) +{ + GstElement *thread, *decoder, *audiosink; + + /* create a new thread to hold the elements */ + thread = gst_thread_new ("org-gnome-audio-inline-flac-thread"); + + /* now it's time to get the decoder */ + decoder = gst_element_factory_make ("mikmod", "decoder"); + + /* and an audio sink */ + audiosink = gst_element_factory_make ("osssink", "play_audio"); + + /* add objects to the main pipeline */ + gst_bin_add_many (GST_BIN (thread), filesrc, decoder, audiosink, NULL); + + /* link src to sink */ + gst_element_link_many (filesrc, decoder, audiosink, NULL); + + return thread; +} + static void org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pobject) { @@ -195,7 +213,7 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob d(printf ("audio inline formatter: init gst thread\n")); - if (gst_init_check (&argc, &argv)) { + if (gst_init_check (&argc, (char ***) &argv)) { CamelContentType *type; GstElement *filesrc; @@ -206,10 +224,14 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob type = camel_mime_part_get_content_type (po->part); if (type) { if (!strcasecmp (type->type, "audio")) { - if (!strcasecmp (type->subtype, "mpeg") || !strcasecmp (type->subtype, "x-mp3")) { + if (!strcasecmp (type->subtype, "mpeg") || !strcasecmp (type->subtype, "x-mpeg") + || !strcasecmp (type->subtype, "mpeg3") || !strcasecmp (type->subtype, "x-mpeg3") + || !strcasecmp (type->subtype, "mp3") || !strcasecmp (type->subtype, "x-mp3")) { po->thread = org_gnome_audio_inline_gst_mpeg_thread (filesrc); - } else if (!strcasecmp (type->subtype, "x-flac")) { + } else if (!strcasecmp (type->subtype, "flac") || !strcasecmp (type->subtype, "x-flac")) { po->thread = org_gnome_audio_inline_gst_flac_thread (filesrc); + } else if (!strcasecmp (type->subtype, "mod") || !strcasecmp (type->subtype, "x-mod")) { + po->thread = org_gnome_audio_inline_gst_mod_thread (filesrc); } } else if (!strcasecmp (type->type, "application")) { if (!strcasecmp (type->subtype, "ogg") || !strcasecmp (type->subtype, "x-ogg")) { @@ -223,9 +245,6 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob if (po->thread) { /* start playing */ gst_element_set_state (po->thread, GST_STATE_PLAYING); - - /* do whatever you want here, the thread will be playing */ - g_print ("thread is playing\n"); } } diff --git a/plugins/audio-inline/org-gnome-audio-inline.eplug.in b/plugins/audio-inline/org-gnome-audio-inline.eplug.in index 209630412e..41ae24d04f 100644 --- a/plugins/audio-inline/org-gnome-audio-inline.eplug.in +++ b/plugins/audio-inline/org-gnome-audio-inline.eplug.in @@ -10,8 +10,15 @@ <hook class="org.gnome.evolution.mail.format:1.0"> <group id="EMFormatHTMLDisplay"> <item mime_type="audio/mpeg" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/x-mpeg" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/mpeg3" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/x-mpeg3" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/mp3" format="org_gnome_audio_inline_format" flags="inline_disposition"/> <item mime_type="audio/x-mp3" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/flac" format="org_gnome_audio_inline_format" flags="inline_disposition"/> <item mime_type="audio/x-flac" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/mod" format="org_gnome_audio_inline_format" flags="inline_disposition"/> + <item mime_type="audio/x-mod" format="org_gnome_audio_inline_format" flags="inline_disposition"/> <item mime_type="application/ogg" format="org_gnome_audio_inline_format" flags="inline_disposition"/> <item mime_type="application/x-ogg" format="org_gnome_audio_inline_format" flags="inline_disposition"/> </group> |