+ bool reconfigurable_io() const { return true; }
+ bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
+ bool configure_io (ChanCount in, ChanCount out);
+ bool requires_fixed_size_buffers() const;
+
+ void set_fixed_size_buffers (bool yn) {
+ _requires_fixed_size_buffers = yn;
+ }
+
+ boost::shared_ptr<CAAudioUnit> get_au () { return unit; }
+ boost::shared_ptr<CAComponent> get_comp () const { return comp; }
+
+ OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList* ioData);
+
+ /* "host" callbacks */
+
+ OSStatus get_beat_and_tempo_callback (Float64* outCurrentBeat,
+ Float64* outCurrentTempo);
+
+ OSStatus get_musical_time_location_callback (UInt32* outDeltaSampleOffsetToNextBeat,
+ Float32* outTimeSig_Numerator,
+ UInt32* outTimeSig_Denominator,
+ Float64* outCurrentMeasureDownBeat);
+
+ OSStatus get_transport_state_callback (Boolean* outIsPlaying,
+ Boolean* outTransportStateChanged,
+ Float64* outCurrentSampleInTimeLine,
+ Boolean* outIsCycling,
+ Float64* outCycleStartBeat,
+ Float64* outCycleEndBeat);
+
+ static std::string maybe_fix_broken_au_id (const std::string&);
+
+ private:
+ void find_presets ();
+
+ boost::shared_ptr<CAComponent> comp;
+ boost::shared_ptr<CAAudioUnit> unit;
+
+ bool initialized;
+ int32_t input_channels;
+ int32_t output_channels;
+ std::vector<std::pair<int,int> > io_configs;
+ pframes_t _current_block_size;
+ framecnt_t _last_nframes;
+ bool _requires_fixed_size_buffers;
+ AudioBufferList* buffers;
+ bool _has_midi_input;
+ bool _has_midi_output;
+
+ /* despite all the cool work that apple did on their AU preset
+ system, they left factory presets and user presets as two
+ entirely different kinds of things, handled by two entirely
+ different parts of the API. Resolve this.
+ */
+
+ /* XXX these two maps should really be shared across all instances of this AUPlugin */
+
+ typedef std::map<std::string,std::string> UserPresetMap;
+ UserPresetMap user_preset_map;
+ typedef std::map<std::string,int> FactoryPresetMap;
+ FactoryPresetMap factory_preset_map;
+
+ UInt32 global_elements;
+ UInt32 output_elements;
+ UInt32 input_elements;
+
+ int set_output_format (AudioStreamBasicDescription&);
+ int set_input_format (AudioStreamBasicDescription&);
+ int set_stream_format (int scope, uint32_t cnt, AudioStreamBasicDescription&);
+ void discover_parameters ();
+ void add_state (XMLNode *) const;