ref: be3a483d03c798835baa67735cfbbfbc6dda90f0
parent: 0ea58225b89ddcb1e38e57b350df2ea4ccb7ed7b
author: rrt <rrt>
date: Wed Dec 27 10:31:25 EST 2006
Add a "delete" method to effects. For now, set all of them to st_effect_nothing.
--- a/src/avg.c
+++ b/src/avg.c
@@ -567,7 +567,8 @@
st_avg_start,
st_avg_flow,
st_effect_nothing_drain,
- st_avg_stop
+ st_avg_stop,
+st_effect_nothing
};
static st_effect_t st_pick_effect = {
@@ -578,7 +579,8 @@
st_avg_start,
st_avg_flow,
st_effect_nothing_drain,
- st_avg_stop
+ st_avg_stop,
+st_effect_nothing
};
const st_effect_t *st_avg_effect_fn(void)
--- a/src/band.c
+++ b/src/band.c
@@ -175,7 +175,8 @@
st_band_start,
st_band_flow,
st_effect_nothing_drain,
- st_band_stop
+ st_band_stop,
+st_effect_nothing
};
const st_effect_t *st_band_effect_fn(void)
--- a/src/chorus.c
+++ b/src/chorus.c
@@ -347,7 +347,8 @@
st_chorus_start,
st_chorus_flow,
st_chorus_drain,
- st_chorus_stop
+ st_chorus_stop,
+st_effect_nothing
};
const st_effect_t *st_chorus_effect_fn(void)
--- a/src/compand.c
+++ b/src/compand.c
@@ -401,7 +401,8 @@
st_compand_start,
st_compand_flow,
st_compand_drain,
- st_compand_stop
+ st_compand_stop,
+st_effect_nothing
};
const st_effect_t *st_compand_effect_fn(void)
--- a/src/dcshift.c
+++ b/src/dcshift.c
@@ -204,7 +204,8 @@
st_dcshift_start,
st_dcshift_flow,
st_effect_nothing_drain,
- st_dcshift_stop
+ st_dcshift_stop,
+st_effect_nothing
};
const st_effect_t *st_dcshift_effect_fn(void)
--- a/src/earwax.c
+++ b/src/earwax.c
@@ -174,7 +174,8 @@
st_earwax_start,
st_earwax_flow,
st_earwax_drain,
- st_earwax_stop
+ st_earwax_stop,
+st_effect_nothing
};
const st_effect_t *st_earwax_effect_fn(void)
--- a/src/echo.c
+++ b/src/echo.c
@@ -274,7 +274,8 @@
st_echo_start,
st_echo_flow,
st_echo_drain,
- st_echo_stop
+ st_echo_stop,
+st_effect_nothing
};
const st_effect_t *st_echo_effect_fn(void)
--- a/src/echos.c
+++ b/src/echos.c
@@ -278,7 +278,8 @@
st_echos_start,
st_echos_flow,
st_echos_drain,
- st_echos_stop
+ st_echos_stop,
+st_effect_nothing
};
const st_effect_t *st_echos_effect_fn(void)
--- a/src/fade.c
+++ b/src/fade.c
@@ -383,7 +383,8 @@
st_fade_start,
st_fade_flow,
st_fade_drain,
- st_fade_stop
+ st_fade_stop,
+st_effect_nothing
};
const st_effect_t *st_fade_effect_fn(void)
--- a/src/filter.c
+++ b/src/filter.c
@@ -318,7 +318,8 @@
st_filter_start,
st_filter_flow,
st_filter_drain,
- st_filter_stop
+ st_filter_stop,
+st_effect_nothing
};
const st_effect_t *st_filter_effect_fn(void)
--- a/src/flanger.c
+++ b/src/flanger.c
@@ -303,7 +303,8 @@
st_flanger_start,
st_flanger_flow,
st_effect_nothing_drain,
- st_flanger_stop
+ st_flanger_stop,
+st_effect_nothing
};
--- a/src/lua.c
+++ b/src/lua.c
@@ -272,7 +272,8 @@
st_lua_start,
st_lua_flow,
st_lua_drain,
- st_lua_stop
+ st_lua_stop,
+st_effect_nothing
};
/*
--- a/src/mcompand.c
+++ b/src/mcompand.c
@@ -687,7 +687,8 @@
st_mcompand_start,
st_mcompand_flow,
st_mcompand_drain,
- st_mcompand_stop
+ st_mcompand_stop,
+st_effect_nothing
};
const st_effect_t *st_mcompand_effect_fn(void)
--- a/src/noiseprof.c
+++ b/src/noiseprof.c
@@ -215,7 +215,8 @@
st_noiseprof_start,
st_noiseprof_flow,
st_noiseprof_drain,
- st_noiseprof_stop
+ st_noiseprof_stop,
+st_effect_nothing
};
const st_effect_t *st_noiseprof_effect_fn(void)
--- a/src/noisered.c
+++ b/src/noisered.c
@@ -332,7 +332,8 @@
st_noisered_start,
st_noisered_flow,
st_noisered_drain,
- st_noisered_stop
+ st_noisered_stop,
+st_effect_nothing
};
const st_effect_t *st_noisered_effect_fn(void)
--- a/src/pad.c
+++ b/src/pad.c
@@ -126,7 +126,8 @@
st_pad_start,
st_pad_flow,
st_pad_drain,
- st_pad_stop
+ st_pad_stop,
+st_effect_nothing
};
const st_effect_t *st_pad_effect_fn(void)
--- a/src/phaser.c
+++ b/src/phaser.c
@@ -270,7 +270,8 @@
st_phaser_start,
st_phaser_flow,
st_phaser_drain,
- st_phaser_stop
+ st_phaser_stop,
+st_effect_nothing
};
const st_effect_t *st_phaser_effect_fn(void)
--- a/src/pitch.c
+++ b/src/pitch.c
@@ -584,7 +584,8 @@
st_pitch_start,
st_pitch_flow,
st_pitch_drain,
- st_pitch_stop
+ st_pitch_stop,
+st_effect_nothing
};
const st_effect_t *st_pitch_effect_fn(void)
--- a/src/polyphas.c
+++ b/src/polyphas.c
@@ -662,7 +662,8 @@
st_poly_start,
st_poly_flow,
st_poly_drain,
- st_poly_stop
+ st_poly_stop,
+st_effect_nothing
};
const st_effect_t *st_polyphase_effect_fn(void)
--- a/src/rabbit.c
+++ b/src/rabbit.c
@@ -199,7 +199,8 @@
st_rabbit_start,
st_rabbit_flow,
st_rabbit_drain,
- st_rabbit_stop
+ st_rabbit_stop,
+st_effect_nothing
};
const st_effect_t *st_rabbit_effect_fn(void)
--- a/src/rate.c
+++ b/src/rate.c
@@ -22,7 +22,8 @@
st_resample_start,
st_resample_flow,
st_resample_drain,
- st_resample_stop
+ st_resample_stop,
+st_effect_nothing
};
const st_effect_t *st_rate_effect_fn(void)
--- a/src/repeat.c
+++ b/src/repeat.c
@@ -207,7 +207,8 @@
st_repeat_start,
st_repeat_flow,
st_repeat_drain,
- st_repeat_stop
+ st_repeat_stop,
+st_effect_nothing
};
const st_effect_t *st_repeat_effect_fn(void)
--- a/src/resample.c
+++ b/src/resample.c
@@ -728,7 +728,8 @@
st_resample_start,
st_resample_flow,
st_resample_drain,
- st_resample_stop
+ st_resample_stop,
+st_effect_nothing
};
const st_effect_t *st_resample_effect_fn(void)
--- a/src/reverb.c
+++ b/src/reverb.c
@@ -292,7 +292,8 @@
st_reverb_start,
st_reverb_flow,
st_reverb_drain,
- st_reverb_stop
+ st_reverb_stop,
+st_effect_nothing
};
const st_effect_t *st_reverb_effect_fn(void)
--- a/src/reverse.c
+++ b/src/reverse.c
@@ -139,7 +139,8 @@
st_reverse_start,
st_reverse_flow,
st_reverse_drain,
- st_reverse_stop
+ st_reverse_stop,
+st_effect_nothing
};
const st_effect_t *st_reverse_effect_fn(void)
--- a/src/silence.c
+++ b/src/silence.c
@@ -664,7 +664,8 @@
st_silence_start,
st_silence_flow,
st_silence_drain,
- st_silence_stop
+ st_silence_stop,
+st_effect_nothing
};
const st_effect_t *st_silence_effect_fn(void)
--- a/src/skeleff.c
+++ b/src/skeleff.c
@@ -111,7 +111,6 @@
/*
* Do anything required when you stop reading samples.
- * (free allocated memory, etc.)
* If there's nothing to do, use st_effect_nothing instead.
*/
static int st_skeleff_stop(eff_t effp)
@@ -119,7 +118,17 @@
return ST_SUCCESS;
}
+/*
+ * Do anything required when you delete an effect.
+ * (free allocated memory, etc.)
+ * If there's nothing to do, use st_effect_nothing instead.
+ */
+static int st_skeleff_delete(eff_t effp)
+{
+ return ST_SUCCESS;
+}
+
/*
* Effect descriptor.
* If one of the methods does nothing, use the relevant
@@ -133,7 +142,8 @@
st_skel_start,
st_skel_flow,
st_skel_drain,
- st_skel_stop
+ st_skel_stop,
+ st_skel_delete,
};
/*
--- a/src/sox.c
+++ b/src/sox.c
@@ -1443,9 +1443,11 @@
st_size_t clippedCount;
(*efftab[e].h->stop)(&efftab[e]);
clippedCount = efftab[e].clippedCount;
+ (*efftab[e].h->delete)(&efftab[e]);
if (efftabR[e].name) {
- (* efftabR[e].h->stop)(&efftabR[e]);
+ (*efftabR[e].h->stop)(&efftabR[e]);
clippedCount += efftab[e].clippedCount;
+ (*efftabR[e].h->delete)(&efftabR[e]);
}
if (clippedCount != 0)
st_warn("%s clipped %u samples; decrease volume?", efftab[e].name,
--- a/src/st.h
+++ b/src/st.h
@@ -352,8 +352,8 @@
typedef struct
{
- char const * name; /* effect name */
- char const * usage;
+ char const *name; /* effect name */
+ char const *usage;
unsigned int flags;
int (*getopts)(eff_t effp, int argc, char *argv[]);
@@ -362,11 +362,12 @@
st_size_t *isamp, st_size_t *osamp);
int (*drain)(eff_t effp, st_sample_t *obuf, st_size_t *osamp);
int (*stop)(eff_t effp);
+ int (*delete)(eff_t effp);
} st_effect_t;
struct st_effect
{
- char const * name; /* effect name */
+ char const *name; /* effect name */
struct st_globalinfo * globalinfo;/* global ST parameters */
struct st_signalinfo ininfo; /* input signal specifications */
struct st_signalinfo outinfo; /* output signal specifications */
--- a/src/stat.c
+++ b/src/stat.c
@@ -326,7 +326,8 @@
st_stat_start,
st_stat_flow,
st_stat_drain,
- st_stat_stop
+ st_stat_stop,
+st_effect_nothing
};
const st_effect_t *st_stat_effect_fn(void)
--- a/src/stretch.c
+++ b/src/stretch.c
@@ -398,7 +398,8 @@
st_stretch_start,
st_stretch_flow,
st_stretch_drain,
- st_stretch_stop
+ st_stretch_stop,
+st_effect_nothing
};
const st_effect_t *st_stretch_effect_fn(void)
--- a/src/trim.c
+++ b/src/trim.c
@@ -201,7 +201,8 @@
st_trim_start,
st_trim_flow,
st_effect_nothing_drain,
- st_trim_stop
+ st_trim_stop,
+st_effect_nothing
};
const st_effect_t *st_trim_effect_fn(void)
--- a/src/vol.c
+++ b/src/vol.c
@@ -205,7 +205,8 @@
st_vol_start,
st_vol_flow,
st_effect_nothing_drain,
- st_vol_stop
+ st_vol_stop,
+st_effect_nothing
};
const st_effect_t *st_vol_effect_fn(void)