From fce86b22a2367f1be1f9aae5e1ba3d18d1371b74 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 8 Dec 2020 22:26:17 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro --- arts/modules/effects/CMakeLists.txt | 20 +- arts/modules/effects/Makefile.am | 22 +- arts/modules/effects/artsmoduleseffects.idl | 2 +- arts/modules/effects/effect_wavecapture_impl.cc | 61 ------ arts/modules/effects/effect_wavecapture_impl.cpp | 61 ++++++ arts/modules/effects/fivebandmonocomplexeq_impl.cc | 208 ------------------- .../modules/effects/fivebandmonocomplexeq_impl.cpp | 208 +++++++++++++++++++ arts/modules/effects/freeverb/allpass.cpp | 2 +- arts/modules/effects/freeverb/allpass.h | 48 +++++ arts/modules/effects/freeverb/allpass.hpp | 48 ----- arts/modules/effects/freeverb/comb.cpp | 2 +- arts/modules/effects/freeverb/comb.h | 55 +++++ arts/modules/effects/freeverb/comb.hpp | 55 ----- arts/modules/effects/freeverb/revmodel.cpp | 2 +- arts/modules/effects/freeverb/revmodel.h | 87 ++++++++ arts/modules/effects/freeverb/revmodel.hpp | 87 -------- arts/modules/effects/freeverbguifactory_impl.cc | 107 ---------- arts/modules/effects/freeverbguifactory_impl.cpp | 107 ++++++++++ arts/modules/effects/monostereoconversion_impl.cc | 160 --------------- arts/modules/effects/monostereoconversion_impl.cpp | 160 +++++++++++++++ .../effects/stereocompressorguifactory_impl.cc | 111 ----------- .../effects/stereocompressorguifactory_impl.cpp | 111 +++++++++++ arts/modules/effects/synth_freeverb_impl.cc | 84 -------- arts/modules/effects/synth_freeverb_impl.cpp | 84 ++++++++ .../effects/synth_stereo_compressor_impl.cc | 132 ------------ .../effects/synth_stereo_compressor_impl.cpp | 132 ++++++++++++ .../effects/synth_stereo_fir_equalizer_impl.cc | 221 --------------------- .../effects/synth_stereo_fir_equalizer_impl.cpp | 221 +++++++++++++++++++++ .../effects/synth_stereo_pitch_shift_fft_impl.cc | 63 ------ .../effects/synth_stereo_pitch_shift_fft_impl.cpp | 63 ++++++ .../effects/synth_stereo_pitch_shift_impl.cc | 51 ----- .../effects/synth_stereo_pitch_shift_impl.cpp | 51 +++++ arts/modules/effects/synth_voice_removal_impl.cc | 106 ---------- arts/modules/effects/synth_voice_removal_impl.cpp | 106 ++++++++++ .../modules/effects/voiceremovalguifactory_impl.cc | 74 ------- .../effects/voiceremovalguifactory_impl.cpp | 74 +++++++ 36 files changed, 1593 insertions(+), 1593 deletions(-) delete mode 100644 arts/modules/effects/effect_wavecapture_impl.cc create mode 100644 arts/modules/effects/effect_wavecapture_impl.cpp delete mode 100644 arts/modules/effects/fivebandmonocomplexeq_impl.cc create mode 100644 arts/modules/effects/fivebandmonocomplexeq_impl.cpp create mode 100644 arts/modules/effects/freeverb/allpass.h delete mode 100644 arts/modules/effects/freeverb/allpass.hpp create mode 100644 arts/modules/effects/freeverb/comb.h delete mode 100644 arts/modules/effects/freeverb/comb.hpp create mode 100644 arts/modules/effects/freeverb/revmodel.h delete mode 100644 arts/modules/effects/freeverb/revmodel.hpp delete mode 100644 arts/modules/effects/freeverbguifactory_impl.cc create mode 100644 arts/modules/effects/freeverbguifactory_impl.cpp delete mode 100644 arts/modules/effects/monostereoconversion_impl.cc create mode 100644 arts/modules/effects/monostereoconversion_impl.cpp delete mode 100644 arts/modules/effects/stereocompressorguifactory_impl.cc create mode 100644 arts/modules/effects/stereocompressorguifactory_impl.cpp delete mode 100644 arts/modules/effects/synth_freeverb_impl.cc create mode 100644 arts/modules/effects/synth_freeverb_impl.cpp delete mode 100644 arts/modules/effects/synth_stereo_compressor_impl.cc create mode 100644 arts/modules/effects/synth_stereo_compressor_impl.cpp delete mode 100644 arts/modules/effects/synth_stereo_fir_equalizer_impl.cc create mode 100644 arts/modules/effects/synth_stereo_fir_equalizer_impl.cpp delete mode 100644 arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cc create mode 100644 arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cpp delete mode 100644 arts/modules/effects/synth_stereo_pitch_shift_impl.cc create mode 100644 arts/modules/effects/synth_stereo_pitch_shift_impl.cpp delete mode 100644 arts/modules/effects/synth_voice_removal_impl.cc create mode 100644 arts/modules/effects/synth_voice_removal_impl.cpp delete mode 100644 arts/modules/effects/voiceremovalguifactory_impl.cc create mode 100644 arts/modules/effects/voiceremovalguifactory_impl.cpp (limited to 'arts/modules/effects') diff --git a/arts/modules/effects/CMakeLists.txt b/arts/modules/effects/CMakeLists.txt index 58c847d9..a5136f08 100644 --- a/arts/modules/effects/CMakeLists.txt +++ b/arts/modules/effects/CMakeLists.txt @@ -38,15 +38,15 @@ link_directories( tde_add_library( artsmoduleseffects SHARED AUTOMOC SOURCES - artsmoduleseffects.cc - fivebandmonocomplexeq_impl.cc - monostereoconversion_impl.cc - synth_stereo_pitch_shift_impl.cc synth_stereo_pitch_shift_fft_impl.cc - synth_voice_removal_impl.cc voiceremovalguifactory_impl.cc - synth_stereo_compressor_impl.cc stereocompressorguifactory_impl.cc - synth_stereo_fir_equalizer_impl.cc - synth_freeverb_impl.cc freeverbguifactory_impl.cc - effect_wavecapture_impl.cc + artsmoduleseffects.cpp + fivebandmonocomplexeq_impl.cpp + monostereoconversion_impl.cpp + synth_stereo_pitch_shift_impl.cpp synth_stereo_pitch_shift_fft_impl.cpp + synth_voice_removal_impl.cpp voiceremovalguifactory_impl.cpp + synth_stereo_compressor_impl.cpp stereocompressorguifactory_impl.cpp + synth_stereo_fir_equalizer_impl.cpp + synth_freeverb_impl.cpp freeverbguifactory_impl.cpp + effect_wavecapture_impl.cpp kstereovolumecontrolgui_impl.cpp stereovolumecontrolguifactory_impl.cpp VERSION 0.0.0 EMBED @@ -60,7 +60,7 @@ tde_add_library( artsmoduleseffects SHARED AUTOMOC add_custom_command( OUTPUT - artsmoduleseffects.cc artsmoduleseffects.h + artsmoduleseffects.cpp artsmoduleseffects.h artsmoduleseffects.mcopclass artsmoduleseffects.mcoptype COMMAND ${ARTS_MCOPIDL_EXECUTABLE} -t -I${CMAKE_SOURCE_DIR}/arts/gui/common diff --git a/arts/modules/effects/Makefile.am b/arts/modules/effects/Makefile.am index d5d54aad..a2c3f31f 100644 --- a/arts/modules/effects/Makefile.am +++ b/arts/modules/effects/Makefile.am @@ -20,15 +20,15 @@ INCLUDES = \ lib_LTLIBRARIES = libartsmoduleseffects.la -libartsmoduleseffects_la_SOURCES = artsmoduleseffects.cc \ - fivebandmonocomplexeq_impl.cc \ - monostereoconversion_impl.cc \ - synth_stereo_pitch_shift_impl.cc synth_stereo_pitch_shift_fft_impl.cc \ - synth_voice_removal_impl.cc voiceremovalguifactory_impl.cc \ - synth_stereo_compressor_impl.cc stereocompressorguifactory_impl.cc \ - synth_stereo_fir_equalizer_impl.cc \ - synth_freeverb_impl.cc freeverbguifactory_impl.cc \ - effect_wavecapture_impl.cc \ +libartsmoduleseffects_la_SOURCES = artsmoduleseffects.cpp \ + fivebandmonocomplexeq_impl.cpp \ + monostereoconversion_impl.cpp \ + synth_stereo_pitch_shift_impl.cpp synth_stereo_pitch_shift_fft_impl.cpp \ + synth_voice_removal_impl.cpp voiceremovalguifactory_impl.cpp \ + synth_stereo_compressor_impl.cpp stereocompressorguifactory_impl.cpp \ + synth_stereo_fir_equalizer_impl.cpp \ + synth_freeverb_impl.cpp freeverbguifactory_impl.cpp \ + effect_wavecapture_impl.cpp \ kstereovolumecontrolgui_impl.cpp stereovolumecontrolguifactory_impl.cpp libartsmoduleseffects_la_COMPILE_FIRST = ../../gui/common/artsgui.h \ ../common/artsmodulescommon.h ../../midi/artsmidi.h ../synth/artsmodulessynth.h \ @@ -44,10 +44,10 @@ libartsmoduleseffects_la_LDFLAGS = $(all_libraries) -L$(arts_libraries) -no-unde METASOURCES=AUTO -artsmoduleseffects.cc artsmoduleseffects.h artsmoduleseffects.mcoptype artsmoduleseffects.mcopclass: $(srcdir)/artsmoduleseffects.idl $(MCOPIDL) +artsmoduleseffects.cpp artsmoduleseffects.h artsmoduleseffects.mcoptype artsmoduleseffects.mcopclass: $(srcdir)/artsmoduleseffects.idl $(MCOPIDL) $(MCOPIDL) -t $(INCLUDES) $(srcdir)/artsmoduleseffects.idl -DISTCLEANFILES= artsmoduleseffects.cc artsmoduleseffects.h artsmoduleseffects.mcop* +DISTCLEANFILES= artsmoduleseffects.cpp artsmoduleseffects.h artsmoduleseffects.mcop* artsincludedir = $(includedir)/arts artsinclude_HEADERS = artsmoduleseffects.h artsmoduleseffects.idl diff --git a/arts/modules/effects/artsmoduleseffects.idl b/arts/modules/effects/artsmoduleseffects.idl index 13e978d9..9d7cd871 100644 --- a/arts/modules/effects/artsmoduleseffects.idl +++ b/arts/modules/effects/artsmoduleseffects.idl @@ -18,7 +18,7 @@ */ /* - * DISCLAIMER: The interfaces in envmixer.idl (and the derived .cc/.h files) + * DISCLAIMER: The interfaces in envmixer.idl (and the derived .cpp/.h files) * DO NOT GUARANTEE BINARY COMPATIBILITY YET. * * They are intended for developers. You shouldn't expect that applications in diff --git a/arts/modules/effects/effect_wavecapture_impl.cc b/arts/modules/effects/effect_wavecapture_impl.cc deleted file mode 100644 index 639307a8..00000000 --- a/arts/modules/effects/effect_wavecapture_impl.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2001 Matthias Kretz - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -/* $Id$ */ - -#include "artsmoduleseffects.h" -#include -#include - -using namespace std; -namespace Arts { - -class Effect_WAVECAPTURE_impl : virtual public Effect_WAVECAPTURE_skel, - virtual public StdSynthModule -{ -protected: - Synth_CAPTURE_WAV _capture; - -public: - void streamStart(); - void streamEnd(); - string filename() { return _capture.filename(); } - void filename( const string &newFilename ) { _capture.filename( newFilename ); } -}; - -void Effect_WAVECAPTURE_impl::streamStart() -{ - _capture.start(); - _node()->virtualize("inleft",_capture._node(),"left"); - _node()->virtualize("inright",_capture._node(),"right"); - _node()->virtualize("outleft",_node(),"inleft"); - _node()->virtualize("outright",_node(),"inright"); -} - -void Effect_WAVECAPTURE_impl::streamEnd() -{ - _node()->devirtualize("inleft",_capture._node(),"left"); - _node()->devirtualize("inright",_capture._node(),"right"); - _node()->devirtualize("outleft",_node(),"inleft"); - _node()->devirtualize("outright",_node(),"inright"); - _capture.stop(); -} - -REGISTER_IMPLEMENTATION(Effect_WAVECAPTURE_impl); - -} diff --git a/arts/modules/effects/effect_wavecapture_impl.cpp b/arts/modules/effects/effect_wavecapture_impl.cpp new file mode 100644 index 00000000..639307a8 --- /dev/null +++ b/arts/modules/effects/effect_wavecapture_impl.cpp @@ -0,0 +1,61 @@ +/* + Copyright (C) 2001 Matthias Kretz + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +/* $Id$ */ + +#include "artsmoduleseffects.h" +#include +#include + +using namespace std; +namespace Arts { + +class Effect_WAVECAPTURE_impl : virtual public Effect_WAVECAPTURE_skel, + virtual public StdSynthModule +{ +protected: + Synth_CAPTURE_WAV _capture; + +public: + void streamStart(); + void streamEnd(); + string filename() { return _capture.filename(); } + void filename( const string &newFilename ) { _capture.filename( newFilename ); } +}; + +void Effect_WAVECAPTURE_impl::streamStart() +{ + _capture.start(); + _node()->virtualize("inleft",_capture._node(),"left"); + _node()->virtualize("inright",_capture._node(),"right"); + _node()->virtualize("outleft",_node(),"inleft"); + _node()->virtualize("outright",_node(),"inright"); +} + +void Effect_WAVECAPTURE_impl::streamEnd() +{ + _node()->devirtualize("inleft",_capture._node(),"left"); + _node()->devirtualize("inright",_capture._node(),"right"); + _node()->devirtualize("outleft",_node(),"inleft"); + _node()->devirtualize("outright",_node(),"inright"); + _capture.stop(); +} + +REGISTER_IMPLEMENTATION(Effect_WAVECAPTURE_impl); + +} diff --git a/arts/modules/effects/fivebandmonocomplexeq_impl.cc b/arts/modules/effects/fivebandmonocomplexeq_impl.cc deleted file mode 100644 index 59d0ef44..00000000 --- a/arts/modules/effects/fivebandmonocomplexeq_impl.cc +++ /dev/null @@ -1,208 +0,0 @@ -/* - - Copyright ( C ) 2002 Arnold Krille - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace Arts { - -class FiveBandMonoComplexEQ_impl : virtual public FiveBandMonoComplexEQ_skel, - virtual public StdSynthModule -{ -private: - Arts::StereoToMono _s2m; - Arts::MonoToStereo _m2s; - Arts::Synth_STD_EQUALIZER _low, _mid1, _mid2, _mid3, _high; -public: - FiveBandMonoComplexEQ_impl() {} - - Arts::StereoToMono s2m() { return _s2m; } - Arts::MonoToStereo m2s() { return _m2s; } - - float lowfreq() { return _low.frequency(); } - void lowfreq( float n ) { _low.frequency( n ); }; - float lowq() { return _low.q(); } - void lowq( float n ) { _low.q( n ); }; - float lowgain() { return _low.low(); } - void lowgain( float n ) { _low.low( n ); }; - - float mid1freq() { return _mid1.frequency(); } - void mid1freq( float n ) { _mid1.frequency( n ); }; - float mid1q() { return _mid1.q(); } - void mid1q( float n ) { _mid1.q( n ); }; - float mid1gain() { return _mid1.mid(); } - void mid1gain( float n ) { _mid1.mid( n ); }; - - float mid2freq() { return _mid2.frequency(); } - void mid2freq( float n ) { _mid2.frequency( n ); }; - float mid2q() { return _mid2.q(); } - void mid2q( float n ) { _mid2.q( n ); }; - float mid2gain() { return _mid2.mid(); } - void mid2gain( float n ) { _mid2.mid( n ); }; - - float mid3freq() { return _mid3.frequency(); } - void mid3freq( float n ) { _mid3.frequency( n ); }; - float mid3q() { return _mid3.q(); } - void mid3q( float n ) { _mid3.q( n ); }; - float mid3gain() { return _mid3.mid(); } - void mid3gain( float n ) { _mid3.mid( n ); }; - - float highfreq() { return _high.frequency(); } - void highfreq( float n ) { _high.frequency( n ); }; - float highq() { return _high.q(); } - void highq( float n ) { _high.q( n ); }; - float highgain() { return _high.high(); } - void highgain( float n ) { _high.high( n ); }; - - void streamInit() - { - _s2m.start(); _low.start(); _mid1.start(); _mid2.start(); _mid3.start(); _high.start(); _m2s.start(); - - _node()->virtualize( "inleft", _s2m._node(), "inleft" ); - _node()->virtualize( "inright", _s2m._node(), "inright" ); - connect( _s2m, "outmono", _low, "invalue" ); - connect( _low, "outvalue", _mid1, "invalue" ); - connect( _mid1, "outvalue", _mid2, "invalue" ); - connect( _mid2, "outvalue", _mid3, "invalue" ); - connect( _mid3, "outvalue", _high, "invalue" ); - connect( _high, "outvalue", _m2s, "inmono" ); - _node()->virtualize( "outleft", _m2s._node(), "outleft" ); - _node()->virtualize( "outright", _m2s._node(), "outright" ); - } -}; -REGISTER_IMPLEMENTATION( FiveBandMonoComplexEQ_impl ); - -class FiveBandMonoComplexEQGuiFactory_impl : virtual public FiveBandMonoComplexEQGuiFactory_skel -{ -public: - Arts::Widget createGui( Arts::Object object ) - { - TDEGlobal::locale()->insertCatalogue( "artsmodules" ); - - arts_return_val_if_fail( !object.isNull(), Arts::Widget::null() ); - FiveBandMonoComplexEQ ch = DynamicCast( object ); - arts_return_val_if_fail( !ch.isNull(), Arts::Widget::null() ); - - Arts::LayoutBox hbox; - hbox.direction( Arts::LeftToRight ); - hbox.layoutmargin( 5 ); hbox.spacing( 5 ); - - Arts::Poti lowgain; lowgain.caption( i18n( "Low Gain" ).utf8().data() ); - lowgain.min( -24 ); lowgain.max( 24 ); - lowgain.value( ch.lowgain() ); connect( lowgain, "value_changed", ch, "lowgain" ); - hbox.addWidget( lowgain ); - PopupBox low; - low.height( 100 ); low.direction( LeftToRight ); - hbox.addWidget( low ); - Arts::VBox lowbox; low.widget( lowbox ); - Arts::Poti lowfreq; lowfreq.color( "grey" ); lowfreq.caption( i18n( "Low Freq" ).utf8().data() ); - lowfreq.min( 20 ); lowfreq.max( 1000 ); - lowfreq.value( ch.lowfreq() ); connect( lowfreq, "value_changed", ch, "lowfreq" ); - lowfreq.parent( lowbox ); lowbox._addChild( lowfreq , "" ); - Arts::Poti lowq; lowq.color( "grey" ); lowq.caption( i18n( "Low Q" ).utf8().data() ); - lowq.min( 0.01 ); lowq.max( 10 ); - lowq.value( ch.lowq() ); connect( lowq, "value_changed", ch, "lowq" ); - lowq.parent( lowbox ); lowbox._addChild( lowq , "" ); - - Arts::Poti mid1gain; mid1gain.caption( i18n( "Mid1 Gain" ).utf8().data() ); - mid1gain.min( -24 ); mid1gain.max( 24 ); - mid1gain.value( ch.mid1gain() ); connect( mid1gain, "value_changed", ch, "mid1gain" ); - hbox.addWidget( mid1gain ); - PopupBox mid1; - mid1.height( 100 ); mid1.direction( LeftToRight ); - hbox.addWidget( mid1 ); - Arts::VBox mid1box; mid1.widget( mid1box ); - Arts::Poti mid1freq; mid1freq.color( "grey" ); mid1freq.caption( i18n( "Mid1 Freq" ).utf8().data() ); - mid1freq.min( 20 ); mid1freq.max( 5000 ); - mid1freq.value( ch.mid1freq() ); connect( mid1freq, "value_changed", ch, "mid1freq" ); - mid1freq.parent( mid1box ); mid1box._addChild( mid1freq , "" ); - Arts::Poti mid1q; mid1q.color( "grey" ); mid1q.caption( i18n( "Mid1 Q" ).utf8().data() ); - mid1q.min( 0.01 ); mid1q.max( 10 ); - mid1q.value( ch.mid1q() ); connect( mid1q, "value_changed", ch, "mid1q" ); - mid1q.parent( mid1box ); mid1box._addChild( mid1q , "" ); - - Arts::Poti mid2gain; mid2gain.caption( i18n( "Mid2 Gain" ).utf8().data() ); - mid2gain.min( -24 ); mid2gain.max( 24 ); - mid2gain.value( ch.mid2gain() ); connect( mid2gain, "value_changed", ch, "mid2gain" ); - hbox.addWidget( mid2gain ); - PopupBox mid2; - mid2.height( 100 ); mid2.direction( LeftToRight ); - hbox.addWidget( mid2 ); - Arts::VBox mid2box; mid2.widget( mid2box ); - Arts::Poti mid2freq; mid2freq.color( "grey" ); mid2freq.caption( i18n( "Mid2 Freq" ).utf8().data() ); - mid2freq.min( 20 ); mid2freq.max( 10000 ); - mid2freq.value( ch.mid2freq() ); connect( mid2freq, "value_changed", ch, "mid2freq" ); - mid2freq.parent( mid2box ); mid2box._addChild( mid2freq , "" ); - Arts::Poti mid2q; mid2q.color( "grey" ); mid2q.caption( i18n( "Mid2 Q" ).utf8().data() ); - mid2q.min( 0.01 ); mid2q.max( 10 ); - mid2q.value( ch.mid2q() ); connect( mid2q, "value_changed", ch, "mid2q" ); - mid2q.parent( mid2box ); mid2box._addChild( mid2q , "" ); - - Arts::Poti mid3gain; mid3gain.caption( i18n( "Mid3 Gain" ).utf8().data() ); - mid3gain.min( -24 ); mid3gain.max( 24 ); - mid3gain.value( ch.mid3gain() ); connect( mid3gain, "value_changed", ch, "mid3gain" ); - hbox.addWidget( mid3gain ); - PopupBox mid3; - mid3.height( 100 ); mid3.direction( LeftToRight ); - hbox.addWidget( mid3 ); - Arts::VBox mid3box; mid3.widget( mid3box ); - Arts::Poti mid3freq; mid3freq.color( "grey" ); mid3freq.caption( i18n( "Mid3 Freq" ).utf8().data() ); - mid3freq.min( 1000 ); mid3freq.max( 10000 ); - mid3freq.value( ch.mid3freq() ); connect( mid3freq, "value_changed", ch, "mid3freq" ); - mid3freq.parent( mid3box ); mid3box._addChild( mid3freq , "" ); - Arts::Poti mid3q; mid3q.color( "grey" ); mid3q.caption( i18n( "Mid3 Q" ).utf8().data() ); - mid3q.min( 0.01 ); mid3q.max( 10 ); - mid3q.value( ch.mid3q() ); connect( mid3q, "value_changed", ch, "mid3q" ); - mid3q.parent( mid3box ); mid3box._addChild( mid3q , "" ); - - Arts::Poti highgain; highgain.caption( i18n( "High Gain" ).utf8().data() ); - highgain.min( -24 ); highgain.max( 24 ); - highgain.value( ch.highgain() ); connect( highgain, "value_changed", ch, "highgain" ); - hbox.addWidget( highgain ); - PopupBox high; - high.height( 100 ); high.direction( LeftToRight ); - hbox.addWidget( high ); - Arts::VBox highbox; high.widget( highbox ); - Arts::Poti highfreq; highfreq.color( "grey" ); highfreq.caption( i18n( "High Freq" ).utf8().data() ); - highfreq.min( 5000 ); highfreq.max( 16000 ); - highfreq.value( ch.highfreq() ); connect( highfreq, "value_changed", ch, "highfreq" ); - highfreq.parent( highbox ); highbox._addChild( highfreq , "" ); - Arts::Poti highq; highq.color( "grey" ); highq.caption( i18n( "High Q" ).utf8().data() ); - highq.min( 0.01 ); highq.max( 10 ); - highq.value( ch.highq() ); connect( highq, "value_changed", ch, "highq" ); - highq.parent( highbox ); highbox._addChild( highq , "" ); - - hbox.addStretch( 100 ); - - return hbox; - } -}; -REGISTER_IMPLEMENTATION( FiveBandMonoComplexEQGuiFactory_impl ); - -} - diff --git a/arts/modules/effects/fivebandmonocomplexeq_impl.cpp b/arts/modules/effects/fivebandmonocomplexeq_impl.cpp new file mode 100644 index 00000000..59d0ef44 --- /dev/null +++ b/arts/modules/effects/fivebandmonocomplexeq_impl.cpp @@ -0,0 +1,208 @@ +/* + + Copyright ( C ) 2002 Arnold Krille + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace Arts { + +class FiveBandMonoComplexEQ_impl : virtual public FiveBandMonoComplexEQ_skel, + virtual public StdSynthModule +{ +private: + Arts::StereoToMono _s2m; + Arts::MonoToStereo _m2s; + Arts::Synth_STD_EQUALIZER _low, _mid1, _mid2, _mid3, _high; +public: + FiveBandMonoComplexEQ_impl() {} + + Arts::StereoToMono s2m() { return _s2m; } + Arts::MonoToStereo m2s() { return _m2s; } + + float lowfreq() { return _low.frequency(); } + void lowfreq( float n ) { _low.frequency( n ); }; + float lowq() { return _low.q(); } + void lowq( float n ) { _low.q( n ); }; + float lowgain() { return _low.low(); } + void lowgain( float n ) { _low.low( n ); }; + + float mid1freq() { return _mid1.frequency(); } + void mid1freq( float n ) { _mid1.frequency( n ); }; + float mid1q() { return _mid1.q(); } + void mid1q( float n ) { _mid1.q( n ); }; + float mid1gain() { return _mid1.mid(); } + void mid1gain( float n ) { _mid1.mid( n ); }; + + float mid2freq() { return _mid2.frequency(); } + void mid2freq( float n ) { _mid2.frequency( n ); }; + float mid2q() { return _mid2.q(); } + void mid2q( float n ) { _mid2.q( n ); }; + float mid2gain() { return _mid2.mid(); } + void mid2gain( float n ) { _mid2.mid( n ); }; + + float mid3freq() { return _mid3.frequency(); } + void mid3freq( float n ) { _mid3.frequency( n ); }; + float mid3q() { return _mid3.q(); } + void mid3q( float n ) { _mid3.q( n ); }; + float mid3gain() { return _mid3.mid(); } + void mid3gain( float n ) { _mid3.mid( n ); }; + + float highfreq() { return _high.frequency(); } + void highfreq( float n ) { _high.frequency( n ); }; + float highq() { return _high.q(); } + void highq( float n ) { _high.q( n ); }; + float highgain() { return _high.high(); } + void highgain( float n ) { _high.high( n ); }; + + void streamInit() + { + _s2m.start(); _low.start(); _mid1.start(); _mid2.start(); _mid3.start(); _high.start(); _m2s.start(); + + _node()->virtualize( "inleft", _s2m._node(), "inleft" ); + _node()->virtualize( "inright", _s2m._node(), "inright" ); + connect( _s2m, "outmono", _low, "invalue" ); + connect( _low, "outvalue", _mid1, "invalue" ); + connect( _mid1, "outvalue", _mid2, "invalue" ); + connect( _mid2, "outvalue", _mid3, "invalue" ); + connect( _mid3, "outvalue", _high, "invalue" ); + connect( _high, "outvalue", _m2s, "inmono" ); + _node()->virtualize( "outleft", _m2s._node(), "outleft" ); + _node()->virtualize( "outright", _m2s._node(), "outright" ); + } +}; +REGISTER_IMPLEMENTATION( FiveBandMonoComplexEQ_impl ); + +class FiveBandMonoComplexEQGuiFactory_impl : virtual public FiveBandMonoComplexEQGuiFactory_skel +{ +public: + Arts::Widget createGui( Arts::Object object ) + { + TDEGlobal::locale()->insertCatalogue( "artsmodules" ); + + arts_return_val_if_fail( !object.isNull(), Arts::Widget::null() ); + FiveBandMonoComplexEQ ch = DynamicCast( object ); + arts_return_val_if_fail( !ch.isNull(), Arts::Widget::null() ); + + Arts::LayoutBox hbox; + hbox.direction( Arts::LeftToRight ); + hbox.layoutmargin( 5 ); hbox.spacing( 5 ); + + Arts::Poti lowgain; lowgain.caption( i18n( "Low Gain" ).utf8().data() ); + lowgain.min( -24 ); lowgain.max( 24 ); + lowgain.value( ch.lowgain() ); connect( lowgain, "value_changed", ch, "lowgain" ); + hbox.addWidget( lowgain ); + PopupBox low; + low.height( 100 ); low.direction( LeftToRight ); + hbox.addWidget( low ); + Arts::VBox lowbox; low.widget( lowbox ); + Arts::Poti lowfreq; lowfreq.color( "grey" ); lowfreq.caption( i18n( "Low Freq" ).utf8().data() ); + lowfreq.min( 20 ); lowfreq.max( 1000 ); + lowfreq.value( ch.lowfreq() ); connect( lowfreq, "value_changed", ch, "lowfreq" ); + lowfreq.parent( lowbox ); lowbox._addChild( lowfreq , "" ); + Arts::Poti lowq; lowq.color( "grey" ); lowq.caption( i18n( "Low Q" ).utf8().data() ); + lowq.min( 0.01 ); lowq.max( 10 ); + lowq.value( ch.lowq() ); connect( lowq, "value_changed", ch, "lowq" ); + lowq.parent( lowbox ); lowbox._addChild( lowq , "" ); + + Arts::Poti mid1gain; mid1gain.caption( i18n( "Mid1 Gain" ).utf8().data() ); + mid1gain.min( -24 ); mid1gain.max( 24 ); + mid1gain.value( ch.mid1gain() ); connect( mid1gain, "value_changed", ch, "mid1gain" ); + hbox.addWidget( mid1gain ); + PopupBox mid1; + mid1.height( 100 ); mid1.direction( LeftToRight ); + hbox.addWidget( mid1 ); + Arts::VBox mid1box; mid1.widget( mid1box ); + Arts::Poti mid1freq; mid1freq.color( "grey" ); mid1freq.caption( i18n( "Mid1 Freq" ).utf8().data() ); + mid1freq.min( 20 ); mid1freq.max( 5000 ); + mid1freq.value( ch.mid1freq() ); connect( mid1freq, "value_changed", ch, "mid1freq" ); + mid1freq.parent( mid1box ); mid1box._addChild( mid1freq , "" ); + Arts::Poti mid1q; mid1q.color( "grey" ); mid1q.caption( i18n( "Mid1 Q" ).utf8().data() ); + mid1q.min( 0.01 ); mid1q.max( 10 ); + mid1q.value( ch.mid1q() ); connect( mid1q, "value_changed", ch, "mid1q" ); + mid1q.parent( mid1box ); mid1box._addChild( mid1q , "" ); + + Arts::Poti mid2gain; mid2gain.caption( i18n( "Mid2 Gain" ).utf8().data() ); + mid2gain.min( -24 ); mid2gain.max( 24 ); + mid2gain.value( ch.mid2gain() ); connect( mid2gain, "value_changed", ch, "mid2gain" ); + hbox.addWidget( mid2gain ); + PopupBox mid2; + mid2.height( 100 ); mid2.direction( LeftToRight ); + hbox.addWidget( mid2 ); + Arts::VBox mid2box; mid2.widget( mid2box ); + Arts::Poti mid2freq; mid2freq.color( "grey" ); mid2freq.caption( i18n( "Mid2 Freq" ).utf8().data() ); + mid2freq.min( 20 ); mid2freq.max( 10000 ); + mid2freq.value( ch.mid2freq() ); connect( mid2freq, "value_changed", ch, "mid2freq" ); + mid2freq.parent( mid2box ); mid2box._addChild( mid2freq , "" ); + Arts::Poti mid2q; mid2q.color( "grey" ); mid2q.caption( i18n( "Mid2 Q" ).utf8().data() ); + mid2q.min( 0.01 ); mid2q.max( 10 ); + mid2q.value( ch.mid2q() ); connect( mid2q, "value_changed", ch, "mid2q" ); + mid2q.parent( mid2box ); mid2box._addChild( mid2q , "" ); + + Arts::Poti mid3gain; mid3gain.caption( i18n( "Mid3 Gain" ).utf8().data() ); + mid3gain.min( -24 ); mid3gain.max( 24 ); + mid3gain.value( ch.mid3gain() ); connect( mid3gain, "value_changed", ch, "mid3gain" ); + hbox.addWidget( mid3gain ); + PopupBox mid3; + mid3.height( 100 ); mid3.direction( LeftToRight ); + hbox.addWidget( mid3 ); + Arts::VBox mid3box; mid3.widget( mid3box ); + Arts::Poti mid3freq; mid3freq.color( "grey" ); mid3freq.caption( i18n( "Mid3 Freq" ).utf8().data() ); + mid3freq.min( 1000 ); mid3freq.max( 10000 ); + mid3freq.value( ch.mid3freq() ); connect( mid3freq, "value_changed", ch, "mid3freq" ); + mid3freq.parent( mid3box ); mid3box._addChild( mid3freq , "" ); + Arts::Poti mid3q; mid3q.color( "grey" ); mid3q.caption( i18n( "Mid3 Q" ).utf8().data() ); + mid3q.min( 0.01 ); mid3q.max( 10 ); + mid3q.value( ch.mid3q() ); connect( mid3q, "value_changed", ch, "mid3q" ); + mid3q.parent( mid3box ); mid3box._addChild( mid3q , "" ); + + Arts::Poti highgain; highgain.caption( i18n( "High Gain" ).utf8().data() ); + highgain.min( -24 ); highgain.max( 24 ); + highgain.value( ch.highgain() ); connect( highgain, "value_changed", ch, "highgain" ); + hbox.addWidget( highgain ); + PopupBox high; + high.height( 100 ); high.direction( LeftToRight ); + hbox.addWidget( high ); + Arts::VBox highbox; high.widget( highbox ); + Arts::Poti highfreq; highfreq.color( "grey" ); highfreq.caption( i18n( "High Freq" ).utf8().data() ); + highfreq.min( 5000 ); highfreq.max( 16000 ); + highfreq.value( ch.highfreq() ); connect( highfreq, "value_changed", ch, "highfreq" ); + highfreq.parent( highbox ); highbox._addChild( highfreq , "" ); + Arts::Poti highq; highq.color( "grey" ); highq.caption( i18n( "High Q" ).utf8().data() ); + highq.min( 0.01 ); highq.max( 10 ); + highq.value( ch.highq() ); connect( highq, "value_changed", ch, "highq" ); + highq.parent( highbox ); highbox._addChild( highq , "" ); + + hbox.addStretch( 100 ); + + return hbox; + } +}; +REGISTER_IMPLEMENTATION( FiveBandMonoComplexEQGuiFactory_impl ); + +} + diff --git a/arts/modules/effects/freeverb/allpass.cpp b/arts/modules/effects/freeverb/allpass.cpp index ca4d8bc5..850337e3 100644 --- a/arts/modules/effects/freeverb/allpass.cpp +++ b/arts/modules/effects/freeverb/allpass.cpp @@ -4,7 +4,7 @@ // http://www.dreampoint.co.uk // This code is public domain -#include "allpass.hpp" +#include "allpass.h" allpass::allpass() { diff --git a/arts/modules/effects/freeverb/allpass.h b/arts/modules/effects/freeverb/allpass.h new file mode 100644 index 00000000..853c7d41 --- /dev/null +++ b/arts/modules/effects/freeverb/allpass.h @@ -0,0 +1,48 @@ +// Allpass filter declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _allpass_ +#define _allpass_ +#include "denormals.h" + +class allpass +{ +public: + allpass(); + void setbuffer(float *buf, int size); + inline float process(float inp); + void mute(); + void setfeedback(float val); + float getfeedback(); +// private: + float feedback; + float *buffer; + int bufsize; + int bufidx; +}; + + +// Big to inline - but crucial for speed + +inline float allpass::process(float input) +{ + float output; + float bufout; + + bufout = buffer[bufidx]; + undenormalise(bufout); + + output = -input + bufout; + buffer[bufidx] = input + (bufout*feedback); + + if(++bufidx>=bufsize) bufidx = 0; + + return output; +} + +#endif//_allpass + +//ends diff --git a/arts/modules/effects/freeverb/allpass.hpp b/arts/modules/effects/freeverb/allpass.hpp deleted file mode 100644 index 853c7d41..00000000 --- a/arts/modules/effects/freeverb/allpass.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// Allpass filter declaration -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// This code is public domain - -#ifndef _allpass_ -#define _allpass_ -#include "denormals.h" - -class allpass -{ -public: - allpass(); - void setbuffer(float *buf, int size); - inline float process(float inp); - void mute(); - void setfeedback(float val); - float getfeedback(); -// private: - float feedback; - float *buffer; - int bufsize; - int bufidx; -}; - - -// Big to inline - but crucial for speed - -inline float allpass::process(float input) -{ - float output; - float bufout; - - bufout = buffer[bufidx]; - undenormalise(bufout); - - output = -input + bufout; - buffer[bufidx] = input + (bufout*feedback); - - if(++bufidx>=bufsize) bufidx = 0; - - return output; -} - -#endif//_allpass - -//ends diff --git a/arts/modules/effects/freeverb/comb.cpp b/arts/modules/effects/freeverb/comb.cpp index c05f5069..62be706d 100644 --- a/arts/modules/effects/freeverb/comb.cpp +++ b/arts/modules/effects/freeverb/comb.cpp @@ -4,7 +4,7 @@ // http://www.dreampoint.co.uk // This code is public domain -#include "comb.hpp" +#include "comb.h" comb::comb() { diff --git a/arts/modules/effects/freeverb/comb.h b/arts/modules/effects/freeverb/comb.h new file mode 100644 index 00000000..4a73b615 --- /dev/null +++ b/arts/modules/effects/freeverb/comb.h @@ -0,0 +1,55 @@ +// Comb filter class declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _comb_ +#define _comb_ + +#include "denormals.h" + +class comb +{ +public: + comb(); + void setbuffer(float *buf, int size); + inline float process(float inp); + void mute(); + void setdamp(float val); + float getdamp(); + void setfeedback(float val); + float getfeedback(); +private: + float feedback; + float filterstore; + float damp1; + float damp2; + float *buffer; + int bufsize; + int bufidx; +}; + + +// Big to inline - but crucial for speed + +inline float comb::process(float input) +{ + float output; + + output = buffer[bufidx]; + undenormalise(output); + + filterstore = (output*damp2) + (filterstore*damp1); + undenormalise(filterstore); + + buffer[bufidx] = input + (filterstore*feedback); + + if(++bufidx>=bufsize) bufidx = 0; + + return output; +} + +#endif //_comb_ + +//ends diff --git a/arts/modules/effects/freeverb/comb.hpp b/arts/modules/effects/freeverb/comb.hpp deleted file mode 100644 index 4a73b615..00000000 --- a/arts/modules/effects/freeverb/comb.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// Comb filter class declaration -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// This code is public domain - -#ifndef _comb_ -#define _comb_ - -#include "denormals.h" - -class comb -{ -public: - comb(); - void setbuffer(float *buf, int size); - inline float process(float inp); - void mute(); - void setdamp(float val); - float getdamp(); - void setfeedback(float val); - float getfeedback(); -private: - float feedback; - float filterstore; - float damp1; - float damp2; - float *buffer; - int bufsize; - int bufidx; -}; - - -// Big to inline - but crucial for speed - -inline float comb::process(float input) -{ - float output; - - output = buffer[bufidx]; - undenormalise(output); - - filterstore = (output*damp2) + (filterstore*damp1); - undenormalise(filterstore); - - buffer[bufidx] = input + (filterstore*feedback); - - if(++bufidx>=bufsize) bufidx = 0; - - return output; -} - -#endif //_comb_ - -//ends diff --git a/arts/modules/effects/freeverb/revmodel.cpp b/arts/modules/effects/freeverb/revmodel.cpp index 23a766cc..3688dd34 100644 --- a/arts/modules/effects/freeverb/revmodel.cpp +++ b/arts/modules/effects/freeverb/revmodel.cpp @@ -4,7 +4,7 @@ // http://www.dreampoint.co.uk // This code is public domain -#include "revmodel.hpp" +#include "revmodel.h" revmodel::revmodel() { diff --git a/arts/modules/effects/freeverb/revmodel.h b/arts/modules/effects/freeverb/revmodel.h new file mode 100644 index 00000000..aec39dfe --- /dev/null +++ b/arts/modules/effects/freeverb/revmodel.h @@ -0,0 +1,87 @@ +// Reverb model declaration +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// This code is public domain + +#ifndef _revmodel_ +#define _revmodel_ + +#include "comb.h" +#include "allpass.h" +#include "tuning.h" + +class revmodel +{ +public: + revmodel(); + void mute(); + void processmix(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); + void processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); + void setroomsize(float value); + float getroomsize(); + void setdamp(float value); + float getdamp(); + void setwet(float value); + float getwet(); + void setdry(float value); + float getdry(); + void setwidth(float value); + float getwidth(); + void setmode(float value); + float getmode(); +private: + void update(); +private: + float gain; + float roomsize,roomsize1; + float damp,damp1; + float wet,wet1,wet2; + float dry; + float width; + float mode; + + // The following are all declared inline + // to remove the need for dynamic allocation + // with its subsequent error-checking messiness + + // Comb filters + comb combL[numcombs]; + comb combR[numcombs]; + + // Allpass filters + allpass allpassL[numallpasses]; + allpass allpassR[numallpasses]; + + // Buffers for the combs + float bufcombL1[combtuningL1]; + float bufcombR1[combtuningR1]; + float bufcombL2[combtuningL2]; + float bufcombR2[combtuningR2]; + float bufcombL3[combtuningL3]; + float bufcombR3[combtuningR3]; + float bufcombL4[combtuningL4]; + float bufcombR4[combtuningR4]; + float bufcombL5[combtuningL5]; + float bufcombR5[combtuningR5]; + float bufcombL6[combtuningL6]; + float bufcombR6[combtuningR6]; + float bufcombL7[combtuningL7]; + float bufcombR7[combtuningR7]; + float bufcombL8[combtuningL8]; + float bufcombR8[combtuningR8]; + + // Buffers for the allpasses + float bufallpassL1[allpasstuningL1]; + float bufallpassR1[allpasstuningR1]; + float bufallpassL2[allpasstuningL2]; + float bufallpassR2[allpasstuningR2]; + float bufallpassL3[allpasstuningL3]; + float bufallpassR3[allpasstuningR3]; + float bufallpassL4[allpasstuningL4]; + float bufallpassR4[allpasstuningR4]; +}; + +#endif//_revmodel_ + +//ends diff --git a/arts/modules/effects/freeverb/revmodel.hpp b/arts/modules/effects/freeverb/revmodel.hpp deleted file mode 100644 index ca6c89a0..00000000 --- a/arts/modules/effects/freeverb/revmodel.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Reverb model declaration -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// This code is public domain - -#ifndef _revmodel_ -#define _revmodel_ - -#include "comb.hpp" -#include "allpass.hpp" -#include "tuning.h" - -class revmodel -{ -public: - revmodel(); - void mute(); - void processmix(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); - void processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); - void setroomsize(float value); - float getroomsize(); - void setdamp(float value); - float getdamp(); - void setwet(float value); - float getwet(); - void setdry(float value); - float getdry(); - void setwidth(float value); - float getwidth(); - void setmode(float value); - float getmode(); -private: - void update(); -private: - float gain; - float roomsize,roomsize1; - float damp,damp1; - float wet,wet1,wet2; - float dry; - float width; - float mode; - - // The following are all declared inline - // to remove the need for dynamic allocation - // with its subsequent error-checking messiness - - // Comb filters - comb combL[numcombs]; - comb combR[numcombs]; - - // Allpass filters - allpass allpassL[numallpasses]; - allpass allpassR[numallpasses]; - - // Buffers for the combs - float bufcombL1[combtuningL1]; - float bufcombR1[combtuningR1]; - float bufcombL2[combtuningL2]; - float bufcombR2[combtuningR2]; - float bufcombL3[combtuningL3]; - float bufcombR3[combtuningR3]; - float bufcombL4[combtuningL4]; - float bufcombR4[combtuningR4]; - float bufcombL5[combtuningL5]; - float bufcombR5[combtuningR5]; - float bufcombL6[combtuningL6]; - float bufcombR6[combtuningR6]; - float bufcombL7[combtuningL7]; - float bufcombR7[combtuningR7]; - float bufcombL8[combtuningL8]; - float bufcombR8[combtuningR8]; - - // Buffers for the allpasses - float bufallpassL1[allpasstuningL1]; - float bufallpassR1[allpasstuningR1]; - float bufallpassL2[allpasstuningL2]; - float bufallpassR2[allpasstuningR2]; - float bufallpassL3[allpasstuningL3]; - float bufallpassR3[allpasstuningR3]; - float bufallpassL4[allpasstuningL4]; - float bufallpassR4[allpasstuningR4]; -}; - -#endif//_revmodel_ - -//ends diff --git a/arts/modules/effects/freeverbguifactory_impl.cc b/arts/modules/effects/freeverbguifactory_impl.cc deleted file mode 100644 index 4b5d4d34..00000000 --- a/arts/modules/effects/freeverbguifactory_impl.cc +++ /dev/null @@ -1,107 +0,0 @@ - /* - - Copyright (C) 2001 Stefan Westerfeld - stefan@space.twc.de - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - */ - -#include "artsmoduleseffects.h" -#include "debug.h" -#include "connect.h" - -#include -#include - -using namespace std; -using namespace Arts; - -namespace Arts { - -class FreeverbGuiFactory_impl : public FreeverbGuiFactory_skel -{ -public: - Widget createGui(Object freeverb); -}; - -REGISTER_IMPLEMENTATION(FreeverbGuiFactory_impl); - -} - -Widget FreeverbGuiFactory_impl::createGui(Object object) -{ - TDEGlobal::locale()->insertCatalogue( "artsmodules" ); - arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); - - Synth_FREEVERB freeverb = DynamicCast(object); - arts_return_val_if_fail(!freeverb.isNull(), Arts::Widget::null()); - - HBox hbox; - hbox.width(330); hbox.height(80); hbox.show(); - - Poti roomsize; - roomsize.x(20); roomsize.y(10); roomsize.caption(i18n("roomsize").utf8().data()); - roomsize.color("red"); roomsize.min(0); roomsize.max(1); - roomsize.value(freeverb.roomsize()); - roomsize.range(100); - roomsize.parent(hbox); - roomsize.show(); - connect(roomsize,"value_changed", freeverb, "roomsize"); - hbox._addChild(roomsize,"roomsizeWidget"); - - Poti damp; - damp.x(80); damp.y(10); damp.caption(i18n("damp").utf8().data()); - damp.color("red"); damp.min(0); damp.max(1); - damp.value(freeverb.damp()); - damp.range(100); - damp.parent(hbox); - damp.show(); - connect(damp,"value_changed", freeverb, "damp"); - hbox._addChild(damp,"dampWidget"); - - Poti wet; - wet.x(140); wet.y(10); wet.caption(i18n("wet").utf8().data()); - wet.color("red"); wet.min(0); wet.max(1); - wet.value(freeverb.wet()); - wet.range(100); - wet.parent(hbox); - wet.show(); - connect(wet,"value_changed", freeverb, "wet"); - hbox._addChild(wet,"wetWidget"); - - Poti dry; - dry.x(200); dry.y(10); dry.caption(i18n("dry").utf8().data()); - dry.color("red"); dry.min(0); dry.max(1); - dry.value(freeverb.dry()); - dry.range(100); - dry.parent(hbox); - dry.show(); - connect(dry,"value_changed", freeverb, "dry"); - hbox._addChild(dry,"dryWidget"); - - Poti width; - width.x(260); width.y(10); width.caption(i18n("width").utf8().data()); - width.color("red"); width.min(0); width.max(1); - width.value(freeverb.width()); - width.range(100); - width.parent(hbox); - width.show(); - connect(width,"value_changed", freeverb, "width"); - hbox._addChild(width,"widthWidget"); - - return hbox; -} diff --git a/arts/modules/effects/freeverbguifactory_impl.cpp b/arts/modules/effects/freeverbguifactory_impl.cpp new file mode 100644 index 00000000..4b5d4d34 --- /dev/null +++ b/arts/modules/effects/freeverbguifactory_impl.cpp @@ -0,0 +1,107 @@ + /* + + Copyright (C) 2001 Stefan Westerfeld + stefan@space.twc.de + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + */ + +#include "artsmoduleseffects.h" +#include "debug.h" +#include "connect.h" + +#include +#include + +using namespace std; +using namespace Arts; + +namespace Arts { + +class FreeverbGuiFactory_impl : public FreeverbGuiFactory_skel +{ +public: + Widget createGui(Object freeverb); +}; + +REGISTER_IMPLEMENTATION(FreeverbGuiFactory_impl); + +} + +Widget FreeverbGuiFactory_impl::createGui(Object object) +{ + TDEGlobal::locale()->insertCatalogue( "artsmodules" ); + arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); + + Synth_FREEVERB freeverb = DynamicCast(object); + arts_return_val_if_fail(!freeverb.isNull(), Arts::Widget::null()); + + HBox hbox; + hbox.width(330); hbox.height(80); hbox.show(); + + Poti roomsize; + roomsize.x(20); roomsize.y(10); roomsize.caption(i18n("roomsize").utf8().data()); + roomsize.color("red"); roomsize.min(0); roomsize.max(1); + roomsize.value(freeverb.roomsize()); + roomsize.range(100); + roomsize.parent(hbox); + roomsize.show(); + connect(roomsize,"value_changed", freeverb, "roomsize"); + hbox._addChild(roomsize,"roomsizeWidget"); + + Poti damp; + damp.x(80); damp.y(10); damp.caption(i18n("damp").utf8().data()); + damp.color("red"); damp.min(0); damp.max(1); + damp.value(freeverb.damp()); + damp.range(100); + damp.parent(hbox); + damp.show(); + connect(damp,"value_changed", freeverb, "damp"); + hbox._addChild(damp,"dampWidget"); + + Poti wet; + wet.x(140); wet.y(10); wet.caption(i18n("wet").utf8().data()); + wet.color("red"); wet.min(0); wet.max(1); + wet.value(freeverb.wet()); + wet.range(100); + wet.parent(hbox); + wet.show(); + connect(wet,"value_changed", freeverb, "wet"); + hbox._addChild(wet,"wetWidget"); + + Poti dry; + dry.x(200); dry.y(10); dry.caption(i18n("dry").utf8().data()); + dry.color("red"); dry.min(0); dry.max(1); + dry.value(freeverb.dry()); + dry.range(100); + dry.parent(hbox); + dry.show(); + connect(dry,"value_changed", freeverb, "dry"); + hbox._addChild(dry,"dryWidget"); + + Poti width; + width.x(260); width.y(10); width.caption(i18n("width").utf8().data()); + width.color("red"); width.min(0); width.max(1); + width.value(freeverb.width()); + width.range(100); + width.parent(hbox); + width.show(); + connect(width,"value_changed", freeverb, "width"); + hbox._addChild(width,"widthWidget"); + + return hbox; +} diff --git a/arts/modules/effects/monostereoconversion_impl.cc b/arts/modules/effects/monostereoconversion_impl.cc deleted file mode 100644 index 9bf1bbee..00000000 --- a/arts/modules/effects/monostereoconversion_impl.cc +++ /dev/null @@ -1,160 +0,0 @@ -/* - - Copyright ( C ) 2002 Arnold Krille - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace Arts { - -class MonoToStereo_impl : virtual public MonoToStereo_skel, - virtual public StdSynthModule -{ -protected: - float _pan, _pLeft, _pRight; -public: - MonoToStereo_impl() - { - pan( 0 ); - } - - float pan() { return _pan; } - void pan( float pan ) - { - if( pan < -1 ) pan = -1; - if( pan > 1 ) pan = 1; - _pan = pan; - _pLeft = _pRight = 1; - if( _pan < 0 ) - _pRight = 1 + _pan; - else - _pLeft = 1 - _pan; - } - - void calculateBlock( unsigned long samples ) - { - for( unsigned int i=0; i 1 ) pan = 1; - _pan = pan; - _pLeft = _pRight = 1; - if( _pan < 0 ) - _pRight = 1 + _pan; - else - _pLeft = 1 - _pan; - } - - void calculateBlock( unsigned long samples ) - { - for( unsigned int i=0; i1 ) n=1; - if( n<-1 ) n=-1; - _balance = n; - _right = _left = 1; - if( _balance < 0 ) - _right = 1 + _balance; - else - _left = 1 - _balance; - } - - void calculateBlock( unsigned long samples ) - { -//arts_debug( "StereoBalance::calculateBlock( unsigned int %i )", samples ); - for( unsigned long i=0; iinsertCatalogue( "artsmodules" ); - - arts_return_val_if_fail( !object.isNull(), Arts::Widget::null() ); - StereoBalance ch= DynamicCast( object ); - arts_return_val_if_fail( !ch.isNull(), Arts::Widget::null() ); - - Poti bal; - bal.caption( i18n( "Balance" ).utf8().data() ); - bal.min( -1 ); bal.max( 1 ); - bal.value( ch.balance() ); - connect( bal, "value_changed", ch, "balance" ); - - return bal; - } -}; -REGISTER_IMPLEMENTATION( StereoBalanceGuiFactory_impl ); - -} - diff --git a/arts/modules/effects/monostereoconversion_impl.cpp b/arts/modules/effects/monostereoconversion_impl.cpp new file mode 100644 index 00000000..9bf1bbee --- /dev/null +++ b/arts/modules/effects/monostereoconversion_impl.cpp @@ -0,0 +1,160 @@ +/* + + Copyright ( C ) 2002 Arnold Krille + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace Arts { + +class MonoToStereo_impl : virtual public MonoToStereo_skel, + virtual public StdSynthModule +{ +protected: + float _pan, _pLeft, _pRight; +public: + MonoToStereo_impl() + { + pan( 0 ); + } + + float pan() { return _pan; } + void pan( float pan ) + { + if( pan < -1 ) pan = -1; + if( pan > 1 ) pan = 1; + _pan = pan; + _pLeft = _pRight = 1; + if( _pan < 0 ) + _pRight = 1 + _pan; + else + _pLeft = 1 - _pan; + } + + void calculateBlock( unsigned long samples ) + { + for( unsigned int i=0; i 1 ) pan = 1; + _pan = pan; + _pLeft = _pRight = 1; + if( _pan < 0 ) + _pRight = 1 + _pan; + else + _pLeft = 1 - _pan; + } + + void calculateBlock( unsigned long samples ) + { + for( unsigned int i=0; i1 ) n=1; + if( n<-1 ) n=-1; + _balance = n; + _right = _left = 1; + if( _balance < 0 ) + _right = 1 + _balance; + else + _left = 1 - _balance; + } + + void calculateBlock( unsigned long samples ) + { +//arts_debug( "StereoBalance::calculateBlock( unsigned int %i )", samples ); + for( unsigned long i=0; iinsertCatalogue( "artsmodules" ); + + arts_return_val_if_fail( !object.isNull(), Arts::Widget::null() ); + StereoBalance ch= DynamicCast( object ); + arts_return_val_if_fail( !ch.isNull(), Arts::Widget::null() ); + + Poti bal; + bal.caption( i18n( "Balance" ).utf8().data() ); + bal.min( -1 ); bal.max( 1 ); + bal.value( ch.balance() ); + connect( bal, "value_changed", ch, "balance" ); + + return bal; + } +}; +REGISTER_IMPLEMENTATION( StereoBalanceGuiFactory_impl ); + +} + diff --git a/arts/modules/effects/stereocompressorguifactory_impl.cc b/arts/modules/effects/stereocompressorguifactory_impl.cc deleted file mode 100644 index 295ad65d..00000000 --- a/arts/modules/effects/stereocompressorguifactory_impl.cc +++ /dev/null @@ -1,111 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Arnold Krille - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -#include -#include - -#include "artsmoduleseffects.h" -#include "connect.h" -#include "debug.h" - -using namespace Arts; - -namespace Arts { - -class StereoCompressorGuiFactory_impl : virtual public StereoCompressorGuiFactory_skel -{ -public: - Widget createGui( Object object ) - { - TDEGlobal::locale()->insertCatalogue( "artsmodules" ); - - arts_return_val_if_fail(!object.isNull(), Arts::Widget::null() ); - - Synth_STEREO_COMPRESSOR comp = DynamicCast(object); - arts_return_val_if_fail(!comp.isNull(), Arts::Widget::null()); - - Poti attack; - attack.caption(i18n("attack").utf8().data()); - attack.color("blue"); - attack.min(0.1); attack.max(250); - attack.value( comp.attack() ); - attack.range(250); - connect( attack, "value_changed", comp, "attack" ); - - Poti release; - release.caption(i18n("release").utf8().data()); - release.color("blue"); - release.min(0.1); release.max(250); - release.value( comp.release() ); - release.range(250); - connect( release, "value_changed", comp, "release" ); - - Poti threshold; - threshold.caption(i18n("thresh.").utf8().data()); - threshold.min(0.00001); threshold.max(1); - threshold.value( comp.threshold() ); - threshold.logarithmic( 2.0 ); - threshold.range(200); - connect( threshold, "value_changed", comp, "threshold" ); - - Poti ratio; - ratio.caption(i18n("ratio").utf8().data()); - ratio.min(0); ratio.max(1); - ratio.value( comp.ratio() ); - ratio.range(200); - connect( ratio, "value_changed", comp, "ratio" ); - - Poti output; - output.caption(i18n("output").utf8().data()); - output.min(0.1); output.max(10.0); - output.value( comp.output() ); - output.logarithmic( 2.0 ); - output.range(200); - connect( output, "value_changed", comp, "output" ); - - Button bon; - bon.text(i18n("Bypass").utf8().data()); - bon.toggle( true ); - connect( bon, "pressed_changed", comp, "thru" ); - - LayoutBox hbox; - hbox.direction( LeftToRight ); hbox.layoutmargin( 5 ); hbox.spacing( 5 ); - PopupBox timesbox; - timesbox.name( "Timings" ); timesbox.direction( LeftToRight ); - LayoutBox times; - times.direction( LeftToRight ); times.spacing( 5 ); - - hbox.addWidget( timesbox ); - times.addSpace( 5 ); - times.addWidget( attack ); - times.addWidget( release ); - times.addSpace( 5 ); - timesbox.widget( times ); - hbox.addWidget( threshold ); - hbox.addWidget( ratio ); - hbox.addWidget( output ); - hbox.addWidget( bon ); - hbox.addStretch( 10 ); - - return hbox; - } -}; -REGISTER_IMPLEMENTATION(StereoCompressorGuiFactory_impl); - -} diff --git a/arts/modules/effects/stereocompressorguifactory_impl.cpp b/arts/modules/effects/stereocompressorguifactory_impl.cpp new file mode 100644 index 00000000..295ad65d --- /dev/null +++ b/arts/modules/effects/stereocompressorguifactory_impl.cpp @@ -0,0 +1,111 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Arnold Krille + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ + +#include +#include + +#include "artsmoduleseffects.h" +#include "connect.h" +#include "debug.h" + +using namespace Arts; + +namespace Arts { + +class StereoCompressorGuiFactory_impl : virtual public StereoCompressorGuiFactory_skel +{ +public: + Widget createGui( Object object ) + { + TDEGlobal::locale()->insertCatalogue( "artsmodules" ); + + arts_return_val_if_fail(!object.isNull(), Arts::Widget::null() ); + + Synth_STEREO_COMPRESSOR comp = DynamicCast(object); + arts_return_val_if_fail(!comp.isNull(), Arts::Widget::null()); + + Poti attack; + attack.caption(i18n("attack").utf8().data()); + attack.color("blue"); + attack.min(0.1); attack.max(250); + attack.value( comp.attack() ); + attack.range(250); + connect( attack, "value_changed", comp, "attack" ); + + Poti release; + release.caption(i18n("release").utf8().data()); + release.color("blue"); + release.min(0.1); release.max(250); + release.value( comp.release() ); + release.range(250); + connect( release, "value_changed", comp, "release" ); + + Poti threshold; + threshold.caption(i18n("thresh.").utf8().data()); + threshold.min(0.00001); threshold.max(1); + threshold.value( comp.threshold() ); + threshold.logarithmic( 2.0 ); + threshold.range(200); + connect( threshold, "value_changed", comp, "threshold" ); + + Poti ratio; + ratio.caption(i18n("ratio").utf8().data()); + ratio.min(0); ratio.max(1); + ratio.value( comp.ratio() ); + ratio.range(200); + connect( ratio, "value_changed", comp, "ratio" ); + + Poti output; + output.caption(i18n("output").utf8().data()); + output.min(0.1); output.max(10.0); + output.value( comp.output() ); + output.logarithmic( 2.0 ); + output.range(200); + connect( output, "value_changed", comp, "output" ); + + Button bon; + bon.text(i18n("Bypass").utf8().data()); + bon.toggle( true ); + connect( bon, "pressed_changed", comp, "thru" ); + + LayoutBox hbox; + hbox.direction( LeftToRight ); hbox.layoutmargin( 5 ); hbox.spacing( 5 ); + PopupBox timesbox; + timesbox.name( "Timings" ); timesbox.direction( LeftToRight ); + LayoutBox times; + times.direction( LeftToRight ); times.spacing( 5 ); + + hbox.addWidget( timesbox ); + times.addSpace( 5 ); + times.addWidget( attack ); + times.addWidget( release ); + times.addSpace( 5 ); + timesbox.widget( times ); + hbox.addWidget( threshold ); + hbox.addWidget( ratio ); + hbox.addWidget( output ); + hbox.addWidget( bon ); + hbox.addStretch( 10 ); + + return hbox; + } +}; +REGISTER_IMPLEMENTATION(StereoCompressorGuiFactory_impl); + +} diff --git a/arts/modules/effects/synth_freeverb_impl.cc b/arts/modules/effects/synth_freeverb_impl.cc deleted file mode 100644 index a1f35d06..00000000 --- a/arts/modules/effects/synth_freeverb_impl.cc +++ /dev/null @@ -1,84 +0,0 @@ - /* - - Copyright (C) 2000 Stefan Westerfeld - stefan@space.twc.de - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - */ - -#include "freeverb/revmodel.hpp" -#include "artsmoduleseffects.h" -#include "stdsynthmodule.h" - -using namespace Arts; - -class Synth_FREEVERB_impl : virtual public Synth_FREEVERB_skel, - virtual public StdSynthModule -{ - revmodel *model; -public: - float roomsize() { return model->getroomsize(); } - void roomsize(float newval) { return model->setroomsize(newval); } - - float damp() { return model->getdamp(); } - void damp(float newval) { return model->setdamp(newval); } - - float wet() { return model->getwet(); } - void wet(float newval) { return model->setwet(newval); } - - float dry() { return model->getdry(); } - void dry(float newval) { return model->setdry(newval); } - - float width() { return model->getwidth(); } - void width(float newval) { return model->setwidth(newval); } - - float mode() { return model->getmode(); } - void mode(float newval) { return model->setmode(newval); } - - void streamInit() - { - /* prevent full buffers to be carried over stop-start sequence */ - model->mute(); - } - - void calculateBlock(unsigned long samples) - { - model->processreplace(inleft, inright, outleft, outright, samples,1); - // don't add the original signal - that's what the "dry" argument is for - //for(unsigned long i = 0;i < samples; i++) - //{ - //outleft[i] += inleft[i]; - //outright[i] += inright[i]; - //} - } - Synth_FREEVERB_impl() - { - // "revmodel" object size is far too big, vtable - // can't handle it - model=new revmodel; - // set dry to 1 so it at first sounds like it always did before - // ok, since scaledry = 2 calling dry( 0.5 ) has the desired - // effect - dry( 0.5f ); - } - ~Synth_FREEVERB_impl() - { - delete model; - } -}; - -REGISTER_IMPLEMENTATION(Synth_FREEVERB_impl); diff --git a/arts/modules/effects/synth_freeverb_impl.cpp b/arts/modules/effects/synth_freeverb_impl.cpp new file mode 100644 index 00000000..3b882d48 --- /dev/null +++ b/arts/modules/effects/synth_freeverb_impl.cpp @@ -0,0 +1,84 @@ + /* + + Copyright (C) 2000 Stefan Westerfeld + stefan@space.twc.de + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + */ + +#include "freeverb/revmodel.h" +#include "artsmoduleseffects.h" +#include "stdsynthmodule.h" + +using namespace Arts; + +class Synth_FREEVERB_impl : virtual public Synth_FREEVERB_skel, + virtual public StdSynthModule +{ + revmodel *model; +public: + float roomsize() { return model->getroomsize(); } + void roomsize(float newval) { return model->setroomsize(newval); } + + float damp() { return model->getdamp(); } + void damp(float newval) { return model->setdamp(newval); } + + float wet() { return model->getwet(); } + void wet(float newval) { return model->setwet(newval); } + + float dry() { return model->getdry(); } + void dry(float newval) { return model->setdry(newval); } + + float width() { return model->getwidth(); } + void width(float newval) { return model->setwidth(newval); } + + float mode() { return model->getmode(); } + void mode(float newval) { return model->setmode(newval); } + + void streamInit() + { + /* prevent full buffers to be carried over stop-start sequence */ + model->mute(); + } + + void calculateBlock(unsigned long samples) + { + model->processreplace(inleft, inright, outleft, outright, samples,1); + // don't add the original signal - that's what the "dry" argument is for + //for(unsigned long i = 0;i < samples; i++) + //{ + //outleft[i] += inleft[i]; + //outright[i] += inright[i]; + //} + } + Synth_FREEVERB_impl() + { + // "revmodel" object size is far too big, vtable + // can't handle it + model=new revmodel; + // set dry to 1 so it at first sounds like it always did before + // ok, since scaledry = 2 calling dry( 0.5 ) has the desired + // effect + dry( 0.5f ); + } + ~Synth_FREEVERB_impl() + { + delete model; + } +}; + +REGISTER_IMPLEMENTATION(Synth_FREEVERB_impl); diff --git a/arts/modules/effects/synth_stereo_compressor_impl.cc b/arts/modules/effects/synth_stereo_compressor_impl.cc deleted file mode 100644 index 3add8d46..00000000 --- a/arts/modules/effects/synth_stereo_compressor_impl.cc +++ /dev/null @@ -1,132 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Arnold Krille - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -#include "artsmoduleseffects.h" -#include -#include -#include - -using namespace Arts; - -namespace Arts { - -class Synth_STEREO_COMPRESSOR_impl : virtual public Synth_STEREO_COMPRESSOR_skel, - virtual public StdSynthModule -{ -public: - Synth_STEREO_COMPRESSOR_impl() - { - attack( 10 ); - release( 10 ); - threshold( 1 ); - ratio( 0.8 ); - output( 1 ); - _thru = false; - _run = false; - } - - void streamStart() - { - _run = true; - compleft.start(); - compright.start(); - if(!_thru) - connectComp(true); - else - connectThru(true); - } - - void streamEnd() - { - _run = false; - connectComp(false); - connectThru(false); - compleft.stop(); - compright.stop(); - } - - float attack() { return compleft.attack(); }; - void attack( float f ) { compleft.attack(f); compright.attack(f); } - float release() { return compleft.release(); }; - void release( float f ) { compleft.release(f); compright.release(f); } - float threshold() { return compleft.threshold(); }; - void threshold( float f ) { compleft.threshold(f); compright.threshold(f); } - float ratio() { return compleft.ratio(); }; - void ratio( float f ) { compleft.ratio(f); compright.ratio(f); } - float output() { return compleft.output(); }; - void output( float f ) { compleft.output(f); compright.output(f); } - - bool thru() { return _thru; } - void thru( bool f ) - { - if( _thru != f ) - { - if(!_thru) - connectComp(false); - else - connectThru(false); - _thru = f; - if(!_thru) - connectComp(true); - else - connectThru(true); - } - } - -private: - Synth_COMPRESSOR compleft, compright; - bool _thru; - bool _run; - - void connectComp( bool _connect ) - { - if(_connect) - { - _node()->virtualize("inleft",compleft._node(),"invalue"); - _node()->virtualize("inright",compright._node(),"invalue"); - _node()->virtualize("outleft",compleft._node(),"outvalue"); - _node()->virtualize("outright",compright._node(),"outvalue"); - } - else - { - _node()->devirtualize("inleft",compleft._node(),"invalue"); - _node()->devirtualize("inright",compright._node(),"invalue"); - _node()->devirtualize("outleft",compleft._node(),"outvalue"); - _node()->devirtualize("outright",compright._node(),"outvalue"); - } - } - - void connectThru( bool _connect ) - { - if(_connect) - { - _node()->virtualize("inleft",_node(),"outleft"); - _node()->virtualize("inright",_node(),"outright"); - } - else - { - _node()->devirtualize("inleft",_node(),"outleft"); - _node()->devirtualize("inright",_node(),"outright"); - } - } - -}; -REGISTER_IMPLEMENTATION(Synth_STEREO_COMPRESSOR_impl); - -} diff --git a/arts/modules/effects/synth_stereo_compressor_impl.cpp b/arts/modules/effects/synth_stereo_compressor_impl.cpp new file mode 100644 index 00000000..3add8d46 --- /dev/null +++ b/arts/modules/effects/synth_stereo_compressor_impl.cpp @@ -0,0 +1,132 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Arnold Krille + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ + +#include "artsmoduleseffects.h" +#include +#include +#include + +using namespace Arts; + +namespace Arts { + +class Synth_STEREO_COMPRESSOR_impl : virtual public Synth_STEREO_COMPRESSOR_skel, + virtual public StdSynthModule +{ +public: + Synth_STEREO_COMPRESSOR_impl() + { + attack( 10 ); + release( 10 ); + threshold( 1 ); + ratio( 0.8 ); + output( 1 ); + _thru = false; + _run = false; + } + + void streamStart() + { + _run = true; + compleft.start(); + compright.start(); + if(!_thru) + connectComp(true); + else + connectThru(true); + } + + void streamEnd() + { + _run = false; + connectComp(false); + connectThru(false); + compleft.stop(); + compright.stop(); + } + + float attack() { return compleft.attack(); }; + void attack( float f ) { compleft.attack(f); compright.attack(f); } + float release() { return compleft.release(); }; + void release( float f ) { compleft.release(f); compright.release(f); } + float threshold() { return compleft.threshold(); }; + void threshold( float f ) { compleft.threshold(f); compright.threshold(f); } + float ratio() { return compleft.ratio(); }; + void ratio( float f ) { compleft.ratio(f); compright.ratio(f); } + float output() { return compleft.output(); }; + void output( float f ) { compleft.output(f); compright.output(f); } + + bool thru() { return _thru; } + void thru( bool f ) + { + if( _thru != f ) + { + if(!_thru) + connectComp(false); + else + connectThru(false); + _thru = f; + if(!_thru) + connectComp(true); + else + connectThru(true); + } + } + +private: + Synth_COMPRESSOR compleft, compright; + bool _thru; + bool _run; + + void connectComp( bool _connect ) + { + if(_connect) + { + _node()->virtualize("inleft",compleft._node(),"invalue"); + _node()->virtualize("inright",compright._node(),"invalue"); + _node()->virtualize("outleft",compleft._node(),"outvalue"); + _node()->virtualize("outright",compright._node(),"outvalue"); + } + else + { + _node()->devirtualize("inleft",compleft._node(),"invalue"); + _node()->devirtualize("inright",compright._node(),"invalue"); + _node()->devirtualize("outleft",compleft._node(),"outvalue"); + _node()->devirtualize("outright",compright._node(),"outvalue"); + } + } + + void connectThru( bool _connect ) + { + if(_connect) + { + _node()->virtualize("inleft",_node(),"outleft"); + _node()->virtualize("inright",_node(),"outright"); + } + else + { + _node()->devirtualize("inleft",_node(),"outleft"); + _node()->devirtualize("inright",_node(),"outright"); + } + } + +}; +REGISTER_IMPLEMENTATION(Synth_STEREO_COMPRESSOR_impl); + +} diff --git a/arts/modules/effects/synth_stereo_fir_equalizer_impl.cc b/arts/modules/effects/synth_stereo_fir_equalizer_impl.cc deleted file mode 100644 index 8f15a4dc..00000000 --- a/arts/modules/effects/synth_stereo_fir_equalizer_impl.cc +++ /dev/null @@ -1,221 +0,0 @@ -/* - - Copyright (C) 2001-2002 Stefan Westerfeld - stefan@space.twc.de - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - */ - -#include - -#include -#include -#include -#include -#include "artsmoduleseffects.h" - -#include -#include - -#include -#include - -using namespace std; -using namespace Arts; - -static inline bool odd(int x) { return ((x & 1) == 1); } - -/* returns a blackman window: x is supposed to be in the interval [0..1] */ -static inline float blackmanWindow(float x) -{ - if(x < 0) return 0; - if(x > 1) return 0; - return 0.42-0.5*cos(M_PI*x*2)+0.08*cos(4*M_PI*x); -} - -void firapprox(double *filter, int filtersize, vector& points) -{ - assert((filtersize >= 3) && odd(filtersize)); - - int fft_size = 8; - while(fft_size/2 < filtersize) - fft_size *= 2; - - vector::iterator pi = points.begin(); - float lfreq=-2, lval=1.0, rfreq=-1, rval=1.0; - - float *re = (float*) malloc(fft_size * sizeof(float)); - for(int i=0;i rfreq && pi != points.end()) - { - lfreq = rfreq; rfreq = pi->x; - lval = rval; rval = pi->y; - pi++; - } - float pos = (freq-lfreq)/(rfreq-lfreq); - float val = lval*(1.0-pos) + rval*pos; - - //printf("%f %f\n",freq,val); - re[i] = re[fft_size-1-i] = val; - } - - float *filter_re = (float*) malloc(fft_size * sizeof(float)); - float *filter_im = (float*) malloc(fft_size * sizeof(float)); - arts_fft_float (fft_size, 1, re, 0, filter_re, filter_im); - - for(int i=0;i _frequencies; - long _taps; - unsigned long bpos; - double filter[256]; - float lbuffer[256]; - float rbuffer[256]; - -public: - Synth_STEREO_FIR_EQUALIZER_impl() - { - _frequencies.push_back(GraphPoint(0.0,1.0)); - _frequencies.push_back(GraphPoint(1.0,1.0)); - _taps = 3; - for(bpos = 0; bpos < 256; bpos++) - lbuffer[bpos] = rbuffer[bpos] = 0.0; - - calcFilter(); - } - vector *frequencies() { - return new vector(_frequencies); - } - void frequencies(const vector& newFrequencies) - { - _frequencies = newFrequencies; - - calcFilter(); - } - long taps() - { - return _taps; - } - void taps(long newTaps) - { - arts_return_if_fail(newTaps >= 3 && newTaps <= 255); - - if(!odd(newTaps)) - newTaps++; - _taps = newTaps; - - calcFilter(); - } - void calcFilter() - { - firapprox(filter, _taps, _frequencies); - } - void calculateBlock(unsigned long samples) - { - for(unsigned i=0;iinsertCatalogue( "artsmodules" ); - arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); - - Synth_STEREO_FIR_EQUALIZER equalizer = DynamicCast(object); - arts_return_val_if_fail(!equalizer.isNull(), Arts::Widget::null()); - - VBox vbox; - vbox.show(); - - Graph g; - g.parent(vbox); - g.width(400); - g.height(230); - g.caption(i18n("a graph").utf8().data()); - g.minx(0.0); - g.maxx(1.0); - g.miny(0.0); - g.maxy(1.0); - g.show(); - - GraphLine gline; - gline.graph(g); - vector *points = equalizer.frequencies(); - gline.points(*points); - delete points; - gline.color("red"); - gline.editable(true); - - connect(gline,"points_changed", equalizer, "frequencies"); - g._addChild(gline,"gline"); - - SpinBox spinbox; - spinbox.caption(i18n("channels").utf8().data()); - spinbox.min(3); spinbox.max(255); - spinbox.value(equalizer.taps()); - spinbox.parent(vbox); - spinbox.show(); - connect(spinbox,"value_changed", equalizer, "taps"); - vbox._addChild(spinbox,"spinbox"); - vbox._addChild(g,"g"); - - return vbox; -} diff --git a/arts/modules/effects/synth_stereo_fir_equalizer_impl.cpp b/arts/modules/effects/synth_stereo_fir_equalizer_impl.cpp new file mode 100644 index 00000000..8f15a4dc --- /dev/null +++ b/arts/modules/effects/synth_stereo_fir_equalizer_impl.cpp @@ -0,0 +1,221 @@ +/* + + Copyright (C) 2001-2002 Stefan Westerfeld + stefan@space.twc.de + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + */ + +#include + +#include +#include +#include +#include +#include "artsmoduleseffects.h" + +#include +#include + +#include +#include + +using namespace std; +using namespace Arts; + +static inline bool odd(int x) { return ((x & 1) == 1); } + +/* returns a blackman window: x is supposed to be in the interval [0..1] */ +static inline float blackmanWindow(float x) +{ + if(x < 0) return 0; + if(x > 1) return 0; + return 0.42-0.5*cos(M_PI*x*2)+0.08*cos(4*M_PI*x); +} + +void firapprox(double *filter, int filtersize, vector& points) +{ + assert((filtersize >= 3) && odd(filtersize)); + + int fft_size = 8; + while(fft_size/2 < filtersize) + fft_size *= 2; + + vector::iterator pi = points.begin(); + float lfreq=-2, lval=1.0, rfreq=-1, rval=1.0; + + float *re = (float*) malloc(fft_size * sizeof(float)); + for(int i=0;i rfreq && pi != points.end()) + { + lfreq = rfreq; rfreq = pi->x; + lval = rval; rval = pi->y; + pi++; + } + float pos = (freq-lfreq)/(rfreq-lfreq); + float val = lval*(1.0-pos) + rval*pos; + + //printf("%f %f\n",freq,val); + re[i] = re[fft_size-1-i] = val; + } + + float *filter_re = (float*) malloc(fft_size * sizeof(float)); + float *filter_im = (float*) malloc(fft_size * sizeof(float)); + arts_fft_float (fft_size, 1, re, 0, filter_re, filter_im); + + for(int i=0;i _frequencies; + long _taps; + unsigned long bpos; + double filter[256]; + float lbuffer[256]; + float rbuffer[256]; + +public: + Synth_STEREO_FIR_EQUALIZER_impl() + { + _frequencies.push_back(GraphPoint(0.0,1.0)); + _frequencies.push_back(GraphPoint(1.0,1.0)); + _taps = 3; + for(bpos = 0; bpos < 256; bpos++) + lbuffer[bpos] = rbuffer[bpos] = 0.0; + + calcFilter(); + } + vector *frequencies() { + return new vector(_frequencies); + } + void frequencies(const vector& newFrequencies) + { + _frequencies = newFrequencies; + + calcFilter(); + } + long taps() + { + return _taps; + } + void taps(long newTaps) + { + arts_return_if_fail(newTaps >= 3 && newTaps <= 255); + + if(!odd(newTaps)) + newTaps++; + _taps = newTaps; + + calcFilter(); + } + void calcFilter() + { + firapprox(filter, _taps, _frequencies); + } + void calculateBlock(unsigned long samples) + { + for(unsigned i=0;iinsertCatalogue( "artsmodules" ); + arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); + + Synth_STEREO_FIR_EQUALIZER equalizer = DynamicCast(object); + arts_return_val_if_fail(!equalizer.isNull(), Arts::Widget::null()); + + VBox vbox; + vbox.show(); + + Graph g; + g.parent(vbox); + g.width(400); + g.height(230); + g.caption(i18n("a graph").utf8().data()); + g.minx(0.0); + g.maxx(1.0); + g.miny(0.0); + g.maxy(1.0); + g.show(); + + GraphLine gline; + gline.graph(g); + vector *points = equalizer.frequencies(); + gline.points(*points); + delete points; + gline.color("red"); + gline.editable(true); + + connect(gline,"points_changed", equalizer, "frequencies"); + g._addChild(gline,"gline"); + + SpinBox spinbox; + spinbox.caption(i18n("channels").utf8().data()); + spinbox.min(3); spinbox.max(255); + spinbox.value(equalizer.taps()); + spinbox.parent(vbox); + spinbox.show(); + connect(spinbox,"value_changed", equalizer, "taps"); + vbox._addChild(spinbox,"spinbox"); + vbox._addChild(g,"g"); + + return vbox; +} diff --git a/arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cc b/arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cc deleted file mode 100644 index 390fd04e..00000000 --- a/arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cc +++ /dev/null @@ -1,63 +0,0 @@ -#include "flowsystem.h" -#include "artsmoduleseffects.h" -#include "stdsynthmodule.h" - -using namespace Arts; - -class Synth_STEREO_PITCH_SHIFT_FFT_impl : virtual public Synth_STEREO_PITCH_SHIFT_FFT_skel, - virtual public StdSynthModule -{ -protected: - Synth_PITCH_SHIFT_FFT leftPitchShift, rightPitchShift; - -public: - float speed() { return leftPitchShift.speed(); } - void speed(float newSpeed) - { - leftPitchShift.speed(newSpeed); - rightPitchShift.speed(newSpeed); - } - - float scaleFactor() { return leftPitchShift.scaleFactor(); } - void scaleFactor(float newScaleFactor) - { - leftPitchShift.scaleFactor(newScaleFactor); - rightPitchShift.scaleFactor(newScaleFactor); - } - - long frameSize() { return leftPitchShift.frameSize(); } - void frameSize(long newFrameSize) - { - leftPitchShift.frameSize(newFrameSize); - rightPitchShift.frameSize(newFrameSize); - } - - long oversample() { return leftPitchShift.oversample(); } - void oversample(long newOversample) - { - leftPitchShift.oversample(newOversample); - rightPitchShift.oversample(newOversample); - } - - void streamStart() - { - leftPitchShift.start(); - rightPitchShift.start(); - _node()->virtualize("inleft",leftPitchShift._node(),"inStream"); - _node()->virtualize("outleft",leftPitchShift._node(),"outStream"); - _node()->virtualize("inright",rightPitchShift._node(),"inStream"); - _node()->virtualize("outright",rightPitchShift._node(),"outStream"); - } - - void streamEnd() - { - _node()->devirtualize("inleft",leftPitchShift._node(),"inStream"); - _node()->devirtualize("outleft",leftPitchShift._node(),"outStream"); - _node()->devirtualize("inright",rightPitchShift._node(),"inStream"); - _node()->devirtualize("outright",rightPitchShift._node(),"outStream"); - leftPitchShift.stop(); - rightPitchShift.stop(); - } -}; - -REGISTER_IMPLEMENTATION(Synth_STEREO_PITCH_SHIFT_FFT_impl); diff --git a/arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cpp b/arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cpp new file mode 100644 index 00000000..390fd04e --- /dev/null +++ b/arts/modules/effects/synth_stereo_pitch_shift_fft_impl.cpp @@ -0,0 +1,63 @@ +#include "flowsystem.h" +#include "artsmoduleseffects.h" +#include "stdsynthmodule.h" + +using namespace Arts; + +class Synth_STEREO_PITCH_SHIFT_FFT_impl : virtual public Synth_STEREO_PITCH_SHIFT_FFT_skel, + virtual public StdSynthModule +{ +protected: + Synth_PITCH_SHIFT_FFT leftPitchShift, rightPitchShift; + +public: + float speed() { return leftPitchShift.speed(); } + void speed(float newSpeed) + { + leftPitchShift.speed(newSpeed); + rightPitchShift.speed(newSpeed); + } + + float scaleFactor() { return leftPitchShift.scaleFactor(); } + void scaleFactor(float newScaleFactor) + { + leftPitchShift.scaleFactor(newScaleFactor); + rightPitchShift.scaleFactor(newScaleFactor); + } + + long frameSize() { return leftPitchShift.frameSize(); } + void frameSize(long newFrameSize) + { + leftPitchShift.frameSize(newFrameSize); + rightPitchShift.frameSize(newFrameSize); + } + + long oversample() { return leftPitchShift.oversample(); } + void oversample(long newOversample) + { + leftPitchShift.oversample(newOversample); + rightPitchShift.oversample(newOversample); + } + + void streamStart() + { + leftPitchShift.start(); + rightPitchShift.start(); + _node()->virtualize("inleft",leftPitchShift._node(),"inStream"); + _node()->virtualize("outleft",leftPitchShift._node(),"outStream"); + _node()->virtualize("inright",rightPitchShift._node(),"inStream"); + _node()->virtualize("outright",rightPitchShift._node(),"outStream"); + } + + void streamEnd() + { + _node()->devirtualize("inleft",leftPitchShift._node(),"inStream"); + _node()->devirtualize("outleft",leftPitchShift._node(),"outStream"); + _node()->devirtualize("inright",rightPitchShift._node(),"inStream"); + _node()->devirtualize("outright",rightPitchShift._node(),"outStream"); + leftPitchShift.stop(); + rightPitchShift.stop(); + } +}; + +REGISTER_IMPLEMENTATION(Synth_STEREO_PITCH_SHIFT_FFT_impl); diff --git a/arts/modules/effects/synth_stereo_pitch_shift_impl.cc b/arts/modules/effects/synth_stereo_pitch_shift_impl.cc deleted file mode 100644 index fbf7bb07..00000000 --- a/arts/modules/effects/synth_stereo_pitch_shift_impl.cc +++ /dev/null @@ -1,51 +0,0 @@ -#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); diff --git a/arts/modules/effects/synth_stereo_pitch_shift_impl.cpp b/arts/modules/effects/synth_stereo_pitch_shift_impl.cpp new file mode 100644 index 00000000..fbf7bb07 --- /dev/null +++ b/arts/modules/effects/synth_stereo_pitch_shift_impl.cpp @@ -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); diff --git a/arts/modules/effects/synth_voice_removal_impl.cc b/arts/modules/effects/synth_voice_removal_impl.cc deleted file mode 100644 index 2ade0879..00000000 --- a/arts/modules/effects/synth_voice_removal_impl.cc +++ /dev/null @@ -1,106 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002-2003 Matthias Kretz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ -// $Id$ - -#include "artsmoduleseffects.h" -#include -#include -#include - -using namespace Arts; -using namespace std; - -class Synth_VOICE_REMOVAL_impl : virtual public Synth_VOICE_REMOVAL_skel, - virtual public StdSynthModule -{ -protected: - float _position, _frequency; - filter fleft, fright; - -public: - Synth_VOICE_REMOVAL_impl() - : _position( 0 ) - , _frequency( 200 ) - { - } - - float position() { return _position; } - void position(float newPosition) - { - if(newPosition != _position) - { - _position = newPosition; - position_changed(newPosition); - } - } - - float frequency() { return _frequency; } - void frequency(float newFrequency) - { - if(newFrequency != _frequency) - { - _frequency = newFrequency; - // the shelve-lowpass-filter is extremely sensitive to frequencies which - // are out of it's range (it produces NaN's then) so we'll be careful ;) - if(_frequency > 22000.0) _frequency = 22000.0; - if(_frequency < 1.0) _frequency = 1.0; - frequency_changed(_frequency); - } - } - - void streamInit() - { - initfilter(&fleft); - initfilter(&fright); - } - - void calculateBlock(unsigned long samples) - { - setfilter_shelvelowpass(&fleft,_frequency,80.0); - setfilter_shelvelowpass(&fright,_frequency,80.0); - - unsigned long i; - for (i=0; i + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ +// $Id$ + +#include "artsmoduleseffects.h" +#include +#include +#include + +using namespace Arts; +using namespace std; + +class Synth_VOICE_REMOVAL_impl : virtual public Synth_VOICE_REMOVAL_skel, + virtual public StdSynthModule +{ +protected: + float _position, _frequency; + filter fleft, fright; + +public: + Synth_VOICE_REMOVAL_impl() + : _position( 0 ) + , _frequency( 200 ) + { + } + + float position() { return _position; } + void position(float newPosition) + { + if(newPosition != _position) + { + _position = newPosition; + position_changed(newPosition); + } + } + + float frequency() { return _frequency; } + void frequency(float newFrequency) + { + if(newFrequency != _frequency) + { + _frequency = newFrequency; + // the shelve-lowpass-filter is extremely sensitive to frequencies which + // are out of it's range (it produces NaN's then) so we'll be careful ;) + if(_frequency > 22000.0) _frequency = 22000.0; + if(_frequency < 1.0) _frequency = 1.0; + frequency_changed(_frequency); + } + } + + void streamInit() + { + initfilter(&fleft); + initfilter(&fright); + } + + void calculateBlock(unsigned long samples) + { + setfilter_shelvelowpass(&fleft,_frequency,80.0); + setfilter_shelvelowpass(&fright,_frequency,80.0); + + unsigned long i; + for (i=0; i - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ -// $Id$ - -#include "artsmoduleseffects.h" -#include -#include -#include - -using namespace std; -using namespace Arts; - -namespace Arts { - -class VoiceRemovalGuiFactory_impl : public VoiceRemovalGuiFactory_skel -{ - public: - Widget createGui( Object ); -}; - -REGISTER_IMPLEMENTATION( VoiceRemovalGuiFactory_impl ); - -} - -Widget VoiceRemovalGuiFactory_impl::createGui( Object object ) -{ - arts_return_val_if_fail( ! object.isNull(), Arts::Widget::null() ); - - Synth_VOICE_REMOVAL voiceremoval = DynamicCast( object ); - arts_return_val_if_fail( ! voiceremoval.isNull(), Arts::Widget::null() ); - - HBox hbox; - hbox.width( 140 ); hbox.height( 80 );// hbox.show(); - - Poti position; - position.x( 20 ); position.y( 10 ); position.caption( "position" ); - position.color( "grey" ); position.min( -1 ); position.max( 1 ); - position.value( voiceremoval.position() ); - position.range( 100 ); - position.parent( hbox ); - position.show(); - connect( position, "value_changed", voiceremoval, "position" ); - hbox._addChild( position, "positionWidget" ); - - Poti freq; - freq.x( 80 ); freq.y( 10 ); freq.caption( "freq" ); - freq.color( "red" ); freq.min( 1 ); freq.max( 10000 ); - freq.value( voiceremoval.frequency() ); - freq.range( 400 ); - freq.logarithmic( 2.0 ); - freq.parent( hbox ); - freq.show(); - connect( freq, "value_changed", voiceremoval, "frequency" ); - hbox._addChild( freq, "freqWidget" ); - - - return hbox; -} diff --git a/arts/modules/effects/voiceremovalguifactory_impl.cpp b/arts/modules/effects/voiceremovalguifactory_impl.cpp new file mode 100644 index 00000000..dc9dce20 --- /dev/null +++ b/arts/modules/effects/voiceremovalguifactory_impl.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Matthias Kretz + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ +// $Id$ + +#include "artsmoduleseffects.h" +#include +#include +#include + +using namespace std; +using namespace Arts; + +namespace Arts { + +class VoiceRemovalGuiFactory_impl : public VoiceRemovalGuiFactory_skel +{ + public: + Widget createGui( Object ); +}; + +REGISTER_IMPLEMENTATION( VoiceRemovalGuiFactory_impl ); + +} + +Widget VoiceRemovalGuiFactory_impl::createGui( Object object ) +{ + arts_return_val_if_fail( ! object.isNull(), Arts::Widget::null() ); + + Synth_VOICE_REMOVAL voiceremoval = DynamicCast( object ); + arts_return_val_if_fail( ! voiceremoval.isNull(), Arts::Widget::null() ); + + HBox hbox; + hbox.width( 140 ); hbox.height( 80 );// hbox.show(); + + Poti position; + position.x( 20 ); position.y( 10 ); position.caption( "position" ); + position.color( "grey" ); position.min( -1 ); position.max( 1 ); + position.value( voiceremoval.position() ); + position.range( 100 ); + position.parent( hbox ); + position.show(); + connect( position, "value_changed", voiceremoval, "position" ); + hbox._addChild( position, "positionWidget" ); + + Poti freq; + freq.x( 80 ); freq.y( 10 ); freq.caption( "freq" ); + freq.color( "red" ); freq.min( 1 ); freq.max( 10000 ); + freq.value( voiceremoval.frequency() ); + freq.range( 400 ); + freq.logarithmic( 2.0 ); + freq.parent( hbox ); + freq.show(); + connect( freq, "value_changed", voiceremoval, "frequency" ); + hbox._addChild( freq, "freqWidget" ); + + + return hbox; +} -- cgit v1.2.1