1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
/* GSequencer - Advanced GTK Sequencer
* Copyright (C) 2005-2023 Joël Krähemann
*
* This file is part of GSequencer.
*
* GSequencer 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 3 of the License, or
* (at your option) any later version.
*
* GSequencer 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 GSequencer. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AGS_BASE_PLUGIN_H__
#define __AGS_BASE_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <ags/libags.h>
#include <alsa/seq_event.h>
G_BEGIN_DECLS
#define AGS_TYPE_BASE_PLUGIN (ags_base_plugin_get_type())
#define AGS_BASE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_BASE_PLUGIN, AgsBasePlugin))
#define AGS_BASE_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_BASE_PLUGIN, AgsBasePluginClass))
#define AGS_IS_BASE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_BASE_PLUGIN))
#define AGS_IS_BASE_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), AGS_TYPE_BASE_PLUGIN))
#define AGS_BASE_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AGS_TYPE_BASE_PLUGIN, AgsBasePluginClass))
#define AGS_BASE_PLUGIN_GET_OBJ_MUTEX(obj) (&(((AgsBasePlugin *) obj)->obj_mutex))
typedef struct _AgsBasePlugin AgsBasePlugin;
typedef struct _AgsBasePluginClass AgsBasePluginClass;
/**
* AgsBasePluginFlags:
* @AGS_BASE_PLUGIN_IS_INSTRUMENT: plugin is instrument
*
* Enum values to control the behavior or indicate internal state of #AgsBasePlugin by
* enable/disable as flags.
*/
typedef enum{
AGS_BASE_PLUGIN_IS_INSTRUMENT = 1,
}AgsBasePluginFlags;
struct _AgsBasePlugin
{
GObject gobject;
guint flags;
GRecMutex obj_mutex;
AgsUUID *uuid;
gchar *filename;
gchar *effect;
guint port_group_count;
guint *port_group;
GList *plugin_port;
guint effect_index;
void *plugin_so;
void *plugin_descriptor;
void *plugin_handle;
gchar *ui_filename;
gchar *ui_effect;
guint ui_effect_index;
void *ui_plugin_so;
void *ui_plugin_descriptor;
void *ui_plugin_handle;
GObject *ui_plugin;
};
struct _AgsBasePluginClass
{
GObjectClass gobject;
gpointer (*instantiate)(AgsBasePlugin *base_plugin,
guint samplerate, guint buffer_size);
gpointer (*instantiate_with_params)(AgsBasePlugin *base_plugin,
guint *n_params,
gchar ***parameter_name,
GValue **value);
void (*connect_port)(AgsBasePlugin *base_plugin, gpointer plugin_handle, guint port_index, gpointer data_location);
void (*activate)(AgsBasePlugin *base_plugin, gpointer plugin_handle);
void (*deactivate)(AgsBasePlugin *base_plugin, gpointer plugin_handle);
void (*run)(AgsBasePlugin *base_plugin,
gpointer plugin_handle,
snd_seq_event_t *seq_event,
guint frame_count);
void (*load_plugin)(AgsBasePlugin *base_plugin);
};
GType ags_base_plugin_get_type(void);
GType ags_base_plugin_flags_get_type();
GRecMutex* ags_base_plugin_get_obj_mutex(AgsBasePlugin *base_plugin);
gboolean ags_base_plugin_test_flags(AgsBasePlugin *base_plugin, AgsBasePluginFlags flags);
void ags_base_plugin_set_flags(AgsBasePlugin *base_plugin, AgsBasePluginFlags flags);
void ags_base_plugin_unset_flags(AgsBasePlugin *base_plugin, AgsBasePluginFlags flags);
gchar* ags_base_plugin_get_filename(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_filename(AgsBasePlugin *base_plugin,
gchar *filename);
gchar* ags_base_plugin_get_effect(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_effect(AgsBasePlugin *base_plugin,
gchar *effect);
guint ags_base_plugin_get_effect_index(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_effect_index(AgsBasePlugin *base_plugin,
guint effect_index);
gpointer ags_base_plugin_get_plugin_so(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_plugin_so(AgsBasePlugin *base_plugin,
gpointer plugin_so);
GList* ags_base_plugin_get_plugin_port(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_plugin_port(AgsBasePlugin *base_plugin,
GList *plugin_port);
gchar* ags_base_plugin_get_ui_filename(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_ui_filename(AgsBasePlugin *base_plugin,
gchar *ui_filename);
gchar* ags_base_plugin_get_ui_effect(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_ui_effect(AgsBasePlugin *base_plugin,
gchar *ui_effect);
guint ags_base_plugin_get_ui_effect_index(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_ui_effect_index(AgsBasePlugin *base_plugin,
guint ui_effect_index);
gpointer ags_base_plugin_get_ui_plugin_so(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_ui_plugin_so(AgsBasePlugin *base_plugin,
gpointer ui_plugin_so);
GObject* ags_base_plugin_get_ui_plugin(AgsBasePlugin *base_plugin);
void ags_base_plugin_set_ui_plugin(AgsBasePlugin *base_plugin,
GObject *ui_plugin);
GList* ags_base_plugin_find_filename(GList *base_plugin, gchar *filename);
GList* ags_base_plugin_find_effect(GList *base_plugin, gchar *filename, gchar *effect);
GList* ags_base_plugin_find_ui_effect_index(GList *base_plugin, gchar *ui_filename, guint ui_effect_index);
gint ags_base_plugin_sort_func(gpointer a, gpointer b);
GList* ags_base_plugin_sort(GList *base_plugin);
void ags_base_plugin_apply_port_group_by_prefix(AgsBasePlugin *base_plugin);
gpointer ags_base_plugin_instantiate(AgsBasePlugin *base_plugin,
guint samplerate, guint buffer_size);
gpointer ags_base_plugin_instantiate_with_params(AgsBasePlugin *base_plugin,
guint *n_params,
gchar ***parameter_name,
GValue **value);
void ags_base_plugin_connect_port(AgsBasePlugin *base_plugin, gpointer plugin_handle, guint port_index, gpointer data_location);
void ags_base_plugin_activate(AgsBasePlugin *base_plugin, gpointer plugin_handle);
void ags_base_plugin_deactivate(AgsBasePlugin *base_plugin, gpointer plugin_handle);
void ags_base_plugin_run(AgsBasePlugin *base_plugin,
gpointer plugin_handle,
snd_seq_event_t *seq_event,
guint frame_count);
void ags_base_plugin_load_plugin(AgsBasePlugin *base_plugin);
AgsBasePlugin* ags_base_plugin_new(gchar *filename, gchar *effect, guint effect_index);
G_END_DECLS
#endif /*__AGS_BASE_PLUGIN_H__*/
|