| 1 | /* GSequencer - Advanced GTK Sequencer |
| 2 | * Copyright (C) 2005-2020 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_analyse_channel.h>cxx . . $ `<file>/ags/audio/fx/ags_fx_analyse_channel.h`/ |
| 21 | |
| 22 | #include <ags/audio/ags_audio_signal.h>cxx . . $ `<file>/ags/audio/ags_audio_signal.h`/ |
| 23 | |
| 24 | #include <ags/audio/task/ags_reset_fx_analyse.h>cxx . . $ `<file>/ags/audio/task/ags_reset_fx_analyse.h`/ |
| 25 | |
| 26 | #include <ags/i18n.h>cxx . . $ `<file>/ags/i18n.h`/ |
| 27 | |
| 28 | static void ags_fx_analyse_channel_class_initcxx . . $ ags_fx_analyse_channel_class_init(cc5c462cfb85fd1a).(AgsFxAnalyseChannelClasscxx . . $ AgsFxAnalyseChannelClass# *fx_analyse_channel); |
| 29 | static void ags_fx_analyse_channel_initcxx . . $ ags_fx_analyse_channel_init(3bc436759eb554b).(AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel); |
| 30 | static void ags_fx_analyse_channel_set_propertycxx . . $ ags_fx_analyse_channel_set_property(d7c4bb29f36c0dc4).(GObjectcxx . . $ GObject# *gobject, |
| 31 | guintcxx . . $ guint# prop_id, |
| 32 | const GValuecxx . . $ GValue# *value, |
| 33 | GParamSpeccxx . . $ GParamSpec# *param_spec); |
| 34 | static void ags_fx_analyse_channel_get_propertycxx . . $ ags_fx_analyse_channel_get_property(cee2c52f22407c66).(GObjectcxx . . $ GObject# *gobject, |
| 35 | guintcxx . . $ guint# prop_id, |
| 36 | GValuecxx . . $ GValue# *value, |
| 37 | GParamSpeccxx . . $ GParamSpec# *param_spec); |
| 38 | static void ags_fx_analyse_channel_disposecxx . . $ ags_fx_analyse_channel_dispose(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject); |
| 39 | static void ags_fx_analyse_channel_finalizecxx . . $ ags_fx_analyse_channel_finalize(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject); |
| 40 | |
| 41 | static void ags_fx_analyse_channel_notify_samplerate_callbackcxx . . $ ags_fx_analyse_channel_notify_samplerate_callback(4ebbded80fa75af1).(GObjectcxx . . $ GObject# *gobject, |
| 42 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 43 | gpointercxx . . $ gpointer# user_data); |
| 44 | static void ags_fx_analyse_channel_notify_buffer_size_callbackcxx . . $ ags_fx_analyse_channel_notify_buffer_size_callback(4ebbded80fa75af1).(GObjectcxx . . $ GObject# *gobject, |
| 45 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 46 | gpointercxx . . $ gpointer# user_data); |
| 47 | |
| 48 | /** |
| 49 | * SECTION:ags_fx_analyse_channel |
| 50 | * @short_description: fx analyse channel |
| 51 | * @title: AgsFxAnalyseChannel |
| 52 | * @section_id: |
| 53 | * @include: ags/audio/fx/ags_fx_analyse_channel.h |
| 54 | * |
| 55 | * The #AgsFxAnalyseChannel class provides ports to the effect processor. |
| 56 | */ |
| 57 | |
| 58 | static gpointercxx . . $ gpointer# ags_fx_analyse_channel_parent_classcxx . . $ ags_fx_analyse_channel_parent_class. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 59 | |
| 60 | static const gcharcxx . . $ gchar# *ags_fx_analyse_channel_plugin_namecxx . . $ ags_fx_analyse_channel_plugin_name. = "ags-fx-analyse"; |
| 61 | |
| 62 | static const gcharcxx . . $ gchar#* ags_fx_analyse_channel_specifiercxx . . $ ags_fx_analyse_channel_specifier.[] = { |
| 63 | "./frequency[0]", |
| 64 | "./magnitude[0]", |
| 65 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 66 | }; |
| 67 | |
| 68 | static const gcharcxx . . $ gchar#* ags_fx_analyse_channel_control_portcxx . . $ ags_fx_analyse_channel_control_port.[] = { |
| 69 | "1/2", |
| 70 | "2/2", |
| 71 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, |
| 72 | }; |
| 73 | |
| 74 | enumcxx . . $ $anonymous_type_b10adb30bdeaee5c_0#{ |
| 75 | PROP_0cxx . . $ PROP_0., |
| 76 | PROP_FREQUENCYcxx . . $ PROP_FREQUENCY., |
| 77 | PROP_MAGNITUDEcxx . . $ PROP_MAGNITUDE., |
| 78 | }; |
| 79 | |
| 80 | GTypecxx . . $ GType# |
| 81 | ags_fx_analyse_channel_get_typecxx . . $ ags_fx_analyse_channel_get_type(7b3bcd0168edf51f).() |
| 82 | { |
| 83 | static gsizecxx . . $ gsize# g_define_type_id__static = 0; |
| 84 | |
| 85 | if(g_once_init_entercxx . . $ `<external>/457917468643292165/gthread.h:270:10`!(&g_define_type_id__static)){ |
| 86 | GTypecxx . . $ GType# ags_type_fx_analyse_channel = 0; |
| 87 | |
| 88 | static const GTypeInfocxx . . $ GTypeInfo# ags_fx_analyse_channel_info = { |
| 89 | sizeof (AgsFxAnalyseChannelClasscxx . . $ AgsFxAnalyseChannelClass#), |
| 90 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, /* base_init */ |
| 91 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, /* base_finalize */ |
| 92 | (GClassInitFunccxx . . $ GClassInitFunc#) ags_fx_analyse_channel_class_initcxx . . $ ags_fx_analyse_channel_class_init(cc5c462cfb85fd1a)., |
| 93 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, /* class_finalize */ |
| 94 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, /* class_channel */ |
| 95 | sizeof (AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel#), |
| 96 | 0, /* n_preallocs */ |
| 97 | (GInstanceInitFunccxx . . $ GInstanceInitFunc#) ags_fx_analyse_channel_initcxx . . $ ags_fx_analyse_channel_init(3bc436759eb554b)., |
| 98 | }; |
| 99 | |
| 100 | ags_type_fx_analyse_channel = g_type_register_staticcxx . . $ g_type_register_static(805a40cfa272e950).(AGS_TYPE_RECALL_CHANNELcxx . . $ `ags/audio/ags_recall_channel.h:34:9`!, |
| 101 | "AgsFxAnalyseChannel", |
| 102 | &ags_fx_analyse_channel_info, |
| 103 | 0); |
| 104 | |
| 105 | g_once_init_leavecxx . . $ `<external>/457917468643292165/gthread.h:277:10`!(&g_define_type_id__static, ags_type_fx_analyse_channel); |
| 106 | } |
| 107 | |
| 108 | return(g_define_type_id__static); |
| 109 | } |
| 110 | |
| 111 | void |
| 112 | ags_fx_analyse_channel_class_initcxx . . $ ags_fx_analyse_channel_class_init(cc5c462cfb85fd1a).(AgsFxAnalyseChannelClasscxx . . $ AgsFxAnalyseChannelClass# *fx_analyse_channel) |
| 113 | { |
| 114 | GObjectClasscxx . . $ GObjectClass# *gobject; |
| 115 | |
| 116 | GParamSpeccxx . . $ GParamSpec# *param_spec; |
| 117 | |
| 118 | ags_fx_analyse_channel_parent_classcxx . . $ ags_fx_analyse_channel_parent_class. = g_type_class_peek_parentcxx . . $ g_type_class_peek_parent(9f162e79bfc6c74).(fx_analyse_channel); |
| 119 | |
| 120 | /* GObjectClass */ |
| 121 | gobject = (GObjectClasscxx . . $ GObjectClass# *) fx_analyse_channel; |
| 122 | |
| 123 | gobject->set_propertycxx . . $ _GObjectClass#set_property. = ags_fx_analyse_channel_set_propertycxx . . $ ags_fx_analyse_channel_set_property(d7c4bb29f36c0dc4).; |
| 124 | gobject->get_propertycxx . . $ _GObjectClass#get_property. = ags_fx_analyse_channel_get_propertycxx . . $ ags_fx_analyse_channel_get_property(cee2c52f22407c66).; |
| 125 | |
| 126 | gobject->disposecxx . . $ _GObjectClass#dispose. = ags_fx_analyse_channel_disposecxx . . $ ags_fx_analyse_channel_dispose(6087475fa43034d3).; |
| 127 | gobject->finalizecxx . . $ _GObjectClass#finalize. = ags_fx_analyse_channel_finalizecxx . . $ ags_fx_analyse_channel_finalize(6087475fa43034d3).; |
| 128 | |
| 129 | /* properties */ |
| 130 | /** |
| 131 | * AgsFxAnalyseChannel:frequency: |
| 132 | * |
| 133 | * The beats per minute. |
| 134 | * |
| 135 | * Since: 3.3.0 |
| 136 | */ |
| 137 | param_spec = g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127).("frequency", |
| 138 | i18n_pspeccxx . . $ `ags/i18n.h:24:9`!("frequency of recall"), |
| 139 | i18n_pspeccxx . . $ `ags/i18n.h:24:9`!("The recall's frequency"), |
| 140 | AGS_TYPE_PORTcxx . . $ `ags/audio/ags_port.h:32:9`!, |
| 141 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | G_PARAM_WRITABLEcxx . . $ G_PARAM_WRITABLE.); |
| 142 | g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26).(gobject, |
| 143 | PROP_FREQUENCYcxx . . $ PROP_FREQUENCY., |
| 144 | param_spec); |
| 145 | |
| 146 | /** |
| 147 | * AgsFxAnalyseChannel:magnitude: |
| 148 | * |
| 149 | * The beats per minute. |
| 150 | * |
| 151 | * Since: 3.3.0 |
| 152 | */ |
| 153 | param_spec = g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127).("magnitude", |
| 154 | i18n_pspeccxx . . $ `ags/i18n.h:24:9`!("magnitude of recall"), |
| 155 | i18n_pspeccxx . . $ `ags/i18n.h:24:9`!("The recall's magnitude"), |
| 156 | AGS_TYPE_PORTcxx . . $ `ags/audio/ags_port.h:32:9`!, |
| 157 | G_PARAM_READABLEcxx . . $ G_PARAM_READABLE. | G_PARAM_WRITABLEcxx . . $ G_PARAM_WRITABLE.); |
| 158 | g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26).(gobject, |
| 159 | PROP_MAGNITUDEcxx . . $ PROP_MAGNITUDE., |
| 160 | param_spec); |
| 161 | } |
| 162 | |
| 163 | void |
| 164 | ags_fx_analyse_channel_initcxx . . $ ags_fx_analyse_channel_init(3bc436759eb554b).(AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel) |
| 165 | { |
| 166 | AgsResetFxAnalysecxx . . $ AgsResetFxAnalyse# *reset_fx_analyse; |
| 167 | |
| 168 | double correction; |
| 169 | guintcxx . . $ guint# samplerate; |
| 170 | guintcxx . . $ guint# buffer_size; |
| 171 | guintcxx . . $ guint# i; |
| 172 | |
| 173 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:554:9`!(fx_analyse_channel, "notify::samplerate", |
| 174 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`!(ags_fx_analyse_channel_notify_samplerate_callback), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 175 | |
| 176 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:554:9`!(fx_analyse_channel, "notify::buffer-size", |
| 177 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`!(ags_fx_analyse_channel_notify_buffer_size_callback), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 178 | |
| 179 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:42:9`!(fx_analyse_channel)->namecxx . . $ _AgsRecall#name. = "ags-fx-analyse"; |
| 180 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:42:9`!(fx_analyse_channel)->versioncxx . . $ _AgsRecall#version. = AGS_RECALL_DEFAULT_VERSIONcxx . . $ `ags/audio/ags_recall.h:52:9`!; |
| 181 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:42:9`!(fx_analyse_channel)->build_idcxx . . $ _AgsRecall#build_id. = AGS_RECALL_DEFAULT_BUILD_IDcxx . . $ `ags/audio/ags_recall.h:53:9`!; |
| 182 | AGS_RECALLcxx . . $ `ags/audio/ags_recall.h:42:9`!(fx_analyse_channel)->xml_typecxx . . $ _AgsRecall#xml_type. = "ags-fx-analyse-channel"; |
| 183 | |
| 184 | samplerate = AGS_SOUNDCARD_DEFAULT_SAMPLERATEcxx . . $ `ags/object/ags_soundcard.h:45:9`!; |
| 185 | buffer_size = AGS_SOUNDCARD_DEFAULT_BUFFER_SIZEcxx . . $ `ags/object/ags_soundcard.h:51:9`!; |
| 186 | |
| 187 | fx_analyse_channel->magnitude_clearedcxx . . $ _AgsFxAnalyseChannel#magnitude_cleared. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 188 | |
| 189 | g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d).(fx_analyse_channel, |
| 190 | "samplerate", &samplerate, |
| 191 | "buffer-size", &buffer_size, |
| 192 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 193 | |
| 194 | /* frequency */ |
| 195 | fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency. = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78).(AGS_TYPE_PORTcxx . . $ `ags/audio/ags_port.h:32:9`!, |
| 196 | "plugin-name", ags_fx_analyse_channel_plugin_namecxx . . $ ags_fx_analyse_channel_plugin_name., |
| 197 | "specifier", "./frequency[0]", |
| 198 | "control-port", "1/2", |
| 199 | "port-value-is-pointer", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, |
| 200 | "port-value-type", G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!, |
| 201 | "port-value-size", sizeof(gdoublecxx . . $ gdouble#), |
| 202 | "port-value-length", buffer_size, |
| 203 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 204 | ags_port_set_flagscxx . . $ ags_port_set_flags(84830934707138c7).(fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency., AGS_PORT_IS_OUTPUTcxx . . $ AGS_PORT_IS_OUTPUT.); |
| 205 | |
| 206 | fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency.->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr. = ags_stream_alloccxx . . $ ags_stream_alloc(b85a973e15814ae0).(buffer_size, |
| 207 | AGS_SOUNDCARD_DOUBLEcxx . . $ AGS_SOUNDCARD_DOUBLE.); |
| 208 | |
| 209 | ags_recall_add_portcxx . . $ ags_recall_add_port(6ead69b5866ab1f9).((AgsRecallcxx . . $ AgsRecall# *) fx_analyse_channel, |
| 210 | fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency.); |
| 211 | |
| 212 | correction = (double) samplerate / (double) buffer_size; |
| 213 | |
| 214 | for(i = 0; i < buffer_size; i++){ |
| 215 | fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency.->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr.[i] = (double) i * (double) correction; |
| 216 | } |
| 217 | |
| 218 | /* magnitude */ |
| 219 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude. = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78).(AGS_TYPE_PORTcxx . . $ `ags/audio/ags_port.h:32:9`!, |
| 220 | "plugin-name", ags_fx_analyse_channel_plugin_namecxx . . $ ags_fx_analyse_channel_plugin_name., |
| 221 | "specifier", "./magnitude[0]", |
| 222 | "control-port", "2/2", |
| 223 | "port-value-is-pointer", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, |
| 224 | "port-value-type", G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!, |
| 225 | "port-value-size", sizeof(gdoublecxx . . $ gdouble#), |
| 226 | "port-value-length", buffer_size, |
| 227 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 228 | ags_port_set_flagscxx . . $ ags_port_set_flags(84830934707138c7).(fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude., AGS_PORT_IS_OUTPUTcxx . . $ AGS_PORT_IS_OUTPUT.); |
| 229 | |
| 230 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr. = ags_stream_alloccxx . . $ ags_stream_alloc(b85a973e15814ae0).(buffer_size, |
| 231 | AGS_SOUNDCARD_DOUBLEcxx . . $ AGS_SOUNDCARD_DOUBLE.); |
| 232 | |
| 233 | ags_recall_add_portcxx . . $ ags_recall_add_port(6ead69b5866ab1f9).((AgsRecallcxx . . $ AgsRecall# *) fx_analyse_channel, |
| 234 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.); |
| 235 | |
| 236 | /* input data */ |
| 237 | for(i = 0; i < AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.; i++){ |
| 238 | fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i] = ags_fx_analyse_channel_input_data_alloccxx . . $ ags_fx_analyse_channel_input_data_alloc(2261207883986efd).(); |
| 239 | |
| 240 | fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->parentcxx . . $ _AgsFxAnalyseChannelInputData#parent. = fx_analyse_channel; |
| 241 | |
| 242 | /* FFTW */ |
| 243 | fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->incxx . . $ _AgsFxAnalyseChannelInputData#in. = (double *) fftw_malloccxx . . $ fftw_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(double)); |
| 244 | fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->outcxx . . $ _AgsFxAnalyseChannelInputData#out. = (double *) fftw_malloccxx . . $ fftw_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(double)); |
| 245 | |
| 246 | fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->comoutcxx . . $ _AgsFxAnalyseChannelInputData#comout. = (fftw_complexcxx . . $ fftw_complex# *) fftw_malloccxx . . $ fftw_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(fftw_complexcxx . . $ fftw_complex#)); |
| 247 | |
| 248 | fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->plancxx . . $ _AgsFxAnalyseChannelInputData#plan. = fftw_plan_r2r_1dcxx . . $ fftw_plan_r2r_1d(9591b457c70c5eda).(buffer_size, fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->incxx . . $ _AgsFxAnalyseChannelInputData#in., fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]->outcxx . . $ _AgsFxAnalyseChannelInputData#out., FFTW_R2HCcxx . . $ FFTW_R2HC., FFTW_ESTIMATEcxx . . $ `<external>/4982487536923700009/fftw3.h:502:9`!); |
| 249 | } |
| 250 | |
| 251 | /* add to reset analyse task */ |
| 252 | reset_fx_analyse = ags_reset_fx_analyse_get_instancecxx . . $ ags_reset_fx_analyse_get_instance(486e9ffede1e4e3e).(); |
| 253 | |
| 254 | ags_reset_fx_analyse_addcxx . . $ ags_reset_fx_analyse_add(272a1dcc804cb01c).(reset_fx_analyse, |
| 255 | fx_analyse_channel); |
| 256 | } |
| 257 | |
| 258 | void |
| 259 | ags_fx_analyse_channel_set_propertycxx . . $ ags_fx_analyse_channel_set_property(d7c4bb29f36c0dc4).(GObjectcxx . . $ GObject# *gobject, |
| 260 | guintcxx . . $ guint# prop_id, |
| 261 | const GValuecxx . . $ GValue# *value, |
| 262 | GParamSpeccxx . . $ GParamSpec# *param_spec) |
| 263 | { |
| 264 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 265 | |
| 266 | GRecMutexcxx . . $ GRecMutex# *recall_mutex; |
| 267 | |
| 268 | fx_analyse_channel = AGS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:37:9`!(gobject); |
| 269 | |
| 270 | /* get recall mutex */ |
| 271 | recall_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:50:9`!(fx_analyse_channel); |
| 272 | |
| 273 | switch(prop_id){ |
| 274 | case PROP_FREQUENCYcxx . . $ PROP_FREQUENCY.: |
| 275 | { |
| 276 | AgsPortcxx . . $ AgsPort# *port; |
| 277 | |
| 278 | port = (AgsPortcxx . . $ AgsPort# *) g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce).(value); |
| 279 | |
| 280 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 281 | |
| 282 | if(port == fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency.){ |
| 283 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 284 | |
| 285 | return; |
| 286 | } |
| 287 | |
| 288 | if(fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 289 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_analyse_channel->frequency)); |
| 290 | } |
| 291 | |
| 292 | if(port != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 293 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`!(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(port)); |
| 294 | } |
| 295 | |
| 296 | fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency. = port; |
| 297 | |
| 298 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 299 | } |
| 300 | break; |
| 301 | case PROP_MAGNITUDEcxx . . $ PROP_MAGNITUDE.: |
| 302 | { |
| 303 | AgsPortcxx . . $ AgsPort# *port; |
| 304 | |
| 305 | port = (AgsPortcxx . . $ AgsPort# *) g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce).(value); |
| 306 | |
| 307 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 308 | |
| 309 | if(port == fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.){ |
| 310 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 311 | |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | if(fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 316 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_analyse_channel->magnitude)); |
| 317 | } |
| 318 | |
| 319 | if(port != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 320 | g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`!(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(port)); |
| 321 | } |
| 322 | |
| 323 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude. = port; |
| 324 | |
| 325 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 326 | } |
| 327 | break; |
| 328 | default: |
| 329 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`!(gobject, prop_id, param_spec); |
| 330 | break; |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | void |
| 335 | ags_fx_analyse_channel_get_propertycxx . . $ ags_fx_analyse_channel_get_property(cee2c52f22407c66).(GObjectcxx . . $ GObject# *gobject, |
| 336 | guintcxx . . $ guint# prop_id, |
| 337 | GValuecxx . . $ GValue# *value, |
| 338 | GParamSpeccxx . . $ GParamSpec# *param_spec) |
| 339 | { |
| 340 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 341 | |
| 342 | GRecMutexcxx . . $ GRecMutex# *recall_mutex; |
| 343 | |
| 344 | fx_analyse_channel = AGS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:37:9`!(gobject); |
| 345 | |
| 346 | /* get recall mutex */ |
| 347 | recall_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:50:9`!(fx_analyse_channel); |
| 348 | |
| 349 | switch(prop_id){ |
| 350 | case PROP_FREQUENCYcxx . . $ PROP_FREQUENCY.: |
| 351 | { |
| 352 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 353 | |
| 354 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f).(value, fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency.); |
| 355 | |
| 356 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 357 | } |
| 358 | break; |
| 359 | case PROP_MAGNITUDEcxx . . $ PROP_MAGNITUDE.: |
| 360 | { |
| 361 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 362 | |
| 363 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f).(value, fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.); |
| 364 | |
| 365 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 366 | } |
| 367 | break; |
| 368 | default: |
| 369 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`!(gobject, prop_id, param_spec); |
| 370 | break; |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | void |
| 375 | ags_fx_analyse_channel_disposecxx . . $ ags_fx_analyse_channel_dispose(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject) |
| 376 | { |
| 377 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 378 | |
| 379 | AgsResetFxAnalysecxx . . $ AgsResetFxAnalyse# *reset_fx_analyse; |
| 380 | |
| 381 | fx_analyse_channel = AGS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:37:9`!(gobject); |
| 382 | |
| 383 | /* frequency */ |
| 384 | if(fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 385 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_analyse_channel->frequency)); |
| 386 | |
| 387 | fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 388 | } |
| 389 | |
| 390 | |
| 391 | /* magnitude */ |
| 392 | if(fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 393 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_analyse_channel->magnitude)); |
| 394 | |
| 395 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 396 | } |
| 397 | |
| 398 | /* reset ags-fx-analyse task */ |
| 399 | reset_fx_analyse = ags_reset_fx_analyse_get_instancecxx . . $ ags_reset_fx_analyse_get_instance(486e9ffede1e4e3e).(); |
| 400 | |
| 401 | ags_reset_fx_analyse_removecxx . . $ ags_reset_fx_analyse_remove(272a1dcc804cb01c).(reset_fx_analyse, |
| 402 | fx_analyse_channel); |
| 403 | |
| 404 | /* call parent */ |
| 405 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`!(ags_fx_analyse_channel_parent_class)->disposecxx . . $ _GObjectClass#dispose.(gobject); |
| 406 | } |
| 407 | |
| 408 | void |
| 409 | ags_fx_analyse_channel_finalizecxx . . $ ags_fx_analyse_channel_finalize(6087475fa43034d3).(GObjectcxx . . $ GObject# *gobject) |
| 410 | { |
| 411 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 412 | |
| 413 | AgsResetFxAnalysecxx . . $ AgsResetFxAnalyse# *reset_fx_analyse; |
| 414 | |
| 415 | guintcxx . . $ guint# i; |
| 416 | |
| 417 | fx_analyse_channel = AGS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:37:9`!(gobject); |
| 418 | |
| 419 | /* frequency */ |
| 420 | if(fx_analyse_channel->frequencycxx . . $ _AgsFxAnalyseChannel#frequency. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 421 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_analyse_channel->frequency)); |
| 422 | } |
| 423 | |
| 424 | /* magnitude */ |
| 425 | if(fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 426 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`!(fx_analyse_channel->magnitude)); |
| 427 | } |
| 428 | |
| 429 | /* input data */ |
| 430 | for(i = 0; i < AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.; i++){ |
| 431 | ags_fx_analyse_channel_input_data_freecxx . . $ ags_fx_analyse_channel_input_data_free(eb300fb66938fc56).(fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]); |
| 432 | } |
| 433 | |
| 434 | /* reset ags-fx-analyse task */ |
| 435 | reset_fx_analyse = ags_reset_fx_analyse_get_instancecxx . . $ ags_reset_fx_analyse_get_instance(486e9ffede1e4e3e).(); |
| 436 | |
| 437 | ags_reset_fx_analyse_removecxx . . $ ags_reset_fx_analyse_remove(272a1dcc804cb01c).(reset_fx_analyse, |
| 438 | fx_analyse_channel); |
| 439 | |
| 440 | /* call parent */ |
| 441 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`!(ags_fx_analyse_channel_parent_class)->finalizecxx . . $ _GObjectClass#finalize.(gobject); |
| 442 | } |
| 443 | |
| 444 | void |
| 445 | ags_fx_analyse_channel_notify_samplerate_callbackcxx . . $ ags_fx_analyse_channel_notify_samplerate_callback(4ebbded80fa75af1).(GObjectcxx . . $ GObject# *gobject, |
| 446 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 447 | gpointercxx . . $ gpointer# user_data) |
| 448 | { |
| 449 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 450 | AgsPortcxx . . $ AgsPort# *frequency; |
| 451 | |
| 452 | double correction; |
| 453 | guintcxx . . $ guint# samplerate; |
| 454 | guintcxx . . $ guint# buffer_size; |
| 455 | guintcxx . . $ guint# i; |
| 456 | |
| 457 | GRecMutexcxx . . $ GRecMutex# *port_mutex; |
| 458 | |
| 459 | fx_analyse_channel = AGS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:37:9`!(gobject); |
| 460 | |
| 461 | /* get buffer size */ |
| 462 | frequency = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 463 | |
| 464 | samplerate = AGS_SOUNDCARD_DEFAULT_SAMPLERATEcxx . . $ `ags/object/ags_soundcard.h:45:9`!; |
| 465 | buffer_size = AGS_SOUNDCARD_DEFAULT_BUFFER_SIZEcxx . . $ `ags/object/ags_soundcard.h:51:9`!; |
| 466 | |
| 467 | g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d).(fx_analyse_channel, |
| 468 | "frequency", &frequency, |
| 469 | "samplerate", &samplerate, |
| 470 | "buffer-size", &buffer_size, |
| 471 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 472 | |
| 473 | /* realloc port - frequency */ |
| 474 | correction = ((double) samplerate - buffer_size) / (double) buffer_size; |
| 475 | |
| 476 | if(frequency != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 477 | port_mutex = AGS_PORT_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_port.h:39:9`!(frequency); |
| 478 | |
| 479 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(port_mutex); |
| 480 | |
| 481 | for(i = 0; i < buffer_size; i++){ |
| 482 | frequency->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr.[i] = (double) i * (double) correction; |
| 483 | } |
| 484 | |
| 485 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(port_mutex); |
| 486 | } |
| 487 | |
| 488 | /* unref */ |
| 489 | if(frequency != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 490 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(frequency); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | void |
| 495 | ags_fx_analyse_channel_notify_buffer_size_callbackcxx . . $ ags_fx_analyse_channel_notify_buffer_size_callback(4ebbded80fa75af1).(GObjectcxx . . $ GObject# *gobject, |
| 496 | GParamSpeccxx . . $ GParamSpec# *pspec, |
| 497 | gpointercxx . . $ gpointer# user_data) |
| 498 | { |
| 499 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 500 | AgsPortcxx . . $ AgsPort# *frequency; |
| 501 | AgsPortcxx . . $ AgsPort# *magnitude; |
| 502 | |
| 503 | double correction; |
| 504 | guintcxx . . $ guint# samplerate; |
| 505 | guintcxx . . $ guint# buffer_size; |
| 506 | guintcxx . . $ guint# i; |
| 507 | |
| 508 | GRecMutexcxx . . $ GRecMutex# *recall_mutex; |
| 509 | GRecMutexcxx . . $ GRecMutex# *port_mutex; |
| 510 | |
| 511 | fx_analyse_channel = AGS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:37:9`!(gobject); |
| 512 | |
| 513 | /* get recall mutex */ |
| 514 | recall_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:50:9`!(fx_analyse_channel); |
| 515 | |
| 516 | /* get buffer size */ |
| 517 | frequency = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 518 | magnitude = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 519 | |
| 520 | samplerate = AGS_SOUNDCARD_DEFAULT_SAMPLERATEcxx . . $ `ags/object/ags_soundcard.h:45:9`!; |
| 521 | buffer_size = AGS_SOUNDCARD_DEFAULT_BUFFER_SIZEcxx . . $ `ags/object/ags_soundcard.h:51:9`!; |
| 522 | |
| 523 | g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d).(fx_analyse_channel, |
| 524 | "frequency", &frequency, |
| 525 | "magnitude", &magnitude, |
| 526 | "samplerate", &samplerate, |
| 527 | "buffer-size", &buffer_size, |
| 528 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 529 | |
| 530 | /* realloc port - frequency */ |
| 531 | correction = (double) samplerate / (double) buffer_size; |
| 532 | |
| 533 | if(frequency != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 534 | port_mutex = AGS_PORT_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_port.h:39:9`!(frequency); |
| 535 | |
| 536 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(port_mutex); |
| 537 | |
| 538 | ags_stream_freecxx . . $ ags_stream_free(5d22bdacc48458e8).(frequency->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr.); |
| 539 | |
| 540 | if(buffer_size > 0){ |
| 541 | frequency->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr. = ags_stream_alloccxx . . $ ags_stream_alloc(b85a973e15814ae0).(buffer_size, |
| 542 | AGS_SOUNDCARD_DOUBLEcxx . . $ AGS_SOUNDCARD_DOUBLE.); |
| 543 | }else{ |
| 544 | frequency->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 545 | } |
| 546 | |
| 547 | for(i = 0; i < buffer_size; i++){ |
| 548 | frequency->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr.[i] = (double) i * (double) correction; |
| 549 | } |
| 550 | |
| 551 | g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d).(frequency, |
| 552 | "port-value-length", buffer_size, |
| 553 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 554 | |
| 555 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(port_mutex); |
| 556 | } |
| 557 | |
| 558 | /* realloc port - magnitude */ |
| 559 | if(magnitude != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 560 | port_mutex = AGS_PORT_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_port.h:39:9`!(magnitude); |
| 561 | |
| 562 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(port_mutex); |
| 563 | |
| 564 | ags_stream_freecxx . . $ ags_stream_free(5d22bdacc48458e8).(fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr.); |
| 565 | |
| 566 | if(buffer_size > 0){ |
| 567 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr. = ags_stream_alloccxx . . $ ags_stream_alloc(b85a973e15814ae0).(buffer_size, |
| 568 | AGS_SOUNDCARD_DOUBLEcxx . . $ AGS_SOUNDCARD_DOUBLE.); |
| 569 | }else{ |
| 570 | fx_analyse_channel->magnitudecxx . . $ _AgsFxAnalyseChannel#magnitude.->port_valuecxx . . $ _AgsPort#port_value..ags_port_double_ptrcxx . . $ _AgsPortValue#ags_port_double_ptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 571 | } |
| 572 | |
| 573 | g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d).(magnitude, |
| 574 | "port-value-length", buffer_size, |
| 575 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 576 | |
| 577 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(port_mutex); |
| 578 | } |
| 579 | |
| 580 | /* reallocate buffer - apply buffer size */ |
| 581 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(recall_mutex); |
| 582 | |
| 583 | for(i = 0; i < AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.; i++){ |
| 584 | AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data; |
| 585 | |
| 586 | input_data = fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[i]; |
| 587 | |
| 588 | /* FFTW */ |
| 589 | fftw_freecxx . . $ fftw_free(5d22bdacc48458e8).(input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in.); |
| 590 | fftw_freecxx . . $ fftw_free(5d22bdacc48458e8).(input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out.); |
| 591 | |
| 592 | fftw_freecxx . . $ fftw_free(5d22bdacc48458e8).(input_data->comoutcxx . . $ _AgsFxAnalyseChannelInputData#comout.); |
| 593 | |
| 594 | fftw_destroy_plancxx . . $ fftw_destroy_plan(a5c787678ab775ef).(input_data->plancxx . . $ _AgsFxAnalyseChannelInputData#plan.); |
| 595 | |
| 596 | if(buffer_size > 0){ |
| 597 | input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in. = (double *) fftw_malloccxx . . $ fftw_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(double)); |
| 598 | input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out. = (double *) fftw_malloccxx . . $ fftw_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(double)); |
| 599 | |
| 600 | input_data->comoutcxx . . $ _AgsFxAnalyseChannelInputData#comout. = (fftw_complexcxx . . $ fftw_complex# *) fftw_malloccxx . . $ fftw_malloc(bfcfa4d6b7f7ef64).(buffer_size * sizeof(fftw_complexcxx . . $ fftw_complex#)); |
| 601 | |
| 602 | input_data->plancxx . . $ _AgsFxAnalyseChannelInputData#plan. = fftw_plan_r2r_1dcxx . . $ fftw_plan_r2r_1d(9591b457c70c5eda).(buffer_size, input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in., input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out., FFTW_R2HCcxx . . $ FFTW_R2HC., FFTW_ESTIMATEcxx . . $ `<external>/4982487536923700009/fftw3.h:502:9`!); |
| 603 | }else{ |
| 604 | input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 605 | input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 606 | |
| 607 | input_data->comoutcxx . . $ _AgsFxAnalyseChannelInputData#comout. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 608 | |
| 609 | input_data->plancxx . . $ _AgsFxAnalyseChannelInputData#plan. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(recall_mutex); |
| 614 | |
| 615 | /* unref */ |
| 616 | if(frequency != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 617 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(frequency); |
| 618 | } |
| 619 | |
| 620 | if(magnitude != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 621 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).(magnitude); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | /** |
| 626 | * ags_fx_analyse_channel_input_data_alloc: |
| 627 | * |
| 628 | * Allocate #AgsFxAnalyseChannelInputData-struct |
| 629 | * |
| 630 | * Returns: (type gpointer) (transfer full): the new #AgsFxAnalyseChannelInputData-struct |
| 631 | * |
| 632 | * Since: 3.3.0 |
| 633 | */ |
| 634 | AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData#* |
| 635 | ags_fx_analyse_channel_input_data_alloccxx . . $ ags_fx_analyse_channel_input_data_alloc(2261207883986efd).() |
| 636 | { |
| 637 | AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data; |
| 638 | |
| 639 | input_data = (AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *) g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64).(sizeof(AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData#)); |
| 640 | |
| 641 | g_rec_mutex_initcxx . . $ g_rec_mutex_init(70e02e1a6dfc5752).(&(input_data->strct_mutexcxx . . $ _AgsFxAnalyseChannelInputData#strct_mutex.)); |
| 642 | |
| 643 | input_data->parentcxx . . $ _AgsFxAnalyseChannelInputData#parent. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 644 | |
| 645 | input_data->plancxx . . $ _AgsFxAnalyseChannelInputData#plan. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 646 | input_data->comoutcxx . . $ _AgsFxAnalyseChannelInputData#comout. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 647 | |
| 648 | input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 649 | input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 650 | |
| 651 | return(input_data); |
| 652 | } |
| 653 | |
| 654 | /** |
| 655 | * ags_fx_analyse_channel_input_data_free: |
| 656 | * @input_data: (type gpointer) (transfer full): the #AgsFxAnalyseChannelInputData-struct |
| 657 | * |
| 658 | * Free @input_data. |
| 659 | * |
| 660 | * Since: 3.3.0 |
| 661 | */ |
| 662 | void |
| 663 | ags_fx_analyse_channel_input_data_freecxx . . $ ags_fx_analyse_channel_input_data_free(eb300fb66938fc56).(AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data) |
| 664 | { |
| 665 | if(input_data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 666 | return; |
| 667 | } |
| 668 | |
| 669 | fftw_freecxx . . $ fftw_free(5d22bdacc48458e8).(input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in.); |
| 670 | fftw_freecxx . . $ fftw_free(5d22bdacc48458e8).(input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out.); |
| 671 | |
| 672 | fftw_freecxx . . $ fftw_free(5d22bdacc48458e8).(input_data->comoutcxx . . $ _AgsFxAnalyseChannelInputData#comout.); |
| 673 | |
| 674 | fftw_destroy_plancxx . . $ fftw_destroy_plan(a5c787678ab775ef).(input_data->plancxx . . $ _AgsFxAnalyseChannelInputData#plan.); |
| 675 | |
| 676 | g_freecxx . . $ `<external>/1123956534522462559/gmem.h:171:9`!(input_data); |
| 677 | } |
| 678 | |
| 679 | /** |
| 680 | * ags_fx_analyse_channel_input_data_get_strct_mutex: |
| 681 | * @input_data: (type gpointer) (transfer none): the #AgsFxAnalyseChannelInputData |
| 682 | * |
| 683 | * Get structure mutex. |
| 684 | * |
| 685 | * Returns: (type gpointer) (transfer none): the #GRecMutex to lock @input_data |
| 686 | * |
| 687 | * Since: 3.3.0 |
| 688 | */ |
| 689 | GRecMutexcxx . . $ GRecMutex#* |
| 690 | ags_fx_analyse_channel_input_data_get_strct_mutexcxx . . $ ags_fx_analyse_channel_input_data_get_strct_mutex(64668d530cdd451e).(AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data) |
| 691 | { |
| 692 | if(input_data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 693 | return(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 694 | } |
| 695 | |
| 696 | return(AGS_FX_ANALYSE_CHANNEL_INPUT_DATA_GET_STRCT_MUTEXcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:44:9`!(input_data)); |
| 697 | } |
| 698 | |
| 699 | /** |
| 700 | * ags_fx_analyse_channel_input_get_parent: |
| 701 | * @input_data: (type gpointer) (transfer none): the #AgsFxAnalyseChannelInputData-struct |
| 702 | * |
| 703 | * Get parent of @input_data. |
| 704 | * |
| 705 | * Returns: (type gpointer) (transfer none): the parent |
| 706 | * |
| 707 | * Since: 3.3.0 |
| 708 | */ |
| 709 | gpointercxx . . $ gpointer# |
| 710 | ags_fx_analyse_channel_input_get_parentcxx . . $ ags_fx_analyse_channel_input_get_parent(627ac51d1f4941e4).(AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data) |
| 711 | { |
| 712 | gpointercxx . . $ gpointer# parent; |
| 713 | |
| 714 | GRecMutexcxx . . $ GRecMutex# *input_data_mutex; |
| 715 | |
| 716 | if(input_data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 717 | return(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 718 | } |
| 719 | |
| 720 | input_data_mutex = AGS_FX_ANALYSE_CHANNEL_INPUT_DATA_GET_STRCT_MUTEXcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:44:9`!(input_data); |
| 721 | |
| 722 | /* parent */ |
| 723 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(input_data_mutex); |
| 724 | |
| 725 | parent = input_data->parentcxx . . $ _AgsFxAnalyseChannelInputData#parent.; |
| 726 | |
| 727 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(input_data_mutex); |
| 728 | |
| 729 | return(parent); |
| 730 | } |
| 731 | |
| 732 | /** |
| 733 | * ags_fx_analyse_channel_input_get_in: |
| 734 | * @input_data: (type gpointer) (transfer none): the #AgsFxAnalyseChannelInputData-struct |
| 735 | * |
| 736 | * Get input of @input_data. |
| 737 | * |
| 738 | * Returns: (type gpointer) (transfer none): the input |
| 739 | * |
| 740 | * Since: 3.3.0 |
| 741 | */ |
| 742 | gpointercxx . . $ gpointer# |
| 743 | ags_fx_analyse_channel_input_get_incxx . . $ ags_fx_analyse_channel_input_get_in(627ac51d1f4941e4).(AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data) |
| 744 | { |
| 745 | gpointercxx . . $ gpointer# in; |
| 746 | |
| 747 | GRecMutexcxx . . $ GRecMutex# *input_data_mutex; |
| 748 | |
| 749 | if(input_data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 750 | return(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 751 | } |
| 752 | |
| 753 | input_data_mutex = AGS_FX_ANALYSE_CHANNEL_INPUT_DATA_GET_STRCT_MUTEXcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:44:9`!(input_data); |
| 754 | |
| 755 | /* in */ |
| 756 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(input_data_mutex); |
| 757 | |
| 758 | in = input_data->incxx . . $ _AgsFxAnalyseChannelInputData#in.; |
| 759 | |
| 760 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(input_data_mutex); |
| 761 | |
| 762 | return(in); |
| 763 | } |
| 764 | |
| 765 | /** |
| 766 | * ags_fx_analyse_channel_input_get_out: |
| 767 | * @input_data: (type gpointer) (transfer none): the #AgsFxAnalyseChannelInputData-struct |
| 768 | * |
| 769 | * Get output of @input_data. |
| 770 | * |
| 771 | * Returns: (type gpointer) (transfer none): the output |
| 772 | * |
| 773 | * Since: 3.3.0 |
| 774 | */ |
| 775 | gpointercxx . . $ gpointer# |
| 776 | ags_fx_analyse_channel_input_get_outcxx . . $ ags_fx_analyse_channel_input_get_out(627ac51d1f4941e4).(AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data) |
| 777 | { |
| 778 | gpointercxx . . $ gpointer# out; |
| 779 | |
| 780 | GRecMutexcxx . . $ GRecMutex# *input_data_mutex; |
| 781 | |
| 782 | if(input_data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!){ |
| 783 | return(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 784 | } |
| 785 | |
| 786 | input_data_mutex = AGS_FX_ANALYSE_CHANNEL_INPUT_DATA_GET_STRCT_MUTEXcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:44:9`!(input_data); |
| 787 | |
| 788 | /* out */ |
| 789 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(input_data_mutex); |
| 790 | |
| 791 | out = input_data->outcxx . . $ _AgsFxAnalyseChannelInputData#out.; |
| 792 | |
| 793 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(input_data_mutex); |
| 794 | |
| 795 | return(out); |
| 796 | } |
| 797 | |
| 798 | /** |
| 799 | * ags_fx_analyse_channel_get_input_data: |
| 800 | * @fx_analyse_channel: the #AgsFxAnalyseChannel |
| 801 | * @sound_scope: the sound scope |
| 802 | * |
| 803 | * Get input data from @fx_analyse_channel by @sound_scope. |
| 804 | * |
| 805 | * Returns: (type gpointer) (transfer none): the matching #AgsFxAnalyseChannelInputData-struct |
| 806 | * |
| 807 | * Since: 3.3.0 |
| 808 | */ |
| 809 | AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData#* |
| 810 | ags_fx_analyse_channel_get_input_datacxx . . $ ags_fx_analyse_channel_get_input_data(1a6d099cfe4f175d).(AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel, |
| 811 | gintcxx . . $ gint# sound_scope) |
| 812 | { |
| 813 | AgsFxAnalyseChannelInputDatacxx . . $ AgsFxAnalyseChannelInputData# *input_data; |
| 814 | |
| 815 | GRecMutexcxx . . $ GRecMutex# *fx_analyse_channel_mutex; |
| 816 | |
| 817 | if(!AGS_IS_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:39:9`!(fx_analyse_channel) || |
| 818 | sound_scope < 0 || |
| 819 | sound_scope >= AGS_SOUND_SCOPE_LASTcxx . . $ AGS_SOUND_SCOPE_LAST.){ |
| 820 | return(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 821 | } |
| 822 | |
| 823 | fx_analyse_channel_mutex = AGS_RECALL_GET_OBJ_MUTEXcxx . . $ `ags/audio/ags_recall.h:50:9`!(fx_analyse_channel); |
| 824 | |
| 825 | /* input data */ |
| 826 | g_rec_mutex_lockcxx . . $ g_rec_mutex_lock(70e02e1a6dfc5752).(fx_analyse_channel_mutex); |
| 827 | |
| 828 | input_data = fx_analyse_channel->input_datacxx . . $ _AgsFxAnalyseChannel#input_data.[sound_scope]; |
| 829 | |
| 830 | g_rec_mutex_unlockcxx . . $ g_rec_mutex_unlock(70e02e1a6dfc5752).(fx_analyse_channel_mutex); |
| 831 | |
| 832 | return(input_data); |
| 833 | } |
| 834 | |
| 835 | /** |
| 836 | * ags_fx_analyse_channel_new: |
| 837 | * @channel: the #AgsChannel |
| 838 | * |
| 839 | * Create a new instance of #AgsFxAnalyseChannel |
| 840 | * |
| 841 | * Returns: the new #AgsFxAnalyseChannel |
| 842 | * |
| 843 | * Since: 3.3.0 |
| 844 | */ |
| 845 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel#* |
| 846 | ags_fx_analyse_channel_newcxx . . $ ags_fx_analyse_channel_new(5ca3ebe2e39d506c).(AgsChannelcxx . . $ AgsChannel# *channel) |
| 847 | { |
| 848 | AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *fx_analyse_channel; |
| 849 | |
| 850 | fx_analyse_channel = (AgsFxAnalyseChannelcxx . . $ AgsFxAnalyseChannel# *) g_object_newcxx . . $ g_object_new(8485fe61b4be4c78).(AGS_TYPE_FX_ANALYSE_CHANNELcxx . . $ `ags/audio/fx/ags_fx_analyse_channel.h:36:9`!, |
| 851 | "source", channel, |
| 852 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 853 | |
| 854 | return(fx_analyse_channel); |
| 855 | } |