]> err.no Git - mapper/commitdiff
Set basedir on init. Don't expand time display.
authorKaj-Michael Lang <milang@tal.org>
Wed, 9 Apr 2008 10:34:09 +0000 (13:34 +0300)
committerKaj-Michael Lang <milang@tal.org>
Wed, 9 Apr 2008 10:34:09 +0000 (13:34 +0300)
src/audio-note.c
src/audio-note.h

index 073642f1f2fc0614caa065a13634a5861d996b02..8c94525b788675cc8aef579bba0ac75051260060 100644 (file)
@@ -108,17 +108,6 @@ audio_note_ui *ui=(audio_note_ui *)data;
 time_t t;
 struct tm *tmp;
 
-/* XXX: Make this a configuration option */
-#ifdef WITH_DEVICE_770
-basedir=NOTES_BASEDIR_MMC1;
-if (g_mkdir_with_parents(basedir, 0775)==-1) {
-       MACRO_BANNER_SHOW_INFO(_window, _("Failed to create directory for sound files!"));
-       return TRUE;
-}
-#else
-basedir=g_get_home_dir();
-#endif
-
 t=time(NULL);
 tmp=localtime(&t);
 if (tmp == NULL) {
@@ -132,7 +121,7 @@ strftime(buffer, sizeof(buffer), "%Y-%m-%d-%H%M%S", tmp);
 if (ui->cfile)
        g_free(ui->cfile);
 
-ui->cfile=g_strdup_printf("%s/an-%s.wav", basedir, buffer);
+ui->cfile=g_strdup_printf("%s/an-%s.wav", ui->basedir, buffer);
 
 if (audio_note_record(ui->cfile)==TRUE) {
        audio_note_position_display(ui, TRUE);
@@ -201,7 +190,8 @@ ui->btn_stop=gtk_button_new_from_stock(GTK_STOCK_MEDIA_STOP);
 gtk_widget_set_sensitive(ui->btn_play, FALSE);
 gtk_widget_set_sensitive(ui->btn_stop, FALSE);
 
-gtk_box_pack_start(GTK_BOX(ui->vbox), ui->lbl_time, TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(ui->vbox), ui->lbl_time, TRUE, FALSE, 0);
+
 gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_record, TRUE, TRUE, 0);
 gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_play, TRUE, TRUE, 0);
 gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_stop, TRUE, TRUE, 0);
@@ -209,6 +199,17 @@ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_stop, TRUE, TRUE, 0);
 ui->note_play=&note_play;
 ui->note_record=&note_record;
 
+/* 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;
+}
+#else
+ui->basedir=g_get_home_dir();
+#endif
+
 g_signal_connect(G_OBJECT(ui->btn_record), "clicked", G_CALLBACK(audio_note_record_cb), ui);
 g_signal_connect(G_OBJECT(ui->btn_play), "clicked", G_CALLBACK(audio_note_play_cb), ui);
 g_signal_connect(G_OBJECT(ui->btn_stop), "clicked", G_CALLBACK(audio_note_stop_cb), ui);
index 4f5cd857c95b117f7407492938ac99dc3f5e5223..3d086c31b67f2dc59cf590a76f421cc65b0a6a54 100644 (file)
@@ -45,6 +45,7 @@ struct _audio_note_ui {
        GtkWidget *btn_stop;
        gint pos_sid;
        gchar *cfile;
+       gchar *basedir;
        note_pipeline *note_play;
        note_pipeline *note_record;
 };