[vlc-devel] [PATCH] audio_filter: SOFAlizer UI for QT4

Andreas Fuchs andi.fuchs.mail at gmail.com
Mon Sep 23 21:36:24 CEST 2013


This adds control options to the qt4 Interface for the SOFAlizer plugin.
---
 modules/gui/qt4/components/extended_panels.cpp | 21 +++++++++++++++++++++
 modules/gui/qt4/components/extended_panels.hpp |  8 ++++++++
 modules/gui/qt4/dialogs/extended.cpp           |  4 ++++
 3 files changed, 33 insertions(+)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 532e811..41b59f3 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -1395,6 +1395,27 @@ Spatializer::Spatializer( intf_thread_t *p_intf, QWidget *parent )
     build();
 }
 
+/**********************************************************************
+ * SOFAlizer
+ **********************************************************************/
+
+Sofalizer::Sofalizer( intf_thread_t *p_intf, QWidget *parent )
+    : AudioFilterControlWidget( p_intf, parent, "sofalizer" )
+{
+    i_smallfont = -1;
+    const FilterSliderData::slider_data_t a[6] =
+    {
+        { "sofalizer-select",   qtr("Select File"),    qtr(""), 1.0f, 5.0f, 1.0f, 1.0f, 1.0f },
+        { "sofalizer-gain",   qtr("Gain"),    qtr("dB"), -20.0f, 40.0f, 0.0f, 1.0f, 1.0f },
+        { "sofalizer-switch",   qtr("Switch"),    qtr(""), 0.0f , 4.0f, 0.0f, 1.0f, 1.0f },
+        { "sofalizer-rotation",  qtr("Rotation"),   "Deg", -180.0f, 180.0f, 0.0f, 1.0f, 1.0f },
+        { "sofalizer-elevation",  qtr("Elevation"),   "Deg", -90, 90, 0, 1.0f, 1.0f },
+        { "sofalizer-radius",  qtr("Radius"),   "m", 0.1f , 2.1f, 1.0f, 0.1f, 1.0f },
+    };
+    for( int i=0; i<6 ;i++ ) controls.append( a[i] );
+    build();
+}
+
 #include <QToolButton>
 #include <QGridLayout>
 
diff --git a/modules/gui/qt4/components/extended_panels.hpp b/modules/gui/qt4/components/extended_panels.hpp
index 770f558..d6efc7d 100644
--- a/modules/gui/qt4/components/extended_panels.hpp
+++ b/modules/gui/qt4/components/extended_panels.hpp
@@ -199,6 +199,14 @@ public:
     Spatializer( intf_thread_t *, QWidget * );
 };
 
+class Sofalizer: public AudioFilterControlWidget
+{
+     Q_OBJECT
+
+public:
+     Sofalizer( intf_thread_t *, QWidget * );
+};
+
 class SyncWidget : public QWidget
 {
     Q_OBJECT
diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp
index 05750cb..804fce9 100644
--- a/modules/gui/qt4/dialogs/extended.cpp
+++ b/modules/gui/qt4/dialogs/extended.cpp
@@ -70,6 +70,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf )
     audioTab->addTab( spatial, qtr( "Spatializer" ) );
     audioLayout->addWidget( audioTab );
 
+    Sofalizer *sofalizer = new Sofalizer( p_intf, audioTab);
+    audioTab->addTab( sofalizer, qtr( "SOFAlizer" ) );
+
     mainTabW->insertTab( AUDIO_TAB, audioWidget, qtr( "Audio Effects" ) );
 
     /* Video Effects */
@@ -103,6 +106,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf )
     CONNECT( writeChangesBox, toggled(bool), compres, setSaveToConfig(bool) );
     CONNECT( writeChangesBox, toggled(bool), spatial, setSaveToConfig(bool) );
     CONNECT( writeChangesBox, toggled(bool), equal, setSaveToConfig(bool) );
+    CONNECT( writeChangesBox, toggled(bool), sofalizer, setSaveToConfig(bool) );
     CONNECT( mainTabW, currentChanged(int), this, currentTabChanged(int) );
 
     QDialogButtonBox *closeButtonBox = new QDialogButtonBox( Qt::Horizontal, this );
-- 
1.8.1.2




More information about the vlc-devel mailing list