summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_range_markers_dialog.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-18 06:07:08 +0000
committerDavid Robillard <d@drobilla.net>2007-03-18 06:07:08 +0000
commit99904735e066804358f1d0bd138a84f1e9ecda91 (patch)
tree71a924cf1660b5b00231275bd481bbd27094dd9b /gtk2_ardour/export_range_markers_dialog.cc
parenteb270e70a12c410cdd98585ad25bb6d8e384a4f5 (diff)
Merged with trunk R1612.
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/export_range_markers_dialog.cc')
-rw-r--r--gtk2_ardour/export_range_markers_dialog.cc39
1 files changed, 21 insertions, 18 deletions
diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc
index c91e1c101a..1184294a67 100644
--- a/gtk2_ardour/export_range_markers_dialog.cc
+++ b/gtk2_ardour/export_range_markers_dialog.cc
@@ -38,12 +38,20 @@ using namespace std;
ExportRangeMarkersDialog::ExportRangeMarkersDialog (PublicEditor& editor)
: ExportDialog(editor)
{
+ set_title (_("ardour: export ranges"));
+ file_frame.set_label (_("Export to Directory"));
+
do_not_allow_export_cd_markers();
total_duration = 0;
current_range_marker_index = 0;
}
-
+
+Gtk::FileChooserAction
+ExportRangeMarkersDialog::browse_action () const
+{
+ return Gtk::FILE_CHOOSER_ACTION_CREATE_FOLDER;
+}
void
ExportRangeMarkersDialog::export_audio_data ()
@@ -57,7 +65,7 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList&
Locations::LocationList::iterator locationIter;
current_range_marker_index = 0;
init_progress_computing(locations);
-
+
for (locationIter = locations.begin(); locationIter != locations.end(); ++locationIter) {
Location *currentLocation = (*locationIter);
@@ -82,7 +90,8 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList&
// wait until export of this range finished
gtk_main_iteration();
- while(spec.running){
+
+ while (spec.running){
if(gtk_events_pending()){
gtk_main_iteration();
}else {
@@ -90,7 +99,6 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList&
}
}
- getSession().engine().freewheel (false);
current_range_marker_index++;
}
}
@@ -140,8 +148,7 @@ 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\n"
- "are not allowed!");
+ 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;
@@ -173,13 +180,11 @@ ExportRangeMarkersDialog::init_progress_computing(Locations::LocationList& locat
Location *currentLocation = (*locationIter);
if(currentLocation->is_range_marker()){
- range_markers_durations_aggregated.push_back(
- duration_before_current_location);
+ range_markers_durations_aggregated.push_back (duration_before_current_location);
- nframes_t duration =
- currentLocation->end() - currentLocation->start();
+ nframes_t duration = currentLocation->end() - currentLocation->start();
- range_markers_durations.push_back(duration);
+ range_markers_durations.push_back (duration);
duration_before_current_location += duration;
}
}
@@ -192,14 +197,12 @@ gint
ExportRangeMarkersDialog::progress_timeout ()
{
double progress = 0.0;
-
- if(current_range_marker_index >= range_markers_durations.size()){
+
+ if (current_range_marker_index >= range_markers_durations.size()){
progress = 1.0;
- }
- else{
- progress =
- ((double) range_markers_durations_aggregated[current_range_marker_index] +
- (spec.progress * (double) range_markers_durations[current_range_marker_index])) /
+ } else{
+ progress = ((double) range_markers_durations_aggregated[current_range_marker_index] +
+ (spec.progress * (double) range_markers_durations[current_range_marker_index])) /
(double) total_duration;
}