#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/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;
class BufferSet;
class Bundle;
class Butler;
+class Click;
class Diskstream;
class ExportHandler;
class ExportStatus;
+class Graph;
class IO;
class IOProcessor;
class ImportStatus;
+class MidiControlUI;
class MidiRegion;
class MidiSource;
class MidiTrack;
-class MidiControlUI;
class NamedSelection;
class Playlist;
class PluginInsert;
class Source;
class Speakers;
class TempoMap;
-class VSTPlugin;
-class Graph;
class Track;
+class WindowsVSTPlugin;
extern void setup_enum_writer ();
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 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;
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;
/* 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
+ );
+
static PBD::Signal0<void> SendFeedback;
/* Speakers */
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.
bool _writable;
bool _was_seamless;
+ void initialize_latencies ();
void set_worst_io_latencies ();
void set_worst_playback_latency ();
void set_worst_capture_latency ();
/* routes stuff */
- boost::shared_ptr<Graph> route_graph;
+ boost::shared_ptr<Graph> _process_graph;
SerializedRCUManager<RouteList> routes;
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 */
-
+ typedef std::list<Click*> Clicks;
Clicks clicks;
bool _clicking;
boost::shared_ptr<IO> _click_io;
boost::shared_ptr<Route> _master_out;
boost::shared_ptr<Route> _monitor_out;
- /* VST support */
+ /* 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 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_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_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;
};
} // namespace ARDOUR