summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_backend.h40
-rw-r--r--libs/ardour/ardour/audioengine.h8
-rw-r--r--libs/ardour/ardour/processor.h4
3 files changed, 47 insertions, 5 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h
index 0e39625e8c..cbe0bfce50 100644
--- a/libs/ardour/ardour/audio_backend.h
+++ b/libs/ardour/ardour/audio_backend.h
@@ -239,7 +239,38 @@ class AudioBackend : public PortEngine {
* app is undefined or cannot be launched.
*/
virtual void launch_control_app () = 0;
- /* Basic state control */
+
+ /* @return a vector of strings that describe the available
+ * MIDI options.
+ *
+ * These can be presented to the user to decide which
+ * MIDI drivers, options etc. can be used. The returned strings
+ * should be thought of as the key to a map of possible
+ * approaches to handling MIDI within the backend. Ensure that
+ * the strings will make sense to the user.
+ */
+ virtual std::vector<std::string> enumerate_midi_options () const = 0;
+
+ /* Request the use of the MIDI option named @param option, which
+ * should be one of the strings returned by enumerate_midi_options()
+ *
+ * @return zero if successful, non-zero otherwise
+ */
+ virtual int set_midi_option (const std::string& option) = 0;
+
+ virtual std::string midi_option () const = 0;
+
+ /* State Control */
+
+ /* non-virtual method to avoid possible overrides of default
+ * parameters. See Scott Meyers or other books on C++ to
+ * understand this pattern, or possibly just this:
+ *
+ * http://stackoverflow.com/questions/12139786/good-pratice-default-arguments-for-pure-virtual-method
+ */
+ int start (bool for_latency_measurement=false) {
+ return _start (for_latency_measurement);
+ }
/** Start using the device named in the most recent call
* to set_device(), with the parameters set by various
@@ -250,9 +281,14 @@ class AudioBackend : public PortEngine {
* the AudioEngine referenced by @param engine. These calls will
* occur in a thread created by and/or under the control of the backend.
*
+ * @param for_latency_measurement if true, the device is being started
+ * to carry out latency measurements and the backend should this
+ * take care to return latency numbers that do not reflect
+ * any existing systemic latency settings.
+ *
* Return zero if successful, negative values otherwise.
*/
- virtual int start () = 0;
+ virtual int _start (bool for_latency_measurement) = 0;
/** Stop using the device currently in use.
*
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index ddffd1d5c0..d5dcbffe2b 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -70,6 +70,7 @@ public:
int discover_backends();
std::vector<const AudioBackendInfo*> available_backends() const;
std::string current_backend_name () const;
+ boost::shared_ptr<AudioBackend> set_default_backend ();
boost::shared_ptr<AudioBackend> set_backend (const std::string&, const std::string& arg1, const std::string& arg2);
boost::shared_ptr<AudioBackend> current_backend() const { return _backend; }
bool setup_required () const;
@@ -82,8 +83,8 @@ public:
* just forward to a backend implementation.
*/
- int start ();
- int stop ();
+ int start (bool for_latency_measurement=false);
+ int stop (bool for_latency_measurement=false);
int pause ();
int freewheel (bool start_stop);
float get_cpu_load() const ;
@@ -193,7 +194,7 @@ public:
MTDM* mtdm();
int prepare_for_latency_measurement ();
- void start_latency_detection ();
+ int start_latency_detection ();
void stop_latency_detection ();
void set_latency_input_port (const std::string&);
void set_latency_output_port (const std::string&);
@@ -228,6 +229,7 @@ public:
std::string _latency_input_name;
std::string _latency_output_name;
framecnt_t _latency_signal_latency;
+ bool _stopped_for_latency;
bool _started_for_latency;
bool _in_destructor;
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h
index 772ae3520d..18f13dbc78 100644
--- a/libs/ardour/ardour/processor.h
+++ b/libs/ardour/ardour/processor.h
@@ -113,6 +113,9 @@ class Processor : public SessionObject, public Automatable, public Latent
void set_ui (void*);
void* get_ui () const { return _ui_pointer; }
+ void set_owner (SessionObject*);
+ SessionObject* owner() const;
+
protected:
virtual int set_state_2X (const XMLNode&, int version);
@@ -125,6 +128,7 @@ protected:
bool _display_to_user;
bool _pre_fader; ///< true if this processor is currently placed before the Amp, otherwise false
void* _ui_pointer;
+ SessionObject* _owner;
};
} // namespace ARDOUR