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
|
/* BSE - Better Sound Engine -*-mode: c;-*-
* Copyright (C) 2002-2003 Tim Janik
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* A copy of the GNU Lesser General Public License should ship along
* with this library; if not, see http://www.gnu.org/copyleft/.
*/
#include <bse/bseplugin.h>
#include <bse/bsewaveosc.h>
#include <bse/bseprocedure.h>
#include <bse/bseeditablesample.h>
AUTHORS = "Tim Janik <timj@gtk.org>";
LICENSE = "GNU Lesser General Public License";
METHOD (BseWaveOsc, request-pcm-position) {
HELP = "Request emission of the ::notify_pcm_position signal.";
IN = bse_param_spec_object ("wosc", NULL, "Wave Oscilator",
BSE_TYPE_WAVE_OSC, SFI_PARAM_STANDARD);
} BODY (BseProcedureClass *proc,
const GValue *in_values,
GValue *out_values)
{
/* extract parameter values */
BseWaveOsc *self = bse_value_get_object (in_values++);
/* check parameters */
if (!BSE_IS_WAVE_OSC (self))
return BSE_ERROR_PROC_PARAM_INVAL;
bse_wave_osc_request_pcm_position (self);
return BSE_ERROR_NONE;
}
PROCEDURE (bse-wave-osc-mass-seek-perc, "Seek Wave Oscillators") {
HELP = "Seek a list of wave oscillators to a pcm position given in percentage. The oscillators will seek to the given position syncronously.";
IN = bse_param_spec_boxed ("wosc-seq", "Wave Oscilators", NULL, BSE_TYPE_ITEM_SEQ, SFI_PARAM_STANDARD); // FIXME: using BseItemSeq because BseWaveOscSeq requires idl+C++
IN = sfi_pspec_real ("pos_perc", NULL, NULL,
0, 0, 100, 1,
SFI_PARAM_STANDARD);
} BODY (BseProcedureClass *proc,
const GValue *in_values,
GValue *out_values)
{
/* extract parameter values */
BseItemSeq *iseq = bse_value_get_boxed (in_values++);
gfloat pos = sfi_value_get_real (in_values++);
guint i, n = iseq ? iseq->n_items : 0;
BseWaveOsc **woscs = g_alloca (sizeof (BseWaveOsc*) * n);
for (i = 0; i < n; i++)
if (!BSE_IS_WAVE_OSC (iseq->items[i])) /* check parameters */
return BSE_ERROR_PROC_PARAM_INVAL;
else
woscs[i] = (BseWaveOsc*) iseq->items[i];
if (n)
bse_wave_osc_mass_seek (n, woscs, pos);
return BSE_ERROR_NONE;
}
METHOD (BseWaveOsc, set-from-editable-sample) {
HELP = "Set wave to play from editable sample, bypassing undo and storage mechanisms.";
IN = bse_param_spec_object ("wosc", NULL, "Wave Oscilator",
BSE_TYPE_WAVE_OSC, SFI_PARAM_STANDARD);
IN = bse_param_spec_object ("esample", NULL, "Editable Sample",
BSE_TYPE_EDITABLE_SAMPLE, SFI_PARAM_STANDARD);
} BODY (BseProcedureClass *proc,
const GValue *in_values,
GValue *out_values)
{
/* extract parameter values */
BseWaveOsc *self = bse_value_get_object (in_values++);
BseEditableSample *esample = bse_value_get_object (in_values++);
/* check parameters */
if (!BSE_IS_WAVE_OSC (self))
return BSE_ERROR_PROC_PARAM_INVAL;
bse_wave_osc_set_from_esample (self, esample);
return BSE_ERROR_NONE;
}
|