X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginlv2client.h;h=1f5f3b356b426b6d962c287e61d27a567d804ca1;hp=ee174accfe9b6b2b84c8675e3aa8a20d8264e2b7;hb=HEAD;hpb=4496e28abcd97051543000f864332c045148907e diff --git a/cinelerra-5.1/cinelerra/pluginlv2client.h b/cinelerra-5.1/cinelerra/pluginlv2client.h index ee174acc..1f5f3b35 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2client.h +++ b/cinelerra-5.1/cinelerra/pluginlv2client.h @@ -1,183 +1,68 @@ +#ifndef __PLUGINLV2CLIENT_H__ +#define __PLUGINLV2CLIENT_H__ -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef PLUGINLV2CLIENT_H -#define PLUGINLV2CLIENT_H - -#include "bcdisplayinfo.h" -#include "guicast.h" +#include "condition.inc" +#include "mutex.h" #include "pluginaclient.h" +#include "plugin.inc" +#include "pluginlv2.h" +#include "pluginlv2config.h" #include "pluginlv2client.inc" +#include "pluginlv2gui.h" +#include "pluginlv2ui.inc" #include "samples.inc" -#include -#include -#include - -class PluginLV2UriTable : public ArrayList -{ -public: - PluginLV2UriTable(); - ~PluginLV2UriTable(); - LV2_URID map(const char *uri); - const char *unmap(LV2_URID urid); -}; - -class PluginLV2Client_OptName : public BC_ListBoxItem -{ -public: - PluginLV2Client_Opt *opt; - PluginLV2Client_OptName(PluginLV2Client_Opt *opt); -}; - -class PluginLV2Client_OptValue : public BC_ListBoxItem -{ -public: - PluginLV2Client_Opt *opt; - PluginLV2Client_OptValue(PluginLV2Client_Opt *opt); - int update(); -}; - -class PluginLV2Client_Opt -{ -public: - int idx; - const char *sym; - PluginLV2ClientConfig *conf; - PluginLV2Client_OptName *item_name; - PluginLV2Client_OptValue *item_value; - float get_value(); - void set_value(float v); - int update(float v); - const char *get_name(); - - PluginLV2Client_Opt(PluginLV2ClientConfig *conf, const char *sym, int idx); - ~PluginLV2Client_Opt(); -}; - - -class PluginLV2ClientConfig : public ArrayList -{ -public: - PluginLV2ClientConfig(); - ~PluginLV2ClientConfig(); - - int equivalent(PluginLV2ClientConfig &that); - void copy_from(PluginLV2ClientConfig &that); - void interpolate(PluginLV2ClientConfig &prev, PluginLV2ClientConfig &next, - int64_t prev_frame, int64_t next_frame, int64_t current_frame); - void reset(); - void init_lv2(const LilvPlugin *lilv); - int update(); - - int nb_ports; - const char **names; - float *mins, *maxs, *ctls; -}; - -class PluginLV2Client_OptPanel : public BC_ListBox +class PluginLV2UIs : public ArrayList, public Mutex { public: - PluginLV2Client_OptPanel(PluginLV2ClientWindow *gui, int x, int y, int w, int h); - ~PluginLV2Client_OptPanel(); + PluginLV2UIs(); + ~PluginLV2UIs(); - PluginLV2ClientWindow *gui; - ArrayList items[2]; - ArrayList &opts; - ArrayList &vals; + void del_uis(); + PluginLV2ParentUI *del_ui(PluginLV2Client *client); + PluginLV2ParentUI *del_ui(PluginLV2ClientWindow *gui); + PluginLV2ParentUI *add_ui(PluginLV2ParentUI *ui, PluginLV2Client *client); + PluginLV2ParentUI *search_ui(Plugin *plugin); + PluginLV2ParentUI *find_ui(Plugin *plugin); + PluginLV2ParentUI *get_ui(PluginLV2Client *client); - int selection_changed(); - void update(); }; -class PluginLV2ClientText : public BC_TextBox { -public: - PluginLV2ClientWindow *gui; - - PluginLV2ClientText(PluginLV2ClientWindow *gui, int x, int y, int w); - ~PluginLV2ClientText(); - int handle_event(); -}; - -class PluginLV2ClientReset : public BC_GenericButton +class PluginLV2ParentUI : public ForkParent { public: + PluginLV2ParentUI(Plugin *plugin); + ~PluginLV2ParentUI(); + ForkChild* new_fork(); + void start_parent(PluginLV2Client *client); + int handle_parent(); + + Condition *output_bfr; + PluginLV2Client *client; PluginLV2ClientWindow *gui; - PluginLV2ClientReset(PluginLV2ClientWindow *gui, int x, int y); - ~PluginLV2ClientReset(); - int handle_event(); -}; + int hidden; + int show(); + int hide(); -class PluginLV2ClientApply : public BC_GenericButton { -public: - PluginLV2ClientWindow *gui; +//from Plugin::identitical_location + int64_t position; + int set_no; + int track_no; - PluginLV2ClientApply(PluginLV2ClientWindow *gui, int x, int y); - ~PluginLV2ClientApply(); - int handle_event(); + static PluginLV2UIs plugin_lv2; }; -class PluginLV2ClientPot : public BC_FPot +class PluginLV2BlackList : public ArrayList { public: - PluginLV2ClientPot(PluginLV2ClientWindow *gui, int x, int y); - int handle_event(); - PluginLV2ClientWindow *gui; -}; + PluginLV2BlackList(const char *path); + ~PluginLV2BlackList(); -class PluginLV2ClientSlider : public BC_FSlider -{ -public: - PluginLV2ClientSlider(PluginLV2ClientWindow *gui, int x, int y); - int handle_event(); - PluginLV2ClientWindow *gui; + int is_badboy(const char *uri); }; -class PluginLV2ClientWindow : public PluginClientWindow -{ -public: - PluginLV2ClientWindow(PluginLV2Client *plugin); - ~PluginLV2ClientWindow(); - - void create_objects(); - int resize_event(int w, int h); - void update_selected(); - void update_selected(float v); - int scalar(float f, char *rp); - void update(PluginLV2Client_Opt *opt); - - PluginLV2Client *plugin; - PluginLV2ClientReset *reset; - PluginLV2ClientApply *apply; - PluginLV2ClientPot *pot; - PluginLV2ClientSlider *slider; - PluginLV2ClientText *text; - BC_Title *varbl, *range; - PluginLV2Client_OptPanel *panel; - PluginLV2Client_Opt *selected; -}; - - -class PluginLV2Client : public PluginAClient +class PluginLV2Client : public PluginAClient, public PluginLV2 { public: PluginLV2Client(PluginServer *server); @@ -190,7 +75,6 @@ public: Samples **input_ptr, Samples **output_ptr); // Update output pointers as well - void update_gui(); int is_realtime(); int is_multichannel(); int is_synthesis(); @@ -198,49 +82,17 @@ public: char* to_string(char *string, const char *input); void save_data(KeyFrame *keyframe); void read_data(KeyFrame *keyframe); - void reset_lv2(); - int load_lv2(const char *path); + void load_buffer(int samples, Samples **input, int ich); + int unload_buffer(int samples, Samples **output, int och); + void process_buffer(int size); + void update_gui(); + void update_lv2(); int init_lv2(); + PluginLV2ParentUI *find_ui(); + PluginLV2ParentUI *get_ui(); PLUGIN_CLASS_MEMBERS(PluginLV2ClientConfig) char title[BCSTRLEN]; - int bfrsz, nb_in_bfrs, nb_out_bfrs; - float **in_buffers, **out_buffers; - - void delete_buffers(); - void init_plugin(int size); - void connect_ports(); - static LV2_URID uri_table_map(LV2_URID_Map_Handle handle, const char *uri); - static const char *uri_table_unmap(LV2_URID_Map_Handle handle, LV2_URID urid); - -// lv2 - LilvWorld *world; - const LilvPlugin *lilv; - int nb_inputs, nb_outputs; - int max_bufsz; - - PluginLV2UriTable uri_table; - LV2_URID_Map map; - LV2_Feature map_feature; - LV2_URID_Unmap unmap; - LV2_Feature unmap_feature; - const LV2_Feature *features[6]; - LV2_Atom_Sequence seq_in[2]; - LV2_Atom_Sequence *seq_out; - - LilvInstance *instance; - LilvNode *atom_AtomPort; - LilvNode *atom_Sequence; - LilvNode *lv2_AudioPort; - LilvNode *lv2_CVPort; - LilvNode *lv2_ControlPort; - LilvNode *lv2_Optional; - LilvNode *lv2_InputPort; - LilvNode *lv2_OutputPort; - LilvNode *urid_map; - LilvNode *powerOf2BlockLength; - LilvNode *fixedBlockLength; - LilvNode *boundedBlockLength; }; #endif