From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../effects/synth_stereo_pitch_shift_impl.cc | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 arts/modules/effects/synth_stereo_pitch_shift_impl.cc (limited to 'arts/modules/effects/synth_stereo_pitch_shift_impl.cc') diff --git a/arts/modules/effects/synth_stereo_pitch_shift_impl.cc b/arts/modules/effects/synth_stereo_pitch_shift_impl.cc new file mode 100644 index 00000000..fbf7bb07 --- /dev/null +++ b/arts/modules/effects/synth_stereo_pitch_shift_impl.cc @@ -0,0 +1,51 @@ +#include "flowsystem.h" +#include "artsmoduleseffects.h" +#include "stdsynthmodule.h" + +#include + +using namespace Arts; + +class Synth_STEREO_PITCH_SHIFT_impl : virtual public Synth_STEREO_PITCH_SHIFT_skel, + virtual public StdSynthModule +{ +protected: + Synth_PITCH_SHIFT leftPitchShift, rightPitchShift; + +public: + float speed() { return leftPitchShift.speed(); } + void speed(float newSpeed) + { + leftPitchShift.speed(newSpeed); + rightPitchShift.speed(newSpeed); + } + + float frequency() { return leftPitchShift.frequency(); } + void frequency(float newFrequency) + { + leftPitchShift.frequency(newFrequency); + rightPitchShift.frequency(newFrequency); + } + + void streamStart() + { + leftPitchShift.start(); + rightPitchShift.start(); + _node()->virtualize("inleft",leftPitchShift._node(),"invalue"); + _node()->virtualize("outleft",leftPitchShift._node(),"outvalue"); + _node()->virtualize("inright",rightPitchShift._node(),"invalue"); + _node()->virtualize("outright",rightPitchShift._node(),"outvalue"); + } + + void streamEnd() + { + _node()->devirtualize("inleft",leftPitchShift._node(),"invalue"); + _node()->devirtualize("outleft",leftPitchShift._node(),"outvalue"); + _node()->devirtualize("inright",rightPitchShift._node(),"invalue"); + _node()->devirtualize("outright",rightPitchShift._node(),"outvalue"); + leftPitchShift.stop(); + rightPitchShift.stop(); + } +}; + +REGISTER_IMPLEMENTATION(Synth_STEREO_PITCH_SHIFT_impl); -- cgit v1.2.1