33 #include <glibmm/threads.h>
34 #include <glibmm/miscutils.h>
35 #include <glibmm/fileutils.h>
37 #include <boost/algorithm/string/erase.hpp>
68 #include "ardour/debug.h"
97 #include "ardour/utils.h"
99 #include "midi++/port.h"
100 #include "midi++/mmc.h"
114 bool Session::_disable_all_loaded_plugins =
false;
116 PBD::Signal1<int,uint32_t> Session::AudioEngineSetupRequired;
117 PBD::Signal1<void,std::string> Session::Dialog;
118 PBD::Signal0<int> Session::AskAboutPendingState;
119 PBD::Signal2<int, framecnt_t, framecnt_t> Session::AskAboutSampleRateMismatch;
120 PBD::Signal0<void> Session::SendFeedback;
121 PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
123 PBD::Signal1<void, framepos_t> Session::StartTimeChanged;
124 PBD::Signal1<void, framepos_t> Session::EndTimeChanged;
125 PBD::Signal2<void,std::string, std::string> Session::Exported;
126 PBD::Signal1<int,boost::shared_ptr<Playlist> > Session::AskAboutPlaylistDeletion;
127 PBD::Signal0<void> Session::Quit;
128 PBD::Signal0<void> Session::FeedbackDetected;
129 PBD::Signal0<void> Session::SuccessfulGraphSort;
130 PBD::Signal2<void,std::string,std::string> Session::VersionMismatch;
132 const framecnt_t Session::bounce_chunk_size = 65536;
138 const string& fullpath,
139 const string& snapshot_name,
144 , process_function (&
Session::process_with_events)
145 , _bounce_processing_active (false)
146 , waiting_for_sync_offset (false)
147 , _base_frame_rate (0)
148 , _current_frame_rate (0)
149 , _nominal_frame_rate (0)
150 , transport_sub_state (0)
151 , _record_status (Disabled)
152 , _transport_frame (0)
153 , _session_range_location (0)
156 , _transport_speed (0)
157 , _default_transport_speed (1.0)
158 , _last_transport_speed (0)
159 , _target_transport_speed (0.0)
160 , auto_play_legal (false)
161 , _last_slave_transport_frame (0)
162 , maximum_output_latency (0)
163 , _requested_return_frame (-1)
164 , current_block_size (0)
165 , _worst_output_latency (0)
166 , _worst_input_latency (0)
167 , _worst_track_latency (0)
168 , _have_captured (false)
169 , _non_soloed_outs_muted (false)
171 , _solo_isolated_cnt (0)
173 , _was_seamless (
Config->get_seamless_loop ())
174 , _under_nsm_control (false)
176 , delta_accumulator_cnt (0)
177 , average_slave_delta (1800)
179 , have_first_delta_accumulator (false)
180 , _slave_state (Stopped)
181 , post_export_sync (false)
182 , post_export_position (0)
184 , _export_started (false)
185 , _export_rolling (false)
186 , _pre_export_mmc_enabled (false)
187 , _name (snapshot_name)
189 , _send_qf_mtc (false)
190 , _pframes_since_last_mtc (0)
191 , session_midi_feedback (0)
193 , loop_changing (false)
196 , _current_snapshot_name (snapshot_name)
198 , state_was_pending (false)
199 , _state_of_the_state (
StateOfTheState(CannotSave|InitialConnecting|Loading))
201 , _save_queued (false)
202 , _last_roll_location (0)
203 , _last_roll_or_reversal_location (0)
204 , _last_record_location (0)
205 , pending_locate_roll (false)
206 , pending_locate_frame (0)
207 , pending_locate_flush (false)
208 , pending_abort (false)
209 , pending_auto_loop (false)
210 , _butler (new
Butler (*this))
211 , _post_transport_work (0)
212 , cumulative_rf_motion (0)
215 , _ignore_skips_updates (false)
216 , _rt_thread_active (false)
217 , _rt_emit_pending (false)
219 , outbound_mtc_timecode_frame (0)
220 , next_quarter_frame_to_send (-1)
221 , _frames_per_timecode_frame (0)
222 , _frames_per_hour (0)
223 , _timecode_frames_per_hour (0)
224 , last_timecode_valid (false)
225 , last_timecode_when (0)
226 , _send_timecode_update (false)
238 , ltc_timecode_offset (0)
239 , ltc_timecode_negative_offset (false)
240 , midi_control_ui (0)
242 , _all_route_group (new
RouteGroup (*this,
"all"))
244 , _adding_routes_in_progress (false)
245 , destructive_index (0)
246 , _track_number_decimals(1)
247 , solo_update_disabled (false)
248 , default_fade_steepness (0)
249 , default_fade_msecs (0)
250 , _total_free_4k_blocks (0)
251 , _total_free_4k_blocks_uncertain (false)
252 , no_questions_about_missing_files (false)
256 , _bundle_xml_node (0)
260 , click_emphasis_data (0)
262 , click_emphasis_length (0)
263 , _clicks_cleared (0)
264 , _play_range (false)
266 , first_file_data_format_reset (true)
267 , first_file_header_format_reset (true)
268 , have_looped (false)
269 , _have_rec_enabled_track (false)
271 , _suspend_timecode_transmission (0)
274 , ignore_route_processor_changes (false)
292 if (
create (mix_template, bus_profile)) {
346 bool was_dirty =
dirty();
389 if (r.get_value_or (-1) != 0) {
395 if (r.get_value_or (-1) != 0) {
438 if (
config.get_jack_time_master()) {
465 vector<void*> debug_pointers;
557 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
559 (*i)->drop_references ();
570 for (SourceMap::iterator i =
sources.begin(); i !=
sources.end(); ++i) {
572 i->second->drop_references ();
597 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
666 XMLNodeList::const_iterator i = children.begin();
669 if (i != children.end()) {
692 for (uint32_t physport = 0; physport < 2; ++physport) {
693 if (outs.size() > physport) {
694 if (
_click_io->add_port (outs[physport],
this)) {
713 for (BundleList::iterator i = b->begin(); i != b->end();) {
714 if (boost::dynamic_pointer_cast<UserBundle>(*i)) {
743 snprintf (buf,
sizeof (buf),
_(
"out %s"), pn.substr(0,12).c_str());
745 snprintf (buf,
sizeof (buf),
_(
"out %" PRIu32), np+1);
760 snprintf (buf,
sizeof(buf),
_(
"out %" PRIu32
"+%" PRIu32), np + 1, np + 2);
777 snprintf (buf,
sizeof (buf),
_(
"in %s"), pn.substr(0,12).c_str());
779 snprintf (buf,
sizeof (buf),
_(
"in %" PRIu32), np+1);
794 snprintf (buf,
sizeof(buf),
_(
"in %" PRIu32
"+%" PRIu32), np + 1, np + 2);
814 boost::erase_first (n,
X_(
"alsa_pcm:"));
824 for (uint32_t np = 0; np < outputs[
DataType::MIDI].size(); ++np) {
830 boost::erase_first (n,
X_(
"alsa_pcm:"));
859 for (uint32_t n = 0; n < limit; ++n) {
862 if (outputs[p->
type()].size() > n) {
863 connect_to = outputs[p->
type()][n];
866 if (!connect_to.empty() && p->
connected_to (connect_to) ==
false) {
884 Config->set_solo_control_is_listen_control (
false);
908 for (RouteList::iterator x = r->begin(); x != r->end(); ++x) {
910 if ((*x)->is_monitor()) {
912 }
else if ((*x)->is_master()) {
943 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
975 for (uint32_t n = 0; n < limit; ++n) {
980 string connect_to = o->
name();
995 if (!
Config->get_monitor_bus_preferred_bundle().empty()) {
1003 Config->get_monitor_bus_preferred_bundle())
1022 for (uint32_t n = 0; n < limit; ++n) {
1030 if (!connect_to.empty()) {
1033 _(
"cannot connect control output %1 to %2"),
1060 for (RouteList::iterator x = rls->begin(); x != rls->end(); ++x) {
1062 if ((*x)->is_monitor()) {
1064 }
else if ((*x)->is_master()) {
1067 (*x)->enable_monitor_send ();
1101 for (uint32_t n = 0; n < limit; ++n) {
1106 string connect_to = o->
name();
1118 if (
Config->get_auto_connect_standard_busses()) {
1120 if (!
Config->get_monitor_bus_preferred_bundle().empty()) {
1128 Config->get_monitor_bus_preferred_bundle())
1147 for (uint32_t n = 0; n < limit; ++n) {
1155 if (!connect_to.empty()) {
1158 _(
"cannot connect control output %1 to %2"),
1179 for (RouteList::iterator x = rls->begin(); x != rls->end(); ++x) {
1181 if ((*x)->is_monitor()) {
1183 }
else if ((*x)->is_master()) {
1186 (*x)->enable_monitor_send ();
1216 warning <<
_(
"cannot create Auditioner: no auditioning of regions possible") <<
endmsg;
1267 if ((playlist = track->
playlist()) != 0) {
1282 if (
Config->get_all_safe()) {
1292 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
1337 pos = max (loc->
start(), loc->
end() - 64);
1338 length = loc->
end() - pos;
1396 if (location == 0) {
1400 if (location->
end() <= location->
start()) {
1401 error <<
_(
"Session: you can't use that location for auto punch (start <= end)") <<
endmsg;
1428 error <<
_(
"Session: you can't use that location for session start/end)") <<
endmsg;
1432 existing->
set( start, end );
1455 if (location == 0) {
1459 if (location->
end() <= location->
start()) {
1460 error <<
_(
"You cannot use this location for auto-loop because it has zero or negative length") <<
endmsg;
1519 for (Locations::LocationList::iterator l = all_locations.begin(); l != all_locations.end(); ) {
1521 if (!(*l)->is_skip ()) {
1540 loc->
set_end (max (loc->
end(), (*l)->end()));
1544 l = all_locations.erase (l);
1570 for (Locations::LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) {
1628 error <<
_(
"programming error: session range removed!") << endl;
1654 for (Locations::LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
1677 send_immediate_mmc (MIDI::MachineControlCommand (MIDI::MachineControl::cmdRecordStrobe));
1698 send_immediate_mmc (MIDI::MachineControlCommand (MIDI::MachineControl::cmdRecordExit));
1748 if (!
config.get_punch_in()) {
1752 send_immediate_mmc (MIDI::MachineControlCommand (MIDI::MachineControl::cmdRecordPause));
1859 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
1860 (*i)->set_block_size (nframes);
1864 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
1881 if (r1->
feeds (rbase) && rbase->
feeds (r1)) {
1894 for (Route::FedBy::iterator i = existing.begin(); i != existing.end(); ++i) {
1895 if (!(r2 = i->r.lock ())) {
1947 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
1952 for (Route::FedBy::const_iterator
f = fb.begin();
f != fb.end(); ++
f) {
1988 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
1991 (*i)->clear_fed_by ();
1993 for (RouteList::iterator j = r->begin(); j != r->end(); ++j) {
1995 bool via_sends_only;
2000 if ((*j)->direct_feeds_according_to_reality (*i, &via_sends_only)) {
2002 edges.
add (*j, *i, via_sends_only);
2004 (*i)->add_fed_by (*j, via_sends_only);
2012 if (sorted_routes) {
2028 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2032 *r = *sorted_routes;
2036 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2038 (*i)->name(), (*i)->order_key ()));
2076 snprintf (name, name_len,
"%s", base.c_str());
2081 snprintf (name, name_len,
"%s %" PRIu32, base.c_str(),
id);
2089 }
while (
id < (UINT_MAX-1));
2103 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2116 list<boost::shared_ptr<MidiTrack> >
2120 char track_name[32];
2121 uint32_t track_id = 0;
2124 list<boost::shared_ptr<MidiTrack> > ret;
2126 bool const use_number = (how_many != 1) || name_template.empty () || name_template ==
_(
"MIDI");
2129 if (!
find_route_name (name_template.empty() ?
_(
"MIDI") : name_template, ++track_id, track_name,
sizeof(track_name), use_number)) {
2130 error <<
"cannot find name for new midi track" <<
endmsg;
2139 if (track->
init ()) {
2145 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
2150 if (track->
input()->ensure_io (input,
false,
this)) {
2151 error <<
"cannot configure " << input <<
" out configuration for new midi track" <<
endmsg;
2155 if (track->
output()->ensure_io (output,
false,
this)) {
2156 error <<
"cannot configure " << output <<
" out configuration for new midi track" <<
endmsg;
2164 route_group->
add (track);
2173 new_routes.push_back (track);
2174 ret.push_back (track);
2178 error <<
_(
"Session: could not create new midi track.") <<
endmsg;
2184 error <<
string_compose (
_(
"No more JACK ports are available. You will need to stop %1 and restart JACK with more ports if you need this many tracks."), PROGRAM_NAME) <<
endmsg;
2192 if (!new_routes.empty()) {
2197 for (RouteList::iterator r = new_routes.begin(); r != new_routes.end(); ++r) {
2266 existing_inputs, existing_outputs));
2268 const bool in_out_physical =
2273 const ChanCount in_offset = in_out_physical
2277 const ChanCount out_offset = in_out_physical
2282 vector<string> physinputs;
2283 vector<string> physoutputs;
2288 if (!physinputs.empty() && connect_inputs) {
2289 uint32_t nphysical_in = physinputs.size();
2295 for (uint32_t i = input_start.
get(*t); i < route->
n_inputs().
get(*t) && i < nphysical_in; ++i) {
2301 in_offset.
get(*t), i, nphysical_in,
2302 (in_offset.
get(*t) + i) % nphysical_in));
2303 port = physinputs[(in_offset.
get(*t) + i) % nphysical_in];
2308 route->
name(), port));
2310 if (!port.empty() && route->
input()->connect (route->
input()->ports().port(*t, i), port,
this)) {
2315 existing_inputs += one_added;
2319 if (!physoutputs.empty()) {
2320 uint32_t nphysical_out = physoutputs.size();
2321 for (uint32_t i = output_start.
get(*t); i < route->
n_outputs().
get(*t); ++i) {
2325 port = physoutputs[(out_offset.
get(*t) + i) % nphysical_out];
2336 route->
name(), port));
2338 if (!port.empty() && route->
output()->connect (route->
output()->ports().port(*t, i), port,
this)) {
2343 existing_outputs += one_added;
2360 list< boost::shared_ptr<AudioTrack> >
2362 uint32_t how_many,
string name_template)
2364 char track_name[32];
2365 uint32_t track_id = 0;
2368 list<boost::shared_ptr<AudioTrack> > ret;
2370 bool const use_number = (how_many != 1) || name_template.empty () || name_template ==
_(
"Audio");
2373 if (!
find_route_name (name_template.empty() ?
_(
"Audio") : name_template, ++track_id, track_name,
sizeof(track_name), use_number)) {
2374 error <<
"cannot find name for new audio track" <<
endmsg;
2383 if (track->
init ()) {
2389 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
2397 _(
"cannot configure %1 in/%2 out configuration for new audio track"),
2398 input_channels, output_channels)
2405 _(
"cannot configure %1 in/%2 out configuration for new audio track"),
2406 input_channels, output_channels)
2413 route_group->
add (track);
2423 new_routes.push_back (track);
2424 ret.push_back (track);
2428 error <<
_(
"Session: could not create new audio track.") <<
endmsg;
2442 if (!new_routes.empty()) {
2457 uint32_t bus_id = 0;
2461 bool const use_number = (how_many != 1) || name_template.empty () || name_template ==
_(
"Bus");
2464 if (!
find_route_name (name_template.empty () ?
_(
"Bus") : name_template, ++bus_id, bus_name,
sizeof(bus_name), use_number)) {
2465 error <<
"cannot find name for new audio bus" <<
endmsg;
2476 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
2484 input_channels, output_channels)
2492 input_channels, output_channels)
2499 route_group->
add (bus);
2507 ret.push_back (bus);
2514 error <<
_(
"Session: could not create new audio route.") <<
endmsg;
2541 uint32_t control_id;
2543 uint32_t number = 0;
2544 const uint32_t being_added = how_many;
2546 if (!tree.
read (template_path.c_str())) {
2566 if (!name_base.empty()) {
2574 fatal <<
_(
"Session: UINT_MAX routes? impossible!") <<
endmsg;
2584 fatal <<
_(
"Session: UINT_MAX routes? impossible!") <<
endmsg;
2594 for (XMLNodeList::iterator i = children.begin(); i != children.end(); ++i) {
2595 if ((*i)->name() ==
X_(
"Processor")) {
2597 if (role && role->
value() ==
X_(
"Listen")) {
2598 (*i)->remove_property (
X_(
"bitslot"));
2606 error <<
_(
"Session: cannot create track/bus from template description") <<
endmsg;
2610 if (boost::dynamic_pointer_cast<Track>(route)) {
2620 route->
input()->changed (change,
this);
2622 route->
output()->changed (change,
this);
2628 ret.push_back (route);
2632 error <<
_(
"Session: could not create new route from template") <<
endmsg;
2662 error <<
_(
"Adding new tracks/busses failed") <<
endmsg;
2698 r->insert (r->end(), new_routes.begin(), new_routes.end());
2711 for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
2745 if (input_auto_connect || output_auto_connect) {
2771 for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
2772 if ((*x)->is_monitor()) {
2774 }
else if ((*x)->is_master()) {
2777 (*x)->enable_monitor_send ();
2789 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2790 if ((s = (*i)->internal_send_for (dest)) != 0) {
2802 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2803 if ((s = (*i)->internal_send_for (dest)) != 0) {
2815 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2816 if ((s = (*i)->internal_send_for (dest)) != 0) {
2817 s->
amp()->gain_control()->set_value ((*i)->gain_control()->get_value());
2829 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2831 if (include_buses || boost::dynamic_pointer_cast<AudioTrack>(*i)) {
2842 for (RouteList::iterator i = senders->begin(); i != senders->end(); ++i) {
2904 route->
input()->disconnect (0);
2905 route->
output()->disconnect (0);
2911 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2914 (*i)->remove_processor (s);
2982 if (
Config->get_exclusive_solo()) {
2985 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
2986 if ((*i) == route || (*i)->
solo_isolated() || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
2989 (*i)->set_listen (
false,
this);
3013 bool send_changed =
false;
3017 send_changed =
true;
3023 send_changed =
true;
3037 if (!self_solo_change) {
3063 if (delta == 1 &&
Config->get_exclusive_solo()) {
3067 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3068 if ((*i) == route || (*i)->
solo_isolated() || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner() ||
3069 (leave_group_alone && ((*i)->route_group() == rg))) {
3084 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3085 bool via_sends_only;
3086 bool in_signal_flow;
3088 if ((*i) == route || (*i)->
solo_isolated() || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner() ||
3089 (leave_group_alone && ((*i)->route_group() == rg))) {
3093 in_signal_flow =
false;
3097 if ((*i)->feeds (route, &via_sends_only)) {
3099 if (!via_sends_only) {
3101 (*i)->mod_solo_by_others_downstream (delta);
3106 in_signal_flow =
true;
3113 if (route->
feeds (*i, &via_sends_only)) {
3125 if (!via_sends_only) {
3128 (*i)->mod_solo_by_others_upstream (delta);
3135 in_signal_flow =
true;
3140 if (!in_signal_flow) {
3141 uninvolved.push_back (*i);
3154 for (RouteList::iterator i = uninvolved.begin(); i != uninvolved.end(); ++i) {
3156 (*i)->act_on_mute ();
3157 (*i)->mute_changed (
this);
3169 bool something_soloed =
false;
3170 uint32_t listeners = 0;
3171 uint32_t isolated = 0;
3177 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3178 if (!(*i)->is_master() && !(*i)->is_monitor() && !(*i)->is_auditioner() && (*i)->self_soloed()) {
3179 something_soloed =
true;
3182 if (!(*i)->is_auditioner() && (*i)->listening_via_monitor()) {
3183 if (
Config->get_solo_control_is_listen_control()) {
3186 (*i)->set_listen (
false,
this);
3190 if ((*i)->solo_isolated()) {
3208 something_soloed, listeners, isolated));
3217 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3218 if ((*i)->internal_return ()) {
3230 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3231 if ((*i)->name() ==
name) {
3235 if ((*i)->has_io_processor_named (name)) {
3247 vector<string> connections;
3253 if (flip_others ==
false && rl->size() == 1) {
3261 for (RouteList::iterator rt = rl->begin(); rt != rl->end(); ++rt) {
3263 PortSet& ps ((*rt)->input()->ports());
3266 p->get_connections (connections);
3269 for (vector<string>::iterator s = connections.begin(); s != connections.end(); ++s) {
3275 bool others_are_already_on =
false;
3277 for (RouteList::iterator r = rl2.begin(); r != rl2.end(); ++r) {
3285 if ((*r) != (*rt)) {
3287 others_are_already_on =
true;
3299 for (RouteList::iterator r = rl2.begin(); r != rl2.end(); ++r) {
3300 if ((*r) != (*rt)) {
3316 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3317 if ((*i)->input()->connected_to (str)) {
3328 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3329 if ((*i)->name() ==
name) {
3342 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3343 if ((*i)->id() ==
id) {
3356 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3371 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
3372 if ((*i)->remote_control_id() ==
id) {
3392 for (RouteList::iterator i = r.begin(); i != r.end(); ++i) {
3393 if (boost::dynamic_pointer_cast<Track> (*i)) {
3394 (*i)->set_track_number(++tn);
3396 else if (!(*i)->is_master() && !(*i)->is_monitor() && !(*i)->is_auditioner()) {
3397 (*i)->set_track_number(--bn);
3400 const uint32_t decimals = ceilf (log10f (tn + 1));
3404 if (decimals_changed &&
config.get_track_name_number ()) {
3405 for (RouteList::iterator i = r.begin(); i != r.end(); ++i) {
3473 if (a < _session_range_location->
start()) {
3505 RegionFactory::RegionMap::const_iterator i;
3510 for (i = regions.begin(); i != regions.end(); ++i) {
3528 set<boost::shared_ptr<Region> > relevant_regions;
3535 set<boost::shared_ptr<Region> >::iterator tmp;
3543 (*r)->drop_sources ();
3544 (*r)->drop_references ();
3546 relevant_regions.erase (r);
3559 (*s)->mark_for_remove ();
3560 (*s)->drop_references ();
3571 list<boost::shared_ptr<Source> > srcs;
3574 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
3583 srcs.insert (srcs.end(), l.begin(), l.end());
3600 pair<SourceMap::key_type, SourceMap::mapped_type> entry;
3601 pair<SourceMap::iterator,bool> result;
3603 entry.first = source->
id();
3604 entry.second = source;
3608 result =
sources.insert (entry);
3611 if (result.second) {
3627 if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(source)) != 0) {
3628 if (
Config->get_auto_analyse_audio()) {
3644 SourceMap::iterator i;
3673 SourceMap::iterator i;
3692 for (SourceMap::const_iterator i =
sources.begin(); i !=
sources.end(); ++i) {
3696 if (afs && afs->
path() == path && chn == afs->
channel()) {
3713 for (SourceMap::const_iterator s =
sources.begin(); s !=
sources.end(); ++s) {
3719 if (ms && fs && fs->path() ==
path) {
3733 for (SourceMap::iterator i =
sources.begin(); i !=
sources.end(); ++i) {
3779 string base = Glib::path_get_basename (path);
3780 string newpath = Glib::build_filename (sdir.
sound_path(), base);
3782 if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) {
3797 newpath = Glib::build_filename (sdir.
sound_path(), base);
3801 if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) {
3826 vector<space_and_path>::iterator i;
3827 uint32_t existing = 0;
3829 for (vector<string>::const_iterator i = sdirs.begin(); i != sdirs.end(); ++i) {
3837 const string spath = *i;
3854 string possible_path = Glib::build_filename (spath, name);
3862 return (existing == 0);
3873 sstr << setfill (
'0') << setw (4) << cnt;
3874 sstr << legalized_base;
3876 sstr << legalized_base;
3878 if (take_required || related_exists) {
3890 }
else if (nchan > 2) {
3911 string possible_name;
3912 const uint32_t limit = 9999;
3914 bool some_related_source_name_exists =
false;
3922 possible_name =
format_audio_source_name (legalized, nchan, chan, destructive, take_required, cnt, some_related_source_name_exists);
3928 some_related_source_name_exists =
true;
3932 _(
"There are already %1 recordings for %2, which I consider too many."),
3946 std::string s = Glib::build_filename (sdir.
sound_path(), possible_name);
3957 const uint32_t limit = 10000;
3959 string possible_path;
3960 string possible_name;
3976 std::reverse(sdirs.begin(), sdirs.end());
3978 for (cnt = 1; cnt <= limit; ++cnt) {
3980 vector<space_and_path>::iterator i;
3981 uint32_t existing = 0;
3983 for (vector<string>::const_iterator i = sdirs.begin(); i != sdirs.end(); ++i) {
3985 snprintf (buf,
sizeof(buf),
"%s-%u.mid", legalized.c_str(), cnt);
3986 possible_name = buf;
3988 possible_path = Glib::build_filename (*i, possible_name);
3990 if (Glib::file_test (possible_path, Glib::FILE_TEST_EXISTS)) {
3999 if (existing == 0) {
4005 _(
"There are already %1 recordings for %2, which I consider too many."),
4016 return possible_path;
4026 if (!path.empty()) {
4040 if (!path.empty()) {
4095 if (playlist->
hidden()) {
4218 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
4229 boost::optional<framecnt_t>
4235 return boost::optional<framecnt_t> ();
4238 float sample_bytes_on_disk = 4.0;
4240 switch (
config.get_native_file_data_format()) {
4242 sample_bytes_on_disk = 4.0;
4246 sample_bytes_on_disk = 3.0;
4250 sample_bytes_on_disk = 2.0;
4256 X_(
"illegal native file data format"))
4261 double scale = 4096.0 / sample_bytes_on_disk;
4276 b->push_back (bundle);
4289 bool removed =
false;
4294 BundleList::iterator i = find (b->begin(), b->end(), bundle);
4296 if (i != b->end()) {
4314 for (BundleList::const_iterator i = b->begin(); i != b->end(); ++i) {
4315 if ((*i)->name() ==
name) {
4328 playlists->update_after_tempo_map_change ();
4338 for (Locations::LocationList::const_iterator i = loc.begin(); i != loc.end(); ++i) {
4339 (*i)->recompute_frames_from_bbt ();
4366 for (boost::dynamic_bitset<uint32_t>::size_type n = 0; n <
insert_bitset.size(); ++n) {
4386 for (boost::dynamic_bitset<uint32_t>::size_type n = 0; n <
send_bitset.size(); ++n) {
4406 for (boost::dynamic_bitset<uint32_t>::size_type n = 0; n <
aux_send_bitset.size(); ++n) {
4426 for (boost::dynamic_bitset<uint32_t>::size_type n = 0; n <
return_bitset.size(); ++n) {
4524 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
4542 for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
4543 if ((*i)->name() == n) {
4570 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
4574 if ((t = boost::dynamic_pointer_cast<Track>(*i)) != 0) {
4590 bool for_export,
bool for_freeze)
4602 bool need_block_size_reset =
false;
4604 string legal_playlist_name;
4605 string possible_path;
4614 include_endpoint, for_export, for_freeze);
4616 if (diskstream_channels.n(track.
data_type()) < 1) {
4617 error <<
_(
"Cannot write a range with no data.") <<
endmsg;
4637 if ((playlist = track.
playlist()) == 0) {
4643 for (uint32_t chan_n = 0; chan_n < diskstream_channels.n(track.
data_type()); ++chan_n) {
4663 srcs.push_back (source);
4671 need_block_size_reset =
true;
4677 latency_skip = track.
bounce_get_latency (endpoint, include_endpoint, for_export, for_freeze);
4690 }
else if ((ms = boost::dynamic_pointer_cast<MidiSource>(*src))) {
4696 while (to_do && !itt.
cancel) {
4700 if (track.
export_stuff (buffers, start, this_chunk, endpoint, include_endpoint, for_export, for_freeze)) {
4704 start += this_chunk;
4705 to_do -= this_chunk;
4706 itt.
progress = (float) (1.0 - ((
double) to_do / len));
4713 const framecnt_t current_chunk = this_chunk - latency_skip;
4721 if (afs->
write (buffers.
get_audio(n).
data(latency_skip), current_chunk) != current_chunk) {
4724 }
else if ((ms = boost::dynamic_pointer_cast<MidiSource>(*src))) {
4739 latency_skip = track.
bounce_get_latency (endpoint, include_endpoint, for_export, for_freeze);
4741 while (latency_skip && !itt.
cancel) {
4743 latency_skip -= this_chunk;
4745 buffers.
silence (this_chunk, 0);
4746 track.
bounce_process (buffers, start, this_chunk, endpoint, include_endpoint, for_export, for_freeze);
4765 xnow = localtime (&now);
4774 }
else if ((ms = boost::dynamic_pointer_cast<MidiSource>(*src))) {
4795 (*src)->mark_for_remove ();
4796 (*src)->drop_references ();
4810 if (need_block_size_reset) {
4875 for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
4876 if (boost::dynamic_pointer_cast<Track> (*i)) {
4890 for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
4891 if (boost::dynamic_pointer_cast<Track>(*i) == 0) {
4917 RouteList::iterator i = rl->begin();
4918 while (i != rl->end ()) {
4942 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
4943 (*i)->listen_position_changed ();
4986 for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) {
4987 if (boost::dynamic_pointer_cast<Track> (*r)) {
4988 if (!(*r)->is_auditioner()) {
5002 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5100 if (l && l->
start() == old) {
5119 if (l && l->
end() == old) {
5124 std::vector<std::string>
5153 const string sound_path_2X =
_session_dir->sound_path_2X();
5154 if (Glib::file_test (sound_path_2X, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
5155 if (find (sp.begin(), sp.end(), sound_path_2X) == sp.end()) {
5156 sp.push_back (sound_path_2X);
5193 for (vector<std::string>::iterator i = sp.begin(); i != sp.end(); ++i) {
5256 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5257 list<string> t = (*i)->unknown_processors ();
5258 copy (t.begin(), t.end(), back_inserter (p));
5283 reverse (r->begin(), r->end());
5291 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5292 max_latency = max (max_latency, (*i)->set_private_port_latencies (playback));
5304 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5305 (*i)->set_public_port_latencies (max_latency, playback);
5327 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5328 if (!(*i)->is_auditioner() && ((*i)->active())) {
5333 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5347 for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
5389 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5411 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5421 bool some_track_latency_changed =
false;
5433 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5434 if (!(*i)->is_auditioner() && ((*i)->active())) {
5436 if ((*i)->signal_latency () != (tl = (*i)->update_signal_latency ())) {
5437 some_track_latency_changed =
true;
5444 (some_track_latency_changed ?
"yes" :
"no")));
5448 if (some_track_latency_changed || force_whole_graph) {
5453 for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
5465 char illegal_chars[] = {
'/',
'\\',
':',
';',
'\0' };
5467 for (
int i = 0; illegal_chars[i]; ++i) {
5468 if (path.find (illegal_chars[i]) != string::npos) {
5469 return illegal_chars[i];
5500 switch (
Config->get_remote_model()) {
5554 string src =
Config->get_ltc_source_port();
5558 if (src !=
_(
"None") && !src.empty()) {
5570 string src =
Config->get_ltc_sink_port();
5574 if (src !=
_(
"None") && !src.empty()) {
framecnt_t _nominal_frame_rate
void config_changed(std::string, bool)
boost::shared_ptr< InternalReturn > internal_return() const
std::map< PBD::ID, boost::shared_ptr< Region > > RegionMap
framepos_t audible_frame() const
bool transport_rolling() const
void set_order_key(uint32_t)
virtual DataType type() const =0
std::string new_audio_source_path(const std::string &, uint32_t nchans, uint32_t chan, bool destructive, bool take_required)
PBD::Signal0< void > IOConnectionsComplete
static int enable_connecting()
void add_routes_inner(RouteList &, bool input_auto_connect, bool output_auto_connect)
std::string steal_write_source_name()
void set_session_extents(framepos_t start, framepos_t end)
virtual void freeze_me(InterThreadInfo &)=0
PBD::Signal0< void > IsolatedChanged
boost::shared_ptr< RouteList > get_tracks() const
void sync_locations_to_skips()
void step_edit_status_change(bool)
boost::shared_ptr< Route > _monitor_out
LIBPBD_API Transmitter fatal
RangeList< T > subtract(Range< T > range, RangeList< T > sub)
bool non_realtime_work_pending() const
boost::scoped_ptr< SessionDirectory > _session_dir
void clear_events(SessionEvent::Type type)
void update_latency(bool playback)
void ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capacity)
boost::shared_ptr< Speakers > _speakers
bool soloed_by_others_downstream() const
boost::shared_ptr< IO > _ltc_input
int atoi(const string &s)
void set_port(uint32_t, std::string)
virtual int export_stuff(BufferSet &bufs, framepos_t start_frame, framecnt_t nframes, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)=0
void remove_dir_from_search_path(const std::string &path, DataType type)
void reconnect_existing_routes(bool withLock, bool reconnect_master=true, bool reconnect_inputs=true, bool reconnect_outputs=true)
framecnt_t _worst_output_latency
void end_time_changed(framepos_t)
void set_listen(boost::shared_ptr< RouteList >, bool, SessionEvent::RTeventCallback after=rt_cleanup, bool group_override=false)
Glib::Threads::Mutex source_lock
MidiBuffer & get_midi(size_t i)
std::string get_best_session_directory_for_new_audio()
boost::shared_ptr< Region > write_one_track(Track &, framepos_t start, framepos_t end, bool overwrite, std::vector< boost::shared_ptr< Source > > &, InterThreadInfo &wot, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)
boost::shared_ptr< Track > track_by_diskstream_id(PBD::ID)
boost::shared_ptr< IO > _click_io
LIBARDOUR_API uint64_t Latency
static void trace_terminal(boost::shared_ptr< Route > r1, boost::shared_ptr< Route > rbase)
PBD::Signal0< void > DropReferences
SceneChanger * _scene_changer
Location * auto_loop_location() const
void add_internal_sends(boost::shared_ptr< Route > dest, Placement p, boost::shared_ptr< RouteList > senders)
static BufferSet & get_silent_buffers(ChanCount count=ChanCount::ZERO)
void unmark_aux_send_id(uint32_t)
void set_solo(boost::shared_ptr< RouteList >, bool, SessionEvent::RTeventCallback after=rt_cleanup, bool group_override=false)
void ensure_search_path_includes(const std::string &path, DataType type)
void set_session(Session *)
const std::string & value() const
void use_new_diskstream()
boost::shared_ptr< Route > route_by_id(PBD::ID)
std::list< Location * > LocationList
void add_playlist(boost::shared_ptr< Playlist >, bool unused=false)
int prepare_for_peakfile_writes()
bool get_record_enabled() const
framepos_t _last_record_location
boost::function< void(SessionEvent *)> RTeventCallback
void playlist_regions_extended(std::list< Evoral::Range< framepos_t > > const &)
framecnt_t worst_playback_latency() const
boost::dynamic_bitset< uint32_t > send_bitset
Glib::Threads::Mutex::Lock Lock
void remove_playlist(boost::weak_ptr< Playlist >)
void setup_click_state(const XMLNode *)
PBD::Signal0< void > DiskstreamChanged
boost::shared_ptr< AudioFileSource > create_audio_source_for_session(size_t, std::string const &, uint32_t, bool destructive)
bool connected_to(std::string const &) const
LIBARDOUR_API uint64_t Destruction
void globally_set_send_gains_to_unity(boost::shared_ptr< Route > dest)
boost::dynamic_bitset< uint32_t > return_bitset
virtual DataType data_type() const =0
void set_count(const ChanCount &count)
void non_realtime_set_audition()
framepos_t transport_frame()
LIBARDOUR_API std::string legalize_for_path(const std::string &str)
PBD::Signal1< void, RouteGroup * > RouteGroupPropertyChanged
void add_routes(RouteList &, bool input_auto_connect, bool output_auto_connect, bool save)
void location_added(Location *)
LIBARDOUR_API GQuark selection_grab
static void map_remove(boost::weak_ptr< Region >)
LIBARDOUR_API GQuark region_drag
void tempo_map_changed(const PBD::PropertyChange &)
static PBD::Signal1< void, framepos_t > EndTimeChanged
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
LIBARDOUR_API PBD::PropertyDescriptor< std::string > name
boost::shared_ptr< MidiSource > create_midi_source_for_session(std::string const &)
static const Sample default_click[]
bool solo_update_disabled
static void delete_all_regions()
static const RegionMap & regions()
void playlist_region_added(boost::weak_ptr< Region >)
PBD::Signal0< void > SoloChanged
std::string get_suffix(const std::string &p)
LIBARDOUR_API int store_recent_sessions(std::string name, std::string path)
LIBARDOUR_API const char *const peakfile_suffix
void set_exclusive_input_active(boost::shared_ptr< RouteList > rt, bool onoff, bool flip_others=false)
void reset_write_sources(bool, bool force=false)
void maybe_enable_record()
void globally_set_send_gains_from_track(boost::shared_ptr< Route > dest)
bool have_looped
Used in ::audible_frame(*)
void set_auto_punch(bool yn, void *src)
boost::shared_ptr< Graph > _process_graph
boost::shared_ptr< AudioBackend > current_backend() const
bool _adding_routes_in_progress
pthread_cond_t _rt_emit_cond
const FedBy & fed_by() const
virtual void mark_streaming_write_completed(const Lock &lock)
void set_track_monitor_input_status(bool)
void ensure_buffer_set(BufferSet &buffers, const ChanCount &howmany)
boost::shared_ptr< Amp > _click_gain
int immediately_post_engine()
void emit_thread_terminate()
void set_worst_io_latencies_x(IOChange, void *)
gain_t * trim_automation_buffer() const
LIBARDOUR_API GQuark region_fill
boost::shared_ptr< Region > find_whole_file_parent(boost::shared_ptr< Region const >) const
void auto_punch_changed(Location *)
void location_removed(Location *)
bool is_auditioning() const
int start(bool for_latency_measurement=false)
LIBARDOUR_API uint64_t OrderKeys
boost::shared_ptr< MidiSource > midi_source_by_path(const std::string &) const
framecnt_t _worst_input_latency
LIBPBD_API Transmitter error
LIBPBD_API Transmitter warning
void non_realtime_input_change()
LIBARDOUR_API GQuark fixed_time_region_copy
PBD::Signal2< void, RouteGroup *, boost::weak_ptr< Route > > RouteAddedToRouteGroup
const XMLNodeList & children(const std::string &str=std::string()) const
void set_track_loop(bool)
LIBARDOUR_API GQuark paste
static void clean_up_session_event(SessionEvent *ev)
LIBARDOUR_API GQuark duplicate_region
static bool connecting_legal
void request_input_change_handling()
RouteList new_route_from_template(uint32_t how_many, const std::string &template_path, const std::string &name)
MidiPortManager * _midi_ports
void add_bundle(boost::shared_ptr< Bundle >, bool emit_signal=true)
static PBD::Signal1< int, uint32_t > AudioEngineSetupRequired
bool is_auditioner() const
std::ostream & endmsg(std::ostream &ostr)
void post_capture_latency()
SessionConfiguration config
void reassign_track_numbers()
bool feeds(boost::shared_ptr< Route >, bool *via_send_only=0)
static gain_t * send_gain_automation_buffer()
void remove_aux_or_listen(boost::shared_ptr< Route >)
char * digestString(char const *string)
MIDI::MachineControl * _mmc
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
void route_group_property_changed(RouteGroup *)
LIBARDOUR_API GQuark create_region
framecnt_t _base_frame_rate
void remove_route(boost::shared_ptr< Route >)
void playlist_ranges_moved(std::list< Evoral::RangeMove< framepos_t > > const &)
PBD::Signal0< void > BundleAddedOrRemoved
PBD::Signal1< void, void * > solo_isolated_changed
uint32_t _track_number_decimals
void request_locate(framepos_t frame, bool with_roll=false)
LIBARDOUR_API uint32_t how_many_dsp_threads()
static AudioEngine * instance()
framecnt_t frame_rate() const
int add_aux_send(boost::shared_ptr< Route >, boost::shared_ptr< Processor >)
void add(GraphVertex from, GraphVertex to, bool via_sends_only)
AudioBuffer & get_audio(size_t i)
void auto_loop_changed(Location *)
Glib::Threads::Mutex region_lock
bool using_diskstream_id(PBD::ID) const
void add_internal_send(boost::shared_ptr< Route >, int, boost::shared_ptr< Route >)
LIBARDOUR_API GQuark insert_file
bool is_session_range() const
LIBARDOUR_API PBD::Signal0< void > GUIIdle
static PBD::Signal0< void > RemoteControlIDChange
int remove_last_capture()
void add_internal_return()
static BufferSet & get_route_buffers(ChanCount count=ChanCount::ZERO, bool silence=false)
Location * session_range_location() const
ProcessThread * main_thread() const
void unmark_insert_id(uint32_t)
uint32_t destructive_index
bool within_session() const
LIBARDOUR_API GQuark drag_region_brush
void set_remote_control_id(uint32_t id, bool notify_class_listeners=true)
boost::shared_ptr< AudioFileSource > audio_source_by_path_and_channel(const std::string &, uint16_t) const
static PBD::Signal0< void > PortDrop
int load_state(std::string snapshot_name)
std::list< XMLNode * > XMLNodeList
int save_history(std::string snapshot_name="")
SerializedRCUManager< BundleList > _bundles
bool operation_in_progress(GQuark) const
void get_physical_outputs(DataType type, std::vector< std::string > &)
void request_input_monitoring(bool)
framepos_t _last_roll_or_reversal_location
LIBARDOUR_API bool matching_unsuffixed_filename_exists_in(const std::string &dir, const std::string &name)
std::list< RouteGroup * > _route_groups
std::string format_audio_source_name(const std::string &legalized_base, uint32_t nchan, uint32_t chan, bool destructive, bool take_required, uint32_t cnt, bool related_exists)
PBD::Signal1< void, bool > StepEditStatusChange
void reconnect_ltc_output()
bool has_region_at(framepos_t const) const
bool source_equivalent(boost::shared_ptr< const Region >) const
void unmark_send_id(uint32_t)
void consolidate_skips(Location *)
std::map< PBD::ID, AutomationList * > automation_lists
void route_processors_changed(RouteProcessorChange)
void route_listen_changed(void *src, boost::weak_ptr< Route >)
void add_automation_list(AutomationList *)
static void ensure_buffers(ChanCount howmany=ChanCount::ZERO, size_t custom=0)
static PBD::Signal1< void, framepos_t > StartTimeChanged
void set_auto_loop_location(Location *)
void solo_control_mode_changed()
pframes_t current_block_size
static PBD::Signal0< void > FeedbackDetected
void silence(framecnt_t nframes, framecnt_t offset)
virtual int flush_header()=0
XMLNode * _bundle_xml_node
void update_route_solo_state(boost::shared_ptr< RouteList > r=boost::shared_ptr< RouteList >())
pan_t ** pan_automation_buffer() const
bool io_name_is_legal(const std::string &)
std::string _current_snapshot_name
void set_block_size(pframes_t nframes)
boost::shared_ptr< Processor > before_processor_for_index(int)
void add_post_transport_work(PostTransportWork ptw)
XMLProperty * property(const char *)
virtual PluginPtr load(Session &session)=0
uint32_t order_key() const
LIBARDOUR_API RCConfiguration * Config
uint32_t next_aux_send_id()
void schedule_transport_work()
static const framepos_t Immediate
int set(framepos_t start, framepos_t end, bool allow_bbt_recompute=true)
void set_capture_offset()
boost::shared_ptr< Region > pending_audition_region
bool listening_via_monitor() const
bool audio_source_name_is_unique(const std::string &name)
void update_locations_after_tempo_map_change(const Locations::LocationList &)
static int disable_connecting()
uint32_t count_sources_by_origin(const std::string &)
void set_input_active(bool)
enum ARDOUR::IOChange::Type type
void auto_punch_start_changed(Location *)
std::vector< boost::shared_ptr< Bundle > > BundleList
bool is_auto_punch() const
void count_existing_track_channels(ChanCount &in, ChanCount &out)
void remove_pending_capture_state()
bool find_route_name(std::string const &, uint32_t &id, char *name, size_t name_len, bool)
int destroy_sources(std::list< boost::shared_ptr< Source > >)
void set_block_size(pframes_t)
uint32_t next_return_id()
PBD::Signal0< void > FlagsChanged
const LocationList & list()
void update_have_rec_enabled_track()
LIBARDOUR_API GQuark fill_selection
static void queue_source_for_analysis(boost::shared_ptr< Source >, bool force)
LIBARDOUR_API uint64_t Solo
static void free_working_buffers()
bool route_name_unique(std::string) const
void set_solo(bool yn, void *src)
const PBD::ID & id() const
void track_playlist_changed(boost::weak_ptr< Track >)
PBD::Signal2< void, std::list< Evoral::RangeMove< framepos_t > > const &, bool > RangesMoved
void route_added_to_route_group(RouteGroup *, boost::weak_ptr< Route >)
boost::dynamic_bitset< uint32_t > aux_send_bitset
ChanCount n_outputs() const
gain_t * send_gain_automation_buffer() const
PBD::Signal1< void, bool > AuditionActive
PBD::Signal0< void > DirtyChanged
framecnt_t _worst_track_latency
std::list< boost::shared_ptr< Source > > & last_capture_sources()
void add_session_range_location(framepos_t, framepos_t)
boost::shared_ptr< Speakers > get_speakers()
bool deletion_in_progress() const
void resort_routes_using(boost::shared_ptr< RouteList >)
std::string new_midi_source_path(const std::string &)
static char session_name_is_legal(const std::string &)
PBD::Signal1< void, void * > listen_changed
void step_back_from_record()
void routes_using_input_from(const std::string &str, RouteList &rl)
boost::shared_ptr< Playlist > playlist()
boost::shared_ptr< T > get_copy() const
void mark_send_id(uint32_t)
void set_auto_loop(bool yn, void *src)
static gain_t * trim_automation_buffer()
void done_with_peakfile_writes(bool done=true)
bool route_name_internal(std::string) const
boost::shared_ptr< RouteList > get_routes() const
#define DEBUG_TRACE(bits, str)
static ChanCount max(const ChanCount &a, const ChanCount &b)
bool record_enabled() const
void auto_punch_end_changed(Location *)
PBD::Signal1< void, bool > StepEditStatusChange
void add_channel(std::string const &, DataType)
LIBARDOUR_API uint64_t Graph
void route_removed_from_route_group(RouteGroup *, boost::weak_ptr< Route >)
void post_playback_latency()
const std::string sound_path() const
LIBARDOUR_API XMLNode * find_named_node(const XMLNode &node, std::string name)
bool add_fed_by(boost::shared_ptr< Route >, bool sends_only)
static const uint32_t num_types
boost::shared_ptr< Auditioner > auditioner
void update_latency_compensation(bool force=false)
const std::string & origin() const
RouteList new_audio_route(int input_channels, int output_channels, RouteGroup *route_group, uint32_t how_many, std::string name_template="")
static int loading_state_version
void unblock_processing()
void notify_remote_id_change()
void maybe_update_session_range(framepos_t, framepos_t)
ChanCount n_inputs() const
LIBARDOUR_API PBD::PropertyDescriptor< bool > regions
PBD::Signal0< void > Running
PBD::Signal1< void, std::list< Evoral::Range< framepos_t > > const & > RegionsExtended
PBD::Signal1< void, std::string > ParameterChanged
LIBPBD_API Transmitter info
PBD::Signal0< void > RecordStateChanged
PBD::Signal2< void, bool, void * > solo_changed
gint _have_rec_enabled_track
void set_worst_capture_latency()
PBD::Signal0< void > PlaylistChanged
size_t raw_buffer_size(DataType t)
void globally_set_send_gains_to_zero(boost::shared_ptr< Route > dest)
void disable_record(bool rt_context, bool force=false)
static PBD::Signal0< void > SuccessfulGraphSort
void queue_event(SessionEvent *)
pthread_mutex_t _rt_emit_mutex
framepos_t position() const
bool synced_to_engine() const
int set_start(framepos_t s, bool force=false, bool allow_bbt_recompute=true)
void reconnect_ltc_input()
boost::shared_ptr< RouteList > topological_sort(boost::shared_ptr< RouteList >, GraphEdges)
void set_auto_punch_location(Location *)
void add(Location *, bool make_current=false)
void audition_region(boost::shared_ptr< Region >)
void route_solo_changed(bool self_solo_change, void *src, boost::weak_ptr< Route >)
boost::shared_ptr< Region > region
bool _non_soloed_outs_muted
Glib::Threads::Mutex & mutex()
static const framecnt_t bounce_chunk_size
boost::shared_ptr< IO > _ltc_output
BufferSet & get_route_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
const std::string & path() const
bool _ignore_skips_updates
virtual void mark_streaming_write_started(const Lock &lock)
boost::shared_ptr< Route > route_by_remote_id(uint32_t id)
framecnt_t bounce_get_latency(boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze) const
PBD::Signal1< void, RouteProcessorChange > processors_changed
std::list< GQuark > _current_trans_quarks
Glib::Threads::Mutex & process_lock()
PBD::Signal1< void, boost::weak_ptr< Region > > RegionAdded
static PBD::Signal0< void > SyncOrderKeys
void update_marks(Location *loc)
bool operator()(boost::shared_ptr< Route >, boost::shared_ptr< Route > b)
uint32_t get(DataType t) const
int ensure_engine(uint32_t desired_sample_rate)
void _locations_changed(const Locations::LocationList &)
bool soloed_by_others_upstream() const
void writeToString()
Buffer must be 32+1 (nul) = 33 chars long at least.
static BufferSet & get_mix_buffers(ChanCount count=ChanCount::ZERO)
Location * _session_range_location
session range, or 0 if there is nothing in the session yet
static void set_name_in_state(XMLNode &, const std::string &)
pframes_t get_block_size() const
bool setup_required() const
PBD::Signal1< void, void * > mute_changed
framepos_t current_end_frame() const
boost::shared_ptr< Amp > amp() const
void reset_monitor_section()
boost::shared_ptr< Route > route_by_name(std::string)
void pre_engine_init(std::string path)
framepos_t current_start_frame() const
void remove_source(boost::weak_ptr< Source >)
RouteGroup * route_group() const
std::list< boost::shared_ptr< AudioTrack > > new_audio_track(int input_channels, int output_channels, TrackMode mode=Normal, RouteGroup *route_group=0, uint32_t how_many=1, std::string name_template="")
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > position
std::vector< std::string > source_search_path(DataType) const
SerializedRCUManager< RouteList > routes
void replace_event(SessionEvent::Type, framepos_t action_frame, framepos_t target=0)
bool ignore_route_processor_changes
LIBARDOUR_API PBD::Signal1< void, std::string > BootMessage
LIBPBD_TEMPLATE_MEMBER_API const std::string to_string() const
const std::string midi_path() const
MidiControlUI * midi_control_ui
OverlapType coverage(T sa, T ea, T sb, T eb)
boost::optional< framecnt_t > available_capture_duration()
bool record_enabling_legal() const
void start_time_changed(framepos_t)
std::set< FeedRecord, FeedRecordCompare > FedBy
std::vector< space_and_path > session_dirs
void mark_return_id(uint32_t)
Glib::Threads::Mutex space_lock
boost::shared_ptr< MidiSource > create_midi_source_by_stealing_name(boost::shared_ptr< Track >)
PBD::Signal1< void, bool > SoloActive
void remove_property_recursively(const std::string &)
bool input_active() const
void reset_native_file_format()
void auto_connect_master_bus()
bool bounce_processing() const
void transport_locate(framepos_t pos)
PBD::Signal0< void > PortRegisteredOrUnregistered
void add_source(boost::shared_ptr< Source >)
int add(boost::shared_ptr< Route >)
boost::shared_ptr< IO > input() const
virtual framecnt_t write(Sample *src, framecnt_t cnt)
boost::shared_ptr< Port > ltc_output_port() const
int create(const std::string &mix_template, BusProfile *)
framepos_t timeline_position() const
PBD::Signal0< void > EndChanged
PBD::Signal1< void, Location * > auto_punch_location_changed
void unmark_return_id(uint32_t)
PBD::Signal0< void > RecordEnableChanged
uint32_t _total_free_4k_blocks
StateOfTheState _state_of_the_state
Sample * click_emphasis_data
void route_mute_changed(void *src)
std::list< std::string > unknown_processors() const
bool have_rec_enabled_track() const
void midi_output_change_handler(IOChange change, void *, boost::weak_ptr< Route > midi_track)
std::list< boost::shared_ptr< MidiTrack > > new_midi_track(const ChanCount &input, const ChanCount &output, boost::shared_ptr< PluginInfo > instrument=boost::shared_ptr< PluginInfo >(), TrackMode mode=Normal, RouteGroup *route_group=0, uint32_t how_many=1, std::string name_template="")
RouteGroup * _all_route_group
const char * what() const
void _sync_locations_to_skips()
PBD::Signal0< void > StartChanged
boost::shared_ptr< SessionPlaylists > playlists
bool equivalent_paths(const std::string &a, const std::string &b)
void remove_bundle(boost::shared_ptr< Bundle >)
void initialize_latencies()
std::string get_pretty_name_by_name(const std::string &portname) const
void set_worst_io_latencies()
PBD::Signal2< void, RouteGroup *, boost::weak_ptr< Route > > RouteRemovedFromRouteGroup
gain_t * gain_automation_buffer() const
void boost_debug_list_ptrs()
boost::shared_ptr< Bundle > bundle_by_name(std::string) const
boost::shared_ptr< Source > source_by_id(const PBD::ID &)
bool _bounce_processing_active
void set_audition(boost::shared_ptr< Region >)
std::string peak_path(std::string) const
void ensure_buffers(ChanCount howmany=ChanCount::ZERO)
LIBARDOUR_API GQuark capture
PBD::Signal1< void, Location * > auto_loop_location_changed
boost::shared_ptr< IO > output() const
framepos_t _transport_frame
boost::shared_ptr< Processor > before_processor_for_placement(Placement)
int save_state(std::string snapshot_name, bool pending=false, bool switch_to_snapshot=false, bool template_only=false)
bool _total_free_4k_blocks_uncertain
void update_skips(Location *, bool consolidate)
PBD::ScopedConnectionList loop_connections
const Sample * data(framecnt_t offset=0) const
static const framecnt_t max_framecnt
void get_physical_inputs(DataType type, std::vector< std::string > &)
void remove_monitor_section()
GraphEdges _current_route_graph
PBD::ScopedConnectionList punch_connections
static BufferSet & get_scratch_buffers(ChanCount count=ChanCount::ZERO, bool silence=false)
boost::shared_ptr< T > reader() const
void set_frame_rate(framecnt_t nframes)
PBD::ScopedConnectionList skip_update_connections
void send_immediate_mmc(MIDI::MachineControlCommand)
void set_worst_playback_latency()
bool is_auto_loop() const
static void get_regions_using_source(boost::shared_ptr< Source >, std::set< boost::shared_ptr< Region > > &)
uint32_t next_control_id() const
ChanCount max_processor_streams() const
static boost::shared_ptr< Region > create(boost::shared_ptr< const Region > other, bool announce=false)
void auto_connect_route(boost::shared_ptr< Route > route, ChanCount &existing_inputs, ChanCount &existing_outputs, bool with_lock, bool connect_inputs=true, ChanCount input_start=ChanCount(), ChanCount output_start=ChanCount())
boost::shared_ptr< Route > _master_out
LIBARDOUR_API GQuark insert_region
void mark_insert_id(uint32_t)
static const ChanCount ZERO
std::list< boost::shared_ptr< Route > > RouteList
ChanCount bounce_get_output_streams(ChanCount &cc, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze) const
BufferSet & get_silent_buffers(ChanCount count=ChanCount::ZERO)
void apply(T &obj, void(T::*method)(const LocationList &)) const
void remove_event(framepos_t frame, SessionEvent::Type type)
boost::shared_ptr< RouteList > get_routes_with_internal_returns() const
boost::shared_ptr< RouteList > get_routes_with_regions_at(framepos_t const) const
LIBARDOUR_API GQuark region_copy
void update_loop(Location *loc)
virtual void bounce_process(BufferSet &bufs, framepos_t start_frame, framecnt_t nframes, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)
boost::shared_ptr< Route > XMLRouteFactory(const XMLNode &, int)
LIBARDOUR_API std::string region_name_from_path(std::string path, bool strip_channels, bool add_channel_suffix=false, uint32_t total=0, uint32_t this_one=0)
void listen_position_changed()
bool add(PropertyBase *prop)
std::string new_audio_source_path_for_embedded(const std::string &existing_path)
bool solo_isolated() const
BufferSet & get_scratch_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
uint32_t _solo_isolated_cnt
static pan_t ** pan_automation_buffer()
int load_bundles(XMLNode const &)
static boost::shared_ptr< Source > createWritable(DataType type, Session &, const std::string &path, bool destructive, framecnt_t rate, bool announce=true, bool async=false)
BufferSet & get_mix_buffers(ChanCount count=ChanCount::ZERO)
void add_monitor_section()
int set_end(framepos_t e, bool force=false, bool allow_bbt_recompute=true)
std::string string_compose(const std::string &fmt, const T1 &o1)
virtual int update_header(framepos_t when, struct tm &, time_t)=0
PBD::Signal0< void > Changed
void auto_loop_declick_range(Location *, framepos_t &, framepos_t &)
bool step_editing() const
static const Sample default_click_emphasis[]
bool has_order_key() const
static gain_t * gain_automation_buffer()
boost::shared_ptr< Port > ltc_input_port() const
int freeze_all(InterThreadInfo &)
void mark_aux_send_id(uint32_t)
framepos_t last_frame() const
virtual void append_event_frames(const Lock &lock, const Evoral::Event< framepos_t > &ev, framepos_t source_start)=0
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length
PBD::Signal1< void, RouteList & > RouteAdded
uint32_t next_insert_id()
void route_solo_isolated_changed(void *src, boost::weak_ptr< Route >)
void globally_add_internal_sends(boost::shared_ptr< Route > dest, Placement p, bool)
Location * auto_punch_location() const
LIBARDOUR_API const char * native_header_format_extension(ARDOUR::HeaderFormat, const ARDOUR::DataType &type)
boost::dynamic_bitset< uint32_t > insert_bitset