summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-25 12:36:54 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-25 12:36:54 -0400
commit20b1a7d9d8800f8fdca8379cba01cc39757c34fc (patch)
treee7e4f67e1d9378fb02a53b85a501f3a44968345b /libs/ardour/ardour
parent2af6491c1c779cda31b9a9bd8eee2fb47015e91f (diff)
most of libardour now actually compiles
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_backend.h8
-rw-r--r--libs/ardour/ardour/jack_audiobackend.h52
-rw-r--r--libs/ardour/ardour/jack_portengine.h34
-rw-r--r--libs/ardour/ardour/port.h14
-rw-r--r--libs/ardour/ardour/port_engine.h34
-rw-r--r--libs/ardour/ardour/port_manager.h4
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/ardour/slave.h2
-rw-r--r--libs/ardour/ardour/types.h4
9 files changed, 112 insertions, 42 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h
index 7ae48c4c46..e8511d0c57 100644
--- a/libs/ardour/ardour/audio_backend.h
+++ b/libs/ardour/ardour/audio_backend.h
@@ -17,8 +17,8 @@
*/
-#ifndef __ardour_audiobackend_h__
-#define __ardour_audiobackend_h__
+#ifndef __libardour_audiobackend_h__
+#define __libardour_audiobackend_h__
#include <string>
#include <vector>
@@ -26,6 +26,8 @@
#include <stdint.h>
#include <stdlib.h>
+#include <boost/function.hpp>
+
namespace ARDOUR {
class AudioEngine;
@@ -342,5 +344,5 @@ class AudioBackend {
}
-#endif /* __ardour_audiobackend_h__ */
+#endif /* __libardour_audiobackend_h__ */
diff --git a/libs/ardour/ardour/jack_audiobackend.h b/libs/ardour/ardour/jack_audiobackend.h
index 2e12d521cd..218f08b55e 100644
--- a/libs/ardour/ardour/jack_audiobackend.h
+++ b/libs/ardour/ardour/jack_audiobackend.h
@@ -17,34 +17,62 @@
*/
-#ifndef __ardour_jack_audiobackend_h__
-#define __ardour_jack_audiobackend_h__
+#ifndef __libardour_jack_audiobackend_h__
+#define __libardour_jack_audiobackend_h__
#include <string>
#include <vector>
#include <stdint.h>
+#include <jack/jack.h>
+#ifdef HAVE_JACK_SESSION
+#include <jack/session.h>
+#endif
+
#include "ardour/audio_backend.h"
namespace ARDOUR {
-class JACKAudioBackend : public {
+class JACKAudioBackend : public AudioBackend {
public:
JACKAudioBackend (AudioEngine& e);
~JACKAudioBackend ();
+ std::string name() const;
+ bool connected() const;
+ bool is_realtime () const;
+
std::vector<std::string> enumerate_devices () const;
std::vector<float> available_sample_rates (const std::string& device) const;
std::vector<uint32_t> available_buffer_sizes (const std::string& device) const;
-
- int set_parameters (const Parameters&);
- int get_parameters (Parameters&) const;
+ uint32_t available_input_channel_count (const std::string& device) const;
+ uint32_t available_output_channel_count (const std::string& device) const;
+
+ int set_device_name (const std::string&);
+ int set_sample_rate (float);
+ int set_buffer_size (uint32_t);
+ int set_sample_format (SampleFormat);
+ int set_interleaved (bool yn);
+ int set_input_channels (uint32_t);
+ int set_output_channels (uint32_t);
+ int set_systemic_input_latency (uint32_t);
+ int set_systemic_output_latency (uint32_t);
+
+ std::string get_device_name () const;
+ float get_sample_rate () const;
+ uint32_t get_buffer_size () const;
+ SampleFormat get_sample_format () const;
+ bool get_interleaved () const;
+ uint32_t get_input_channels () const;
+ uint32_t get_output_channels () const;
+ uint32_t get_systemic_input_latency () const;
+ uint32_t get_systemic_output_latency () const;
int start ();
int stop ();
int pause ();
- int freewheel ();
+ int freewheel (bool);
private:
jack_client_t* volatile _jack; /* could be reset to null by SIGPIPE or another thread */
@@ -60,10 +88,10 @@ class JACKAudioBackend : public {
static void _freewheel_callback (int , void *arg);
static void _registration_callback (jack_port_id_t, int, void *);
static void _connect_callback (jack_port_id_t, jack_port_id_t, int, void *);
- static void _latency_callback (jack_latency_callback_mode_t, void*);#
+ static void _latency_callback (jack_latency_callback_mode_t, void*);
static void halted (void *);
static void halted_info (jack_status_t,const char*,void *);
-ifdef HAVE_JACK_SESSION
+#ifdef HAVE_JACK_SESSION
static void _session_callback (jack_session_event_t *event, void *arg);
#endif
@@ -103,11 +131,11 @@ ifdef HAVE_JACK_SESSION
bool _target_interleaved;
uint32_t _target_input_channels;
uint32_t _target_output_channels;
- uin32_t _target_systemic_input_latency;
- uin32_t _target_systemic_input_latency;
+ uint32_t _target_systemic_input_latency;
+ uint32_t _target_systemic_output_latency;
};
-}
+} // namespace
#endif /* __ardour_audiobackend_h__ */
diff --git a/libs/ardour/ardour/jack_portengine.h b/libs/ardour/ardour/jack_portengine.h
new file mode 100644
index 0000000000..2456adc272
--- /dev/null
+++ b/libs/ardour/ardour/jack_portengine.h
@@ -0,0 +1,34 @@
+/*
+ Copyright (C) 2013 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __libardour_jack_portengine_h__
+#define __libardour_jack_portengine_h__
+
+namespace ARDOUR {
+
+class JACKPortEngine : public PortEngine
+{
+ public:
+ JACKPortEngine (const std::string& client_name,
+ const std::string& session_uuid);
+};
+
+} // namespace
+
+#endif /* __libardour_jack_portengine_h__ */
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 6186ce7748..06175de673 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -97,13 +97,13 @@ public:
PortEngine::PortHandle port_handle() { return _port_handle; }
- void get_connected_latency_range (jack_latency_range_t& range, bool playback) const;
+ void get_connected_latency_range (LatencyRange& range, bool playback) const;
- void set_private_latency_range (jack_latency_range_t& range, bool playback);
- const jack_latency_range_t& private_latency_range (bool playback) const;
+ void set_private_latency_range (LatencyRange& range, bool playback);
+ const LatencyRange& private_latency_range (bool playback) const;
- void set_public_latency_range (jack_latency_range_t& range, bool playback) const;
- jack_latency_range_t public_latency_range (bool playback) const;
+ void set_public_latency_range (LatencyRange& range, bool playback) const;
+ LatencyRange public_latency_range (bool playback) const;
virtual void reset ();
@@ -147,8 +147,8 @@ protected:
framecnt_t _port_buffer_offset; /* access only from process() tree */
- jack_latency_range_t _private_playback_latency;
- jack_latency_range_t _private_capture_latency;
+ LatencyRange _private_playback_latency;
+ LatencyRange _private_capture_latency;
private:
std::string _name; ///< port short name
diff --git a/libs/ardour/ardour/port_engine.h b/libs/ardour/ardour/port_engine.h
index 3bea32620e..8dc35ec8f5 100644
--- a/libs/ardour/ardour/port_engine.h
+++ b/libs/ardour/ardour/port_engine.h
@@ -87,28 +87,39 @@ class PortEngine {
typedef void* PortHandle;
- virtual bool connected() const = 0;
+ virtual bool connected() const = 0;
+ virtual void* private_handle() const = 0;
virtual int set_port_name (PortHandle, const std::string&) = 0;
virtual std::string get_port_name (PortHandle) const = 0;
virtual PortHandle* get_port_by_name (const std::string&) const = 0;
- virtual PortHandle register_port (const std::string&, DataType::Symbol, ARDOUR::PortFlags) = 0;
+ virtual std::string make_port_name_relative (const std::string& name) const = 0;
+ virtual std::string make_port_name_non_relative (const std::string& name) const = 0;
+ virtual bool port_is_mine (const std::string& fullname) const = 0;
+
+ virtual PortHandle register_port (const std::string& shortname, ARDOUR::DataType, ARDOUR::PortFlags) = 0;
virtual void unregister_port (PortHandle) = 0;
+
virtual bool connected (PortHandle) = 0;
- virtual int disconnect_all (PortHandle) = 0;
virtual bool connected_to (PortHandle, const std::string&) = 0;
- virtual int get_connections (PortHandle, std::vector<std::string>&) = 0;
virtual bool physically_connected (PortHandle) = 0;
+
+ virtual int get_connections (PortHandle, std::vector<std::string>&) = 0;
+
virtual int connect (PortHandle, const std::string&) = 0;
virtual int disconnect (PortHandle, const std::string&) = 0;
+ virtual int disconnect_all (PortHandle) = 0;
+
+ virtual int connect (const std::string& src, const std::string& dst) = 0;
+ virtual int disconnect (const std::string& src, const std::string& dst) = 0;
/* MIDI */
- virtual void midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index) = 0;
- virtual int midi_event_put (void* port_buffer, pframes_t timestamp, const uint8_t* buffer, size_t size) = 0;
+ virtual void midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index) = 0;
+ virtual int midi_event_put (void* port_buffer, pframes_t timestamp, const uint8_t* buffer, size_t size) = 0;
virtual uint32_t get_midi_event_count (void* port_buffer);
- virtual void midi_clear (void* port_buffer);
+ virtual void midi_clear (void* port_buffer);
/* Monitoring */
@@ -120,13 +131,8 @@ class PortEngine {
/* Latency management
*/
- struct LatencyRange {
- uint32_t min;
- uint32_t max;
- };
-
- virtual void set_latency_range (PortHandle, int dir, LatencyRange) = 0;
- virtual LatencyRange get_latency_range (PortHandle, int dir) = 0;
+ virtual void set_latency_range (PortHandle, bool for_playback, LatencyRange) = 0;
+ virtual LatencyRange get_latency_range (PortHandle, bool for_playback) = 0;
virtual LatencyRange get_connected_latency_range (PortHandle, int dir) = 0;
virtual void* get_buffer (PortHandle, pframes_t) = 0;
diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h
index 399ab46b34..0e9a84ea8c 100644
--- a/libs/ardour/ardour/port_manager.h
+++ b/libs/ardour/ardour/port_manager.h
@@ -78,10 +78,6 @@ class PortManager
bool can_request_input_monitoring () const;
void request_input_monitoring (const std::string&, bool) const;
void ensure_input_monitoring (const std::string&, bool) const;
-
- std::string make_port_name_relative (const std::string&) const;
- std::string make_port_name_non_relative (const std::string&) const;
- bool port_is_mine (const std::string&) const;
class PortRegistrationFailure : public std::exception {
public:
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index a149224607..a782680082 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -1213,7 +1213,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
framepos_t ltc_timecode_offset;
bool ltc_timecode_negative_offset;
- jack_latency_range_t ltc_out_latency;
+ LatencyRange ltc_out_latency;
void ltc_tx_initialize();
void ltc_tx_cleanup();
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h
index 9862824da9..88c9a09be7 100644
--- a/libs/ardour/ardour/slave.h
+++ b/libs/ardour/ardour/slave.h
@@ -391,7 +391,7 @@ public:
PBD::ScopedConnectionList port_connections;
PBD::ScopedConnection config_connection;
- jack_latency_range_t ltc_slave_latency;
+ LatencyRange ltc_slave_latency;
/* DLL - chase LTC */
int transport_direction;
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 390f1e4fec..0167909ef3 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -602,6 +602,10 @@ namespace ARDOUR {
IsOutput = 2,
};
+ struct LatencyRange {
+ uint32_t min; //< samples
+ uint32_t max; //< samples
+ };
} // namespace ARDOUR