--- /dev/null
+/*
+ * Quick record audio notes on the road.
+ */
+
+#include "config.h"
+#include <gst/gst.h>
+
+#include "audio-note.h"
+
+#ifdef WITH_DEVICE_770
+#define AUDIO_SRC "dsppcmsrc"
+#define AUDIO_SINK "dsppcmsink"
+#else
+#define AUDIO_SRC "alsasrc"
+#define AUDIO_SINK "autoaudiosink"
+#endif
+
+typedef struct _note_pipeline note_pipeline;
+struct _note_pipeline {
+ GstElement *pipeline,
+ GstElement *src,
+ GstElement *sink,
+ GstElement *filter,
+};
+static note_pipeline note_play;
+static note_pipeline note_record;
+
+static gboolean
+audio_bus_cb()
+{
+}
+
+static gboolean
+audio_create_pipeline(note_pipeline *np, gboolean rec)
+{
+p->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");
+} 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");
+}
+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);
+}
+
+gboolean
+audio_note_play(gchar *file)
+{
+audio_set_filename(note_play.src, file);
+}
+
+gboolean
+audio_note_record(gchar *file)
+{
+audio_set_filename(note_play.sink, file);
+}
+
+gboolean
+audio_init(void)
+{
+audio_create_pipeline(note_play, FALSE);
+audio_create_pipeline(note_record, TRUE);
+return TRUE;
+}
+++ /dev/null
-/*
- * Quick record audio notes on the road.
- */
-
-#include "config.h"
-#include <gst/gst.h>
-
-#ifdef WITH_HILDON
-#define AUDIO_SRC "dsppcmsrc"
-#define AUDIO_SINK "dsppcmsink"
-#else
-#define AUDIO_SRC "alsasrc"
-#define AUDIO_SINK "alsasink"
-#endif
-
-struct {
- GstElement *pipeline,
- GstElement *src,
- GstElement *sink,
- GstElement *filter,
-} pipeline;
-
-gboolean
-audio_bus_cb()
-{
-}
-
-gboolean
-audio_create_record_pipeline(void)
-{
-pipeline=gst_pipeline_new("pipeline");
-src=gst_element_factory_make(AUDIO_SRC, "source");
-filter=gst_element_factory_make("wavenc", "filter");
-sink=gst_element_factory_make("filesink", "sink");
-}
-
-gboolean
-audio_create_play_pipelin(void)
-{
-
-}
-
-void
-audio_file_set_filename(GstElement *e, gchar *file)
-{
-g_object_set(G_OBJECT(e), "location", file, NULL);
-}
-
-gboolean
-audio_cb_xxx(void)
-{
-
-}
-