| 1 | /* GSequencer - Advanced GTK Sequencer |
| 2 | * Copyright (C) 2005-2024 Joël Krähemann |
| 3 | * |
| 4 | * This file is part of GSequencer. |
| 5 | * |
| 6 | * GSequencer is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation, either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * GSequencer is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GSequencer. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include <ags/audio/fx/ags_fx_peak_channel.h>cxx . . $ `<file>/ags/audio/fx/ags_fx_peak_channel.h`/ |
| 21 | |
| 22 | #include <ags/plugin/ags_plugin_port.h>cxx . . $ `<file>/ags/plugin/ags_plugin_port.h`/ |
| 23 | |
| 24 | #include <ags/audio/task/ags_reset_fx_peak.h>cxx . . $ `<file>/ags/audio/task/ags_reset_fx_peak.h`/ |
| 25 | |
| 26 | #include <ags/i18n.h>cxx . . $ `<file>/ags/i18n.h`/ |
| 27 | |
| 28 | void ags_fx_peak_channel_class_initcxx . . $ ags_fx_peak_channel_class_init(5d43919f5494edb3).(AgsFxPeakChannelClasscxx . . $ AgsFxPeakChannelClass# *fx_peak_channel); |
| 29 | void ags_fx_peak_channel_initcxx . . $ ags_fx_peak_channel_init(b37efb164a381bfb).(AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel); |
| 30 | void ags_fx_peak_channel_set_propertycxx . . $ ags_fx_peak_channel_set_property(d7c4bb29f36c0dc4).(GObjectcxx . . $ GObject# *gobject, |
| 31 | guintcxx . . $ guint# prop_id, |
| 32 | const GValuecxx . . $ GValue# *value, |
| 33 | GParamSpeccxx . . $ GParamSpec# *param_spec); |
| 34 | void ags_fx_peak_channel_get_propertycxx . . $ ags_fx_peak_channel_get_property(cee2c52f22407c66).(GObjectcxx . . $ GObject# *gobject, |
| 35 | guintcxx . . $ guint# prop_id, |
| 36 | GValuecxx . . $ GValue# *value, |
| 37 | GParamSpeccxx . . $ GParamSpec# *param_spec); |
| 38 | void ags_fx_peak_channel_disposecxx . . $ ags_fx_peak_channel_dispose(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject); |
| 39 | void ags_fx_peak_channel_finalizecxx . . $ ags_fx_peak_channel_finalize(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject); |
| 40 | |
| 41 | void ags_fx_peak_channel_notify_buffer_size_callbackcxx . . $ ags_fx_peak_channel_notify_buffer_size_callback(4ebbded80fa75af1).(GObjectcxx . . $ GObject# *gobject, |
| 42 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 43 | gpointercxx . . $ gpointer# user_data); |
| 44 | |
| 45 | static AgsPluginPortcxx . . $ AgsPluginPort#* ags_fx_peak_channel_get_peak_plugin_portcxx . . $ ags_fx_peak_channel_get_peak_plugin_port(34b69cdf8fd7ff84).(); |
| 46 | |
| 47 | /** |
| 48 | * SECTION:ags_fx_peak_channel |
| 49 | * @short_description: fx peak channel |
| 50 | * @title: AgsFxPeakChannel |
| 51 | * @section_id: |
| 52 | * @include: ags/audio/fx/ags_fx_peak_channel.h |
| 53 | * |
| 54 | * The #AgsFxPeakChannel class provides ports to the effect processor. |
| 55 | */ |
| 56 | |
| 57 | static gpointercxx . . $ gpointer# ags_fx_peak_channel_parent_classcxx . . $ ags_fx_peak_channel_parent_class. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 58 | |
| 59 | const gcharcxx . . $ gchar# *ags_fx_peak_channel_plugin_namecxx . . $ ags_fx_peak_channel_plugin_name. = "ags-fx-peak"; |
| 60 | |
| 61 | const gcharcxx . . $ gchar#* ags_fx_peak_channel_specifiercxx . . $ ags_fx_peak_channel_specifier.[] = { |
| 62 | "./peak[0]", |
| 63 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 64 | }; |
| 65 | |
| 66 | const gcharcxx . . $ gchar#* ags_fx_peak_channel_control_portcxx . . $ ags_fx_peak_channel_control_port.[] = { |
| 67 | "1/1", |
| 68 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 69 | }; |
| 70 | |
| 71 | enumcxx . . $ $anonymous_type_45438898c62fddc3_0#{ |
| 72 | PROP_0cxx . . $ PROP_0., |
| 73 | PROP_PEAKcxx . . $ PROP_PEAK., |
| 74 | }; |
| 75 | |
| 76 | GTypecxx . . $ GType# |
| 77 | ags_fx_peak_channel_get_typecxx . . $ ags_fx_peak_channel_get_type(7b3bcd0168edf51f).() |
| 78 | { |
| 79 | static gsizecxx . . $ gsize# g_define_type_id__static = 0; |
| 80 | |
| 81 | if(g_once_init_entercxx . . $ `<external>/457917468643292165/gthread.h:270:10`!(&g_define_type_id__static)){ |
| 82 | GTypecxx . . $ GType# ags_type_fx_peak_channel = 0; |
| 83 | |
| 84 | static const GTypeInfocxx . . $ GTypeInfo# ags_fx_peak_channel_info = { |
| 85 | sizeof (AgsFxPeakChannelClasscxx . . $ AgsFxPeakChannelClass#), |
| 86 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* base_init */ |
| 87 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* base_finalize */ |
| 88 | (GClassInitFunccxx . . $ GClassInitFunc#) ags_fx_peak_channel_class_initcxx . . $ ags_fx_peak_channel_class_init(5d43919f5494edb3)., |
| 89 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* class_finalize */ |
| 90 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* class_channel */ |
| 91 | sizeof (AgsFxPeakChannelcxx . . $ AgsFxPeakChannel#), |
| 92 | 0, /* n_preallocs */ |
| 93 | (GInstanceInitFunccxx . . $ GInstanceInitFunc#) ags_fx_peak_channel_initcxx . . $ ags_fx_peak_channel_init(b37efb164a381bfb)., |
| 94 | }; |
| 95 | |
| 96 | ags_type_fx_peak_channel = g_type_register_staticcxx . . $ g_type_register_static(805a40cfa272e950).(AGS_TYPE_RECALL_CHANNELcxx . . $ `ags/audio/ags_recall_channel.h:34:9`!, |
| 97 | "AgsFxPeakChannel", |
| 98 | &ags_fx_peak_channel_info, |
| 99 | 0); |
| 100 | |
| 101 | g_once_init_leavecxx . . $ `<external>/457917468643292165/gthread.h:277:10`!(&g_define_type_id__static, ags_type_fx_peak_channel); |
| 102 | } |
| 103 | |
| 104 | return(g_define_type_id__static); |
| 105 | } |
| 106 | |
| 107 | void |
| 108 | ags_fx_peak_channel_class_initcxx . . $ ags_fx_peak_channel_class_init(5d43919f5494edb3).(AgsFxPeakChannelClasscxx . . $ AgsFxPeakChannelClass# *fx_peak_channel) |
| 109 | { |
| 110 | GObjectClasscxx . . $ GObjectClass# *gobject; |
| 111 | |
| 112 | GParamSpeccxx . . $ GParamSpec# *param_spec; |
| 113 | |
| 114 | ags_fx_peak_channel_parent_classcxx . . $ ags_fx_peak_channel_parent_class. = g_type_class_peek_parentcxx . . $ g_type_class_peek_parent(9f162e79bfc6c74).(fx_peak_channel); |
| 115 | |
| 116 | /* GObjectClass */ |
| 117 | gobject = (GObjectClasscxx . . $ GObjectClass# *) fx_peak_channel; |
| 118 | |
| 119 | gobject->set_propertycxx . . $ _GObjectClass#set_property. = ags_fx_peak_channel_set_propertycxx . . $ ags_fx_peak_channel_set_property(d7c4bb29f36c0dc4).; |
| 120 | gobject->get_propertycxx . . $ _GObjectClass#get_property. = ags_fx_peak_channel_get_propertycxx . . $ ags_fx_peak_channel_get_property(cee2c52f22407c66).; |
| 121 | |
| 122 | gobject->disposecxx . . $ _GObjectClass#dispose. = ags_fx_peak_channel_disposecxx . . $ ags_fx_peak_channel_dispose(6087475fa43034d3).; |
| 123 | gobject->finalizecxx . . $ _GObjectClass#finalize. = ags_fx_peak_channel_finalizecxx . . $ ags_fx_peak_channel_finalize(6087475fa43034d3).; |
| 124 | |
| 125 | /* properties */ |
| 126 | /** |
| 127 | * AgsFxPeakChannel:peak: |
| 128 | * |
| 129 | * The beats per minute. |
| 130 | * |
| 131 | * Since: 3.3.0 |
| 132 | */ |
| 133 | param_spec = g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127).("peak", |
| 134 | i18n_pspeccxx . . $ `ags/i18n.h:24:9`!("peak of recall"), |
| 135 | i18n_pspeccxx . . $ `ags/i18n.h:24:9`!("The recall's peak"), |
| 136 | AGS_TYPE_PORTcxx . . $ `ags/audio/ags_port.h:32:9`!, |
| 137 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | G_PARAM_WRITABLEcxx . . $ G_PARAM_WRITABLE.); |
| 138 | g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26).(gobject, |
| 139 | PROP_PEAKcxx . . $ PROP_PEAK., |
| 140 | param_spec); |
| 141 | } |
| 142 | |
| 143 | void |
| 144 | ags_fx_peak_channel_initcxx . . $ ags_fx_peak_channel_init(b37efb164a381bfb).(AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel) |
| 145 | { |
| 146 | AgsResetFxPeakcxx . . $ AgsResetFxPeak# *reset_fx_peak; |
| 147 | |
| 148 | guintcxx . . $ guint# buffer_size; |
| 149 | guintcxx . . $ guint# i; |
| 150 | |
| 151 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`!(fx_peak_channel, "notify::buffer-size", |
| 152 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`!(ags_fx_peak_channel_notify_buffer_size_callback), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 153 | |
| 154 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:41:9`!(fx_peak_channel)->namecxx . . $ _AgsRecall#name. = "ags-fx-peak"; |
| 155 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:41:9`!(fx_peak_channel)->versioncxx . . $ _AgsRecall#version. = AGS_RECALL_DEFAULT_VERSIONcxx . . $ `ags/audio/ags_recall.h:137:9`!; |
| 156 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:41:9`!(fx_peak_channel)->build_idcxx . . $ _AgsRecall#build_id. = AGS_RECALL_DEFAULT_BUILD_IDcxx . . $ `ags/audio/ags_recall.h:138:9`!; |
| 157 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:41:9`!(fx_peak_channel)->xml_typecxx . . $ _AgsRecall#xml_type. = "ags-fx-peak-channel"; |
| 158 | |
| 159 | buffer_size = AGS_SOUNDCARD_DEFAULT_BUFFER_SIZEcxx . . $ `ags/object/ags_soundcard.h:51:9`!; |
| 160 | |
| 161 | fx_peak_channel->peak_resetedcxx . . $ _AgsFxPeakChannel#peak_reseted. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 162 | |
| 163 | g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d).(fx_peak_channel, |
| 164 | "buffer-size", &buffer_size, |
| 165 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 166 | |
| 167 | /* peak */ |
| 168 | fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak. = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78).(AGS_TYPE_PORTcxx . . $ `ags/audio/ags_port.h:32:9`!, |
| 169 | "plugin-name", ags_fx_peak_channel_plugin_namecxx . . $ ags_fx_peak_channel_plugin_name., |
| 170 | "specifier", "./peak[0]", |
| 171 | "control-port", "1/1", |
| 172 | "port-value-is-pointer", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, |
| 173 | "port-value-type", G_TYPE_FLOATcxx . . $ `<external>/9567554376676449156/gtype.h:153:9`!, |
| 174 | "port-value-size", sizeof(gfloatcxx . . $ gfloat#), |
| 175 | "port-value-length", 1, |
| 176 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 177 | ags_port_set_flagscxx . . $ ags_port_set_flags(84830934707138c7).(fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak., AGS_PORT_IS_OUTPUTcxx . . $ AGS_PORT_IS_OUTPUT.); |
| 178 | |
| 179 | fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak.->port_valuecxx . . $ _AgsPort#port_value..ags_port_floatcxx . . $ _AgsPortValue#ags_port_float. = 0.0; |
| 180 | |
| 181 | g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d).(fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak., |
| 182 | "plugin-port", ags_fx_peak_channel_get_peak_plugin_portcxx . . $ ags_fx_peak_channel_get_peak_plugin_port(34b69cdf8fd7ff84).(), |
| 183 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 184 | |
| 185 | ags_recall_add_portcxx . . $ ags_recall_add_port(6ead69b5866ab1f9).((AgsRecallcxx . . $ AgsRecall# *) fx_peak_channel, |
| 186 | fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak.); |
| 187 | |
| 188 | /* input data */ |
| 189 | for(i = 0; i < AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.; i++){ |
| 190 | fx_peak_channel->input_datacxx . . $ _AgsFxPeakChannel#input_data.[i] = ags_fx_peak_channel_input_data_alloccxx . . $ ags_fx_peak_channel_input_data_alloc(b6649be1c52b12ff).(); |
| 191 | |
| 192 | fx_peak_channel->input_datacxx . . $ _AgsFxPeakChannel#input_data.[i]->parentcxx . . $ _AgsFxPeakChannelInputData#parent. = fx_peak_channel; |
| 193 | |
| 194 | fx_peak_channel->input_datacxx . . $ _AgsFxPeakChannel#input_data.[i]->buffercxx . . $ _AgsFxPeakChannelInputData#buffer. = (gdoublecxx . . $ gdouble# *) g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(gdoublecxx . . $ gdouble#)); |
| 195 | ags_audio_buffer_util_clear_doublecxx . . $ ags_audio_buffer_util_clear_double(135bbc0d8ff9b582).(&(fx_peak_channel->audio_buffer_utilcxx . . $ _AgsFxPeakChannel#audio_buffer_util.), |
| 196 | fx_peak_channel->input_datacxx . . $ _AgsFxPeakChannel#input_data.[i]->buffercxx . . $ _AgsFxPeakChannelInputData#buffer., 1, |
| 197 | buffer_size); |
| 198 | } |
| 199 | |
| 200 | /* add to reset peak task */ |
| 201 | reset_fx_peak = ags_reset_fx_peak_get_instancecxx . . $ ags_reset_fx_peak_get_instance(caf9cc2e825cea9).(); |
| 202 | |
| 203 | ags_reset_fx_peak_addcxx . . $ ags_reset_fx_peak_add(44f2a438c9623c23).(reset_fx_peak, |
| 204 | fx_peak_channel); |
| 205 | } |
| 206 | |
| 207 | void |
| 208 | ags_fx_peak_channel_set_propertycxx . . $ ags_fx_peak_channel_set_property(d7c4bb29f36c0dc4).(GObjectcxx . . $ GObject# *gobject, |
| 209 | guintcxx . . $ guint# prop_id, |
| 210 | const GValuecxx . . $ GValue# *value, |
| 211 | GParamSpeccxx . . $ GParamSpec# *param_spec) |
| 212 | { |
| 213 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel; |
| 214 | |
| 215 | GRecMutexcxx . . $ GRecMutex# *recall_mutex; |
| 216 | |
| 217 | fx_peak_channel = AGS_FX_PEAK_CHANNELcxx . . $ `ags/audio/fx/ags_fx_peak_channel.h:36:9`!(gobject); |
| 218 | |
| 219 | /* get recall mutex */ |
| 220 | recall_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:49:9`!(fx_peak_channel); |
| 221 | |
| 222 | switch(prop_id){ |
| 223 | case PROP_PEAKcxx . . $ PROP_PEAK.: |
| 224 | { |
| 225 | AgsPortcxx . . $ AgsPort# *port; |
| 226 | |
| 227 | port = (AgsPortcxx . . $ AgsPort# *) g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce).(value); |
| 228 | |
| 229 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 230 | |
| 231 | if(port == fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak.){ |
| 232 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 233 | |
| 234 | return; |
| 235 | } |
| 236 | |
| 237 | if(fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 238 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_peak_channel->peak)); |
| 239 | } |
| 240 | |
| 241 | if(port != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 242 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`!(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(port)); |
| 243 | } |
| 244 | |
| 245 | fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak. = port; |
| 246 | |
| 247 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 248 | } |
| 249 | break; |
| 250 | default: |
| 251 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`!(gobject, prop_id, param_spec); |
| 252 | break; |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | void |
| 257 | ags_fx_peak_channel_get_propertycxx . . $ ags_fx_peak_channel_get_property(cee2c52f22407c66).(GObjectcxx . . $ GObject# *gobject, |
| 258 | guintcxx . . $ guint# prop_id, |
| 259 | GValuecxx . . $ GValue# *value, |
| 260 | GParamSpeccxx . . $ GParamSpec# *param_spec) |
| 261 | { |
| 262 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel; |
| 263 | |
| 264 | GRecMutexcxx . . $ GRecMutex# *recall_mutex; |
| 265 | |
| 266 | fx_peak_channel = AGS_FX_PEAK_CHANNELcxx . . $ `ags/audio/fx/ags_fx_peak_channel.h:36:9`!(gobject); |
| 267 | |
| 268 | /* get recall mutex */ |
| 269 | recall_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:49:9`!(fx_peak_channel); |
| 270 | |
| 271 | switch(prop_id){ |
| 272 | case PROP_PEAKcxx . . $ PROP_PEAK.: |
| 273 | { |
| 274 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 275 | |
| 276 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f).(value, fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak.); |
| 277 | |
| 278 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 279 | } |
| 280 | break; |
| 281 | default: |
| 282 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`!(gobject, prop_id, param_spec); |
| 283 | break; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | void |
| 288 | ags_fx_peak_channel_disposecxx . . $ ags_fx_peak_channel_dispose(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject) |
| 289 | { |
| 290 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel; |
| 291 | |
| 292 | AgsResetFxPeakcxx . . $ AgsResetFxPeak# *reset_fx_peak; |
| 293 | |
| 294 | fx_peak_channel = AGS_FX_PEAK_CHANNELcxx . . $ `ags/audio/fx/ags_fx_peak_channel.h:36:9`!(gobject); |
| 295 | |
| 296 | /* peak */ |
| 297 | if(fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 298 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_peak_channel->peak)); |
| 299 | |
| 300 | fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 301 | } |
| 302 | |
| 303 | /* reset ags-fx-peak task */ |
| 304 | reset_fx_peak = ags_reset_fx_peak_get_instancecxx . . $ ags_reset_fx_peak_get_instance(caf9cc2e825cea9).(); |
| 305 | |
| 306 | ags_reset_fx_peak_removecxx . . $ ags_reset_fx_peak_remove(44f2a438c9623c23).(reset_fx_peak, |
| 307 | fx_peak_channel); |
| 308 | |
| 309 | /* call parent */ |
| 310 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`!(ags_fx_peak_channel_parent_class)->disposecxx . . $ _GObjectClass#dispose.(gobject); |
| 311 | } |
| 312 | |
| 313 | void |
| 314 | ags_fx_peak_channel_finalizecxx . . $ ags_fx_peak_channel_finalize(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject) |
| 315 | { |
| 316 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel; |
| 317 | |
| 318 | AgsResetFxPeakcxx . . $ AgsResetFxPeak# *reset_fx_peak; |
| 319 | |
| 320 | guintcxx . . $ guint# i; |
| 321 | |
| 322 | fx_peak_channel = AGS_FX_PEAK_CHANNELcxx . . $ `ags/audio/fx/ags_fx_peak_channel.h:36:9`!(gobject); |
| 323 | |
| 324 | /* peak */ |
| 325 | if(fx_peak_channel->peakcxx . . $ _AgsFxPeakChannel#peak. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 326 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_peak_channel->peak)); |
| 327 | } |
| 328 | |
| 329 | /* input data */ |
| 330 | for(i = 0; i < AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.; i++){ |
| 331 | ags_fx_peak_channel_input_data_freecxx . . $ ags_fx_peak_channel_input_data_free(fedb9e1036298a80).(fx_peak_channel->input_datacxx . . $ _AgsFxPeakChannel#input_data.[i]); |
| 332 | } |
| 333 | |
| 334 | /* reset ags-fx-peak task */ |
| 335 | reset_fx_peak = ags_reset_fx_peak_get_instancecxx . . $ ags_reset_fx_peak_get_instance(caf9cc2e825cea9).(); |
| 336 | |
| 337 | ags_reset_fx_peak_removecxx . . $ ags_reset_fx_peak_remove(44f2a438c9623c23).(reset_fx_peak, |
| 338 | fx_peak_channel); |
| 339 | |
| 340 | /* call parent */ |
| 341 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`!(ags_fx_peak_channel_parent_class)->finalizecxx . . $ _GObjectClass#finalize.(gobject); |
| 342 | } |
| 343 | |
| 344 | void |
| 345 | ags_fx_peak_channel_notify_buffer_size_callbackcxx . . $ ags_fx_peak_channel_notify_buffer_size_callback(4ebbded80fa75af1).(GObjectcxx . . $ GObject# *gobject, |
| 346 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 347 | gpointercxx . . $ gpointer# user_data) |
| 348 | { |
| 349 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel; |
| 350 | |
| 351 | guintcxx . . $ guint# buffer_size; |
| 352 | guintcxx . . $ guint# i; |
| 353 | |
| 354 | GRecMutexcxx . . $ GRecMutex# *recall_mutex; |
| 355 | |
| 356 | fx_peak_channel = AGS_FX_PEAK_CHANNELcxx . . $ `ags/audio/fx/ags_fx_peak_channel.h:36:9`!(gobject); |
| 357 | |
| 358 | /* get recall mutex */ |
| 359 | recall_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:49:9`!(fx_peak_channel); |
| 360 | |
| 361 | /* get buffer size */ |
| 362 | g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d).(fx_peak_channel, |
| 363 | "buffer-size", &buffer_size, |
| 364 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 365 | |
| 366 | /* reallocate buffer - apply buffer size */ |
| 367 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 368 | |
| 369 | for(i = 0; i < AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.; i++){ |
| 370 | AgsFxPeakChannelInputDatacxx . . $ AgsFxPeakChannelInputData# *input_data; |
| 371 | |
| 372 | input_data = fx_peak_channel->input_datacxx . . $ _AgsFxPeakChannel#input_data.[i]; |
| 373 | |
| 374 | if(buffer_size > 0){ |
| 375 | if(input_data->buffercxx . . $ _AgsFxPeakChannelInputData#buffer. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 376 | input_data->buffercxx . . $ _AgsFxPeakChannelInputData#buffer. = (gdoublecxx . . $ gdouble# *) g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(gdoublecxx . . $ gdouble#)); |
| 377 | }else{ |
| 378 | input_data->buffercxx . . $ _AgsFxPeakChannelInputData#buffer. = (gdoublecxx . . $ gdouble# *) g_realloccxx . . $ g_realloc(417ab160f6baadc6).(input_data->buffercxx . . $ _AgsFxPeakChannelInputData#buffer., |
| 379 | buffer_size * sizeof(gdoublecxx . . $ gdouble#)); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * ags_fx_peak_channel_input_data_alloc: |
| 389 | * |
| 390 | * Allocate #AgsFxPeakChannelInputData-struct |
| 391 | * |
| 392 | * Returns: the new #AgsFxPeakChannelInputData-struct |
| 393 | * |
| 394 | * Since: 3.3.0 |
| 395 | */ |
| 396 | AgsFxPeakChannelInputDatacxx . . $ AgsFxPeakChannelInputData#* |
| 397 | ags_fx_peak_channel_input_data_alloccxx . . $ ags_fx_peak_channel_input_data_alloc(b6649be1c52b12ff).() |
| 398 | { |
| 399 | AgsFxPeakChannelInputDatacxx . . $ AgsFxPeakChannelInputData# *input_data; |
| 400 | |
| 401 | input_data = (AgsFxPeakChannelInputDatacxx . . $ AgsFxPeakChannelInputData# *) g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64).(sizeof(AgsFxPeakChannelInputDatacxx . . $ AgsFxPeakChannelInputData#)); |
| 402 | |
| 403 | g_rec_mutex_initcxx . . $ g_rec_mutex_init(70e02e1a6dfc5752).(&(input_data->strct_mutexcxx . . $ _AgsFxPeakChannelInputData#strct_mutex.)); |
| 404 | |
| 405 | input_data->parentcxx . . $ _AgsFxPeakChannelInputData#parent. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 406 | |
| 407 | input_data->buffercxx . . $ _AgsFxPeakChannelInputData#buffer. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 408 | |
| 409 | return(input_data); |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * ags_fx_peak_channel_input_data_free: |
| 414 | * @input_data: the #AgsFxPeakChannelInputData-struct |
| 415 | * |
| 416 | * Free @input_data. |
| 417 | * |
| 418 | * Since: 3.3.0 |
| 419 | */ |
| 420 | void |
| 421 | ags_fx_peak_channel_input_data_freecxx . . $ ags_fx_peak_channel_input_data_free(fedb9e1036298a80).(AgsFxPeakChannelInputDatacxx . . $ AgsFxPeakChannelInputData# *input_data) |
| 422 | { |
| 423 | if(input_data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 424 | return; |
| 425 | } |
| 426 | |
| 427 | ags_stream_freecxx . . $ ags_stream_free(5d22bdacc48458e8).(input_data->buffercxx . . $ _AgsFxPeakChannelInputData#buffer.); |
| 428 | |
| 429 | g_freecxx . . $ g_free(5d22bdacc48458e8).(input_data); |
| 430 | } |
| 431 | |
| 432 | static AgsPluginPortcxx . . $ AgsPluginPort#* |
| 433 | ags_fx_peak_channel_get_peak_plugin_portcxx . . $ ags_fx_peak_channel_get_peak_plugin_port(34b69cdf8fd7ff84).() |
| 434 | { |
| 435 | static AgsPluginPortcxx . . $ AgsPluginPort# *plugin_port = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 436 | |
| 437 | static GMutexcxx . . $ GMutex# mutex; |
| 438 | |
| 439 | g_mutex_lockcxx . . $ g_mutex_lock(d80b1953a7cb7fd1).(&mutex); |
| 440 | |
| 441 | if(plugin_port == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!){ |
| 442 | plugin_port = ags_plugin_port_newcxx . . $ ags_plugin_port_new(34b69cdf8fd7ff84).(); |
| 443 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`!(plugin_port); |
| 444 | |
| 445 | plugin_port->flagscxx . . $ _AgsPluginPort#flags. |= (AGS_PLUGIN_PORT_OUTPUTcxx . . $ AGS_PLUGIN_PORT_OUTPUT. | |
| 446 | AGS_PLUGIN_PORT_CONTROLcxx . . $ AGS_PLUGIN_PORT_CONTROL.); |
| 447 | |
| 448 | plugin_port->port_indexcxx . . $ _AgsPluginPort#port_index. = 0; |
| 449 | |
| 450 | /* range */ |
| 451 | g_value_initcxx . . $ g_value_init(afc049a76445919c).(plugin_port->default_valuecxx . . $ _AgsPluginPort#default_value., |
| 452 | G_TYPE_FLOATcxx . . $ `<external>/9567554376676449156/gtype.h:153:9`!); |
| 453 | g_value_initcxx . . $ g_value_init(afc049a76445919c).(plugin_port->lower_valuecxx . . $ _AgsPluginPort#lower_value., |
| 454 | G_TYPE_FLOATcxx . . $ `<external>/9567554376676449156/gtype.h:153:9`!); |
| 455 | g_value_initcxx . . $ g_value_init(afc049a76445919c).(plugin_port->upper_valuecxx . . $ _AgsPluginPort#upper_value., |
| 456 | G_TYPE_FLOATcxx . . $ `<external>/9567554376676449156/gtype.h:153:9`!); |
| 457 | |
| 458 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb).(plugin_port->default_valuecxx . . $ _AgsPluginPort#default_value., |
| 459 | 0.0); |
| 460 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb).(plugin_port->lower_valuecxx . . $ _AgsPluginPort#lower_value., |
| 461 | 0.0); |
| 462 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb).(plugin_port->upper_valuecxx . . $ _AgsPluginPort#upper_value., |
| 463 | 1.0); |
| 464 | } |
| 465 | |
| 466 | g_mutex_unlockcxx . . $ g_mutex_unlock(d80b1953a7cb7fd1).(&mutex); |
| 467 | |
| 468 | return(plugin_port); |
| 469 | } |
| 470 | |
| 471 | /** |
| 472 | * ags_fx_peak_channel_new: |
| 473 | * @channel: the #AgsChannel |
| 474 | * |
| 475 | * Create a new instance of #AgsFxPeakChannel |
| 476 | * |
| 477 | * Returns: the new #AgsFxPeakChannel |
| 478 | * |
| 479 | * Since: 3.3.0 |
| 480 | */ |
| 481 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel#* |
| 482 | ags_fx_peak_channel_newcxx . . $ ags_fx_peak_channel_new(998bd501b359299a).(AgsChannelcxx . . $ AgsChannel# *channel) |
| 483 | { |
| 484 | AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *fx_peak_channel; |
| 485 | |
| 486 | fx_peak_channel = (AgsFxPeakChannelcxx . . $ AgsFxPeakChannel# *) g_object_newcxx . . $ g_object_new(8485fe61b4be4c78).(AGS_TYPE_FX_PEAK_CHANNELcxx . . $ `ags/audio/fx/ags_fx_peak_channel.h:35:9`!, |
| 487 | "source", channel, |
| 488 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 489 | |
| 490 | return(fx_peak_channel); |
| 491 | } |