#include <ardour/audioengine.h>
#include <ardour/sndfile_helpers.h>
-#include <pbd/dirname.h>
-
#include "ardour_ui.h"
#include "export_range_markers_dialog.h"
using namespace Gtk;
using namespace ARDOUR;
+using namespace PBD;
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 ()
Locations::LocationList::iterator locationIter;
current_range_marker_index = 0;
init_progress_computing(locations);
-
+
for (locationIter = locations.begin(); locationIter != locations.end(); ++locationIter) {
Location *currentLocation = (*locationIter);
// wait until export of this range finished
gtk_main_iteration();
- while(spec.running){
+
+ while (spec.running){
if(gtk_events_pending()){
gtk_main_iteration();
}else {
}
}
- getSession().engine().freewheel (false);
current_range_marker_index++;
}
}
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;
}
// directory needs to exist and be writable
- string dirpath = PBD::dirname (filepath);
+ string dirpath = Glib::path_get_dirname (filepath);
if (::access (dirpath.c_str(), W_OK) != 0) {
string txt = _("Cannot write file in: ") + dirpath;
MessageDialog msg (*this, txt, false, MESSAGE_ERROR, BUTTONS_OK, true);
// flush vector
range_markers_durations_aggregated.resize(0);
- jack_nframes_t duration_before_current_location = 0;
+ nframes_t duration_before_current_location = 0;
Locations::LocationList::iterator locationIter;
for (locationIter = locations.begin(); locationIter != locations.end(); ++locationIter) {
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);
- jack_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;
}
}
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;
}