summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/lv2_plugin.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-17 18:41:19 +0000
committerDavid Robillard <d@drobilla.net>2012-11-17 18:41:19 +0000
commit4c5ef5318edb4e1cdc76288860c27358155efe17 (patch)
treeb799988e6b5ef0a105d9c89fa9399c35b6b604e2 /libs/ardour/ardour/lv2_plugin.h
parentdd78c6ed719c717a892e47e8b4ef5702ced7eb8d (diff)
Sent precise transport information to LV2 plugins via events.
We send the full transport state (frame position, BBT time, transport speed, meter) to the plugin: * At the start of a cycle whenever a relocate or transport speed change has occurred * On every occurrence of a meter change within a cycle This means the plugin gets a sample accurate meter/tempo map, even if the meter changes in the middle of a cycle. However, this is not quite right yet: things can get wonky if the tempo map is edited while rolling, since this code will not detect the change and fail to update the plugin at the start of the cycle. Other changes: * Factor out TempoMetric::set_metric() and simplify some tempo functions * Clean up LV2 URID stuff git-svn-id: svn://localhost/ardour2/branches/3.0@13513 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/lv2_plugin.h')
-rw-r--r--libs/ardour/ardour/lv2_plugin.h35
1 files changed, 23 insertions, 12 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index 1090f30307..a4b89a5841 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -111,8 +111,6 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
boost::shared_ptr<Plugin::ScalePoints>
get_scale_points(uint32_t port_index) const;
- static uint32_t midi_event_type() { return _midi_event_type; }
-
void set_insert_info(const PluginInsert* insert);
int set_state (const XMLNode& node, int version);
@@ -124,8 +122,6 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
bool has_editor () const;
bool has_message_output () const;
- uint32_t atom_eventTransfer() const;
-
void write_from_ui(uint32_t index,
uint32_t protocol,
uint32_t size,
@@ -147,14 +143,26 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
static URIMap _uri_map;
- static uint32_t _midi_event_type;
- static uint32_t _chunk_type;
- static uint32_t _sequence_type;
- static uint32_t _event_transfer_type;
- static uint32_t _path_type;
- static uint32_t _log_Error;
- static uint32_t _log_Warning;
- static uint32_t _log_Note;
+ struct URIDs {
+ uint32_t atom_Chunk;
+ uint32_t atom_Path;
+ uint32_t atom_Sequence;
+ uint32_t atom_eventTransfer;
+ uint32_t log_Error;
+ uint32_t log_Note;
+ uint32_t log_Warning;
+ uint32_t midi_MidiEvent;
+ uint32_t time_Position;
+ uint32_t time_bar;
+ uint32_t time_barBeat;
+ uint32_t time_beatUnit;
+ uint32_t time_beatsPerBar;
+ uint32_t time_beatsPerMinute;
+ uint32_t time_frame;
+ uint32_t time_speed;
+ };
+
+ static URIDs urids;
private:
struct Impl;
@@ -171,6 +179,9 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
float* _bpm_control_port; ///< Special input set by ardour
float* _freewheel_control_port; ///< Special input set by ardour
float* _latency_control_port; ///< Special output set by ardour
+ uint32_t _position_seq_port_idx; ///< Index of Sequence port for position
+ framepos_t _next_cycle_start; ///< Expected start frame of next run cycle
+ double _next_cycle_speed; ///< Expected start frame of next run cycle
PBD::ID _insert_id;
friend const void* lv2plugin_get_port_value(const char* port_symbol,