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/mixers/CMakeLists.txt | 10 +- arts/modules/mixers/Makefile.am | 12 +- arts/modules/mixers/artsmodulesmixers.idl | 2 +- .../mixers/littlestereomixerchannel_impl.cc | 134 --------------------- .../mixers/littlestereomixerchannel_impl.cpp | 134 +++++++++++++++++++++ arts/modules/mixers/monosimplemixerchannel_impl.cc | 106 ---------------- .../modules/mixers/monosimplemixerchannel_impl.cpp | 106 ++++++++++++++++ .../monosimplemixerchannelguifactory_impl.cc | 94 --------------- .../monosimplemixerchannelguifactory_impl.cpp | 94 +++++++++++++++ arts/modules/mixers/simplemixerchannel_impl.cc | 132 -------------------- arts/modules/mixers/simplemixerchannel_impl.cpp | 132 ++++++++++++++++++++ .../mixers/simplemixerchannelguifactory_impl.cc | 82 ------------- .../mixers/simplemixerchannelguifactory_impl.cpp | 82 +++++++++++++ 13 files changed, 560 insertions(+), 560 deletions(-) delete mode 100644 arts/modules/mixers/littlestereomixerchannel_impl.cc create mode 100644 arts/modules/mixers/littlestereomixerchannel_impl.cpp delete mode 100644 arts/modules/mixers/monosimplemixerchannel_impl.cc create mode 100644 arts/modules/mixers/monosimplemixerchannel_impl.cpp delete mode 100644 arts/modules/mixers/monosimplemixerchannelguifactory_impl.cc create mode 100644 arts/modules/mixers/monosimplemixerchannelguifactory_impl.cpp delete mode 100644 arts/modules/mixers/simplemixerchannel_impl.cc create mode 100644 arts/modules/mixers/simplemixerchannel_impl.cpp delete mode 100644 arts/modules/mixers/simplemixerchannelguifactory_impl.cc create mode 100644 arts/modules/mixers/simplemixerchannelguifactory_impl.cpp (limited to 'arts/modules/mixers') diff --git a/arts/modules/mixers/CMakeLists.txt b/arts/modules/mixers/CMakeLists.txt index 98e7147d..7f6d4dc4 100644 --- a/arts/modules/mixers/CMakeLists.txt +++ b/arts/modules/mixers/CMakeLists.txt @@ -37,10 +37,10 @@ link_directories( tde_add_library( artsmodulesmixers SHARED SOURCES - artsmodulesmixers.cc - monosimplemixerchannel_impl.cc monosimplemixerchannelguifactory_impl.cc - simplemixerchannel_impl.cc simplemixerchannelguifactory_impl.cc - littlestereomixerchannel_impl.cc + artsmodulesmixers.cpp + monosimplemixerchannel_impl.cpp monosimplemixerchannelguifactory_impl.cpp + simplemixerchannel_impl.cpp simplemixerchannelguifactory_impl.cpp + littlestereomixerchannel_impl.cpp VERSION 0.0.0 LINK artsgui_idl-shared artsmodulescommon-shared artsmoduleseffects-shared @@ -50,7 +50,7 @@ tde_add_library( artsmodulesmixers SHARED add_custom_command( OUTPUT - artsmodulesmixers.cc artsmodulesmixers.h + artsmodulesmixers.cpp artsmodulesmixers.h artsmodulesmixers.mcopclass artsmodulesmixers.mcoptype COMMAND ${ARTS_MCOPIDL_EXECUTABLE} -t -I${CMAKE_SOURCE_DIR}/arts/gui/common diff --git a/arts/modules/mixers/Makefile.am b/arts/modules/mixers/Makefile.am index b504bfba..0cb0b666 100644 --- a/arts/modules/mixers/Makefile.am +++ b/arts/modules/mixers/Makefile.am @@ -25,10 +25,10 @@ MCOPINCLUDES = \ lib_LTLIBRARIES = libartsmodulesmixers.la -libartsmodulesmixers_la_SOURCES = artsmodulesmixers.cc \ - monosimplemixerchannel_impl.cc monosimplemixerchannelguifactory_impl.cc \ - simplemixerchannel_impl.cc simplemixerchannelguifactory_impl.cc \ - littlestereomixerchannel_impl.cc +libartsmodulesmixers_la_SOURCES = artsmodulesmixers.cpp \ + monosimplemixerchannel_impl.cpp monosimplemixerchannelguifactory_impl.cpp \ + simplemixerchannel_impl.cpp simplemixerchannelguifactory_impl.cpp \ + littlestereomixerchannel_impl.cpp libartsmodulesmixers_la_COMPILE_FIRST = ../synth/artsmodulessynth.h \ ../../midi/artsmidi.h ../common/artsmodulescommon.h ../../gui/common/artsgui.h \ artsmodulesmixers.h @@ -40,10 +40,10 @@ libartsmodulesmixers_la_LIBADD = \ libartsmodulesmixers_la_LDFLAGS = $(all_libraries) -L$(arts_libraries) -no-undefined -artsmodulesmixers.cc artsmodulesmixers.h artsmodulesmixers.mcoptype artsmodulesmixers.mcopclass: $(srcdir)/artsmodulesmixers.idl $(MCOPIDL) +artsmodulesmixers.cpp artsmodulesmixers.h artsmodulesmixers.mcoptype artsmodulesmixers.mcopclass: $(srcdir)/artsmodulesmixers.idl $(MCOPIDL) $(MCOPIDL) -t $(MCOPINCLUDES) $(srcdir)/artsmodulesmixers.idl -DISTCLEANFILES= artsmodulesmixers.cc artsmodulesmixers.h artsmodulesmixers.mcop* +DISTCLEANFILES= artsmodulesmixers.cpp artsmodulesmixers.h artsmodulesmixers.mcop* artsincludedir = $(includedir)/arts artsinclude_HEADERS = artsmodulesmixers.h artsmodulesmixers.idl diff --git a/arts/modules/mixers/artsmodulesmixers.idl b/arts/modules/mixers/artsmodulesmixers.idl index 56ff073b..dbe82c5c 100644 --- a/arts/modules/mixers/artsmodulesmixers.idl +++ b/arts/modules/mixers/artsmodulesmixers.idl @@ -25,7 +25,7 @@ */ /* -* DISCLAIMER: The interfaces in artsmodules.idl (and the derived .cc/.h files) +* DISCLAIMER: The interfaces in artsmodules.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/mixers/littlestereomixerchannel_impl.cc b/arts/modules/mixers/littlestereomixerchannel_impl.cc deleted file mode 100644 index 3b14fa39..00000000 --- a/arts/modules/mixers/littlestereomixerchannel_impl.cc +++ /dev/null @@ -1,134 +0,0 @@ - /* - - Copyright ( C ) 2002-2003 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. - - 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 "artsmodulesmixers.h" -#include "artsmoduleseffects.h" - -#include -#include -#include -#include -#include "artsgui.h" - -#include - -using namespace Arts; - -namespace Arts { - -class LittleStereoMixerChannel_impl : virtual public LittleStereoMixerChannel_skel, - virtual public StdSynthModule -{ -protected: - std::string _name; - Arts::StereoBalance _balance; - Arts::StereoVolumeControl _volume; -public: - LittleStereoMixerChannel_impl() - { - arts_debug( "LittleStereo startup" ); - if( _balance.isNull() ) arts_debug( "\n\nCouldn't create StereoBalance!!!!\n\n" ); - if( _volume.isNull() ) arts_debug( "\n\nCouldn't create StereoVolumeControl!!!!\n\n" ); - _balance.balance( 0 ); - _volume.scaleFactor( 1 ); - arts_debug( "startup ok\n" ); - } - - std::string name() { return _name; } - void name( const std::string& n ) { arts_debug( "Name = %s", n.c_str() ); _name = n; } - - //Arts::StereoBalance balance() { return _balance; } - - //Arts::StereoVolumeControl volume() { return _volume; } - - float balance() { return _balance.balance(); } - void balance( float n ) { _balance.balance( n ); } - - float volume() { return _volume.scaleFactor(); } - void volume( float n ) { _volume.scaleFactor( n ); } - - void streamInit() - { - arts_debug( "LittleStereo::streamInit()" ); - if( _balance.isNull() ) arts_warning( "Couldn't create StereoBalance!!!!\n" ); - if( _volume.isNull() ) arts_warning( "Couldn't create StereoVolumeControl!!!!\n" ); - - arts_debug( "LittleStereo::streamInit() starts" ); - _balance.start(); - _volume.start(); - - arts_debug( "LittleStereo::streamInit() first connects" ); - _node()->virtualize( "inleft", _balance._node(), "inleft" ); - _node()->virtualize( "inright", _balance._node(), "inright" ); - arts_debug( "LittleStereo::streamInit() middle connects" ); - connect( _balance, "outleft", _volume, "inleft" ); - connect( _balance, "outright", _volume, "inright" ); - arts_debug( "LittleStereo::streamInit() last connects" ); - _node()->virtualize( "outleft", _volume._node(), "outleft" ); - _node()->virtualize( "outright", _volume._node(), "outright" ); - arts_debug( "LittleStereo::streamInit() finished.\nbye" ); - _balance.balance( 0 ); - _volume.scaleFactor( 1 ); - } - - void streamEnd() - { - _balance.stop(); - _volume.stop(); - } - -}; -REGISTER_IMPLEMENTATION( LittleStereoMixerChannel_impl ); - -class LittleStereoMixerChannelGuiFactory_impl : virtual public LittleStereoMixerChannelGuiFactory_skel -{ -public: - Widget createGui( Object object ) - { - arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); - LittleStereoMixerChannel ch= DynamicCast(object); - arts_return_val_if_fail(!ch.isNull(), Arts::Widget::null()); - - Arts::LayoutBox vbox; - vbox.direction( Arts::TopToBottom ); - - Poti pan; - pan.caption( i18n( "pan" ).utf8().data() ); - pan.color( "grey" ); pan.min( -1.0 ); pan.max( 1.0 ); - pan.value( ch.balance() ); - connect( pan, "value_changed", ch, "balance" ); - vbox.addWidget( pan ); - - Fader volume; - volume.caption( i18n( "volume" ).utf8().data() ); - volume.color( "red" ); volume.min( 0.01 ); volume.max( 2 ); - //volume.logarithmic( 2 ); - volume.value( ch.volume() ); - connect( volume, "value_changed", ch, "volume" ); - vbox.addWidget( volume ); - - return vbox; - } -}; -REGISTER_IMPLEMENTATION( LittleStereoMixerChannelGuiFactory_impl ); - -} - diff --git a/arts/modules/mixers/littlestereomixerchannel_impl.cpp b/arts/modules/mixers/littlestereomixerchannel_impl.cpp new file mode 100644 index 00000000..3b14fa39 --- /dev/null +++ b/arts/modules/mixers/littlestereomixerchannel_impl.cpp @@ -0,0 +1,134 @@ + /* + + Copyright ( C ) 2002-2003 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. + + 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 "artsmodulesmixers.h" +#include "artsmoduleseffects.h" + +#include +#include +#include +#include +#include "artsgui.h" + +#include + +using namespace Arts; + +namespace Arts { + +class LittleStereoMixerChannel_impl : virtual public LittleStereoMixerChannel_skel, + virtual public StdSynthModule +{ +protected: + std::string _name; + Arts::StereoBalance _balance; + Arts::StereoVolumeControl _volume; +public: + LittleStereoMixerChannel_impl() + { + arts_debug( "LittleStereo startup" ); + if( _balance.isNull() ) arts_debug( "\n\nCouldn't create StereoBalance!!!!\n\n" ); + if( _volume.isNull() ) arts_debug( "\n\nCouldn't create StereoVolumeControl!!!!\n\n" ); + _balance.balance( 0 ); + _volume.scaleFactor( 1 ); + arts_debug( "startup ok\n" ); + } + + std::string name() { return _name; } + void name( const std::string& n ) { arts_debug( "Name = %s", n.c_str() ); _name = n; } + + //Arts::StereoBalance balance() { return _balance; } + + //Arts::StereoVolumeControl volume() { return _volume; } + + float balance() { return _balance.balance(); } + void balance( float n ) { _balance.balance( n ); } + + float volume() { return _volume.scaleFactor(); } + void volume( float n ) { _volume.scaleFactor( n ); } + + void streamInit() + { + arts_debug( "LittleStereo::streamInit()" ); + if( _balance.isNull() ) arts_warning( "Couldn't create StereoBalance!!!!\n" ); + if( _volume.isNull() ) arts_warning( "Couldn't create StereoVolumeControl!!!!\n" ); + + arts_debug( "LittleStereo::streamInit() starts" ); + _balance.start(); + _volume.start(); + + arts_debug( "LittleStereo::streamInit() first connects" ); + _node()->virtualize( "inleft", _balance._node(), "inleft" ); + _node()->virtualize( "inright", _balance._node(), "inright" ); + arts_debug( "LittleStereo::streamInit() middle connects" ); + connect( _balance, "outleft", _volume, "inleft" ); + connect( _balance, "outright", _volume, "inright" ); + arts_debug( "LittleStereo::streamInit() last connects" ); + _node()->virtualize( "outleft", _volume._node(), "outleft" ); + _node()->virtualize( "outright", _volume._node(), "outright" ); + arts_debug( "LittleStereo::streamInit() finished.\nbye" ); + _balance.balance( 0 ); + _volume.scaleFactor( 1 ); + } + + void streamEnd() + { + _balance.stop(); + _volume.stop(); + } + +}; +REGISTER_IMPLEMENTATION( LittleStereoMixerChannel_impl ); + +class LittleStereoMixerChannelGuiFactory_impl : virtual public LittleStereoMixerChannelGuiFactory_skel +{ +public: + Widget createGui( Object object ) + { + arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); + LittleStereoMixerChannel ch= DynamicCast(object); + arts_return_val_if_fail(!ch.isNull(), Arts::Widget::null()); + + Arts::LayoutBox vbox; + vbox.direction( Arts::TopToBottom ); + + Poti pan; + pan.caption( i18n( "pan" ).utf8().data() ); + pan.color( "grey" ); pan.min( -1.0 ); pan.max( 1.0 ); + pan.value( ch.balance() ); + connect( pan, "value_changed", ch, "balance" ); + vbox.addWidget( pan ); + + Fader volume; + volume.caption( i18n( "volume" ).utf8().data() ); + volume.color( "red" ); volume.min( 0.01 ); volume.max( 2 ); + //volume.logarithmic( 2 ); + volume.value( ch.volume() ); + connect( volume, "value_changed", ch, "volume" ); + vbox.addWidget( volume ); + + return vbox; + } +}; +REGISTER_IMPLEMENTATION( LittleStereoMixerChannelGuiFactory_impl ); + +} + diff --git a/arts/modules/mixers/monosimplemixerchannel_impl.cc b/arts/modules/mixers/monosimplemixerchannel_impl.cc deleted file mode 100644 index 04bad0ce..00000000 --- a/arts/modules/mixers/monosimplemixerchannel_impl.cc +++ /dev/null @@ -1,106 +0,0 @@ -#include "artsmodulesmixers.h" -#include "flowsystem.h" -#include "stdsynthmodule.h" -#include "connect.h" - -namespace Arts { -class MonoSimpleMixerChannel_impl : virtual public MonoSimpleMixerChannel_skel, - virtual public StdSynthModule -{ -protected: - Synth_STD_EQUALIZER _equalizer; - StereoEffectStack _insertEffects; - Synth_MUL mulGain; - Synth_MUL mulVolumeLeft, mulVolumeRight; - float _gain, _pan, _volume, pLeft, pRight; - std::string _name; -public: - MonoSimpleMixerChannel_impl() - : _gain(1.0), _pan(0), _volume(1.0), pLeft(1), pRight(1) - { - setValue(mulVolumeLeft,"invalue2",_volume*pLeft); - setValue(mulVolumeRight,"invalue2",_volume*pRight); - setValue(mulGain,"invalue2",_gain); - } - - Synth_STD_EQUALIZER equalizer() { return _equalizer; } - StereoEffectStack insertEffects() { return _insertEffects; } - - float gain() { return _gain; } - void gain(float g) - { - if(g != _gain) { - _gain = g; - setValue(mulGain,"invalue2",g); - gain_changed(g); - } - } - - float volume() { return _volume; } - void volume(float v) - { - if(v != _volume) { - _volume = v; - setValue(mulVolumeLeft,"invalue2",v*pLeft); - setValue(mulVolumeRight,"invalue2",v*pRight); - volume_changed(v); - } - } - - float pan() { return _pan; } - void pan(float p) - { - if(p != _pan) - { - _pan = p; - pLeft = 1.0; - pRight = 1.0; - if(p > 0) - pLeft = 1-p; - else - pRight = 1+p; - setValue(mulVolumeLeft,"invalue2",_volume*pLeft); - setValue(mulVolumeRight,"invalue2",_volume*pRight); - pan_changed(p); - } - } - - std::string name() { return _name; } - void name(const std::string& newName) - { - if(_name != newName) { - _name = newName; - name_changed(newName); - } - } - - void streamInit() - { - _equalizer.start(); - mulVolumeLeft.start(); - mulVolumeRight.start(); - mulGain.start(); - //_insertEffects.start(); - - _node()->virtualize("inleft",mulGain._node(),"invalue1"); - connect(mulGain,"outvalue",_equalizer,"invalue"); - //connect(_equalizer,"outvalue",_insertEffects,"inleft"); - //connect(_insertEffects,"outleft",mulVolume,"invalue1"); - connect(_equalizer,"outvalue",mulVolumeLeft,"invalue1"); - connect(_equalizer,"outvalue",mulVolumeRight,"invalue1"); - _node()->virtualize("outleft",mulVolumeLeft._node(),"outvalue"); - _node()->virtualize("outright",mulVolumeRight._node(),"outvalue"); - - } - void streamEnd() - { - _equalizer.stop(); - //_insertEffects.stop(); - mulVolumeLeft.stop(); - mulVolumeRight.stop(); - mulGain.stop(); - } -}; -REGISTER_IMPLEMENTATION(MonoSimpleMixerChannel_impl); -} - diff --git a/arts/modules/mixers/monosimplemixerchannel_impl.cpp b/arts/modules/mixers/monosimplemixerchannel_impl.cpp new file mode 100644 index 00000000..04bad0ce --- /dev/null +++ b/arts/modules/mixers/monosimplemixerchannel_impl.cpp @@ -0,0 +1,106 @@ +#include "artsmodulesmixers.h" +#include "flowsystem.h" +#include "stdsynthmodule.h" +#include "connect.h" + +namespace Arts { +class MonoSimpleMixerChannel_impl : virtual public MonoSimpleMixerChannel_skel, + virtual public StdSynthModule +{ +protected: + Synth_STD_EQUALIZER _equalizer; + StereoEffectStack _insertEffects; + Synth_MUL mulGain; + Synth_MUL mulVolumeLeft, mulVolumeRight; + float _gain, _pan, _volume, pLeft, pRight; + std::string _name; +public: + MonoSimpleMixerChannel_impl() + : _gain(1.0), _pan(0), _volume(1.0), pLeft(1), pRight(1) + { + setValue(mulVolumeLeft,"invalue2",_volume*pLeft); + setValue(mulVolumeRight,"invalue2",_volume*pRight); + setValue(mulGain,"invalue2",_gain); + } + + Synth_STD_EQUALIZER equalizer() { return _equalizer; } + StereoEffectStack insertEffects() { return _insertEffects; } + + float gain() { return _gain; } + void gain(float g) + { + if(g != _gain) { + _gain = g; + setValue(mulGain,"invalue2",g); + gain_changed(g); + } + } + + float volume() { return _volume; } + void volume(float v) + { + if(v != _volume) { + _volume = v; + setValue(mulVolumeLeft,"invalue2",v*pLeft); + setValue(mulVolumeRight,"invalue2",v*pRight); + volume_changed(v); + } + } + + float pan() { return _pan; } + void pan(float p) + { + if(p != _pan) + { + _pan = p; + pLeft = 1.0; + pRight = 1.0; + if(p > 0) + pLeft = 1-p; + else + pRight = 1+p; + setValue(mulVolumeLeft,"invalue2",_volume*pLeft); + setValue(mulVolumeRight,"invalue2",_volume*pRight); + pan_changed(p); + } + } + + std::string name() { return _name; } + void name(const std::string& newName) + { + if(_name != newName) { + _name = newName; + name_changed(newName); + } + } + + void streamInit() + { + _equalizer.start(); + mulVolumeLeft.start(); + mulVolumeRight.start(); + mulGain.start(); + //_insertEffects.start(); + + _node()->virtualize("inleft",mulGain._node(),"invalue1"); + connect(mulGain,"outvalue",_equalizer,"invalue"); + //connect(_equalizer,"outvalue",_insertEffects,"inleft"); + //connect(_insertEffects,"outleft",mulVolume,"invalue1"); + connect(_equalizer,"outvalue",mulVolumeLeft,"invalue1"); + connect(_equalizer,"outvalue",mulVolumeRight,"invalue1"); + _node()->virtualize("outleft",mulVolumeLeft._node(),"outvalue"); + _node()->virtualize("outright",mulVolumeRight._node(),"outvalue"); + + } + void streamEnd() + { + _equalizer.stop(); + //_insertEffects.stop(); + mulVolumeLeft.stop(); + mulVolumeRight.stop(); + mulGain.stop(); + } +}; +REGISTER_IMPLEMENTATION(MonoSimpleMixerChannel_impl); +} + diff --git a/arts/modules/mixers/monosimplemixerchannelguifactory_impl.cc b/arts/modules/mixers/monosimplemixerchannelguifactory_impl.cc deleted file mode 100644 index 28fbab55..00000000 --- a/arts/modules/mixers/monosimplemixerchannelguifactory_impl.cc +++ /dev/null @@ -1,94 +0,0 @@ -#include "artsmodulesmixers.h" -#include "debug.h" -#include "connect.h" - -#include -#include - -namespace Arts { - - class MonoSimpleMixerChannelGuiFactory_impl : virtual public MonoSimpleMixerChannelGuiFactory_skel - { - public: - Widget createGui(Object object) - { - TDEGlobal::locale()->insertCatalogue( "artsmodules" ); - arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); - MonoSimpleMixerChannel ch= DynamicCast(object); - arts_return_val_if_fail(!ch.isNull(), Arts::Widget::null()); - - Arts::LayoutBox vbox; - vbox.direction( Arts::TopToBottom ); - - Poti gain; - gain.caption(i18n("gain").utf8().data()); - gain.color("red"); gain.min(0.01); gain.max(4); - gain.value(ch.gain()); - connect(gain,"value_changed", ch, "gain"); - vbox.addWidget( gain ); - - Arts::PopupBox eqbox; - eqbox.name( i18n( "EQ" ).utf8().data() ); - eqbox.direction( Arts::TopToBottom ); - vbox.addWidget( eqbox ); - - Arts::LayoutBox eq; - eq.direction( Arts::TopToBottom ); - eqbox.widget( eq ); - - Poti high; - high.caption(i18n("volume","high").utf8().data()); - high.color("blue"); high.min(-12); high.max(12); - high.value(ch.equalizer().high()); - connect(high,"value_changed", ch.equalizer(), "high"); - eq.addWidget( high ); - - Poti mid; - mid.caption(i18n("volume","mid").utf8().data()); - mid.color("blue"); mid.min(-12); mid.max(12); - mid.value(ch.equalizer().mid()); - connect(mid,"value_changed", ch.equalizer(), "mid"); - eq.addWidget( mid ); - - Poti low; - low.caption(i18n("volume","low").utf8().data()); - low.color("blue"); low.min(-12); low.max(12); - low.value(ch.equalizer().low()); - connect(low,"value_changed", ch.equalizer(), "low"); - eq.addWidget( low ); - - Poti frequency; - frequency.caption(i18n("frequency").utf8().data()); - frequency.color("darkgreen"); frequency.min(20); frequency.max(10000); - frequency.value(ch.equalizer().frequency()); - frequency.logarithmic(2.0); - connect(frequency,"value_changed", ch.equalizer(), "frequency"); - eq.addWidget( frequency ); - - Poti q; - q.caption(i18n( "q" ).utf8().data()); - q.color("darkgreen"); q.min(0.01); q.max(10); - q.value(ch.equalizer().q()); - q.logarithmic(2.0); - connect(q,"value_changed", ch.equalizer(), "q"); - eq.addWidget( q ); - - Poti pan; - pan.caption(i18n("pan").utf8().data()); - pan.color("grey"); pan.min(-1.0); pan.max(1.0); - pan.value(ch.pan()); - connect(pan,"value_changed",ch,"pan"); - vbox.addWidget( pan ); - - Fader volume; - volume.caption(i18n("volume").utf8().data()); - volume.color("red"); volume.min(0.01); volume.max(4); - volume.value(ch.volume()); - connect(volume,"value_changed", ch, "volume"); - vbox.addWidget( volume ); - - return vbox; - } - }; - REGISTER_IMPLEMENTATION(MonoSimpleMixerChannelGuiFactory_impl); -} diff --git a/arts/modules/mixers/monosimplemixerchannelguifactory_impl.cpp b/arts/modules/mixers/monosimplemixerchannelguifactory_impl.cpp new file mode 100644 index 00000000..28fbab55 --- /dev/null +++ b/arts/modules/mixers/monosimplemixerchannelguifactory_impl.cpp @@ -0,0 +1,94 @@ +#include "artsmodulesmixers.h" +#include "debug.h" +#include "connect.h" + +#include +#include + +namespace Arts { + + class MonoSimpleMixerChannelGuiFactory_impl : virtual public MonoSimpleMixerChannelGuiFactory_skel + { + public: + Widget createGui(Object object) + { + TDEGlobal::locale()->insertCatalogue( "artsmodules" ); + arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); + MonoSimpleMixerChannel ch= DynamicCast(object); + arts_return_val_if_fail(!ch.isNull(), Arts::Widget::null()); + + Arts::LayoutBox vbox; + vbox.direction( Arts::TopToBottom ); + + Poti gain; + gain.caption(i18n("gain").utf8().data()); + gain.color("red"); gain.min(0.01); gain.max(4); + gain.value(ch.gain()); + connect(gain,"value_changed", ch, "gain"); + vbox.addWidget( gain ); + + Arts::PopupBox eqbox; + eqbox.name( i18n( "EQ" ).utf8().data() ); + eqbox.direction( Arts::TopToBottom ); + vbox.addWidget( eqbox ); + + Arts::LayoutBox eq; + eq.direction( Arts::TopToBottom ); + eqbox.widget( eq ); + + Poti high; + high.caption(i18n("volume","high").utf8().data()); + high.color("blue"); high.min(-12); high.max(12); + high.value(ch.equalizer().high()); + connect(high,"value_changed", ch.equalizer(), "high"); + eq.addWidget( high ); + + Poti mid; + mid.caption(i18n("volume","mid").utf8().data()); + mid.color("blue"); mid.min(-12); mid.max(12); + mid.value(ch.equalizer().mid()); + connect(mid,"value_changed", ch.equalizer(), "mid"); + eq.addWidget( mid ); + + Poti low; + low.caption(i18n("volume","low").utf8().data()); + low.color("blue"); low.min(-12); low.max(12); + low.value(ch.equalizer().low()); + connect(low,"value_changed", ch.equalizer(), "low"); + eq.addWidget( low ); + + Poti frequency; + frequency.caption(i18n("frequency").utf8().data()); + frequency.color("darkgreen"); frequency.min(20); frequency.max(10000); + frequency.value(ch.equalizer().frequency()); + frequency.logarithmic(2.0); + connect(frequency,"value_changed", ch.equalizer(), "frequency"); + eq.addWidget( frequency ); + + Poti q; + q.caption(i18n( "q" ).utf8().data()); + q.color("darkgreen"); q.min(0.01); q.max(10); + q.value(ch.equalizer().q()); + q.logarithmic(2.0); + connect(q,"value_changed", ch.equalizer(), "q"); + eq.addWidget( q ); + + Poti pan; + pan.caption(i18n("pan").utf8().data()); + pan.color("grey"); pan.min(-1.0); pan.max(1.0); + pan.value(ch.pan()); + connect(pan,"value_changed",ch,"pan"); + vbox.addWidget( pan ); + + Fader volume; + volume.caption(i18n("volume").utf8().data()); + volume.color("red"); volume.min(0.01); volume.max(4); + volume.value(ch.volume()); + connect(volume,"value_changed", ch, "volume"); + vbox.addWidget( volume ); + + return vbox; + } + }; + REGISTER_IMPLEMENTATION(MonoSimpleMixerChannelGuiFactory_impl); +} diff --git a/arts/modules/mixers/simplemixerchannel_impl.cc b/arts/modules/mixers/simplemixerchannel_impl.cc deleted file mode 100644 index 0c00768a..00000000 --- a/arts/modules/mixers/simplemixerchannel_impl.cc +++ /dev/null @@ -1,132 +0,0 @@ -#include "artsmodulesmixers.h" -#include "flowsystem.h" -#include "stdsynthmodule.h" -#include "connect.h" - -namespace Arts { -class SimpleMixerChannel_impl : virtual public SimpleMixerChannel_skel, - virtual public StdSynthModule -{ -protected: - Synth_STD_EQUALIZER _equalizerLeft, _equalizerRight; - StereoEffectStack _insertEffects; - Synth_MUL mulGainLeft, mulGainRight; - Synth_MUL mulVolumeLeft, mulVolumeRight; - float _gainLeft, _gainRight, _pan, _volumeLeft, _volumeRight, pLeft, pRight; - std::string _name; -public: - SimpleMixerChannel_impl() - : _gainLeft(1.0), _gainRight(1.0), _pan(0), _volumeLeft(1.0), _volumeRight(1.0), pLeft(1), pRight(1) - { - setValue(mulVolumeLeft,"invalue2",_volumeLeft*pLeft); - setValue(mulVolumeRight,"invalue2",_volumeRight*pRight); - setValue(mulGainLeft,"invalue2",_gainLeft); - setValue(mulGainRight,"invalue2",_gainRight); - } - - Synth_STD_EQUALIZER equalizerLeft() { return _equalizerLeft; } - Synth_STD_EQUALIZER equalizerRight() { return _equalizerRight; } - StereoEffectStack insertEffects() { return _insertEffects; } - - float gainLeft() { return _gainLeft; } - void gainLeft(float g) - { - if(g != _gainLeft) { - _gainLeft = g; - setValue(mulGainLeft,"invalue2",g); - gainLeft_changed(g); - } - } - - float gainRight() { return _gainRight; } - void gainRight(float g) - { - if(g != _gainRight) { - _gainRight = g; - setValue(mulGainRight,"invalue2",g); - gainRight_changed(g); - } - } - - float volumeLeft() { return _volumeLeft; } - void volumeLeft(float v) - { - if(v != _volumeLeft) { - _volumeLeft = v; - setValue(mulVolumeLeft,"invalue2",v*pLeft); - volumeLeft_changed(v); - } - } - - float volumeRight() { return _volumeRight; } - void volumeRight(float v) - { - if(v != _volumeRight) { - _volumeRight = v; - setValue(mulVolumeRight,"invalue2",v*pRight); - volumeRight_changed(v); - } - } - - float pan() { return _pan; } - void pan(float p) - { - if(p != _pan) - { - _pan = p; - pLeft = 1.0; - pRight = 1.0; - if(p > 0) - pLeft = 1-p; - else - pRight = 1+p; - setValue(mulVolumeLeft,"invalue2",_volumeLeft*pLeft); - setValue(mulVolumeRight,"invalue2",_volumeRight*pRight); - pan_changed(p); - } - } - - std::string name() { return _name; } - void name(const std::string& newName) - { - if(_name != newName) { - _name = newName; - name_changed(newName); - } - } - - void streamInit() - { - _equalizerLeft.start(); - _equalizerRight.start(); - _insertEffects.start(); - mulVolumeLeft.start(); - mulVolumeRight.start(); - mulGainLeft.start(); - mulGainRight.start(); - - _node()->virtualize("inleft",mulGainLeft._node(),"invalue1"); - _node()->virtualize("inright",mulGainRight._node(),"invalue1"); - connect(mulGainLeft,"outvalue",_equalizerLeft,"invalue"); - connect(mulGainRight,"outvalue",_equalizerRight,"invalue"); - connect(_equalizerLeft,"outvalue",_insertEffects,"inleft"); - connect(_equalizerRight,"outvalue",_insertEffects,"inright"); - connect(_insertEffects,"outleft",mulVolumeLeft,"invalue1"); - connect(_insertEffects,"outright",mulVolumeRight,"invalue1"); - _node()->virtualize("outleft",mulVolumeLeft._node(),"outvalue"); - _node()->virtualize("outright",mulVolumeRight._node(),"outvalue"); - } - void streamEnd() - { - _equalizerLeft.stop(); - _equalizerRight.stop(); - _insertEffects.stop(); - mulVolumeLeft.stop(); - mulVolumeRight.stop(); - mulGainLeft.stop(); - mulGainRight.stop(); - } -}; -REGISTER_IMPLEMENTATION(SimpleMixerChannel_impl); -} - diff --git a/arts/modules/mixers/simplemixerchannel_impl.cpp b/arts/modules/mixers/simplemixerchannel_impl.cpp new file mode 100644 index 00000000..0c00768a --- /dev/null +++ b/arts/modules/mixers/simplemixerchannel_impl.cpp @@ -0,0 +1,132 @@ +#include "artsmodulesmixers.h" +#include "flowsystem.h" +#include "stdsynthmodule.h" +#include "connect.h" + +namespace Arts { +class SimpleMixerChannel_impl : virtual public SimpleMixerChannel_skel, + virtual public StdSynthModule +{ +protected: + Synth_STD_EQUALIZER _equalizerLeft, _equalizerRight; + StereoEffectStack _insertEffects; + Synth_MUL mulGainLeft, mulGainRight; + Synth_MUL mulVolumeLeft, mulVolumeRight; + float _gainLeft, _gainRight, _pan, _volumeLeft, _volumeRight, pLeft, pRight; + std::string _name; +public: + SimpleMixerChannel_impl() + : _gainLeft(1.0), _gainRight(1.0), _pan(0), _volumeLeft(1.0), _volumeRight(1.0), pLeft(1), pRight(1) + { + setValue(mulVolumeLeft,"invalue2",_volumeLeft*pLeft); + setValue(mulVolumeRight,"invalue2",_volumeRight*pRight); + setValue(mulGainLeft,"invalue2",_gainLeft); + setValue(mulGainRight,"invalue2",_gainRight); + } + + Synth_STD_EQUALIZER equalizerLeft() { return _equalizerLeft; } + Synth_STD_EQUALIZER equalizerRight() { return _equalizerRight; } + StereoEffectStack insertEffects() { return _insertEffects; } + + float gainLeft() { return _gainLeft; } + void gainLeft(float g) + { + if(g != _gainLeft) { + _gainLeft = g; + setValue(mulGainLeft,"invalue2",g); + gainLeft_changed(g); + } + } + + float gainRight() { return _gainRight; } + void gainRight(float g) + { + if(g != _gainRight) { + _gainRight = g; + setValue(mulGainRight,"invalue2",g); + gainRight_changed(g); + } + } + + float volumeLeft() { return _volumeLeft; } + void volumeLeft(float v) + { + if(v != _volumeLeft) { + _volumeLeft = v; + setValue(mulVolumeLeft,"invalue2",v*pLeft); + volumeLeft_changed(v); + } + } + + float volumeRight() { return _volumeRight; } + void volumeRight(float v) + { + if(v != _volumeRight) { + _volumeRight = v; + setValue(mulVolumeRight,"invalue2",v*pRight); + volumeRight_changed(v); + } + } + + float pan() { return _pan; } + void pan(float p) + { + if(p != _pan) + { + _pan = p; + pLeft = 1.0; + pRight = 1.0; + if(p > 0) + pLeft = 1-p; + else + pRight = 1+p; + setValue(mulVolumeLeft,"invalue2",_volumeLeft*pLeft); + setValue(mulVolumeRight,"invalue2",_volumeRight*pRight); + pan_changed(p); + } + } + + std::string name() { return _name; } + void name(const std::string& newName) + { + if(_name != newName) { + _name = newName; + name_changed(newName); + } + } + + void streamInit() + { + _equalizerLeft.start(); + _equalizerRight.start(); + _insertEffects.start(); + mulVolumeLeft.start(); + mulVolumeRight.start(); + mulGainLeft.start(); + mulGainRight.start(); + + _node()->virtualize("inleft",mulGainLeft._node(),"invalue1"); + _node()->virtualize("inright",mulGainRight._node(),"invalue1"); + connect(mulGainLeft,"outvalue",_equalizerLeft,"invalue"); + connect(mulGainRight,"outvalue",_equalizerRight,"invalue"); + connect(_equalizerLeft,"outvalue",_insertEffects,"inleft"); + connect(_equalizerRight,"outvalue",_insertEffects,"inright"); + connect(_insertEffects,"outleft",mulVolumeLeft,"invalue1"); + connect(_insertEffects,"outright",mulVolumeRight,"invalue1"); + _node()->virtualize("outleft",mulVolumeLeft._node(),"outvalue"); + _node()->virtualize("outright",mulVolumeRight._node(),"outvalue"); + } + void streamEnd() + { + _equalizerLeft.stop(); + _equalizerRight.stop(); + _insertEffects.stop(); + mulVolumeLeft.stop(); + mulVolumeRight.stop(); + mulGainLeft.stop(); + mulGainRight.stop(); + } +}; +REGISTER_IMPLEMENTATION(SimpleMixerChannel_impl); +} + diff --git a/arts/modules/mixers/simplemixerchannelguifactory_impl.cc b/arts/modules/mixers/simplemixerchannelguifactory_impl.cc deleted file mode 100644 index 73ab31e2..00000000 --- a/arts/modules/mixers/simplemixerchannelguifactory_impl.cc +++ /dev/null @@ -1,82 +0,0 @@ -#include "artsmodulesmixers.h" -#include "debug.h" -#include "connect.h" - -#include -#include - -namespace Arts { - class SimpleMixerChannelGuiFactory_impl : virtual public SimpleMixerChannelGuiFactory_skel { - public: - Widget createGui(Object object) - { - TDEGlobal::locale()->insertCatalogue( "artsmodules" ); - arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); - SimpleMixerChannel ch = DynamicCast(object); - arts_return_val_if_fail(!ch.isNull(), Arts::Widget::null()); - - Arts::LayoutBox vbox; - vbox.direction( Arts::TopToBottom ); - - Poti high; - high.caption(i18n("volume","high").utf8().data()); - high.color("blue"); high.min(-12); high.max(12); - high.value(ch.equalizerLeft().high()); - connect(high,"value_changed", ch.equalizerLeft(), "high"); - connect(high,"value_changed", ch.equalizerRight(), "high"); - vbox.addWidget( high ); - - Poti mid; - mid.caption(i18n("volume","mid").utf8().data()); - mid.color("blue"); mid.min(-12); mid.max(12); - mid.value(ch.equalizerLeft().mid()); - connect(mid,"value_changed", ch.equalizerLeft(), "mid"); - connect(mid,"value_changed", ch.equalizerRight(), "mid"); - vbox.addWidget( mid ); - - Poti low; - low.caption(i18n("volume","low").utf8().data()); - low.color("blue"); low.min(-12); low.max(12); - low.value(ch.equalizerLeft().low()); - connect(low,"value_changed", ch.equalizerLeft(), "low"); - connect(low,"value_changed", ch.equalizerRight(), "low"); - vbox.addWidget( low ); - - Poti frequency; - frequency.caption(i18n("frequency").utf8().data()); - frequency.color("darkgreen"); frequency.min(200); frequency.max(10000); - frequency.value(ch.equalizerLeft().frequency()); - frequency.logarithmic(2.0); - connect(frequency,"value_changed", ch.equalizerLeft(), "frequency"); - connect(frequency,"value_changed", ch.equalizerRight(), "frequency"); - vbox.addWidget( frequency ); - - Poti q; - q.caption(i18n( "q" ).utf8().data()); - q.color("darkgreen"); q.min(0.01); q.max(10); - q.value(ch.equalizerLeft().q()); - q.logarithmic(2.0); - connect(q,"value_changed", ch.equalizerLeft(), "q"); - connect(q,"value_changed", ch.equalizerRight(), "q"); - vbox.addWidget( q ); - - Poti pan; - pan.caption(i18n("pan").utf8().data()); - pan.color("grey"); pan.min(-1.0); pan.max(1.0); - pan.value(ch.pan()); - connect(pan,"value_changed",ch,"pan"); - vbox.addWidget( pan ); - - Fader volume; - volume.caption(i18n("volume").utf8().data()); - volume.color("red"); volume.min(0.01); volume.max(4); - volume.value(ch.volumeLeft()); - connect(volume,"value_changed", ch, "volumeLeft"); - connect(volume,"value_changed", ch, "volumeRight"); - vbox.addWidget( volume ); - - return vbox; - } - }; - REGISTER_IMPLEMENTATION(SimpleMixerChannelGuiFactory_impl); -} diff --git a/arts/modules/mixers/simplemixerchannelguifactory_impl.cpp b/arts/modules/mixers/simplemixerchannelguifactory_impl.cpp new file mode 100644 index 00000000..73ab31e2 --- /dev/null +++ b/arts/modules/mixers/simplemixerchannelguifactory_impl.cpp @@ -0,0 +1,82 @@ +#include "artsmodulesmixers.h" +#include "debug.h" +#include "connect.h" + +#include +#include + +namespace Arts { + class SimpleMixerChannelGuiFactory_impl : virtual public SimpleMixerChannelGuiFactory_skel { + public: + Widget createGui(Object object) + { + TDEGlobal::locale()->insertCatalogue( "artsmodules" ); + arts_return_val_if_fail(!object.isNull(), Arts::Widget::null()); + SimpleMixerChannel ch = DynamicCast(object); + arts_return_val_if_fail(!ch.isNull(), Arts::Widget::null()); + + Arts::LayoutBox vbox; + vbox.direction( Arts::TopToBottom ); + + Poti high; + high.caption(i18n("volume","high").utf8().data()); + high.color("blue"); high.min(-12); high.max(12); + high.value(ch.equalizerLeft().high()); + connect(high,"value_changed", ch.equalizerLeft(), "high"); + connect(high,"value_changed", ch.equalizerRight(), "high"); + vbox.addWidget( high ); + + Poti mid; + mid.caption(i18n("volume","mid").utf8().data()); + mid.color("blue"); mid.min(-12); mid.max(12); + mid.value(ch.equalizerLeft().mid()); + connect(mid,"value_changed", ch.equalizerLeft(), "mid"); + connect(mid,"value_changed", ch.equalizerRight(), "mid"); + vbox.addWidget( mid ); + + Poti low; + low.caption(i18n("volume","low").utf8().data()); + low.color("blue"); low.min(-12); low.max(12); + low.value(ch.equalizerLeft().low()); + connect(low,"value_changed", ch.equalizerLeft(), "low"); + connect(low,"value_changed", ch.equalizerRight(), "low"); + vbox.addWidget( low ); + + Poti frequency; + frequency.caption(i18n("frequency").utf8().data()); + frequency.color("darkgreen"); frequency.min(200); frequency.max(10000); + frequency.value(ch.equalizerLeft().frequency()); + frequency.logarithmic(2.0); + connect(frequency,"value_changed", ch.equalizerLeft(), "frequency"); + connect(frequency,"value_changed", ch.equalizerRight(), "frequency"); + vbox.addWidget( frequency ); + + Poti q; + q.caption(i18n( "q" ).utf8().data()); + q.color("darkgreen"); q.min(0.01); q.max(10); + q.value(ch.equalizerLeft().q()); + q.logarithmic(2.0); + connect(q,"value_changed", ch.equalizerLeft(), "q"); + connect(q,"value_changed", ch.equalizerRight(), "q"); + vbox.addWidget( q ); + + Poti pan; + pan.caption(i18n("pan").utf8().data()); + pan.color("grey"); pan.min(-1.0); pan.max(1.0); + pan.value(ch.pan()); + connect(pan,"value_changed",ch,"pan"); + vbox.addWidget( pan ); + + Fader volume; + volume.caption(i18n("volume").utf8().data()); + volume.color("red"); volume.min(0.01); volume.max(4); + volume.value(ch.volumeLeft()); + connect(volume,"value_changed", ch, "volumeLeft"); + connect(volume,"value_changed", ch, "volumeRight"); + vbox.addWidget( volume ); + + return vbox; + } + }; + REGISTER_IMPLEMENTATION(SimpleMixerChannelGuiFactory_impl); +} -- cgit v1.2.1