#include <boost/algorithm/string/erase.hpp>
#include "pbd/basename.h"
-#include "pbd/boost_debug.h"
#include "pbd/convert.h"
#include "pbd/convert.h"
#include "pbd/error.h"
#include "ardour/audioengine.h"
#include "ardour/audiofilesource.h"
#include "ardour/auditioner.h"
+#include "ardour/boost_debug.h"
#include "ardour/buffer_manager.h"
#include "ardour/buffer_set.h"
#include "ardour/bundle.h"
#include "ardour/track.h"
#include "ardour/user_bundle.h"
#include "ardour/utils.h"
+#include "ardour/vca_manager.h"
#include "midi++/port.h"
#include "midi++/mmc.h"
, first_file_header_format_reset (true)
, have_looped (false)
, _have_rec_enabled_track (false)
- , _have_rec_disabled_track (true)
+ , _have_rec_disabled_track (true)
, _step_editors (0)
, _suspend_timecode_transmission (0)
, _speakers (new Speakers)
, _scene_changer (0)
, _midi_ports (0)
, _mmc (0)
+ , _vca_manager (new VCAManager (*this))
{
uint32_t sr = 0;
*/
if (state_tree) {
- const XMLProperty* prop;
- if ((prop = state_tree->root()->property (X_("sample-rate"))) != 0) {
+ XMLProperty const * prop;
+ XMLNode const * root (state_tree->root());
+ if ((prop = root->property (X_("sample-rate"))) != 0) {
sr = atoi (prop->value());
}
}
}
try {
+ LocaleGuard lg;
BootMessage (_("Set up LTC"));
setup_ltc ();
BootMessage (_("Set up Click"));
delete midi_clock;
delete _tempo_map;
+ delete _vca_manager;
/* clear event queue, the session is gone, nobody is interested in
* those anymore, but they do leak memory if not removed
DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n");
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- boost_debug_list_ptrs ();
-#endif
+ BOOST_SHOW_POINTERS ();
}
void
return;
}
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- // boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
-#endif
+ BOOST_MARK_ROUTE(r);
+
try {
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
r->input()->ensure_io (_master_out->output()->n_ports(), false, this);
*/
list<boost::shared_ptr<MidiTrack> >
Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost::shared_ptr<PluginInfo> instrument,
- TrackMode mode, RouteGroup* route_group, uint32_t how_many, string name_template)
+ TrackMode mode, RouteGroup* route_group, uint32_t how_many, string name_template, Plugin::PresetRecord* pset)
{
string track_name;
uint32_t track_id = 0;
track->use_new_diskstream();
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- // boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
-#endif
+ BOOST_MARK_TRACK (track);
+
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (track->input()->ensure_io (input, false, this)) {
if (instrument) {
for (RouteList::iterator r = new_routes.begin(); r != new_routes.end(); ++r) {
PluginPtr plugin = instrument->load (*this);
+ if (pset) {
+ plugin->load_preset (*pset);
+ }
boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin));
(*r)->add_processor (p, PreFader);
}
RouteList
-Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name_template, boost::shared_ptr<PluginInfo> instrument)
+Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name_template, boost::shared_ptr<PluginInfo> instrument, Plugin::PresetRecord* pset)
{
string bus_name;
uint32_t bus_id = 0;
bus->set_strict_io (true);
}
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- // boost_debug_shared_ptr_mark_interesting (bus.get(), "Route");
-#endif
+ BOOST_MARK_ROUTE(bus);
+
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (instrument) {
for (RouteList::iterator r = ret.begin(); r != ret.end(); ++r) {
PluginPtr plugin = instrument->load (*this);
+ if (pset) {
+ plugin->load_preset (*pset);
+ }
boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin));
(*r)->add_processor (p, PreFader);
}
track->use_new_diskstream();
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- // boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
-#endif
+ BOOST_MARK_TRACK (track);
+
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
bus->set_strict_io (true);
}
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- // boost_debug_shared_ptr_mark_interesting (bus.get(), "Route");
-#endif
+ BOOST_MARK_ROUTE(bus);
+
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
case NewPlaylist:
rename_playlist = true;
break;
+ default:
case CopyPlaylist:
case SharePlaylist:
rename_playlist = false;
for (XMLNodeList::iterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == X_("Processor")) {
/* ForceIDRegeneration does not catch the following */
- XMLProperty* role = (*i)->property (X_("role"));
- XMLProperty* type = (*i)->property (X_("type"));
+ XMLProperty const * role = (*i)->property (X_("role"));
+ XMLProperty const * type = (*i)->property (X_("type"));
if (role && role->value() == X_("Aux")) {
/* check if the target bus exists.
* we should not save aux-sends in templates.
*/
- XMLProperty* target = (*i)->property (X_("target"));
+ XMLProperty const * target = (*i)->property (X_("target"));
if (!target) {
(*i)->add_property ("type", "dangling-aux-send");
continue;
graph_reordered ();
}
-
void
Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove)
{
" assert(self.scripts[n] == nil, 'Callback \"'.. n ..'\" already exists.')"
" self.scripts[n] = { ['f'] = f, ['a'] = a }"
" local env = _ENV; env.f = nil env.io = nil env.os = nil env.loadfile = nil env.require = nil env.dofile = nil env.package = nil env.debug = nil"
- " local env = { print = print, Session = Session, tostring = tostring, assert = assert, ipairs = ipairs, error = error, select = select, string = string, type = type, tonumber = tonumber, collectgarbage = collectgarbage, pairs = pairs, math = math, table = table, pcall = pcall }"
+ " local env = { print = print, tostring = tostring, assert = assert, ipairs = ipairs, error = error, select = select, string = string, type = type, tonumber = tonumber, collectgarbage = collectgarbage, pairs = pairs, math = math, table = table, pcall = pcall, Session = Session, PBD = PBD, Timecode = Timecode, Evoral = Evoral, C = C, ARDOUR = ARDOUR }"
" self.instances[n] = load (string.dump(f, true), nil, nil, env)(a)"
" Session:scripts_changed()" // call back
" end"
set_dirty ();
}
+void
+Session::gui_tempo_map_changed ()
+{
+ clear_clicks ();
+
+ playlists->update_after_tempo_map_change ();
+
+ _locations->apply (*this, &Session::update_locations_after_tempo_map_change);
+}
+
void
Session::update_locations_after_tempo_map_change (const Locations::LocationList& loc)
{
}
unblock_processing ();
- itt.done = true;
return result;
}
void
Session::update_latency (bool playback)
{
+
DEBUG_TRACE (DEBUG::Latency, string_compose ("JACK latency callback: %1\n", (playback ? "PLAYBACK" : "CAPTURE")));
- if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress) {
+ if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress || _route_deletion_in_progress) {
return;
}