diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-06-03 12:22:21 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-06-03 12:22:21 +0000 |
commit | a29b3b862aaa7964d64a625eac9962bb6d0ff14f (patch) | |
tree | f84a9d526ba320abc89fdb090fdd9b0aac2275eb | |
parent | 66016dfef77df2c5f6bcb0bc44ffd7cb38b83f87 (diff) |
small changes to export code to hopefully fix some bugs with range export(s)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3441 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/export_dialog.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/export_range_markers_dialog.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/utils.cc | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 7 | ||||
-rw-r--r-- | libs/ardour/session_export.cc | 64 | ||||
-rw-r--r-- | libs/sigc++2/sigc++/Makefile.in | 1 |
6 files changed, 51 insertions, 31 deletions
diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index b6bc69c9b9..5d46b06a07 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -974,6 +974,8 @@ ExportDialog::do_export () progress_connection = Glib::signal_timeout().connect (mem_fun(*this, &ExportDialog::progress_timeout), 100); cancel_label.set_text (_("Stop Export")); + session->pre_export (); + export_audio_data(); progress_connection.disconnect (); @@ -1228,7 +1230,7 @@ ExportDialog::initSpec(string &filepath) { spec.path = filepath; spec.progress = 0; - spec.running = true; + spec.running = false; spec.stop = false; spec.port_map.clear(); diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc index 1184294a67..329493e195 100644 --- a/gtk2_ardour/export_range_markers_dialog.cc +++ b/gtk2_ardour/export_range_markers_dialog.cc @@ -81,8 +81,6 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList& spec.start_frame = currentLocation->start(); spec.end_frame = currentLocation->end(); - getSession().request_locate(spec.start_frame, false); - if (getSession().start_audio_export(spec)){ // if export fails return; @@ -100,6 +98,8 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList& } current_range_marker_index++; + + getSession().stop_audio_export (spec); } } diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index ae3d3947f7..6470b1c357 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -680,7 +680,7 @@ set_pango_fontsize () /* Cairo rendering, in case there is any */ - pango_cairo_font_map_set_resolution ((PangoCairoFontMap*) pango_cairo_font_map_get_default(), val/1024); + // pango_cairo_font_map_set_resolution ((PangoCairoFontMap*) pango_cairo_font_map_get_default(), val/1024); } void diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index e5750e8a5b..f2dbed9047 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -600,8 +600,9 @@ class Session : public PBD::StatefulDestructible SlaveSource post_export_slave; nframes_t post_export_position; - int start_audio_export (ARDOUR::AudioExportSpecification&); - int stop_audio_export (ARDOUR::AudioExportSpecification&); + int pre_export (); + int start_audio_export (ARDOUR::AudioExportSpecification&); + int stop_audio_export (ARDOUR::AudioExportSpecification&); void finalize_audio_export (); static sigc::signal<void, std::string, std::string> Exported; @@ -1068,7 +1069,7 @@ class Session : public PBD::StatefulDestructible void set_slave_source (SlaveSource); bool _exporting; - int prepare_to_export (ARDOUR::AudioExportSpecification&); + int prepare_to_export (ARDOUR::AudioExportSpecification&); void prepare_diskstreams (); void commit_diskstreams (nframes_t, bool& session_requires_butler); diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 33c9e0062d..373f662eda 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -253,6 +253,12 @@ AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate) output_data = (void*) malloc (sample_bytes * out_samples_max); } + pos = start_frame; + end_frame = end_frame; + total_frames = end_frame - start_frame; + running = true; + do_freewheel = false; /* force a call to ::prepare_to_export() before proceeding to normal operation */ + return 0; } @@ -435,12 +441,6 @@ Session::start_audio_export (AudioExportSpecification& spec) return -1; } - spec.pos = spec.start_frame; - spec.end_frame = spec.end_frame; - spec.total_frames = spec.end_frame - spec.start_frame; - spec.running = true; - spec.do_freewheel = false; /* force a call to ::prepare_to_export() before proceeding to normal operation */ - spec.freewheel_connection = _engine.Freewheel.connect (sigc::bind (mem_fun (*this, &Session::process_export), &spec)); return _engine.freewheel (true); @@ -454,16 +454,14 @@ Session::stop_audio_export (AudioExportSpecification& spec) spec.freewheel_connection.disconnect (); spec.clear (); /* resets running/stop etc */ - Exported( spec.path, name() ); + Exported (spec.path, name()); return 0; } -int -Session::prepare_to_export (AudioExportSpecification& spec) +int +Session::pre_export () { - int ret = -1; - wait_till_butler_finished (); /* take everyone out of awrite to avoid disasters */ @@ -476,6 +474,27 @@ Session::prepare_to_export (AudioExportSpecification& spec) } } + /* make sure we are actually rolling */ + + if (get_record_enabled()) { + disable_record (false); + } + + /* no slaving */ + + post_export_slave = Config->get_slave_source (); + post_export_position = _transport_frame; + + Config->set_slave_source (None); + + return 0; +} + +int +Session::prepare_to_export (AudioExportSpecification& spec) +{ + int ret = -1; + /* get everyone to the right position */ { @@ -491,22 +510,19 @@ Session::prepare_to_export (AudioExportSpecification& spec) } } - /* make sure we are actually rolling */ - - if (get_record_enabled()) { - disable_record (false); - } + /* we just did the core part of a locate() call above, but + for the sake of any GUI, put the _transport_frame in + the right place too. + */ + _transport_frame = spec.start_frame; _exporting = true; - - /* no slaving */ - - post_export_slave = Config->get_slave_source (); - post_export_position = _transport_frame; - - Config->set_slave_source (None); - /* get transport ready */ + /* get transport ready. note how this is calling butler functions + from a non-butler thread. we waited for the butler to stop + what it was doing earlier in Session::pre_export() and nothing + since then has re-awakened it. + */ set_transport_speed (1.0, false); butler_transport_work (); diff --git a/libs/sigc++2/sigc++/Makefile.in b/libs/sigc++2/sigc++/Makefile.in index 11ff5f5904..f1aed4ae10 100644 --- a/libs/sigc++2/sigc++/Makefile.in +++ b/libs/sigc++2/sigc++/Makefile.in @@ -140,6 +140,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ |