#include <set>
#include <string>
#include <vector>
+#include <map>
-#include <ardour/plugin.h>
+#include "ardour/plugin.h"
#include <AudioUnit/AudioUnit.h>
#include <appleutility/AUParamInfo.h>
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;
+ nframes_t latency () const;
void set_parameter (uint32_t which, float val);
float get_parameter (uint32_t which) const;
void deactivate ();
void set_block_size (nframes_t nframes);
- int connect_and_run (BufferSet& bufs, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset);
-
+ int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
std::set<uint32_t> automatable() const;
string describe_parameter (uint32_t);
string state_node_name () const { return "audiounit"; }
bool save_preset (string name);
bool load_preset (const string preset_label);
std::vector<std::string> get_presets ();
-
+ std::string current_preset() const;
+
bool has_editor () const;
- bool fixed_io() const { return false; }
- int32_t can_support_input_configuration (int32_t in);
- int32_t compute_output_streams (int32_t nplugins);
+ int32_t can_do (int32_t in, int32_t& out);
uint32_t output_streams() const;
uint32_t input_streams() const;
+ int32_t configure_io (int32_t in, int32_t out);
boost::shared_ptr<CAAudioUnit> get_au () { return unit; }
boost::shared_ptr<CAComponent> get_comp () const { return comp; }
private:
boost::shared_ptr<CAComponent> comp;
boost::shared_ptr<CAAudioUnit> unit;
-
- AudioStreamBasicDescription streamFormat;
+
bool initialized;
- int format_set;
+ int32_t input_channels;
+ int32_t output_channels;
+ std::vector<std::pair<int,int> > io_configs;
AudioBufferList* buffers;
-
+
+ /* XXX this should really be shared across all AUPlugin instances */
+
+ typedef std::map<std::string,std::string> PresetMap;
+ PresetMap preset_map;
+
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_output_format (AudioStreamBasicDescription&);
+ int set_input_format (AudioStreamBasicDescription&);
+ int set_stream_format (int scope, uint32_t cnt, AudioStreamBasicDescription&);
int _set_block_size (nframes_t nframes);
void discover_parameters ();
typedef boost::shared_ptr<AUPlugin> AUPluginPtr;
+struct AUPluginCachedInfo {
+ std::vector<std::pair<int,int> > io_configs;
+};
+
class AUPluginInfo : public PluginInfo {
public:
AUPluginInfo (boost::shared_ptr<CAComponentDescription>);
PluginPtr load (Session& session);
+ AUPluginCachedInfo cache;
+
static PluginInfoList discover ();
static void get_names (CAComponentDescription&, std::string& name, Glib::ustring& maker);
static std::string stringify_descriptor (const CAComponentDescription&);
+ static int load_cached_info ();
+
private:
boost::shared_ptr<CAComponentDescription> descriptor;
-
+ UInt32 version;
+
static void discover_music (PluginInfoList&);
static void discover_fx (PluginInfoList&);
+ static void discover_generators (PluginInfoList&);
static void discover_by_description (PluginInfoList&, CAComponentDescription&);
+ static Glib::ustring au_cache_path ();
+
+ typedef std::map<std::string,AUPluginCachedInfo> CachedInfoMap;
+ static CachedInfoMap cached_info;
+
+ static bool cached_io_configuration (const std::string&, UInt32, CAComponent&, AUPluginCachedInfo&, const std::string& name);
+ static void add_cached_info (const std::string&, AUPluginCachedInfo&);
+ static void save_cached_info ();
};
typedef boost::shared_ptr<AUPluginInfo> AUPluginInfoPtr;