aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/audio-inline/audio-inline.c
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2004-10-26 00:37:25 +0800
committerRadek Doulik <rodo@src.gnome.org>2004-10-26 00:37:25 +0800
commit0e92e94b3800d682a3a74da8cef3d928b8d891f2 (patch)
tree0e04761e57091c4662f45606105776a83fae4ce2 /plugins/audio-inline/audio-inline.c
parent35f50e44ed36185c64dffb6380b69ddc8542258c (diff)
downloadgsoc2013-evolution-0e92e94b3800d682a3a74da8cef3d928b8d891f2.tar.gz
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/audio-inline.c')
-rw-r--r--plugins/audio-inline/audio-inline.c43
1 files changed, 31 insertions, 12 deletions
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");
}
}