summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-10-12 09:45:22 +0000
committerRobin Gareus <robin@gareus.org>2012-10-12 09:45:22 +0000
commitbce3184ff5383f47675a97a8184f7739552cb04e (patch)
treef74f770085dfb11a2b419cd3af197d3bc489e260 /libs/ardour/ardour
parent8f55ca6a5099f44de83330d3da267bd32fd769d9 (diff)
skeleton framework for LTC-slave
git-svn-id: svn://localhost/ardour2/branches/3.0@13256 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audioengine.h8
-rw-r--r--libs/ardour/ardour/slave.h37
-rw-r--r--libs/ardour/ardour/types.h3
3 files changed, 47 insertions, 1 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index 1c0d0f1a55..4e55ea2140 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -260,6 +260,10 @@ _ the regular process() call to session->process() is not made.
int create_process_thread (boost::function<void()>, pthread_t*, size_t stacksize);
+#ifdef HAVE_LTC
+ Port *ltc_input_port() const { return _ltc_input; }
+#endif
+
private:
static AudioEngine* _instance;
@@ -289,6 +293,10 @@ private:
Glib::Threads::Thread* m_meter_thread;
ProcessThread* _main_thread;
+#ifdef HAVE_LTC
+ Port* _ltc_input;
+#endif
+
SerializedRCUManager<Ports> ports;
boost::shared_ptr<Port> register_port (DataType type, const std::string& portname, bool input);
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h
index a8bf28b8ce..b64ba3f42e 100644
--- a/libs/ardour/ardour/slave.h
+++ b/libs/ardour/ardour/slave.h
@@ -32,6 +32,10 @@
#include "midi++/parser.h"
#include "midi++/types.h"
+#ifdef HAVE_LTC
+#include <ltc.h>
+#endif
+
namespace MIDI {
class Port;
}
@@ -293,6 +297,39 @@ class MTC_Slave : public Slave {
void init_engine_dll (framepos_t, framepos_t);
};
+#ifdef HAVE_LTC
+class LTC_Slave : public Slave {
+ public:
+ LTC_Slave (Session&);
+ ~LTC_Slave ();
+
+ bool speed_and_position (double&, framepos_t&);
+
+ bool locked() const;
+ bool ok() const;
+
+ framecnt_t resolution () const;
+ bool requires_seekahead () const { return true; }
+ framecnt_t seekahead_distance() const;
+ bool give_slave_full_control_over_transport_speed() const;
+
+ private:
+ int parse_ltc(const jack_nframes_t nframes, const jack_default_audio_sample_t * const in, const framecnt_t posinfo);
+ void process_ltc();
+
+ Session& session;
+ bool did_reset_tc_format;
+ Timecode::TimecodeFormat saved_tc_format;
+
+ LTCDecoder *decoder;
+ framecnt_t current_frames_per_ltc_frame;
+ framecnt_t monotonic_fcnt;
+
+ framepos_t ltc_transport_pos;
+ double ltc_speed;
+};
+#endif
+
class MIDIClock_Slave : public Slave {
public:
MIDIClock_Slave (Session&, MIDI::Port&, int ppqn = 24);
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index b84eb8e7f6..5bd03d2788 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -462,7 +462,8 @@ namespace ARDOUR {
enum SyncSource {
JACK,
MTC,
- MIDIClock
+ MIDIClock,
+ LTC
};
enum ShuttleBehaviour {