NO-OP: whitespace
This commit is contained in:
parent
597837022a
commit
ad0c5f1a1c
|
@ -20,10 +20,10 @@
|
||||||
#ifndef __libardour_port_manager_h__
|
#ifndef __libardour_port_manager_h__
|
||||||
#define __libardour_port_manager_h__
|
#define __libardour_port_manager_h__
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -44,58 +44,59 @@ class Session;
|
||||||
|
|
||||||
class LIBARDOUR_API PortManager
|
class LIBARDOUR_API PortManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::map<std::string,boost::shared_ptr<Port> > Ports;
|
typedef std::map<std::string, boost::shared_ptr<Port> > Ports;
|
||||||
typedef std::list<boost::shared_ptr<Port> > PortList;
|
typedef std::list<boost::shared_ptr<Port> > PortList;
|
||||||
|
|
||||||
PortManager ();
|
PortManager ();
|
||||||
virtual ~PortManager() {}
|
virtual ~PortManager () {}
|
||||||
|
|
||||||
PortEngine& port_engine();
|
PortEngine& port_engine ();
|
||||||
|
|
||||||
uint32_t port_name_size() const;
|
uint32_t port_name_size () const;
|
||||||
std::string my_name() const;
|
std::string my_name () const;
|
||||||
|
|
||||||
/* Port registration */
|
/* Port registration */
|
||||||
|
|
||||||
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_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));
|
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>);
|
int unregister_port (boost::shared_ptr<Port>);
|
||||||
|
|
||||||
/* Port connectivity */
|
/* Port connectivity */
|
||||||
|
|
||||||
int connect (const std::string& source, const std::string& destination);
|
int connect (const std::string& source, const std::string& destination);
|
||||||
int disconnect (const std::string& source, const std::string& destination);
|
int disconnect (const std::string& source, const std::string& destination);
|
||||||
int disconnect (boost::shared_ptr<Port>);
|
int disconnect (boost::shared_ptr<Port>);
|
||||||
int disconnect (std::string const &);
|
int disconnect (std::string const&);
|
||||||
int reestablish_ports ();
|
int reestablish_ports ();
|
||||||
int reconnect_ports ();
|
int reconnect_ports ();
|
||||||
|
|
||||||
bool connected (const std::string&);
|
bool connected (const std::string&);
|
||||||
bool physically_connected (const std::string&);
|
bool physically_connected (const std::string&);
|
||||||
int get_connections (const std::string&, std::vector<std::string>&);
|
int get_connections (const std::string&, std::vector<std::string>&);
|
||||||
|
|
||||||
/* Naming */
|
/* Naming */
|
||||||
|
|
||||||
boost::shared_ptr<Port> get_port_by_name (const std::string &);
|
boost::shared_ptr<Port> get_port_by_name (const std::string&);
|
||||||
void port_renamed (const std::string&, const std::string&);
|
void port_renamed (const std::string&, const std::string&);
|
||||||
std::string make_port_name_relative (const std::string& name) const;
|
std::string make_port_name_relative (const std::string& name) const;
|
||||||
std::string make_port_name_non_relative (const std::string& name) const;
|
std::string make_port_name_non_relative (const std::string& name) const;
|
||||||
std::string get_pretty_name_by_name (const std::string& portname) const;
|
std::string get_pretty_name_by_name (const std::string& portname) const;
|
||||||
std::string short_port_name_from_port_name (std::string const & full_name) const;
|
std::string short_port_name_from_port_name (std::string const& full_name) const;
|
||||||
bool port_is_mine (const std::string& fullname) const;
|
bool port_is_mine (const std::string& fullname) const;
|
||||||
|
|
||||||
static bool port_is_control_only (std::string const &);
|
static bool port_is_control_only (std::string const&);
|
||||||
|
|
||||||
/* other Port management */
|
/* other Port management */
|
||||||
|
|
||||||
bool port_is_physical (const std::string&) const;
|
bool port_is_physical (const std::string&) const;
|
||||||
void get_physical_outputs (DataType type, std::vector<std::string>&,
|
void get_physical_outputs (DataType type, std::vector<std::string>&,
|
||||||
MidiPortFlags include = MidiPortFlags (0),
|
MidiPortFlags include = MidiPortFlags (0),
|
||||||
MidiPortFlags exclude = MidiPortFlags (0));
|
MidiPortFlags exclude = MidiPortFlags (0));
|
||||||
void get_physical_inputs (DataType type, std::vector<std::string>&,
|
void get_physical_inputs (DataType type, std::vector<std::string>&,
|
||||||
MidiPortFlags include = MidiPortFlags (0),
|
MidiPortFlags include = MidiPortFlags (0),
|
||||||
MidiPortFlags exclude = MidiPortFlags (0));
|
MidiPortFlags exclude = MidiPortFlags (0));
|
||||||
|
|
||||||
ChanCount n_physical_outputs () const;
|
ChanCount n_physical_outputs () const;
|
||||||
ChanCount n_physical_inputs () const;
|
ChanCount n_physical_inputs () const;
|
||||||
|
|
||||||
|
@ -105,9 +106,15 @@ class LIBARDOUR_API PortManager
|
||||||
void set_port_pretty_name (std::string const&, std::string const&);
|
void set_port_pretty_name (std::string const&, std::string const&);
|
||||||
|
|
||||||
void remove_all_ports ();
|
void remove_all_ports ();
|
||||||
|
|
||||||
void clear_pending_port_deletions ();
|
void clear_pending_port_deletions ();
|
||||||
|
|
||||||
virtual void add_pending_port_deletion (Port*) = 0;
|
virtual void add_pending_port_deletion (Port*) = 0;
|
||||||
PBD::RingBuffer<Port*>& port_deletions_pending () { return _port_deletions_pending; }
|
|
||||||
|
PBD::RingBuffer<Port*>& port_deletions_pending ()
|
||||||
|
{
|
||||||
|
return _port_deletions_pending;
|
||||||
|
}
|
||||||
|
|
||||||
bool check_for_amibiguous_latency (bool log = false) const;
|
bool check_for_amibiguous_latency (bool log = false) const;
|
||||||
|
|
||||||
|
@ -117,26 +124,33 @@ class LIBARDOUR_API PortManager
|
||||||
void request_input_monitoring (const std::string&, bool) const;
|
void request_input_monitoring (const std::string&, bool) const;
|
||||||
void ensure_input_monitoring (const std::string&, bool) const;
|
void ensure_input_monitoring (const std::string&, bool) const;
|
||||||
|
|
||||||
class PortRegistrationFailure : public std::exception {
|
class PortRegistrationFailure : public std::exception
|
||||||
public:
|
{
|
||||||
PortRegistrationFailure (std::string const & why = "")
|
public:
|
||||||
|
PortRegistrationFailure (std::string const& why = "")
|
||||||
: reason (why) {}
|
: reason (why) {}
|
||||||
|
|
||||||
~PortRegistrationFailure () throw () {}
|
~PortRegistrationFailure () throw () {}
|
||||||
|
|
||||||
const char *what() const throw () { return reason.c_str(); }
|
const char* what () const throw ()
|
||||||
|
{
|
||||||
|
return reason.c_str ();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string reason;
|
std::string reason;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* the port engine will invoke these callbacks when the time is right */
|
/* the port engine will invoke these callbacks when the time is right */
|
||||||
|
|
||||||
void registration_callback ();
|
void registration_callback ();
|
||||||
int graph_order_callback ();
|
int graph_order_callback ();
|
||||||
void connect_callback (const std::string&, const std::string&, bool connection);
|
void connect_callback (const std::string&, const std::string&, bool connection);
|
||||||
|
|
||||||
bool port_remove_in_progress() const { return _port_remove_in_progress; }
|
bool port_remove_in_progress () const
|
||||||
|
{
|
||||||
|
return _port_remove_in_progress;
|
||||||
|
}
|
||||||
|
|
||||||
struct MidiPortInformation {
|
struct MidiPortInformation {
|
||||||
std::string backend;
|
std::string backend;
|
||||||
|
@ -145,24 +159,27 @@ class LIBARDOUR_API PortManager
|
||||||
MidiPortFlags properties;
|
MidiPortFlags properties;
|
||||||
bool exists;
|
bool exists;
|
||||||
|
|
||||||
MidiPortInformation (std::string const & b, std::string const & pretty, bool input, MidiPortFlags flags, bool xists)
|
MidiPortInformation (std::string const& b, std::string const& pretty, bool input, MidiPortFlags flags, bool xists)
|
||||||
: backend (b)
|
: backend (b)
|
||||||
, pretty_name (pretty)
|
, pretty_name (pretty)
|
||||||
, input (input)
|
, input (input)
|
||||||
, properties (flags)
|
, properties (flags)
|
||||||
, exists (xists) {}
|
, exists (xists)
|
||||||
|
{}
|
||||||
|
|
||||||
MidiPortInformation ()
|
MidiPortInformation ()
|
||||||
: properties (MidiPortFlags (0))
|
: properties (MidiPortFlags (0))
|
||||||
, exists (false) {}
|
, exists (false)
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
void fill_midi_port_info ();
|
void fill_midi_port_info ();
|
||||||
|
|
||||||
MidiPortInformation midi_port_information (std::string const&);
|
MidiPortInformation midi_port_information (std::string const&);
|
||||||
void get_known_midi_ports (std::vector<std::string>&);
|
void get_known_midi_ports (std::vector<std::string>&);
|
||||||
void get_midi_selection_ports (std::vector<std::string>&);
|
void get_midi_selection_ports (std::vector<std::string>&);
|
||||||
void add_midi_port_flags (std::string const&, MidiPortFlags);
|
void add_midi_port_flags (std::string const&, MidiPortFlags);
|
||||||
void remove_midi_port_flags (std::string const&, MidiPortFlags);
|
void remove_midi_port_flags (std::string const&, MidiPortFlags);
|
||||||
|
|
||||||
/** Emitted if the list of ports to be used for MIDI selection tracking changes */
|
/** Emitted if the list of ports to be used for MIDI selection tracking changes */
|
||||||
PBD::Signal0<void> MidiSelectionPortsChanged;
|
PBD::Signal0<void> MidiSelectionPortsChanged;
|
||||||
|
@ -182,19 +199,21 @@ class LIBARDOUR_API PortManager
|
||||||
*/
|
*/
|
||||||
PBD::Signal5<void, boost::weak_ptr<Port>, std::string, boost::weak_ptr<Port>, std::string, bool> PortConnectedOrDisconnected;
|
PBD::Signal5<void, boost::weak_ptr<Port>, std::string, boost::weak_ptr<Port>, std::string, bool> PortConnectedOrDisconnected;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
boost::shared_ptr<AudioBackend> _backend;
|
boost::shared_ptr<AudioBackend> _backend;
|
||||||
|
|
||||||
SerializedRCUManager<Ports> ports;
|
SerializedRCUManager<Ports> ports;
|
||||||
bool _port_remove_in_progress;
|
|
||||||
|
bool _port_remove_in_progress;
|
||||||
PBD::RingBuffer<Port*> _port_deletions_pending;
|
PBD::RingBuffer<Port*> _port_deletions_pending;
|
||||||
|
|
||||||
boost::shared_ptr<Port> register_port (DataType type, const std::string& portname, bool input, bool async = false, PortFlags extra_flags = PortFlags (0));
|
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);
|
void port_registration_failure (const std::string& portname);
|
||||||
|
|
||||||
/** List of ports to be used between \ref cycle_start() and \ref cycle_end() */
|
/** List of ports to be used between \ref cycle_start() and \ref cycle_end() */
|
||||||
boost::shared_ptr<Ports> _cycle_ports;
|
boost::shared_ptr<Ports> _cycle_ports;
|
||||||
|
|
||||||
void silence (pframes_t nframes, Session *s = 0);
|
void silence (pframes_t nframes, Session* s = 0);
|
||||||
void silence_outputs (pframes_t nframes);
|
void silence_outputs (pframes_t nframes);
|
||||||
void check_monitoring ();
|
void check_monitoring ();
|
||||||
/** Signal the start of an audio cycle.
|
/** Signal the start of an audio cycle.
|
||||||
|
@ -212,24 +231,22 @@ class LIBARDOUR_API PortManager
|
||||||
|
|
||||||
void cycle_end_fade_out (gain_t, gain_t, pframes_t, Session* s = 0);
|
void cycle_end_fade_out (gain_t, gain_t, pframes_t, Session* s = 0);
|
||||||
|
|
||||||
typedef std::map<std::string,MidiPortInformation> MidiPortInfo;
|
typedef std::map<std::string, MidiPortInformation> MidiPortInfo;
|
||||||
|
|
||||||
mutable Glib::Threads::Mutex midi_port_info_mutex;
|
mutable Glib::Threads::Mutex midi_port_info_mutex;
|
||||||
MidiPortInfo midi_port_info;
|
MidiPortInfo midi_port_info;
|
||||||
|
|
||||||
static std::string midi_port_info_file ();
|
static std::string midi_port_info_file ();
|
||||||
bool midi_info_dirty;
|
bool midi_info_dirty;
|
||||||
void save_midi_port_info ();
|
void save_midi_port_info ();
|
||||||
void load_midi_port_info ();
|
void load_midi_port_info ();
|
||||||
void fill_midi_port_info_locked ();
|
void fill_midi_port_info_locked ();
|
||||||
|
|
||||||
void filter_midi_ports (std::vector<std::string>&, MidiPortFlags, MidiPortFlags);
|
void filter_midi_ports (std::vector<std::string>&, MidiPortFlags, MidiPortFlags);
|
||||||
|
|
||||||
void set_port_buffer_sizes (pframes_t);
|
void set_port_buffer_sizes (pframes_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace ARDOUR
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif /* __libardour_port_manager_h__ */
|
#endif /* __libardour_port_manager_h__ */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user