From e00d9dd585a2966f4e14cab890292bb48bdd6a68 Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Mon, 23 Dec 2013 20:26:51 +0200 Subject: [PATCH 1/7] Re-enable export file tagging. No idea why this code has dropped out at some stage... --- libs/ardour/export_handler.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 4a6b0552c5..93f43f33a6 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -25,12 +25,14 @@ #include "pbd/convert.h" +#include "ardour/audiofile_tagger.h" #include "ardour/export_graph_builder.h" #include "ardour/export_timespan.h" #include "ardour/export_channel_configuration.h" #include "ardour/export_status.h" #include "ardour/export_format_specification.h" #include "ardour/export_filename.h" +#include "ardour/session_metadata.h" #include "i18n.h" @@ -280,13 +282,18 @@ ExportHandler::finish_timespan () while (config_map.begin() != timespan_bounds.second) { ExportFormatSpecPtr fmt = config_map.begin()->second.format; + std::string filename = config_map.begin()->second.filename->get_path(fmt); if (fmt->with_cue()) { - export_cd_marker_file (current_timespan, fmt, config_map.begin()->second.filename->get_path(fmt), CDMarkerCUE); - } + export_cd_marker_file (current_timespan, fmt, filename, CDMarkerCUE); + } if (fmt->with_toc()) { - export_cd_marker_file (current_timespan, fmt, config_map.begin()->second.filename->get_path(fmt), CDMarkerTOC); + export_cd_marker_file (current_timespan, fmt, filename, CDMarkerTOC); + } + + if (fmt->tag()) { + AudiofileTagger::tag_file(filename, *SessionMetadata::Metadata()); } config_map.erase (config_map.begin()); From 2cab506f0045adf1b89887b7d6b38579372de1df Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Mon, 23 Dec 2013 20:47:37 +0200 Subject: [PATCH 2/7] Fix export format dialog tagging state inconsistency The state of a checkbox was used before the UI was properly initialized. This always unset the tagging option in the format object. --- gtk2_ardour/export_format_dialog.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index 1e8e87c7cf..c5d1573d54 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -897,8 +897,6 @@ ExportFormatDialog::show_ogg_enconding_options (boost::shared_ptr Date: Fri, 27 Dec 2013 14:04:49 +0100 Subject: [PATCH 3/7] initialize some uninitialized variables --- libs/ardour/route.cc | 1 + libs/ardour/ticker.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 2f69c3340a..92a6544151 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -96,6 +96,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type) , _have_internal_generator (false) , _solo_safe (false) , _default_type (default_type) + , _order_key (0) , _has_order_key (false) , _remote_control_id (0) , _in_configure_processors (false) diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc index 9a2cff7b23..15326af882 100644 --- a/libs/ardour/ticker.cc +++ b/libs/ardour/ticker.cc @@ -38,7 +38,7 @@ class MidiClockTicker::Position : public Timecode::BBT_Time { public: - Position() : speed(0.0f), frame(0) { } + Position() : speed(0.0f), frame(0), midi_beats(0) { } ~Position() { } /** Sync timing information taken from the given Session From 8f69af4af3f5da403fceffbcdf5e7d61ddfcaaca Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 27 Dec 2013 14:53:30 +0100 Subject: [PATCH 4/7] add support for old compilers w/o implicit stdbool --- libs/plugins/reasonablesynth.lv2/rsynth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/plugins/reasonablesynth.lv2/rsynth.c b/libs/plugins/reasonablesynth.lv2/rsynth.c index 061d72dbff..a6c74aa26c 100644 --- a/libs/plugins/reasonablesynth.lv2/rsynth.c +++ b/libs/plugins/reasonablesynth.lv2/rsynth.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #ifndef BUFFER_SIZE_SAMPLES From 37264c85a509aca4a4ea71e8e2c5d32c81956879 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 28 Dec 2013 13:43:44 +0100 Subject: [PATCH 5/7] centralize buffer silent-flag fixes possible x-talk 1 in, >= 2 out tracks: Previously, only the first route-buffer of the input buffers were marked as non-silent in Route::process_output_buffers(). Other buffers in the set (e.g. post-panner) would contain audio but not marked as non-silent. --- libs/ardour/ardour/audio_buffer.h | 15 +++------------ libs/ardour/audio_buffer.cc | 18 ++++++++++++++++-- libs/ardour/plugin_insert.cc | 1 - libs/ardour/port_insert.cc | 1 - libs/ardour/route.cc | 2 -- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index 054a1f7b45..c356ed82b9 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -33,17 +33,7 @@ public: AudioBuffer(size_t capacity); ~AudioBuffer(); - void silence (framecnt_t len, framecnt_t offset = 0) { - if (!_silent) { - assert(_capacity > 0); - assert(offset + len <= _capacity); - memset(_data + offset, 0, sizeof (Sample) * len); - if (len == _capacity) { - _silent = true; - } - } - _written = true; - } + void silence (framecnt_t len, framecnt_t offset = 0); /** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/ void read_from (const Sample* src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { @@ -204,10 +194,11 @@ public: Sample* data (framecnt_t offset = 0) { assert(offset <= _capacity); + _silent = false; return _data + offset; } - bool check_silence (pframes_t, pframes_t&) const; + bool check_silence (pframes_t, bool, pframes_t&) const; void prepare () { _written = false; _silent = false; } bool written() const { return _written; } diff --git a/libs/ardour/audio_buffer.cc b/libs/ardour/audio_buffer.cc index a36ad81c2a..b4e2a55ac2 100644 --- a/libs/ardour/audio_buffer.cc +++ b/libs/ardour/audio_buffer.cc @@ -76,12 +76,26 @@ AudioBuffer::resize (size_t size) } bool -AudioBuffer::check_silence (pframes_t nframes, pframes_t& n) const +AudioBuffer::check_silence (pframes_t nframes, bool wholebuffer, pframes_t& n) const { - for (n = 0; n < _size && n < nframes; ++n) { + for (n = 0; (wholebuffer || n < _size) && n < nframes; ++n) { if (_data[n] != Sample (0)) { return false; } } return true; } + +void +AudioBuffer::silence (framecnt_t len, framecnt_t offset) { + pframes_t n = 0; + if (!_silent) { + assert(_capacity > 0); + assert(offset + len <= _capacity); + memset(_data + offset, 0, sizeof (Sample) * len); + if (len == _capacity) { + _silent = true; + } + } + _written = true; +} diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index b191cf4890..b3517531aa 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -505,7 +505,6 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end * all buffers appropriately. */ - bufs.set_is_silent (false); } void diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc index 97fe082c81..c352e22e55 100644 --- a/libs/ardour/port_insert.cc +++ b/libs/ardour/port_insert.cc @@ -116,7 +116,6 @@ PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, _mtdm->process (nframes, in, out); - outbuf.set_is_silent (false); outbuf.set_written (true); } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 92a6544151..c032b77eff 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -419,8 +419,6 @@ Route::process_output_buffers (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick, bool gain_automation_ok) { - bufs.set_is_silent (false); - /* figure out if we're going to use gain automation */ if (gain_automation_ok) { _amp->set_gain_automation_buffer (_session.gain_automation_buffer ()); From 0f6686eea90bb9d0d96a525d505e9f3165be2973 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 28 Dec 2013 13:37:09 +0100 Subject: [PATCH 6/7] remove unused API to explicitly set/unset buffer silent flag --- libs/ardour/ardour/buffer.h | 1 - libs/ardour/ardour/buffer_set.h | 1 - libs/ardour/buffer_set.cc | 11 ----------- 3 files changed, 13 deletions(-) diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index 4570a7a663..0d0f5d3758 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -61,7 +61,6 @@ public: DataType type() const { return _type; } bool silent() const { return _silent; } - void set_is_silent(bool yn) { _silent = yn; } /** Reallocate the buffer used internally to handle at least @a size_t units of data. * diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index 26d47682af..5f8553218b 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -86,7 +86,6 @@ public: const ChanCount& count() const { return _count; } ChanCount& count() { return _count; } - void set_is_silent(bool yn); void silence (framecnt_t nframes, framecnt_t offset); bool is_mirror() const { return _is_mirror; } diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc index 227d7a1e95..9db99d20ce 100644 --- a/libs/ardour/buffer_set.cc +++ b/libs/ardour/buffer_set.cc @@ -468,16 +468,5 @@ BufferSet::silence (framecnt_t nframes, framecnt_t offset) } } -void -BufferSet::set_is_silent (bool yn) -{ - for (std::vector::iterator i = _buffers.begin(); i != _buffers.end(); ++i) { - for (BufferVec::iterator b = i->begin(); b != i->end(); ++b) { - (*b)->set_is_silent (yn); - } - } - -} - } // namespace ARDOUR From 5bc8750f73c7b4f4d4fe2c15831862c2bfd8250a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 28 Dec 2013 16:15:00 +0100 Subject: [PATCH 7/7] prevent 0-pointer dereference in editor_routes.cc - fixes #5794 --- gtk2_ardour/editor.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index cf3eab5724..faa2a0cf56 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4871,8 +4871,10 @@ Editor::add_routes (RouteList& routes) rtv->view()->RegionViewRemoved.connect (sigc::mem_fun (*this, &Editor::region_view_removed)); } - _routes->routes_added (new_views); - _summary->routes_added (new_views); + if (new_views.size() > 0) { + _routes->routes_added (new_views); + _summary->routes_added (new_views); + } if (show_editor_mixer_when_tracks_arrive) { show_editor_mixer (true);