]> err.no Git - mapper/commitdiff
Add function to alter basedir for audio files.
authorKaj-Michael Lang <milang@tal.org>
Fri, 18 Apr 2008 09:32:44 +0000 (12:32 +0300)
committerKaj-Michael Lang <milang@tal.org>
Fri, 18 Apr 2008 09:32:44 +0000 (12:32 +0300)
src/audio-note.c

index 8c94525b788675cc8aef579bba0ac75051260060..cf4a88bb1cd5c09bc9c5f984ef48527cc810a6ca 100644 (file)
@@ -198,16 +198,13 @@ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_stop, TRUE, TRUE, 0);
 
 ui->note_play=&note_play;
 ui->note_record=&note_record;
+ui->basedir=NULL;
 
 /* XXX: Make this a configuration option */
 #ifdef WITH_DEVICE_770
-ui->basedir=NOTES_BASEDIR_MMC1;
-if (g_mkdir_with_parents(ui->basedir, 0775)==-1) {
-       MACRO_BANNER_SHOW_INFO(_window, _("Failed to create directory for sound files!"));
-       return TRUE;
-}
+audio_note_set_basedir(NOTES_BASEDIR_MMC1);
 #else
-ui->basedir=g_get_home_dir();
+audio_note_setbasedir(g_get_home_dir());
 #endif
 
 g_signal_connect(G_OBJECT(ui->btn_record), "clicked", G_CALLBACK(audio_note_record_cb), ui);
@@ -217,6 +214,16 @@ g_signal_connect(G_OBJECT(ui->btn_stop), "clicked", G_CALLBACK(audio_note_stop_c
 return ui;
 }
 
+void
+audio_note_set_basedir(audio_note_ui *ui, const gchar *basedir)
+{
+if (ui->basedir)
+       g_free(ui->basedir)
+ui->basedir=g_strdup(basedir);
+if (g_mkdir_with_parents(ui->basedir, 0775)==-1) {
+}
+}
+
 static gboolean
 audio_note_bus_cb(GstBus *bus, GstMessage *msg, gpointer data)
 {