From 6748b37d51353ea6e82dabfca812e733edc3c0ad Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 3 Jan 2016 17:19:05 +0000 Subject: improved ladspa plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5970 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Effect/ladspa/ladspahost.h | 39 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'src/plugins/Effect/ladspa/ladspahost.h') diff --git a/src/plugins/Effect/ladspa/ladspahost.h b/src/plugins/Effect/ladspa/ladspahost.h index df83c8083..06ff6173b 100644 --- a/src/plugins/Effect/ladspa/ladspahost.h +++ b/src/plugins/Effect/ladspa/ladspahost.h @@ -40,10 +40,9 @@ class LADSPAPlugin { public: QString name; - QString fileName; long id; long unique_id; - bool stereo; + const LADSPA_Descriptor *desc; }; class LADSPAControl @@ -58,21 +57,18 @@ public: double min; double max; double step; - LADSPA_Data *value; + LADSPA_Data value; int type; + int port; QString name; }; class LADSPAEffect { public: - void *library; - QString fileName; - bool stereo; - const LADSPA_Descriptor *descriptor; - LADSPA_Handle handle; /* left or mono */ - LADSPA_Handle handle2; /* right stereo */ - LADSPA_Data knobs[MAX_KNOBS]; + LADSPAPlugin *plugin; + QList in_ports, out_ports; + QList handles; QList controls; }; @@ -89,26 +85,27 @@ public: void configure(quint32 freq, int chan); QList plugins(); QList effects(); - LADSPAEffect *addPlugin(LADSPAPlugin * plugin); - void unload(LADSPAEffect *instance); + void load(LADSPAPlugin *plugin); + void unload(LADSPAEffect *effect); + static LADSPAHost* instance(); private: - void bootPlugin(LADSPAEffect *instance); - void findAllPlugins(); - void findPlugins(const QString &path); - LADSPAEffect *load(const QString &path, long num); - void portAssign(LADSPAEffect *instance); - void initialize(LADSPAEffect *instance); - + void loadModules(); + void findModules(const QString &path); + void unloadModules(); + LADSPAEffect *createEffect(LADSPAPlugin *plugin); + LADSPAControl *createControl(const LADSPA_Descriptor *desc, unsigned long port); + void activateEffect(LADSPAEffect *e); + void deactivateEffect(LADSPAEffect *e); QList m_plugins; QList m_effects; - LADSPA_Data m_left[MAX_SAMPLES], m_right[MAX_SAMPLES], m_trash[MAX_SAMPLES]; - static LADSPAHost *m_instance; int m_chan; quint32 m_freq; + QList m_modules; + LADSPA_Data m_buf[9][MAX_SAMPLES]; }; #endif -- cgit v1.2.3-13-gbd6f