]> err.no Git - mapper/commitdiff
Some more work on audio notes
authorKaj-Michael Lang <milang@onion.tal.org>
Wed, 15 Aug 2007 14:37:03 +0000 (17:37 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Wed, 15 Aug 2007 14:37:03 +0000 (17:37 +0300)
src/audio-note.c

index 60209a1ba2b80e9a8d57873fab5c15254f873aa9..638b5e527633093444621e256a49beb27e1111d2 100644 (file)
 
 typedef struct _note_pipeline note_pipeline;
 struct _note_pipeline {
-       GstElement *pipeline,
-       GstElement *src,
-       GstElement *sink,
-       GstElement *filter,
+       GstElement *pipeline;
+       GstElement *src;
+       GstElement *sink;
+       GstElement *filter;
 };
 static note_pipeline note_play;
 static note_pipeline note_record;
@@ -33,43 +33,59 @@ audio_bus_cb()
 static gboolean
 audio_create_pipeline(note_pipeline *np, gboolean rec)
 {
-p->pipeline=gst_pipeline_new("pipeline");
+np->pipeline=gst_pipeline_new("pipeline");
 if (rec==TRUE) {
-       p->src=gst_element_factory_make(AUDIO_SRC, "source");
-       p->filter=gst_element_factory_make("wavenc", "filter");
-       p->sink=gst_element_factory_make("filesink", "sink");
+       np->src=gst_element_factory_make(AUDIO_SRC, "source");
+       np->filter=gst_element_factory_make("wavenc", "filter");
+       np->sink=gst_element_factory_make("filesink", "sink");
 } else {
-       p->src=gst_element_factory_make("filesrc", "source");
-       p->filter=gst_element_factory_make("wavenc", "filter");
-       p->sink=gst_element_factory_make(AUDIO_SINK, "sink");
+       np->src=gst_element_factory_make("filesrc", "source");
+       np->filter=gst_element_factory_make("wavenc", "filter");
+       np->sink=gst_element_factory_make(AUDIO_SINK, "sink");
 }
 return TRUE;
 }
 
 /**
  * Set the given elements (filesrc or filesink) file location
+ */
 static void
 audio_set_filename(GstElement *e, gchar *file)
 {
 g_object_set(G_OBJECT(e), "location", file, NULL);
 }
 
+/**
+ * Play given audio note file
+ */
 gboolean
 audio_note_play(gchar *file)
 {
 audio_set_filename(note_play.src, file);
 }
 
+/**
+ * Record to given file
+ */
 gboolean
 audio_note_record(gchar *file)
 {
 audio_set_filename(note_play.sink, file);
 }
 
+/**
+ * Init gst pipelines for note play and record
+ */
 gboolean
-audio_init(void)
+audio_note_init(void)
 {
-audio_create_pipeline(note_play, FALSE);
-audio_create_pipeline(note_record, TRUE);
+audio_create_pipeline(&note_play, FALSE);
+audio_create_pipeline(&note_record, TRUE);
 return TRUE;
 }
+
+void
+audio_note_deinit(void)
+{
+
+}