- ok_button.set_sensitive(false);
- save_state();
-
- set_modal (true);
-
- spec.path = filepath;
- spec.progress = 0;
- spec.running = true;
- spec.stop = false;
- spec.port_map.clear();
-
- if (channel_count_combo.get_active_text() == _("mono")) {
- spec.channels = 1;
- } else {
- spec.channels = 2;
- }
-
- spec.format = 0;
-
- spec.format |= sndfile_header_format_from_string (header_format_combo.get_active_text ());
-
- if ((spec.format & SF_FORMAT_WAV) == 0) {
- /* RIFF/WAV specifies endianess */
- spec.format |= sndfile_endian_format_from_string (endian_format_combo.get_active_text ());
- }
-
- spec.format |= sndfile_bitdepth_format_from_string (bitdepth_format_combo.get_active_text ());
-
- string sr_str = sample_rate_combo.get_active_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_active_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_active_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 chan=0;
- Port *last_port = 0;
-
- TreeModel::Children rows = master_selector.get_model()->children();
- TreeModel::Children::iterator ri;
- TreeModel::Row row;
- for (ri = rows.begin(); ri != rows.end(); ++ri) {
- row = *ri;
- Port* port = row[exp_cols.port];
-
- if (last_port != port) {
- chan = 0;
- }
-
- if (row[exp_cols.left]) {
- spec.port_map[0].push_back (std::pair<Port*,uint32_t>(port, chan));
- }
-
- if (spec.channels == 2) {
- if (row[exp_cols.right]) {
- spec.port_map[1].push_back (std::pair<Port*,uint32_t>(port, chan));
- }
- }