summaryrefslogtreecommitdiffstats
path: root/noatun/modules/artseffects/extrastereo_impl.cc
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:26:17 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:49:18 +0900
commit2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d (patch)
tree50b6e05734cd5c0f642eeac4e841539db25f113b /noatun/modules/artseffects/extrastereo_impl.cc
parent6f9d8ae25c3ff607e0e07315884c967dd0bca901 (diff)
downloadtdemultimedia-2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d.tar.gz
tdemultimedia-2fe8b1b92fa2a9b93fea0ed0cb62802237b82e8d.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit fce86b22a2367f1be1f9aae5e1ba3d18d1371b74)
Diffstat (limited to 'noatun/modules/artseffects/extrastereo_impl.cc')
-rw-r--r--noatun/modules/artseffects/extrastereo_impl.cc153
1 files changed, 0 insertions, 153 deletions
diff --git a/noatun/modules/artseffects/extrastereo_impl.cc b/noatun/modules/artseffects/extrastereo_impl.cc
deleted file mode 100644
index 3dc92705..00000000
--- a/noatun/modules/artseffects/extrastereo_impl.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-#include "artsgui.h"
-#include "artseffects.h"
-#include "stdsynthmodule.h"
-#include <dynamicrequest.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <convert.h>
-#include "debug.h"
-#include <connect.h>
-#include <cstdlib>
-
-using namespace Arts;
-
-class ExtraStereo_impl : virtual public ExtraStereo_skel,
- virtual public StdSynthModule
-{
- float _intensity;
-// StereoEffectGUI mStereoEffectGUI;
-public:
- float intensity() { return _intensity; }
- void intensity(float newValue) {
- _intensity = newValue;
-// cout << " **** INTENSITY = " << newValue << endl;
- }
-
- ExtraStereo_impl() : _intensity(2.0)
- {
-// mStereoEffectGUI = DynamicCast(server.createObject("Arts::ExtraStereo"));
-// DynamicRequest(mStereoEffectGUI).method("_set_effect").param(*this).invoke();
-
- }
- void calculateBlock(unsigned long samples)
- {
- unsigned long i;
-
- for(i = 0; i < samples; i++)
- {
- float average = (inleft[i] + inright[i]) / 2.0;
-
- float outleftnew = average + (inleft[i] - average) * _intensity;
- if(outleftnew > 1.0) outleft[i] = 1.0;
- else if(outleftnew < -1.0) outleft[i] = -1.0;
- else outleft[i] = outleftnew;
-
- float outrightnew = average + (inright[i] - average) * _intensity;
- if(outrightnew > 1.0) outright[i] = 1.0;
- else if(outrightnew < -1.0) outright[i] = -1.0;
- else outright[i] = outrightnew;
- }
- }
-};
-
-
-class VoiceRemoval_impl : virtual public VoiceRemoval_skel,
- virtual public StdSynthModule
-{
-public:
-
- VoiceRemoval_impl()
- {
-
- }
- // This is based on the work of Anders Carlsson <anders.carlsson@tordata.se>
- void calculateBlock(unsigned long samples)
- {
- for (unsigned i = 0; i < samples; i++)
- {
- float outleftnew=inleft[i]-inright[i];
- float outrightnew=inright[i]-inleft[i];
-
- if (inleft[i] < -1.0) outleftnew = -1.0;
- else if (inleft[i] > 1.0) outleftnew = 1.0;
-
- if (inright[i] < -1.0) outrightnew = -1.0;
- else if (inright[i] > 1.0) outrightnew = 1.0;
- outleft[i] = outleftnew;
- outright[i] = outrightnew;
- }
-
- }
-};
-
-class RawWriter_impl : virtual public RawWriter_skel,
- virtual public StdSynthModule
-{
- int mFd;
-public:
- RawWriter_impl()
- {
- std::string file=getenv("HOME");
- file.append("/arts-write.raw");
- mFd=::open(file.c_str(), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
- }
- ~RawWriter_impl()
- {
- ::close(mFd);
- }
- // This is based on the work of Anders Carlsson <anders.carlsson@tordata.se>
- void calculateBlock(unsigned long samples)
- {
- for (unsigned i = 0; i < samples; i++)
- {
- outleft[i]=inleft[i];
- outright[i]=inright[i];
- }
- unsigned char *buffer=new unsigned char[samples*4];
- convert_stereo_2float_i16le(samples,
- inleft, inright, buffer);
- ::write(mFd, (const void*)buffer, samples*4);
- delete [] buffer;
- }
-};
-
-class ExtraStereoGuiFactory_impl : public ExtraStereoGuiFactory_skel
-{
-public:
- Widget createGui(Object object)
- {
- arts_return_val_if_fail(!object.isNull(), Arts::Widget::null());
-
- ExtraStereo e = DynamicCast(object);
- arts_return_val_if_fail(!e.isNull(), Arts::Widget::null());
-
- HBox hbox;
- hbox.width(80);
- hbox.height(80);
- hbox.show();
-
-
- Poti intense;
- intense.caption("Intensity");
- intense.color("red");
- intense.min(0);
- intense.max(5);
- intense.value(e.intensity());
- intense.parent(hbox);
- intense.show();
- connect(intense,"value_changed", e, "intensity");
-
- hbox._addChild(intense,"intensityWidget");
-
- return hbox;
- }
-};
-
-
-REGISTER_IMPLEMENTATION(ExtraStereo_impl);
-REGISTER_IMPLEMENTATION(VoiceRemoval_impl);
-REGISTER_IMPLEMENTATION(RawWriter_impl);
-REGISTER_IMPLEMENTATION(ExtraStereoGuiFactory_impl);
-
-