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
This commit is contained in:
Paul Davis 2008-11-22 22:58:17 +00:00
parent 495edc3ed9
commit 0627e3f976
5 changed files with 38 additions and 37 deletions

View file

@ -403,6 +403,7 @@
<separator/>
<menuitem action='goto-editor'/>
<menuitem action='goto-mixer'/>
<menuitem action='toggle-editor-mixer-on-top'/>
<menuitem action='ToggleOptionsEditor'/>
<menuitem action='ToggleInspector'/>
<menuitem action='ToggleLocations'/>

View file

@ -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 ());
/* 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";
}
}
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"));

View file

@ -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 ();

View file

@ -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)
{

View file

@ -107,7 +107,7 @@
(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<%WINDOW%>b")
(gtk_accel_path "<Actions>/Editor/normalize-region" "n")
(gtk_accel_path "<Actions>/Editor/mute-unmute-region" "m")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<%WINDOW%>m")
(gtk_accel_path "<Actions>/Common/toggle-editor-mixer-on-top" "<%WINDOW%>m")
;; arrow keys, navigation etc.
@ -215,8 +215,9 @@
(gtk_accel_path "<Actions>/Editor/toggle-edit-mode" "1")
(gtk_accel_path "<Actions>/Editor/cycle-snap-mode" "2")
(gtk_accel_path "<Actions>/Editor/cycle-snap-choice" "3")
(gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "4")
(gtk_accel_path "<Actions>/Transport/ToggleClick" "5")
(gtk_accel_path "<Actions>/Editor/step-mouse-mode" "4")
(gtk_accel_path "<Actions>/Transport/ToggleAutoReturn" "5")
(gtk_accel_path "<Actions>/Transport/ToggleClick" "6")
(gtk_accel_path "<Actions>/Editor/set-tempo-from-region" "9")
(gtk_accel_path "<Actions>/Editor/set-tempo-from-edit-range" "0")