~blackskad/gnomeradio/dev-vol-button

« back to all changes in this revision

Viewing changes to src/gui.c

  • Committer: mfcn
  • Date: 2006-11-23 22:44:23 UTC
  • Revision ID: svn-v3-trunk0:ba97a3d1-ec25-0410-b1c6-e06ad936ea6c:trunk:156
        * src/gui.c: (start_recording), (rec_button_clicked_cb):
        * src/rec_tech.c: (recording_stop):
        * src/rec_tech.h:
        * src/record.c: (record_status_window):
        Made record status window more HIG compliant

Show diffs side-by-side

added added

removed removed

Lines of Context:
611
611
        gtk_widget_set_sensitive(menuitem, sensible);
612
612
}
613
613
 
614
 
static int start_recording(const gchar *filename)
 
614
static int start_recording(const gchar *destination, const char* station, const char* time)
615
615
{
616
616
        GtkWidget *dialog;
617
617
        Recording* recording;
 
618
        char *filename;
618
619
        
619
620
        if (!mixer_set_rec_device())
620
621
        {
626
627
                return -1;
627
628
        }
628
629
        
 
630
        /* You can translate the filename for a recording:
 
631
         * args for this format are: path, station title, time 
 
632
         */ 
 
633
        filename = g_strdup_printf(_("%s/%s_%s"), 
 
634
                destination, 
 
635
                station, 
 
636
                time);
629
637
        recording = recording_start(filename);
 
638
        g_free(filename);
630
639
        if (!recording)
631
640
                return -1;
632
641
        
633
642
        tray_icon_items_set_sensible(FALSE);
634
643
        
 
644
        recording->station = g_strdup(station);
635
645
        dialog = record_status_window(recording);
636
646
        
637
647
        run_status_window(recording);
642
652
void rec_button_clicked_cb(GtkButton *button, gpointer app)
643
653
{
644
654
        GtkWidget *dialog;
645
 
        gchar *filename;
 
655
        char *station;
646
656
        char time_str[100];
647
657
        time_t t;
648
658
        
652
662
        
653
663
        if (mom_ps < 0) {
654
664
                /* Only change the "MHz" part here (if applicable) */
655
 
                filename = g_strdup_printf(_("%s/%.2fMHz_%s"), 
656
 
                        rec_settings.destination, 
657
 
                        rint(adj->value)/STEPS, 
658
 
                        time_str);
 
665
                station = g_strdup_printf(_("%.2fMHz"), rint(adj->value)/STEPS);
659
666
        } else {
660
667
                g_assert(mom_ps < g_list_length(settings.presets));
661
668
                preset* ps = g_list_nth_data(settings.presets, mom_ps);
662
669
                g_assert(ps);
663
 
                
664
 
                filename = g_strdup_printf(_("%s/%s_%s"), 
665
 
                        rec_settings.destination, 
666
 
                        ps->title, 
667
 
                        time_str);
 
670
        
 
671
                station = g_strdup(ps->title);
668
672
        }       
669
673
                
670
674
/*      if (!check_filename(filename)) {
674
678
                gtk_dialog_run (GTK_DIALOG (errdialog));
675
679
                gtk_widget_destroy (errdialog);
676
680
        } else */
677
 
        start_recording(filename);
678
 
        g_free(filename);               
 
681
        start_recording(rec_settings.destination, station, time_str);
 
682
        g_free(station);
679
683
}
680
684
 
681
685
void toggle_volume(void)