[vlc-devel] [PATCH 2/2] qt: add pitch shifting slider under new Advanced tab

Valentin Deniaud valentin.deniaud at inpt.fr
Tue Aug 29 11:22:37 CEST 2017


---
 modules/gui/qt/components/extended_panels.cpp | 13 +++++++++++++
 modules/gui/qt/components/extended_panels.hpp |  8 ++++++++
 modules/gui/qt/dialogs/extended.cpp           | 13 +++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index 9938a39421..0708e6b116 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -1307,6 +1307,19 @@ StereoWidener::StereoWidener( intf_thread_t *p_intf, QWidget *parent )
     build();
 }
 
+/**********************************************************************
+ * Advanced
+ **********************************************************************/
+
+PitchShifter::PitchShifter( intf_thread_t *p_intf, QWidget *parent )
+    : AudioFilterControlWidget( p_intf, parent, "pitch" )
+{
+    i_smallfont = -1;
+    controls.append( { "pitch-shift", N_("Adjust pitch"), "semitones",
+                        -12.0, 12.0, 0.0, 0.25, 1.0 } );
+    build();
+}
+
 #include <QToolButton>
 #include <QGridLayout>
 
diff --git a/modules/gui/qt/components/extended_panels.hpp b/modules/gui/qt/components/extended_panels.hpp
index e44dc29dd6..6c75679669 100644
--- a/modules/gui/qt/components/extended_panels.hpp
+++ b/modules/gui/qt/components/extended_panels.hpp
@@ -214,6 +214,14 @@ public:
     StereoWidener( intf_thread_t *, QWidget * );
 };
 
+class PitchShifter: public AudioFilterControlWidget
+{
+    Q_OBJECT
+
+public:
+    PitchShifter( intf_thread_t *, QWidget * );
+};
+
 class SyncWidget : public QWidget
 {
     Q_OBJECT
diff --git a/modules/gui/qt/dialogs/extended.cpp b/modules/gui/qt/dialogs/extended.cpp
index fbcd70d23a..f8f42e0f2b 100644
--- a/modules/gui/qt/dialogs/extended.cpp
+++ b/modules/gui/qt/dialogs/extended.cpp
@@ -80,6 +80,19 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf )
     audioTab->addTab( stereowiden, qtr( "Stereo Widener" ) );
     audioLayout->addWidget( audioTab );
 
+    QWidget *advancedTab = new QWidget;
+    QGridLayout *advancedTabLayout = new QGridLayout;
+
+    PitchShifter *pitchshifter = new PitchShifter( p_intf, audioTab );
+    CONNECT( pitchshifter, configChanged(QString, QVariant), this, putAudioConfig(QString, QVariant) );
+
+    advancedTabLayout->setColumnStretch( 1, 10 );
+    advancedTabLayout->addWidget( pitchshifter );
+
+    advancedTab->setLayout( advancedTabLayout );
+    audioTab->addTab( advancedTab, qtr( "Advanced" ) );
+    audioLayout->addWidget( audioTab );
+
     mainTabW->insertTab( AUDIO_TAB, audioWidget, qtr( "Audio Effects" ) );
 
     /* Video Effects */
-- 
2.14.1


More information about the vlc-devel mailing list