Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d68625ea
Commit
d68625ea
authored
Mar 21, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: ExtendedDialog: Add sync to config checkbox for audio filters
(fix #7924)
parent
8c2ccecd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
10 deletions
+65
-10
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+27
-4
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+7
-1
modules/gui/qt4/dialogs/extended.cpp
modules/gui/qt4/dialogs/extended.cpp
+22
-5
modules/gui/qt4/dialogs/extended.hpp
modules/gui/qt4/dialogs/extended.hpp
+9
-0
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
d68625ea
...
...
@@ -921,7 +921,9 @@ void ExtV4l2::ValueChange( int value )
FilterSliderData
::
FilterSliderData
(
QObject
*
parent
,
QSlider
*
_slider
)
:
QObject
(
parent
),
slider
(
_slider
)
{}
{
b_save_to_config
=
false
;
}
FilterSliderData
::
FilterSliderData
(
QObject
*
parent
,
intf_thread_t
*
_p_intf
,
...
...
@@ -931,6 +933,7 @@ FilterSliderData::FilterSliderData( QObject *parent,
QObject
(
parent
),
slider
(
_slider
),
valueLabel
(
_label
),
nameLabel
(
_nameLabel
),
p_data
(
_p_data
),
p_intf
(
_p_intf
)
{
b_save_to_config
=
false
;
slider
->
setMinimum
(
p_data
->
f_min
/
p_data
->
f_resolution
);
slider
->
setMaximum
(
p_data
->
f_max
/
p_data
->
f_resolution
);
nameLabel
->
setText
(
p_data
->
descs
);
...
...
@@ -996,10 +999,16 @@ void FilterSliderData::onValueChanged( int i ) const
void
FilterSliderData
::
writeToConfig
()
const
{
if
(
!
b_save_to_config
)
return
;
float
f
=
((
float
)
slider
->
value
())
*
p_data
->
f_resolution
;
config_PutFloat
(
p_intf
,
qtu
(
p_data
->
name
),
f
);
}
void
FilterSliderData
::
setSaveToConfig
(
bool
b
)
{
b_save_to_config
=
b
;
}
AudioFilterControlWidget
::
AudioFilterControlWidget
(
intf_thread_t
*
_p_intf
,
QWidget
*
parent
,
const
char
*
_name
)
:
QWidget
(
parent
),
p_intf
(
_p_intf
),
name
(
_name
),
i_smallfont
(
0
)
...
...
@@ -1034,6 +1043,7 @@ void AudioFilterControlWidget::build()
ctrlLayout
->
addWidget
(
valueLabel
,
1
,
i
,
Qt
::
AlignHCenter
);
ctrlLayout
->
addWidget
(
nameLabel
,
2
,
i
,
Qt
::
AlignHCenter
);
i
++
;
sliderDatas
<<
filter
;
}
vlc_object_t
*
p_aout
=
(
vlc_object_t
*
)
THEMIM
->
getAout
();
...
...
@@ -1065,6 +1075,12 @@ void AudioFilterControlWidget::enable( bool b_enable ) const
playlist_EnableAudioFilter
(
THEPL
,
qtu
(
name
),
b_enable
);
}
void
AudioFilterControlWidget
::
setSaveToConfig
(
bool
b_save
)
{
foreach
(
FilterSliderData
*
f
,
sliderDatas
)
f
->
setSaveToConfig
(
b_save
);
}
/**********************************************************************
* Equalizer
**********************************************************************/
...
...
@@ -1153,6 +1169,7 @@ void EqualizerSliderData::onValueChanged( int i ) const
void
EqualizerSliderData
::
writeToConfig
()
const
{
if
(
!
b_save_to_config
)
return
;
QStringList
bands
=
getBandsFromAout
();
if
(
bands
.
count
()
>
index
)
{
...
...
@@ -1238,7 +1255,7 @@ void Equalizer::build()
ctrlLayout
->
addWidget
(
slider
,
0
,
i
,
Qt
::
AlignHCenter
);
ctrlLayout
->
addWidget
(
valueLabel
,
2
,
i
,
Qt
::
AlignHCenter
);
ctrlLayout
->
addWidget
(
nameLabel
,
1
,
i
,
Qt
::
AlignHCenter
);
eqSlider
s
<<
filter
;
/* keep track for applying presets */
sliderData
s
<<
filter
;
/* keep track for applying presets */
i
++
;
}
...
...
@@ -1304,6 +1321,12 @@ void Equalizer::build()
CONNECT
(
ui
.
eq2PassCheck
,
toggled
(
bool
),
this
,
enable2Pass
(
bool
)
);
}
void
Equalizer
::
setSaveToConfig
(
bool
b_save
)
{
AudioFilterControlWidget
::
setSaveToConfig
(
b_save
);
preamp
->
setSaveToConfig
(
b_save
);
}
void
Equalizer
::
setCorePreset
(
int
i_preset
)
{
if
(
i_preset
<
1
)
...
...
@@ -1313,8 +1336,8 @@ void Equalizer::setCorePreset( int i_preset )
preamp
->
setValue
(
eqz_preset_10b
[
i_preset
].
f_preamp
);
for
(
int
i
=
0
;
i
<
qMin
(
eqz_preset_10b
[
i_preset
].
i_band
,
eqSlider
s
.
count
()
)
;
i
++
)
eqSlider
s
[
i
]
->
setValue
(
eqz_preset_10b
[
i_preset
].
f_amp
[
i
]
);
sliderData
s
.
count
()
)
;
i
++
)
sliderData
s
[
i
]
->
setValue
(
eqz_preset_10b
[
i_preset
].
f_amp
[
i
]
);
vlc_object_t
*
p_aout
=
(
vlc_object_t
*
)
THEMIM
->
getAout
();
if
(
p_aout
)
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
d68625ea
...
...
@@ -111,11 +111,13 @@ protected:
QLabel
*
nameLabel
;
const
slider_data_t
*
p_data
;
intf_thread_t
*
p_intf
;
bool
b_save_to_config
;
public
slots
:
virtual
void
onValueChanged
(
int
i
)
const
;
virtual
void
updateText
(
int
i
);
virtual
void
writeToConfig
()
const
;
void
setSaveToConfig
(
bool
);
}
;
class
AudioFilterControlWidget
:
public
QWidget
...
...
@@ -129,6 +131,7 @@ public:
protected:
virtual
void
build
();
QVector
<
FilterSliderData
::
slider_data_t
>
controls
;
QVector
<
FilterSliderData
*>
sliderDatas
;
QGroupBox
*
slidersBox
;
intf_thread_t
*
p_intf
;
QString
name
;
// filter's module name
...
...
@@ -136,6 +139,7 @@ protected:
protected
slots
:
void
enable
(
bool
)
const
;
virtual
void
setSaveToConfig
(
bool
);
};
class
EqualizerSliderData
:
public
FilterSliderData
...
...
@@ -168,8 +172,10 @@ public:
protected:
virtual
void
build
();
protected
slots
:
virtual
void
setSaveToConfig
(
bool
);
private:
QVector
<
FilterSliderData
*>
eqSliders
;
FilterSliderData
*
preamp
;
FilterSliderData
::
slider_data_t
preamp_values
;
...
...
modules/gui/qt4/dialogs/extended.cpp
View file @
d68625ea
...
...
@@ -70,7 +70,7 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf )
audioTab
->
addTab
(
spatial
,
qtr
(
"Spatializer"
)
);
audioLayout
->
addWidget
(
audioTab
);
mainTabW
->
addTab
(
audioWidget
,
qtr
(
"Audio Effects"
)
);
mainTabW
->
insertTab
(
AUDIO_TAB
,
audioWidget
,
qtr
(
"Audio Effects"
)
);
/* Video Effects */
QWidget
*
videoWidget
=
new
QWidget
;
...
...
@@ -81,23 +81,35 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf )
videoLayout
->
addWidget
(
videoTab
);
videoTab
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Maximum
);
mainTabW
->
addTab
(
videoWidget
,
qtr
(
"Video Effects"
)
);
mainTabW
->
insertTab
(
VIDEO_TAB
,
videoWidget
,
qtr
(
"Video Effects"
)
);
syncW
=
new
SyncControls
(
p_intf
,
videoTab
);
mainTabW
->
addTab
(
syncW
,
qtr
(
"Synchronization"
)
);
mainTabW
->
insertTab
(
SYNCHRO_TAB
,
syncW
,
qtr
(
"Synchronization"
)
);
if
(
module_exists
(
"v4l2"
)
)
{
ExtV4l2
*
v4l2
=
new
ExtV4l2
(
p_intf
,
mainTabW
);
mainTabW
->
addTab
(
v4l2
,
qtr
(
"v4l2 controls"
)
);
mainTabW
->
insertTab
(
V4L2_TAB
,
v4l2
,
qtr
(
"v4l2 controls"
)
);
}
layout
->
addWidget
(
mainTabW
);
/* Bottom buttons / checkbox line */
QHBoxLayout
*
buttonsLayout
=
new
QHBoxLayout
();
layout
->
addLayout
(
buttonsLayout
);
writeChangesBox
=
new
QCheckBox
(
qtr
(
"&Write changes to config"
)
);
buttonsLayout
->
addWidget
(
writeChangesBox
);
CONNECT
(
writeChangesBox
,
toggled
(
bool
),
compres
,
setSaveToConfig
(
bool
)
);
CONNECT
(
writeChangesBox
,
toggled
(
bool
),
spatial
,
setSaveToConfig
(
bool
)
);
CONNECT
(
writeChangesBox
,
toggled
(
bool
),
equal
,
setSaveToConfig
(
bool
)
);
CONNECT
(
mainTabW
,
currentChanged
(
int
),
this
,
currentTabChanged
(
int
)
);
QDialogButtonBox
*
closeButtonBox
=
new
QDialogButtonBox
(
Qt
::
Horizontal
,
this
);
closeButtonBox
->
addButton
(
new
QPushButton
(
qtr
(
"&Close"
),
this
),
QDialogButtonBox
::
RejectRole
);
layout
->
addWidget
(
closeButtonBox
);
buttonsLayout
->
addWidget
(
closeButtonBox
);
CONNECT
(
closeButtonBox
,
rejected
(),
this
,
close
()
);
/* Restore geometry or move this dialog on the left pane of the MI */
...
...
@@ -137,3 +149,8 @@ void ExtendedDialog::changedItem( int i_status )
syncW
->
clean
();
videoEffect
->
clean
();
}
void
ExtendedDialog
::
currentTabChanged
(
int
i
)
{
writeChangesBox
->
setVisible
(
i
==
AUDIO_TAB
);
}
modules/gui/qt4/dialogs/extended.hpp
View file @
d68625ea
...
...
@@ -35,6 +35,13 @@ class ExtendedDialog : public QVLCDialog, public Singleton<ExtendedDialog>
{
Q_OBJECT
public:
enum
{
AUDIO_TAB
=
0
,
VIDEO_TAB
,
SYNCHRO_TAB
,
V4L2_TAB
};
void
showTab
(
int
i
);
int
currentTab
();
private:
...
...
@@ -45,8 +52,10 @@ private:
ExtVideo
*
videoEffect
;
Equalizer
*
equal
;
QTabWidget
*
mainTabW
;
QCheckBox
*
writeChangesBox
;
private
slots
:
void
changedItem
(
int
);
void
currentTabChanged
(
int
);
friend
class
Singleton
<
ExtendedDialog
>
;
};
...
...
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