#include <boost/shared_ptr.hpp>
#include "pbd/rcu.h"
+#include "pbd/ringbuffer.h"
#include "ardour/chan_count.h"
#include "ardour/midiport_manager.h"
class PortEngine;
class AudioBackend;
+class Session;
class LIBARDOUR_API PortManager
{
/* Port registration */
- boost::shared_ptr<Port> register_input_port (DataType, const std::string& portname, bool async = false);
- boost::shared_ptr<Port> register_output_port (DataType, const std::string& portname, bool async = false);
+ boost::shared_ptr<Port> register_input_port (DataType, const std::string& portname, bool async = false, PortFlags extra_flags = PortFlags (0));
+ boost::shared_ptr<Port> register_output_port (DataType, const std::string& portname, bool async = false, PortFlags extra_flags = PortFlags (0));
int unregister_port (boost::shared_ptr<Port>);
/* Port connectivity */
std::string make_port_name_non_relative (const std::string& name) const;
std::string get_pretty_name_by_name (const std::string& portname) const;
bool port_is_mine (const std::string& fullname) const;
- bool port_name_prefix_is_unique (const std::string& first_part_of_port_name) const;
+
+ static bool port_is_control_only (std::string const &);
/* other Port management */
int get_ports (DataType, PortList&);
void remove_all_ports ();
+ void clear_pending_port_deletions ();
+ virtual void add_pending_port_deletion (Port*) = 0;
+ RingBuffer<Port*>& port_deletions_pending () { return _port_deletions_pending; }
/* per-Port monitoring */
bool port_remove_in_progress() const { return _port_remove_in_progress; }
+ typedef std::vector<std::string> MidiSelectionPorts;
+
+ void get_midi_selection_ports (MidiSelectionPorts&) const;
+ void add_to_midi_selection_ports (std::string const&);
+ void remove_from_midi_selection_ports (std::string const&);
+ void clear_midi_selection_ports ();
+ bool port_is_for_midi_selection (std::string const&);
+
+ /** Emitted if the list of ports to be used for MIDI selection tracking changes */
+ PBD::Signal0<void> MidiSelectionPortsChanged;
+
/** Emitted if the backend notifies us of a graph order event */
PBD::Signal0<void> GraphReordered;
boost::shared_ptr<AudioBackend> _backend;
SerializedRCUManager<Ports> ports;
bool _port_remove_in_progress;
+ RingBuffer<Port*> _port_deletions_pending;
- boost::shared_ptr<Port> register_port (DataType type, const std::string& portname, bool input, bool async = false);
+ boost::shared_ptr<Port> register_port (DataType type, const std::string& portname, bool input, bool async = false, PortFlags extra_flags = PortFlags (0));
void port_registration_failure (const std::string& portname);
/** List of ports to be used between ::cycle_start() and ::cycle_end()
boost::shared_ptr<Ports> _cycle_ports;
void fade_out (gain_t, gain_t, pframes_t);
- void silence (pframes_t nframes);
+ void silence (pframes_t nframes, Session *s = 0);
void silence_outputs (pframes_t nframes);
void check_monitoring ();
/** Signal the start of an audio cycle.
* Realtime safe.
*/
void cycle_end (pframes_t nframes);
+
+ mutable Glib::Threads::Mutex midi_selection_ports_mutex;
+ MidiSelectionPorts _midi_selection_ports;
};