diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-19 20:31:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-10-19 20:31:00 +0000 |
commit | f1928b85bbfeee452dabfe3cd75cc93fa0a44d2d (patch) | |
tree | 280b9b529cacd9b702a0fbc3e81fed55af01e8dd /libs/ardour/ardour/audio_unit.h | |
parent | 3a109f797dcbf105632c24b39a3296b87d4b2ad0 (diff) |
add AU parameter listening stuff from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@10242 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/audio_unit.h')
-rw-r--r-- | libs/ardour/ardour/audio_unit.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index db38b0f234..14665da301 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -143,6 +143,17 @@ class AUPlugin : public ARDOUR::Plugin static std::string maybe_fix_broken_au_id (const std::string&); + /* this MUST be called from thread in which you want to receive notifications + about parameter changes. + */ + int create_parameter_listener (AUEventListenerProc callback, void *arg, float interval_secs); + /* these can be called from any thread but SHOULD be called from the same thread + that will receive parameter change notifications. + */ + int listen_to_parameter (uint32_t param_id); + int end_listen_to_parameter (uint32_t param_id); + + protected: std::string do_save_preset (std::string name); void do_remove_preset (std::string); @@ -187,20 +198,26 @@ class AUPlugin : public ARDOUR::Plugin void discover_parameters (); void add_state (XMLNode *) const; - std::vector<std::pair<uint32_t, uint32_t> > parameter_map; - uint32_t current_maxbuf; - framecnt_t current_offset; + typedef std::map<uint32_t, uint32_t> ParameterMap; + ParameterMap parameter_map; + uint32_t input_maxbuf; + framecnt_t input_offset; framecnt_t cb_offset; - BufferSet* current_buffers; + BufferSet* input_buffers; framecnt_t frames_processed; std::vector<AUParameterDescriptor> descriptors; + AUEventListenerRef _parameter_listener; + void * _parameter_listener_arg; void init (); void discover_factory_presets (); bool last_transport_rolling; float last_transport_speed; + + static void _parameter_change_listener (void* /*arg*/, void* /*src*/, const AudioUnitEvent* event, UInt64 host_time, Float32 new_value); + void parameter_change_listener (void* /*arg*/, void* /*src*/, const AudioUnitEvent* event, UInt64 host_time, Float32 new_value); }; typedef boost::shared_ptr<AUPlugin> AUPluginPtr; |