#include <glibmm/thread.h>
#include "pbd/error.h"
+#include "pbd/event_loop.h"
#include "pbd/rcu.h"
#include "pbd/statefuldestructible.h"
#include "pbd/signals.h"
#include "pbd/undo.h"
+#include "evoral/types.hpp"
+
#include "midi++/types.h"
#include "timecode/time.h"
#include "ardour/ardour.h"
-#include "ardour/click.h"
#include "ardour/chan_count.h"
+#include "ardour/delivery.h"
+#include "ardour/interthread_info.h"
#include "ardour/rc_configuration.h"
#include "ardour/session_configuration.h"
#include "ardour/session_event.h"
#include "ardour/location.h"
#include "ardour/interpolation.h"
-#include "ardour/speakers.h"
+#include "ardour/route_graph.h"
#ifdef HAVE_JACK_SESSION
#include <jack/session.h>
class XMLTree;
class XMLNode;
-class AEffect;
+struct _AEffect;
+typedef struct _AEffect AEffect;
namespace MIDI {
class Port;
namespace ARDOUR {
+class Amp;
class AudioEngine;
class AudioFileSource;
class AudioRegion;
class BufferSet;
class Bundle;
class Butler;
+class Click;
class Diskstream;
class ExportHandler;
class ExportStatus;
+class Graph;
class IO;
class IOProcessor;
class ImportStatus;
+class MidiClockTicker;
+class MidiControlUI;
class MidiRegion;
class MidiSource;
class MidiTrack;
-class MidiControlUI;
class NamedSelection;
class Playlist;
class PluginInsert;
+class PluginInfo;
class Port;
class PortInsert;
class ProcessThread;
class Source;
class Speakers;
class TempoMap;
-class VSTPlugin;
-class Graph;
class Track;
+class WindowsVSTPlugin;
extern void setup_enum_writer ();
int ensure_subdirs ();
- std::string automation_dir () const;
- std::string analysis_dir() const;
- std::string plugins_dir() const;
+ std::string automation_dir () const; ///< Automation data
+ std::string analysis_dir () const; ///< Analysis data
+ std::string plugins_dir () const; ///< Plugin state
+ std::string externals_dir () const; ///< Links to external files
std::string peak_path (std::string) const;
template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>));
template<class T, class A> void foreach_route (T *obj, void (T::*func)(Route&, A), A arg);
+ static char session_name_is_legal (const std::string&);
bool io_name_is_legal (const std::string&);
boost::shared_ptr<Route> route_by_name (std::string);
boost::shared_ptr<Route> route_by_id (PBD::ID);
boost::shared_ptr<Route> route_by_remote_id (uint32_t id);
+ boost::shared_ptr<Track> track_by_diskstream_id (PBD::ID);
void routes_using_input_from (const std::string& str, RouteList& rl);
bool route_name_unique (std::string) const;
void set_auto_loop_location (Location *);
int location_name(std::string& result, std::string base = std::string(""));
- void reset_input_monitor_state ();
-
pframes_t get_block_size() const { return current_block_size; }
framecnt_t worst_output_latency () const { return _worst_output_latency; }
framecnt_t worst_input_latency () const { return _worst_input_latency; }
void remove_pending_capture_state ();
int rename (const std::string&);
- static int rename_template (std::string old_name, std::string new_name);
- static int delete_template (std::string name);
-
PBD::Signal1<void,std::string> StateSaved;
PBD::Signal0<void> StateReady;
);
std::list<boost::shared_ptr<MidiTrack> > new_midi_track (
- TrackMode mode = Normal, RouteGroup* route_group = 0, uint32_t how_many = 1, std::string name_template = ""
+ 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 = ""
);
void remove_route (boost::shared_ptr<Route>);
TempoMap& tempo_map() { return *_tempo_map; }
- /// signals the current transport position in frames, bbt and timecode time (in that order)
- PBD::Signal3<void, const framepos_t &, const Timecode::BBT_Time&, const Timecode::Time&> tick;
-
/* region info */
boost::shared_ptr<Region> find_whole_file_parent (boost::shared_ptr<Region const>) const;
/* flattening stuff */
boost::shared_ptr<Region> write_one_track (AudioTrack&, framepos_t start, framepos_t end,
- bool overwrite, std::vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot,
- bool enable_processing = true);
+ bool overwrite, std::vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot,
+ boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export);
int freeze_all (InterThreadInfo&);
/* session-wide solo/mute/rec-enable */
void set_solo (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
void set_just_one_solo (boost::shared_ptr<Route>, bool, SessionEvent::RTeventCallback after = rt_cleanup);
+ void cancel_solo_after_disconnect (boost::shared_ptr<Route>, bool upstream, SessionEvent::RTeventCallback after = rt_cleanup);
void set_mute (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
void set_listen (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
void set_record_enabled (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
void set_solo_isolated (boost::shared_ptr<RouteList>, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
void set_exclusive_input_active (boost::shared_ptr<Route> rt, bool others_on);
+ void set_monitoring (boost::shared_ptr<RouteList>, MonitorChoice, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false);
PBD::Signal1<void,bool> SoloActive;
PBD::Signal0<void> SoloChanged;
PBD::Signal0<void> IsolatedChanged;
- /* control/master out */
+ /* monitor/master out */
+
+ void add_monitor_section ();
+ void remove_monitor_section ();
boost::shared_ptr<Route> monitor_out() const { return _monitor_out; }
boost::shared_ptr<Route> master_out() const { return _master_out; }
void globally_set_send_gains_to_zero (boost::shared_ptr<Route> dest);
void globally_set_send_gains_to_unity (boost::shared_ptr<Route> dest);
void add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::shared_ptr<RouteList> senders);
+ void add_internal_send (boost::shared_ptr<Route>, int, boost::shared_ptr<Route>);
+ void add_internal_send (boost::shared_ptr<Route>, boost::shared_ptr<Processor>, boost::shared_ptr<Route>);
static void set_disable_all_loaded_plugins (bool yn) {
_disable_all_loaded_plugins = yn;
}
uint32_t next_send_id();
+ uint32_t next_aux_send_id();
uint32_t next_return_id();
uint32_t next_insert_id();
void mark_send_id (uint32_t);
+ void mark_aux_send_id (uint32_t);
void mark_return_id (uint32_t);
void mark_insert_id (uint32_t);
void unmark_send_id (uint32_t);
+ void unmark_aux_send_id (uint32_t);
void unmark_return_id (uint32_t);
void unmark_insert_id (uint32_t);
/* clicking */
boost::shared_ptr<IO> click_io() { return _click_io; }
+ boost::shared_ptr<Amp> click_gain() { return _click_gain; }
/* disk, buffer loads */
/* VST support */
- static long vst_callback (AEffect* effect,
- long opcode,
- long index,
- long value,
- void* ptr,
- float opt);
+ static intptr_t vst_callback (
+ AEffect* effect,
+ int32_t opcode,
+ int32_t index,
+ intptr_t value,
+ void* ptr,
+ float opt
+ );
- /*Native linuxVST support*/
-
- static long lxvst_callback (AEffect* effect,
- long opcode,
- long index,
- long value,
- void* ptr,
- float opt);
-
static PBD::Signal0<void> SendFeedback;
/* Speakers */
boost::shared_ptr<PBD::Controllable> solo_cut_control() const;
- SessionMetadata & metadata () { return *_metadata; }
-
SessionConfiguration config;
bool exporting () const {
std::list<std::string> unknown_processors () const;
+ /** Emitted when a feedback cycle has been detected within Ardour's signal
+ processing path. Until it is fixed (by the user) some (unspecified)
+ routes will not be run.
+ */
+ static PBD::Signal0<void> FeedbackDetected;
+
+ /** Emitted when a graph sort has successfully completed, which means
+ that it has no feedback cycles.
+ */
+ static PBD::Signal0<void> SuccessfulGraphSort;
+
/* handlers can return an integer value:
0: config.set_audio_search_path() or config.set_midi_search_path() was used
to modify the search path and we should try to find it again.
void unblock_processing() { g_atomic_int_set (&processing_prohibited, 0); }
bool processing_blocked() const { return g_atomic_int_get (&processing_prohibited); }
- Glib::Mutex process_thread_lock;
- std::list<ProcessThread*> process_threads;
-
/* slave tracking */
static const int delta_accumulator_size = 25;
int pre_export ();
int stop_audio_export ();
void finalize_audio_export ();
+ bool _pre_export_mmc_enabled;
PBD::ScopedConnection export_freewheel_connection;
/* MIDI Machine Control */
- void spp_start (MIDI::Parser&, framepos_t timestamp);
- void spp_continue (MIDI::Parser&, framepos_t timestamp);
- void spp_stop (MIDI::Parser&, framepos_t timestamp);
+ void spp_start ();
+ void spp_continue ();
+ void spp_stop ();
void mmc_deferred_play (MIDI::MachineControl &);
void mmc_stop (MIDI::MachineControl &);
MidiControlUI* midi_control_ui;
int start_midi_thread ();
- void terminate_midi_thread ();
void set_play_loop (bool yn);
void unset_play_loop ();
/* routes stuff */
- boost::shared_ptr<Graph> route_graph;
+ boost::shared_ptr<Graph> _process_graph;
SerializedRCUManager<RouteList> routes;
- void add_routes (RouteList&, bool auto_connect, bool save);
+ void add_routes (RouteList&, bool input_auto_connect, bool output_auto_connect, bool save);
uint32_t destructive_index;
boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int);
/* INSERT AND SEND MANAGEMENT */
boost::dynamic_bitset<uint32_t> send_bitset;
+ boost::dynamic_bitset<uint32_t> aux_send_bitset;
boost::dynamic_bitset<uint32_t> return_bitset;
boost::dynamic_bitset<uint32_t> insert_bitset;
XMLNode* _bundle_xml_node;
int load_bundles (XMLNode const &);
- void reverse_track_buffers ();
-
UndoHistory _history;
/** current undo transaction, or 0 */
UndoTransaction* _current_trans;
XMLNode& state(bool);
/* click track */
-
- Clicks clicks;
- bool _clicking;
- boost::shared_ptr<IO> _click_io;
- Sample* click_data;
- Sample* click_emphasis_data;
- framecnt_t click_length;
- framecnt_t click_emphasis_length;
- mutable Glib::RWLock click_lock;
+ typedef std::list<Click*> Clicks;
+ Clicks clicks;
+ bool _clicking;
+ boost::shared_ptr<IO> _click_io;
+ boost::shared_ptr<Amp> _click_gain;
+ Sample* click_data;
+ Sample* click_emphasis_data;
+ framecnt_t click_length;
+ framecnt_t click_emphasis_length;
+ mutable Glib::RWLock click_lock;
static const Sample default_click[];
static const framecnt_t default_click_length;
static const framecnt_t default_click_emphasis_length;
Click *get_click();
+ framepos_t _clicks_cleared;
void setup_click_sounds (int which);
void setup_click_sounds (Sample**, Sample const *, framecnt_t*, framecnt_t, std::string const &);
void clear_clicks ();
boost::shared_ptr<Route> _master_out;
boost::shared_ptr<Route> _monitor_out;
- /* VST support */
+ void auto_connect_master_bus ();
+
+ /* Windows VST support */
- long _vst_callback (VSTPlugin*,
- long opcode,
- long index,
- long value,
- void* ptr,
- float opt);
+ long _windows_vst_callback (
+ WindowsVSTPlugin*,
+ long opcode,
+ long index,
+ long value,
+ void* ptr,
+ float opt
+ );
/* number of hardware ports we're using,
based on max (requested,available)
static bool _disable_all_loaded_plugins;
- SessionMetadata * _metadata;
-
mutable bool have_looped; ///< Used in ::audible_frame(*)
void update_have_rec_enabled_track ();
static int ask_about_playlist_deletion (boost::shared_ptr<Playlist>);
/* realtime "apply to set of routes" operations */
- SessionEvent* get_rt_event (
- boost::shared_ptr<RouteList> rl, bool yn,
- SessionEvent::RTeventCallback after, bool group_override,
- void (Session::*method) (boost::shared_ptr<RouteList>, bool, bool));
+ template<typename T> SessionEvent*
+ get_rt_event (boost::shared_ptr<RouteList> rl, T targ, SessionEvent::RTeventCallback after, bool group_override,
+ void (Session::*method) (boost::shared_ptr<RouteList>, T, bool)) {
+ SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
+ ev->rt_slot = boost::bind (method, this, rl, targ, group_override);
+ ev->rt_return = after;
+ ev->event_loop = PBD::EventLoop::get_event_loop_for_thread ();
+
+ return ev;
+ }
+ void rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList>, bool upstream, bool /* ignored*/ );
void rt_set_solo (boost::shared_ptr<RouteList>, bool yn, bool group_override);
void rt_set_just_one_solo (boost::shared_ptr<RouteList>, bool yn, bool /* ignored*/ );
void rt_set_mute (boost::shared_ptr<RouteList>, bool yn, bool group_override);
void rt_set_listen (boost::shared_ptr<RouteList>, bool yn, bool group_override);
void rt_set_solo_isolated (boost::shared_ptr<RouteList>, bool yn, bool group_override);
void rt_set_record_enabled (boost::shared_ptr<RouteList>, bool yn, bool group_override);
+ void rt_set_monitoring (boost::shared_ptr<RouteList>, MonitorChoice, bool group_override);
/** temporary list of Diskstreams used only during load of 2.X sessions */
std::list<boost::shared_ptr<Diskstream> > _diskstreams_2X;
boost::shared_ptr<Speakers> _speakers;
void load_nested_sources (const XMLNode& node);
+
+ /** The directed graph of routes that is currently being used for audio processing
+ and solo/mute computations.
+ */
+ GraphEdges _current_route_graph;
+
+ uint32_t next_control_id () const;
+ bool ignore_route_processor_changes;
+
+ MidiClockTicker* midi_clock;
};
} // namespace ARDOUR