21 #include <glib/gstdio.h>
23 #include <glibmm/fileutils.h>
24 #include <glibmm/miscutils.h>
136 if (data_size == 0) {
140 return g_base64_encode (data, data_size);
152 guchar* raw_data = g_base64_decode (data, &size);
186 snprintf (index,
sizeof (index),
"param-%d", n);
202 error <<
_(
"Bad node sent to VSTPlugin::set_state") <<
endmsg;
206 #ifndef NO_PLUGIN_STATE
211 XMLPropertyList::const_iterator i;
212 XMLNodeList::const_iterator n;
214 for (n = child->
children ().begin (); n != child->
children ().end (); ++n) {
215 if ((*n)->is_content ()) {
219 ret =
set_chunk ((*n)->content().c_str(),
false);
225 XMLPropertyList::const_iterator i;
231 sscanf ((*i)->name().c_str(),
"param-%d", ¶m);
232 sscanf ((*i)->value().c_str(),
"%f", &val);
286 desc.
step = range / 100.0f;
291 if (strlen(prop.
label) == 0) {
306 memset (label, 0,
sizeof (label));
354 int const p = sscanf (r.
uri.c_str(),
"VST:%d:%d", &
id, &index);
357 sscanf (r.
uri.c_str(),
"VST:%d:%d", &
id, &index);
377 for (XMLNodeList::const_iterator i = root->
children().begin(); i != root->
children().end(); ++i) {
394 for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
395 if ((*j)->is_content ()) {
398 guchar* raw_data = g_base64_decode ((*j)->content().c_str(), &size);
410 for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
411 if ((*j)->name() ==
X_(
"Parameter")) {
493 memset (name, 0,
sizeof (name));
499 if (name[0] ==
'\0') {
500 strcpy (name,
_(
"Unknown"));
513 return *((int32_t *) (((
char *) &
_plugin->
flags) + 12));
516 set<Evoral::Parameter>
519 set<Evoral::Parameter> ret;
556 uint32_t in_index = 0;
566 uint32_t out_index = 0;
581 v = bufs.get_vst_midi (buf_index_in);
651 if (buf[0] ==
'\0') {
656 while (*first_nonws && isspace (*first_nonws)) {
660 if (*first_nonws ==
'\0') {
664 memmove (buf, first_nonws, strlen (buf) - (first_nonws - buf) + 1);
676 if (vst_version >= 2) {
696 for (XMLNodeList::const_iterator i = root->
children().begin(); i != root->
children().end(); ++i) {
705 _presets.insert (make_pair (r.uri, r));
721 if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
722 if (g_mkdir_with_parents (p.c_str(), 0755) != 0) {
723 error <<
_(
"Unable to make VST presets directory") <<
endmsg;
729 if (!Glib::file_test (p, Glib::FILE_TEST_EXISTS)) {
float get_parameter(uint32_t port) const
int atoi(const string &s)
const XMLPropertyList & properties() const
void set_parameter(uint32_t port, float val)
virtual int set_state(const XMLNode &, int version)
float lower
Minimum value (in Hz, for frequencies)
MidiBuffer & get_midi(size_t i)
const std::string & value() const
int set_chunk(gchar const *, bool)
virtual void set_parameter(uint32_t which, float val)
float default_value(uint32_t port)
const std::string & name() const
bool load_plugin_preset(PresetRecord)
float(* getParameter)(struct _AEffect *, int)
char label[VestigeMaxLabelLen]
void silence(framecnt_t nframes, framecnt_t offset=0)
bool load_user_preset(PresetRecord)
void(* setParameter)(struct _AEffect *, int, float)
intptr_t(* dispatcher)(struct _AEffect *, int, int, intptr_t, void *, float)
MidiBuffer * _midi_out_buf
LIBPBD_API Transmitter error
const XMLNodeList & children(const std::string &str=std::string()) const
std::ostream & endmsg(std::ostream &ostr)
std::string presets_file() const
framecnt_t signal_latency() const
#define effGetParameterProperties
framecnt_t frame_rate() const
AudioBuffer & get_audio(size_t i)
int set_state(XMLNode const &, int)
static bool floateq(float a, float b, int max_ulps_diff)
int connect_and_run(BufferSet &, ChanMapping in, ChanMapping out, pframes_t nframes, framecnt_t offset)
virtual int connect_and_run(BufferSet &bufs, ChanMapping in, ChanMapping out, pframes_t nframes, framecnt_t offset)
LIBARDOUR_API std::string user_config_directory(int version=-1)
const char * name() const
std::string do_save_preset(std::string name)
float upper
Maximum value (in Hz, for frequencies)
XMLNode * set_root(XMLNode *n)
void print_parameter(uint32_t, char *, uint32_t len) const
std::map< std::string, PresetRecord > _presets
const PBD::ID & id() const
int set_block_size(pframes_t)
void set_plugin(AEffect *)
void(* processReplacing)(struct _AEffect *, float **, float **, int)
LIBARDOUR_API XMLNode * find_named_node(const XMLNode &node, std::string name)
const char * label() const
int get_parameter_descriptor(uint32_t which, ParameterDescriptor &) const
int first_user_preset_index() const
const std::string & set_filename(const std::string &fn)
void do_remove_preset(std::string name)
#define effFlagsHasEditor
XMLProperty * add_property(const char *name, const std::string &value)
void add_state(XMLNode *) const
void add_child_nocopy(XMLNode &)
pframes_t get_block_size() const
bool toggled
True iff parameter is boolean.
XMLNode * add_content(const std::string &s=std::string())
uint32_t nth_parameter(uint32_t port, bool &ok) const
bool parameter_is_input(uint32_t) const
const ChanCount & count() const
void set(DataType t, uint32_t count)
std::string unique_id() const
ARDOUR::Session & _session
gchar * get_chunk(bool) const
XMLTree * presets_tree() const
std::string describe_parameter(Evoral::Parameter)
const Sample * data(framecnt_t offset=0) const
uint32_t parameter_count() const
bool load_preset(PresetRecord)
virtual std::string state_node_name() const =0
void remove_nodes_and_delete(const std::string &)
unsigned char * wanted_chunk
BufferSet & get_silent_buffers(ChanCount count=ChanCount::ZERO)
virtual bool load_preset(PresetRecord)
BufferSet & get_scratch_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
uint32_t get(DataType t, uint32_t from, bool *valid)
std::set< Evoral::Parameter > automatable() const
std::string string_compose(const std::string &fmt, const T1 &o1)
double atof(const string &s)
const char * maker() const