Removed gtkmm.h usage.
[ardour.git] / gtk2_ardour / export_dialog.cc
index 5f2365cdce6751896767e7c437ca39eda6dee936..a304fef45ac6198245289afd88abee625ad3a04e 100644 (file)
@@ -141,8 +141,8 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
        file_selector = 0;
        spec.running = false;
 
-       file_entry.signal_focus_in_event().connect (ptr_fun (ARDOUR_UI::generic_focus_in_event));
-       file_entry.signal_focus_out_event().connect (ptr_fun (ARDOUR_UI::generic_focus_out_event));
+       file_entry.signal_focus_in_event().connect (sigc::ptr_fun (ARDOUR_UI::generic_focus_in_event));
+       file_entry.signal_focus_out_event().connect (sigc::ptr_fun (ARDOUR_UI::generic_focus_out_event));
 
        file_entry.set_name ("ExportFileNameEntry");
 
@@ -155,8 +155,8 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
        master_selector.set_column_auto_resize(2, true);
        master_selector.set_column_title (0, _("Output"));
        master_selector.column_titles_show ();
-       master_selector.set_selection_mode (GTK_SELECTION_MULTIPLE);
-       master_selector.button_press_event.connect (mem_fun(*this, &ExportDialog::master_selector_button_press_event));
+       master_selector.set_selection_mode (Gtk::SELECTION_MULTIPLE);
+       master_selector.signal_button_press_event().connect (mem_fun(*this, &ExportDialog::master_selector_button_press_event));
        
        track_selector.set_name ("ExportTrackSelector");
        track_selector.set_size_request (-1, 130);
@@ -167,8 +167,8 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
        track_selector.set_column_auto_resize(2, true);
        track_selector.set_column_title (0, _("Track"));
        track_selector.column_titles_show ();
-       track_selector.set_selection_mode (GTK_SELECTION_MULTIPLE);
-       track_selector.button_press_event.connect (mem_fun(*this, &ExportDialog::track_selector_button_press_event));
+       track_selector.set_selection_mode (Gtk::SELECTION_MULTIPLE);
+       track_selector.signal_button_press_event().connect (mem_fun(*this, &ExportDialog::track_selector_button_press_event));
 
        check_pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL,
                        gtk_widget_get_colormap(GTK_WIDGET(track_selector.gobj())),
@@ -178,7 +178,7 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
                        &empty_mask, NULL, (gchar**) empty_xpm);
 
        progress_bar.set_show_text (false);
-       progress_bar.set_orientation (GTK_PROGRESS_LEFT_TO_RIGHT);
+       progress_bar.set_orientation (PROGRESS_LEFT_TO_RIGHT);
        progress_bar.set_name ("ExportProgress");
 
        format_frame.add (format_table);
@@ -230,14 +230,14 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
        file_frame.set_border_width (5);
        file_frame.set_name (FRAME_NAME);
 
-       sample_rate_combo.set_popdown_strings (internationalize(sample_rates));
-       src_quality_combo.set_popdown_strings (internationalize (src_qualities));
-       dither_type_combo.set_popdown_strings (internationalize (dither_types));
-       channel_count_combo.set_popdown_strings (internationalize (channel_strings));
-       header_format_combo.set_popdown_strings (internationalize ((const char **) sndfile_header_formats_strings));
-       bitdepth_format_combo.set_popdown_strings (internationalize ((const char **) sndfile_bitdepth_formats_strings));
-       endian_format_combo.set_popdown_strings (internationalize ((const char **) sndfile_endian_formats_strings));
-       cue_file_combo.set_popdown_strings (internationalize (cue_file_types));
+       set_popdown_strings (sample_rate_combo, internationalize(sample_rates));
+       set_popdown_strings (src_quality_combo, internationalize (src_qualities));
+       set_popdown_strings (dither_type_combo, internationalize (dither_types));
+       set_popdown_strings (channel_count_combo, internationalize (channel_strings));
+       set_popdown_strings (header_format_combo, internationalize ((const char **) sndfile_header_formats_strings));
+       set_popdown_strings (bitdepth_format_combo, internationalize ((const char **) sndfile_bitdepth_formats_strings));
+       set_popdown_strings (endian_format_combo, internationalize ((const char **) sndfile_endian_formats_strings));
+       set_popdown_strings (cue_file_combo, internationalize (cue_file_types));
 
        /* this will re-sensitized as soon as a non RIFF/WAV
           header format is chosen.
@@ -385,11 +385,11 @@ ExportDialog::ExportDialog(PublicEditor& e, AudioRegion* r)
        file_browse_button.set_name ("EditorGTKButton");
        file_browse_button.signal_clicked().connect (mem_fun(*this, &ExportDialog::initiate_browse));
 
-       channel_count_combo.get_popwin()->unmap_event.connect (mem_fun(*this, &ExportDialog::channels_chosen));
-       bitdepth_format_combo.get_popwin()->unmap_event.connect (mem_fun(*this, &ExportDialog::bitdepth_chosen));
-       header_format_combo.get_popwin()->unmap_event.connect (mem_fun(*this, &ExportDialog::header_chosen));
-       sample_rate_combo.get_popwin()->unmap_event.connect (mem_fun(*this, &ExportDialog::sample_rate_chosen));
-       cue_file_combo.get_popwin()->unmap_event.connect (mem_fun(*this, &ExportDialog::cue_file_type_chosen));
+       channel_count_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &ExportDialog::channels_chosen));
+       bitdepth_format_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &ExportDialog::bitdepth_chosen));
+       header_format_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &ExportDialog::header_chosen));
+       sample_rate_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &ExportDialog::sample_rate_chosen));
+       cue_file_combo.get_popwin()->signal_unmap_event().connect (mem_fun(*this, &ExportDialog::cue_file_type_chosen));
 }
 
 ExportDialog::~ExportDialog()
@@ -603,7 +603,7 @@ ExportDialog::set_range (jack_nframes_t start, jack_nframes_t end)
 gint
 ExportDialog::progress_timeout ()
 {
-       progress_bar.set_percentage (spec.progress);
+       progress_bar.set_fraction (spec.progress/100);
        return TRUE;
 }
 
@@ -655,7 +655,7 @@ ExportDialog::export_toc_file (Locations::LocationList& locations, const string&
        gchar buf[18];
 
        if (!out) {
-               error << compose(_("Editor: cannot open \"%1\" as export file for CD toc file"), filepath) << endmsg;
+               error << string_compose(_("Editor: cannot open \"%1\" as export file for CD toc file"), filepath) << endmsg;
                return;
        }
        out << "CD_DA" << endl;
@@ -729,8 +729,8 @@ ExportDialog::export_toc_file (Locations::LocationList& locations, const string&
                        if ((*i)->cd_info.find("performer") != (*i)->cd_info.end()) {
                          out << "     PERFORMER \"" << (*i)->cd_info["performer"]  << "\"" << endl;
                        }
-                       if ((*i)->cd_info.find("composer") != (*i)->cd_info.end()) {
-                         out  << "     COMPOSER \"" << (*i)->cd_info["composer"] << "\"" << endl;
+                       if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
+                         out  << "     COMPOSER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
                        }
 
                        if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {                          
@@ -777,7 +777,7 @@ ExportDialog::export_cue_file (Locations::LocationList& locations, const string&
        int numtracks = 0, tracknum = 0, indexnum = 0;
 
        if (!out) {
-               error << compose(_("Editor: cannot open \"%1\" as export file for CD cue file"), filepath) << endmsg;
+               error << string_compose(_("Editor: cannot open \"%1\" as export file for CD cue file"), filepath) << endmsg;
                return;
        }
 
@@ -867,8 +867,8 @@ ExportDialog::export_cue_file (Locations::LocationList& locations, const string&
                        out << "PERFORMER \"" <<  (*i)->cd_info["performer"] << "\"" << endl;
                      }
                      
-                     if ((*i)->cd_info.find("composer") != (*i)->cd_info.end()) {
-                       out << "SONGWRITER \"" << (*i)->cd_info["composer"]  << "\"" << endl;
+                     if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
+                       out << "SONGWRITER \"" << (*i)->cd_info["string_composer"]  << "\"" << endl;
                      }
                        snprintf (buf, sizeof(buf), "INDEX %02d", indexnum);
                        out << buf;
@@ -1125,7 +1125,7 @@ ExportDialog::start_export ()
                file_entry.set_text (dir);
        }
        
-       progress_bar.set_percentage (0);
+       progress_bar.set_fraction (0);
        cancel_label.set_text (_("Cancel"));
 
        show_all ();
@@ -1261,7 +1261,7 @@ ExportDialog::channels_chosen (GdkEventAny* ignored)
                        if (route->n_outputs() == 1) {
                                stupid_list.push_back (route->name());
                        } else {
-                               stupid_list.push_back (compose("%1: out-%2", route->name(), i+1));
+                               stupid_list.push_back (string_compose("%1: out-%2", route->name(), i+1));
                        }
 
                        stupid_list.push_back ("");
@@ -1350,10 +1350,10 @@ ExportDialog::initiate_browse ()
                file_selector = new FileSelection;
                file_selector->set_modal (true);
 
-               file_selector->get_cancel_button()-.signal_clicked().connect (bind (mem_fun(*this, &ExportDialog::finish_browse), -1));
-               file_selector->get_ok_button()-.signal_clicked().connect (bind (mem_fun(*this, &ExportDialog::finish_browse), 1));
-               file_selector->map_event.connect (bind (mem_fun(*this, &ExportDialog::change_focus_policy), true));
-               file_selector->unmap_event.connect (bind (mem_fun(*this, &ExportDialog::change_focus_policy), false));
+               file_selector->get_cancel_button()->signal_clicked().connect (bind (mem_fun(*this, &ExportDialog::finish_browse), -1));
+               file_selector->get_ok_button()->signal_clicked().connect (bind (mem_fun(*this, &ExportDialog::finish_browse), 1));
+               file_selector->signal_map_event().connect (bind (mem_fun(*this, &ExportDialog::change_focus_policy), true));
+               file_selector->signal_unmap_event().connect (bind (mem_fun(*this, &ExportDialog::change_focus_policy), false));
        }
        file_selector->show_all ();
 }