diff options
author | David Robillard <d@drobilla.net> | 2008-01-10 21:20:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-01-10 21:20:59 +0000 |
commit | bb457bb960c5bd7ed538f9d31477293415739f68 (patch) | |
tree | 84324a63b87c03589cd165b9e474296eaebb4772 /libs/ardour/ardour/audio_unit.h | |
parent | 73dd9d37e7d715e0d78c0e51569968f9494dac7f (diff) |
Merge libs/ardour and gtk2_ardour with 2.0-ongoing R2837.
git-svn-id: svn://localhost/ardour2/trunk@2883 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/audio_unit.h')
-rw-r--r-- | libs/ardour/ardour/audio_unit.h | 68 |
1 files changed, 51 insertions, 17 deletions
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index 7b31b1937f..b0e4d34c28 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -22,6 +22,7 @@ #define __ardour_audio_unit_h__ #include <stdint.h> +#include <boost/shared_ptr.hpp> #include <list> #include <set> @@ -30,6 +31,8 @@ #include <ardour/plugin.h> +#include <AudioUnit/AudioUnit.h> + #include <boost/shared_ptr.hpp> class CAComponent; @@ -45,13 +48,13 @@ class Session; class AUPlugin : public ARDOUR::Plugin { public: - AUPlugin (AudioEngine& engine, Session& session, CAComponent* comp); + AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAComponent> comp); virtual ~AUPlugin (); - uint32_t unique_id () const; + std::string unique_id () const; const char * label () const; const char * name () const { return _info->name.c_str(); } - const char * maker () const; + const char * maker () const { return _info->creator.c_str(); } uint32_t parameter_count () const; float default_value (uint32_t port); nframes_t signal_latency () const; @@ -87,34 +90,65 @@ class AUPlugin : public ARDOUR::Plugin bool has_editor () const; - CAAudioUnit* get_au () { return unit; } - CAComponent* get_comp () { return comp; } - + bool fixed_io() const { return false; } + int32_t can_support_input_configuration (int32_t in); + int32_t compute_output_streams (int32_t nplugins); + uint32_t output_streams() const; + uint32_t input_streams() const; + + boost::shared_ptr<CAAudioUnit> get_au () { return unit; } + boost::shared_ptr<CAComponent> get_comp () { return comp; } + + OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData); private: - CAComponent* comp; - CAAudioUnit* unit; - - AudioBufferList* in_list; - AudioBufferList* out_list; + boost::shared_ptr<CAComponent> comp; + boost::shared_ptr<CAAudioUnit> unit; + + AudioStreamBasicDescription streamFormat; + bool initialized; + int format_set; + AudioBufferList* buffers; + + UInt32 global_elements; + UInt32 output_elements; + UInt32 input_elements; + + int set_output_format (); + int set_input_format (); + int set_stream_format (int scope, uint32_t cnt); + int _set_block_size (nframes_t nframes); std::vector<std::pair<uint32_t, uint32_t> > parameter_map; + uint32_t current_maxbuf; + nframes_t current_offset; + nframes_t cb_offset; + vector<Sample*>* current_buffers; + nframes_t frames_processed; }; - + typedef boost::shared_ptr<AUPlugin> AUPluginPtr; class AUPluginInfo : public PluginInfo { public: - AUPluginInfo () { }; + AUPluginInfo (boost::shared_ptr<CAComponentDescription>); ~AUPluginInfo (); - CAComponentDescription* desc; + PluginPtr load (Session& session); static PluginInfoList discover (); - PluginPtr load (Session& session); + static void get_names (CAComponentDescription&, std::string& name, Glib::ustring& maker); + static std::string stringify_descriptor (const CAComponentDescription&); private: - static std::string get_name (CAComponentDescription&); - void setup_nchannels (CAComponentDescription&); + boost::shared_ptr<CAComponentDescription> descriptor; + + static void discover_music (PluginInfoList&); + static void discover_fx (PluginInfoList&); + static void discover_by_description (PluginInfoList&, CAComponentDescription&); }; typedef boost::shared_ptr<AUPluginInfo> AUPluginInfoPtr; |