- set_modal (true);
-
- spec.path = file_entry.get_text();
- spec.progress = 0;
- spec.running = true;
- spec.stop = false;
- spec.port_map.clear();
-
- if (channel_count_combo.get_entry()->get_text() == _("mono")) {
- spec.channels = 1;
- } else {
- spec.channels = 2;
- }
-
- spec.format = 0;
-
- spec.format |= sndfile_header_format_from_string (header_format_combo.get_entry()->get_text ());
-
- if ((spec.format & SF_FORMAT_WAV) == 0) {
- /* RIFF/WAV specifies endianess */
- spec.format |= sndfile_endian_format_from_string (endian_format_combo.get_entry()->get_text ());
- }
-
- spec.format |= sndfile_bitdepth_format_from_string (bitdepth_format_combo.get_entry()->get_text ());
-
- string sr_str = sample_rate_combo.get_entry()->get_text();
- if (sr_str == N_("22.05kHz")) {
- spec.sample_rate = 22050;
- } else if (sr_str == N_("44.1kHz")) {
- spec.sample_rate = 44100;
- } else if (sr_str == N_("48kHz")) {
- spec.sample_rate = 48000;
- } else if (sr_str == N_("88.2kHz")) {
- spec.sample_rate = 88200;
- } else if (sr_str == N_("96kHz")) {
- spec.sample_rate = 96000;
- } else if (sr_str == N_("192kHz")) {
- spec.sample_rate = 192000;
- } else {
- spec.sample_rate = session->frame_rate();
- }
-
- string src_str = src_quality_combo.get_entry()->get_text();
- if (src_str == _("fastest")) {
- spec.src_quality = SRC_ZERO_ORDER_HOLD;
- } else if (src_str == _("linear")) {
- spec.src_quality = SRC_LINEAR;
- } else if (src_str == _("better")) {
- spec.src_quality = SRC_SINC_FASTEST;
- } else if (src_str == _("intermediate")) {
- spec.src_quality = SRC_SINC_MEDIUM_QUALITY;
- } else {
- spec.src_quality = SRC_SINC_BEST_QUALITY;
- }
-
- string dither_str = dither_type_combo.get_entry()->get_text();
- if (dither_str == _("None")) {
- spec.dither_type = GDitherNone;
- } else if (dither_str == _("Rectangular")) {
- spec.dither_type = GDitherRect;
- } else if (dither_str == _("Triangular")) {
- spec.dither_type = GDitherTri;
- } else {
- spec.dither_type = GDitherShaped;
- }
-
- if (!audio_region) {
-
- uint32_t n = 0;
- uint32_t chan=0;
- Port *last_port = 0;
-
- for (RowIterator ri = master_selector.rows().begin(); ri != master_selector.rows().end(); ++ri, ++n) {
-
- Port* port = static_cast<Port*> ((*ri)->get_data ());
-
- if (last_port != port) {
- chan = 0;
- }
-
- Gdk::Pixmap left_pixmap = master_selector.cell (n, 1).get_pixmap ();
-
- if (left_pixmap.gobj() == check_pixmap) {
- spec.port_map[0].push_back (std::pair<Port*,uint32_t>(port, chan));
- }
-
- if (spec.channels == 2) {
-
- Gdk::Pixmap right_pixmap = master_selector.cell (n, 2).get_pixmap ();
-
- if (right_pixmap.gobj() == check_pixmap) {
- spec.port_map[1].push_back (std::pair<Port*,uint32_t>(port, chan));
- }
-
- }