Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
11e818fe
Commit
11e818fe
authored
Sep 01, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Spatializer and other audio filter from biodun SoC => Extended panel.
parent
5e0c0bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
181 additions
and
1 deletion
+181
-1
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+154
-1
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+27
-0
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
11e818fe
...
...
@@ -41,6 +41,7 @@
#include <vlc_osd.h>
#include <iostream>
#include <string.h>
#if 0
class ConfClickHandler : public QObject
...
...
@@ -637,7 +638,11 @@ void Equalizer::enable()
bool
en
=
ui
.
enableCheck
->
isChecked
();
aout_EnableFilter
(
VLC_OBJECT
(
p_intf
),
"equalizer"
,
en
?
VLC_TRUE
:
VLC_FALSE
);
enable
(
en
);
// aout_EnableFilter( VLC_OBJECT( p_intf ), "upmixer",
// en ? VLC_TRUE : VLC_FALSE );
// aout_EnableFilter( VLC_OBJECT( p_intf ), "vsurround",
// en ? VLC_TRUE : VLC_FALSE );
enable
(
en
);
}
void
Equalizer
::
enable
(
bool
en
)
...
...
@@ -779,6 +784,154 @@ void Equalizer::addCallbacks( aout_instance_t *p_aout )
}
/**********************************************************************
* Spatializer
**********************************************************************/
static
const
char
*
psz_control_names
[]
=
{
"Roomsize"
,
"Width"
,
"Wet"
,
"Dry"
,
"Damp"
};
static
const
QString
control_names
[]
=
{
"Roomsize"
,
"Width"
,
"Wet"
,
"Dry"
,
"Damp"
};
Spatializer
::
Spatializer
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
QWidget
(
_parent
)
,
p_intf
(
_p_intf
)
{
QFont
smallFont
=
QApplication
::
font
(
static_cast
<
QWidget
*>
(
0
)
);
smallFont
.
setPointSize
(
smallFont
.
pointSize
()
-
3
);
ui
.
setupUi
(
this
);
QGridLayout
*
grid
=
new
QGridLayout
(
ui
.
frame
);
grid
->
setMargin
(
0
);
for
(
int
i
=
0
;
i
<
NUM_SP_CTRL
;
i
++
)
{
spatCtrl
[
i
]
=
new
QSlider
(
Qt
::
Vertical
);
if
(
i
<
2
)
{
spatCtrl
[
i
]
->
setMaximum
(
10
);
spatCtrl
[
i
]
->
setValue
(
2
);
}
else
{
spatCtrl
[
i
]
->
setMaximum
(
10
);
spatCtrl
[
i
]
->
setValue
(
0
);
spatCtrl
[
i
]
->
setMinimum
(
-
10
);
}
oldControlVars
[
i
]
=
spatCtrl
[
i
]
->
value
();
CONNECT
(
spatCtrl
[
i
],
valueChanged
(
int
),
this
,
setInitValues
()
);
ctrl_texts
[
i
]
=
new
QLabel
(
control_names
[
i
]
+
"
\n
"
);
ctrl_texts
[
i
]
->
setFont
(
smallFont
);
ctrl_readout
[
i
]
=
new
QLabel
(
""
);
ctrl_readout
[
i
]
->
setFont
(
smallFont
);
grid
->
addWidget
(
spatCtrl
[
i
],
0
,
i
);
grid
->
addWidget
(
ctrl_readout
[
i
],
1
,
i
);
grid
->
addWidget
(
ctrl_texts
[
i
],
2
,
i
);
}
BUTTONACT
(
ui
.
enableCheck
,
enable
()
);
/* Write down initial values */
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
char
*
psz_af
=
NULL
;
if
(
p_aout
)
{
psz_af
=
var_GetString
(
p_aout
,
"audio-filter"
);
for
(
int
i
=
0
;
i
<
NUM_SP_CTRL
;
i
++
)
{
controlVars
[
i
]
=
var_GetFloat
(
p_aout
,
psz_control_names
[
i
]
);
}
vlc_object_release
(
p_aout
);
}
else
{
psz_af
=
config_GetPsz
(
p_aout
,
"audio-filter"
);
for
(
int
i
=
0
;
i
<
NUM_SP_CTRL
;
i
++
)
{
controlVars
[
i
]
=
config_GetFloat
(
p_intf
,
psz_control_names
[
i
]
);
}
}
if
(
psz_af
&&
strstr
(
psz_af
,
"spatializer"
)
!=
NULL
)
ui
.
enableCheck
->
setChecked
(
true
);
enable
(
ui
.
enableCheck
->
isChecked
()
);
setValues
(
controlVars
);
}
Spatializer
::~
Spatializer
()
{
}
void
Spatializer
::
enable
()
{
bool
en
=
ui
.
enableCheck
->
isChecked
();
aout_EnableFilter
(
VLC_OBJECT
(
p_intf
),
"spatializer"
,
en
?
VLC_TRUE
:
VLC_FALSE
);
enable
(
en
);
}
void
Spatializer
::
enable
(
bool
en
)
{
for
(
int
i
=
0
;
i
<
NUM_SP_CTRL
;
i
++
)
{
spatCtrl
[
i
]
->
setEnabled
(
en
);
ctrl_texts
[
i
]
->
setEnabled
(
en
);
ctrl_readout
[
i
]
->
setEnabled
(
en
);
}
}
void
Spatializer
::
setInitValues
()
{
setValues
(
controlVars
);
}
void
Spatializer
::
setValues
(
float
*
controlVars
)
{
char
psz_val
[
5
];
char
var_name
[
5
];
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
for
(
int
i
=
0
;
i
<
NUM_SP_CTRL
;
i
++
)
{
float
f
=
(
float
)(
spatCtrl
[
i
]
->
value
()
);
sprintf
(
psz_val
,
"%.1f"
,
f
);
ctrl_readout
[
i
]
->
setText
(
psz_val
);
}
if
(
p_aout
)
{
for
(
int
i
=
0
;
i
<
NUM_SP_CTRL
;
i
++
)
{
if
(
oldControlVars
[
i
]
!=
spatCtrl
[
i
]
->
value
()
)
{
var_SetFloat
(
p_aout
,
psz_control_names
[
i
],
(
float
)
spatCtrl
[
i
]
->
value
()
);
config_PutFloat
(
p_intf
,
psz_control_names
[
i
],
(
float
)
spatCtrl
[
i
]
->
value
());
oldControlVars
[
i
]
=
(
float
)
spatCtrl
[
i
]
->
value
();
}
}
vlc_object_release
(
p_aout
);
}
// printf("set callback values %s %s %d\n", __FILE__,__func__,__LINE__);
}
void
Spatializer
::
delCallbacks
(
aout_instance_t
*
p_aout
)
{
// var_DelCallback( p_aout, "Spatializer-bands", EqzCallback, this );
// var_DelCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
}
void
Spatializer
::
addCallbacks
(
aout_instance_t
*
p_aout
)
{
// var_AddCallback( p_aout, "Spatializer-bands", EqzCallback, this );
// var_AddCallback( p_aout, "Spatializer-preamp", EqzCallback, this );
}
/**********************************************************************
* Video filters / Adjust
**********************************************************************/
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
11e818fe
...
...
@@ -29,8 +29,10 @@
#include "ui/equalizer.h"
#include "ui/video_effects.h"
#include "ui/spatializer.h"
#define BANDS 10
#define NUM_SP_CTRL 5
class
QSignalMapper
;
...
...
@@ -79,6 +81,31 @@ private slots:
void
setPreset
(
int
);
};
class
Spatializer
:
public
QWidget
{
Q_OBJECT
public:
Spatializer
(
intf_thread_t
*
,
QWidget
*
);
virtual
~
Spatializer
();
private:
Ui
::
SpatializerWidget
ui
;
QSlider
*
spatCtrl
[
NUM_SP_CTRL
];
QLabel
*
ctrl_texts
[
NUM_SP_CTRL
];
QLabel
*
ctrl_readout
[
NUM_SP_CTRL
];
float
controlVars
[
5
];
float
oldControlVars
[
5
];
void
delCallbacks
(
aout_instance_t
*
);
void
addCallbacks
(
aout_instance_t
*
);
intf_thread_t
*
p_intf
;
private
slots
:
void
enable
(
bool
);
void
enable
();
void
setValues
(
float
*
);
void
setInitValues
();
};
class
ExtendedControls
:
public
QWidget
{
Q_OBJECT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment