summaryrefslogtreecommitdiffstats
path: root/audio/stretchplayer/stretch_25_125.diff
diff options
context:
space:
mode:
author B. Watson2022-01-18 20:13:04 +0100
committer Willy Sudiarto Raharjo2022-01-25 08:44:35 +0100
commit6a87a41a89f1d796e4d0f02dc8bda28e4eb955e1 (patch)
tree5289ab2754f5ca7facc3be90c6a8c9add39da569 /audio/stretchplayer/stretch_25_125.diff
parent6a6e4ee158894ecc05e9f3a90e0b604df66edfeb (diff)
downloadslackbuilds-6a87a41a89f1d796e4d0f02dc8bda28e4eb955e1.tar.gz
audio/stretchplayer: Added (audio player with pitch/speed control).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/stretchplayer/stretch_25_125.diff')
-rw-r--r--audio/stretchplayer/stretch_25_125.diff35
1 files changed, 35 insertions, 0 deletions
diff --git a/audio/stretchplayer/stretch_25_125.diff b/audio/stretchplayer/stretch_25_125.diff
new file mode 100644
index 0000000000..ab3bb33f0c
--- /dev/null
+++ b/audio/stretchplayer/stretch_25_125.diff
@@ -0,0 +1,35 @@
+diff --git a/src/Engine.hpp b/src/Engine.hpp
+index 873ec4d..0d3c988 100644
+--- a/src/Engine.hpp
++++ b/src/Engine.hpp
+@@ -60,7 +60,7 @@ public:
+ return _stretch;
+ }
+ void set_stretch(float str) {
+- if(str > 0.5 && str < 2.0) {
++ if(str > 0.2499 && str < 1.2501) { /* would be 'if(str >= 0.25 && str <= 1.25)', but floating point is tricky... */
+ _stretch = str;
+ //_state_changed = true;
+ }
+diff --git a/src/PlayerWidget.cpp b/src/PlayerWidget.cpp
+index e906446..489856b 100644
+--- a/src/PlayerWidget.cpp
++++ b/src/PlayerWidget.cpp
+@@ -234,7 +234,7 @@ namespace StretchPlayer
+
+ void PlayerWidget::stretch(int pos)
+ {
+- _engine->set_stretch( 0.5 + double(pos)/1000.0 );
++ _engine->set_stretch( 0.25 + double(pos)/1000.0 );
+ }
+
+ void PlayerWidget::volume(int vol)
+@@ -322,7 +322,7 @@ namespace StretchPlayer
+ _volume->setValue( _to_fader(vol) );
+ _status->volume( _volume->value() / 1000.0 );
+
+- _stretch->setValue( (sch-0.5) * 1000 );
++ _stretch->setValue( (sch-0.25) * 1000 );
+ _status->update();
+ }
+