From 0627e3f9768f4e19db37857419b10675751ca021 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 22 Nov 2008 22:58:17 +0000 Subject: [PATCH] don't set up dir name incorrectly for range export git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4235 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour.menus | 1 + gtk2_ardour/export_dialog.cc | 53 +++++++++++----------- gtk2_ardour/export_dialog.h | 4 +- gtk2_ardour/export_range_markers_dialog.cc | 10 ++-- gtk2_ardour/mnemonic-us.bindings.in | 7 +-- 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index b5330721bf..d46a40b07e 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -403,6 +403,7 @@ + diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index b0aa6b17d6..142f425f80 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -949,34 +949,37 @@ ExportDialog::do_export () return; } - /* maybe add suffix */ + if (!wants_dir()) { - int file_format = sndfile_header_format_from_string (header_format_combo.get_active_text ()); - - if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_WAV) { - if (filepath.find (".wav") != filepath.length() - 4) { - filepath += ".wav"; - } - } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AIFF) { - if (filepath.find (".aiff") != filepath.length() - 5) { - filepath += ".aiff"; - } - } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_W64) { - if (filepath.find (".w64") != filepath.length() - 5) { - filepath += ".w64"; - } - } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC) { - if (filepath.find (".flac") != filepath.length() - 5) { - filepath += ".flac"; - } - } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_CAF) { - if (filepath.find (".caf") != filepath.length() - 4) { - filepath += ".caf"; + /* maybe add suffix */ + + int file_format = sndfile_header_format_from_string (header_format_combo.get_active_text ()); + + if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_WAV) { + if (filepath.find (".wav") != filepath.length() - 4) { + filepath += ".wav"; + } + } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AIFF) { + if (filepath.find (".aiff") != filepath.length() - 5) { + filepath += ".aiff"; + } + } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_W64) { + if (filepath.find (".w64") != filepath.length() - 5) { + filepath += ".w64"; + } + } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_FLAC) { + if (filepath.find (".flac") != filepath.length() - 5) { + filepath += ".flac"; + } + } else if ((file_format & SF_FORMAT_TYPEMASK) == SF_FORMAT_CAF) { + if (filepath.find (".caf") != filepath.length() - 4) { + filepath += ".caf"; + } } + + /* others ? */ } - /* others ? */ - if(!is_filepath_valid(filepath)){ return; } @@ -1012,8 +1015,6 @@ ExportDialog::do_export () /* if not stopped early and not SAE, ask for money, maybe */ - cerr << "At end, spec.stop == " << spec.stop << endl; - if (!spec.stop && !Profile->get_sae()) { NagScreen* ns = NagScreen::maybe_nag (_("export")); diff --git a/gtk2_ardour/export_dialog.h b/gtk2_ardour/export_dialog.h index 596467d3e1..f99f6d237e 100644 --- a/gtk2_ardour/export_dialog.h +++ b/gtk2_ardour/export_dialog.h @@ -96,7 +96,7 @@ class ExportDialog : public ArdourDialog private: PublicEditor& editor; ARDOUR::Session* session; - bool track_and_master_selection_allowed; + bool track_and_master_selection_allowed; bool channel_count_selection_allowed; bool export_cd_markers_allowed; @@ -163,7 +163,7 @@ class ExportDialog : public ArdourDialog void fill_lists(); void write_track_and_master_selection_to_spec(); - void do_export_cd_markers (const string& path, const string& cuefile_type); + void do_export_cd_markers (const string& path, const string& cuefile_type); void export_cue_file (ARDOUR::Locations::LocationList& locations, const string& path); void export_toc_file (ARDOUR::Locations::LocationList& locations, const string& path); void do_export (); diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc index 329493e195..50b8098d60 100644 --- a/gtk2_ardour/export_range_markers_dialog.cc +++ b/gtk2_ardour/export_range_markers_dialog.cc @@ -131,7 +131,6 @@ ExportRangeMarkersDialog::get_target_filepath(string path, string filename, stri return target_filepath; } - bool ExportRangeMarkersDialog::is_filepath_valid(string &filepath) { @@ -148,10 +147,10 @@ ExportRangeMarkersDialog::is_filepath_valid(string &filepath) if ( (stat (filepath.c_str(), &statbuf) != 0) || (!S_ISDIR (statbuf.st_mode)) ) { - string txt = _("Please select an existing target directory. Files are not allowed!"); - MessageDialog msg (*this, txt, false, MESSAGE_ERROR, BUTTONS_OK, true); - msg.run(); - return false; + string txt = _("Please select an existing target directory. Files are not allowed!"); + MessageDialog msg (*this, txt, false, MESSAGE_ERROR, BUTTONS_OK, true); + msg.run(); + return false; } // directory needs to exist and be writable @@ -166,7 +165,6 @@ ExportRangeMarkersDialog::is_filepath_valid(string &filepath) return true; } - void ExportRangeMarkersDialog::init_progress_computing(Locations::LocationList& locations) { diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index 4f5b7f9cea..b2419a1b96 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -107,7 +107,7 @@ (gtk_accel_path "/Common/ToggleBigClock" "<%WINDOW%>b") (gtk_accel_path "/Editor/normalize-region" "n") (gtk_accel_path "/Editor/mute-unmute-region" "m") -(gtk_accel_path "/Common/goto-mixer" "<%WINDOW%>m") +(gtk_accel_path "/Common/toggle-editor-mixer-on-top" "<%WINDOW%>m") ;; arrow keys, navigation etc. @@ -215,8 +215,9 @@ (gtk_accel_path "/Editor/toggle-edit-mode" "1") (gtk_accel_path "/Editor/cycle-snap-mode" "2") (gtk_accel_path "/Editor/cycle-snap-choice" "3") -(gtk_accel_path "/Transport/ToggleAutoReturn" "4") -(gtk_accel_path "/Transport/ToggleClick" "5") +(gtk_accel_path "/Editor/step-mouse-mode" "4") +(gtk_accel_path "/Transport/ToggleAutoReturn" "5") +(gtk_accel_path "/Transport/ToggleClick" "6") (gtk_accel_path "/Editor/set-tempo-from-region" "9") (gtk_accel_path "/Editor/set-tempo-from-edit-range" "0") -- 2.30.2