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
eb4bf298
Commit
eb4bf298
authored
Nov 27, 2005
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: added a new variable "equalizer.preamp" (self-explanatory ;) in skins
* winamp2.xml: added preamp slider and fixed offsets
parent
af908f4e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
118 additions
and
18 deletions
+118
-18
modules/gui/skins2/commands/cmd_vars.cpp
modules/gui/skins2/commands/cmd_vars.cpp
+6
-0
modules/gui/skins2/commands/cmd_vars.hpp
modules/gui/skins2/commands/cmd_vars.hpp
+24
-0
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+23
-3
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+8
-2
modules/gui/skins2/vars/equalizer.cpp
modules/gui/skins2/vars/equalizer.cpp
+29
-1
modules/gui/skins2/vars/equalizer.hpp
modules/gui/skins2/vars/equalizer.hpp
+13
-0
modules/gui/skins2/vars/time.hpp
modules/gui/skins2/vars/time.hpp
+2
-2
share/skins2/winamp2.xml
share/skins2/winamp2.xml
+13
-10
No files found.
modules/gui/skins2/commands/cmd_vars.cpp
View file @
eb4bf298
...
...
@@ -65,3 +65,9 @@ void CmdSetEqBands::execute()
m_rEqBands
.
set
(
m_value
);
}
void
CmdSetEqPreamp
::
execute
()
{
// Change the preamp variable
m_rPreamp
.
set
(
m_value
,
false
);
}
modules/gui/skins2/commands/cmd_vars.hpp
View file @
eb4bf298
...
...
@@ -28,6 +28,7 @@
#include "../utils/ustring.hpp"
class
EqualizerBands
;
class
EqualizerPreamp
;
class
VarText
;
/// Command to notify the playlist of a change
...
...
@@ -79,6 +80,29 @@ class CmdSetText: public CmdGeneric
};
/// Command to set the equalizer preamp
class
CmdSetEqPreamp
:
public
CmdGeneric
{
public:
CmdSetEqPreamp
(
intf_thread_t
*
pIntf
,
EqualizerPreamp
&
rPreamp
,
float
value
)
:
CmdGeneric
(
pIntf
),
m_rPreamp
(
rPreamp
),
m_value
(
value
)
{}
virtual
~
CmdSetEqPreamp
()
{}
/// This method does the real job of the command
virtual
void
execute
();
/// Return the type of the command
virtual
string
getType
()
const
{
return
"set equalizer preamp"
;
}
private:
/// Preamp variable to set
EqualizerPreamp
&
m_rPreamp
;
/// Value to set
float
m_value
;
};
/// Command to set the equalizerbands
class
CmdSetEqBands
:
public
CmdGeneric
{
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
eb4bf298
...
...
@@ -5,7 +5,7 @@
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teuli
r
e <ipkiss@via.ecp.fr>
* Olivier Teuli
�
e <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -98,6 +98,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
REGISTER_VAR
(
m_cVarPaused
,
VarBoolImpl
,
"vlc.isPaused"
)
REGISTER_VAR
(
m_cVarSeekable
,
VarBoolImpl
,
"vlc.isSeekable"
)
REGISTER_VAR
(
m_cVarEqualizer
,
VarBoolImpl
,
"equalizer.isEnabled"
)
REGISTER_VAR
(
m_cVarEqPreamp
,
EqualizerPreamp
,
"equalizer.preamp"
)
#undef REGISTER_VAR
m_cVarStreamName
=
VariablePtr
(
new
VarText
(
getIntf
(),
false
)
);
pVarManager
->
registerVar
(
m_cVarStreamName
,
"streamName"
);
...
...
@@ -304,9 +305,11 @@ void VlcProc::refreshAudio()
{
if
(
pAout
!=
m_pAout
)
{
// Register the equalizer callback
// Register the equalizer callback
s
if
(
!
var_AddCallback
(
pAout
,
"equalizer-bands"
,
onEqBandsChange
,
this
)
)
onEqBandsChange
,
this
)
&&
!
var_AddCallback
(
pAout
,
"equalizer-preamp"
,
onEqPreampChange
,
this
)
)
{
m_pAout
=
pAout
;
//char * psz_bands = var_GetString( p_aout, "equalizer-bands" );
...
...
@@ -567,3 +570,20 @@ int VlcProc::onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
return
VLC_SUCCESS
;
}
int
VlcProc
::
onEqPreampChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
)
{
VlcProc
*
pThis
=
(
VlcProc
*
)
pParam
;
EqualizerPreamp
*
pVarPreamp
=
(
EqualizerPreamp
*
)(
pThis
->
m_cVarEqPreamp
.
get
());
// Post a set preamp command
CmdSetEqPreamp
*
pCmd
=
new
CmdSetEqPreamp
(
pThis
->
getIntf
(),
*
pVarPreamp
,
(
newVal
.
f_float
+
20.0
)
/
40.0
);
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pThis
->
getIntf
()
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
return
VLC_SUCCESS
;
}
modules/gui/skins2/src/vlcproc.hpp
View file @
eb4bf298
...
...
@@ -5,7 +5,7 @@
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teuli
r
e <ipkiss@via.ecp.fr>
* Olivier Teuli
�
e <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -119,8 +119,9 @@ class VlcProc: public SkinObject
VariablePtr
m_cVarSeekable
;
/// Variable for the vout
VarBox
m_varVoutSize
;
/// Equalizer variable
/// Equalizer variable
s
EqualizerBands
m_varEqBands
;
VariablePtr
m_cVarEqPreamp
;
VariablePtr
m_cVarEqualizer
;
/// Set of handles of vout windows
...
...
@@ -194,6 +195,11 @@ class VlcProc: public SkinObject
static
int
onEqBandsChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
/// Callback for equalizer-preamp variable
static
int
onEqPreampChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
};
...
...
modules/gui/skins2/vars/equalizer.cpp
View file @
eb4bf298
...
...
@@ -96,7 +96,7 @@ void EqualizerBands::onUpdate( Subject<VarPercent> &rBand )
ss
<<
" "
<<
val
;
}
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
char
*
bands
=
(
char
*
)
ss
.
str
().
c_str
();
config_PutPsz
(
getIntf
(),
"equalizer-bands"
,
bands
);
...
...
@@ -109,3 +109,31 @@ void EqualizerBands::onUpdate( Subject<VarPercent> &rBand )
}
}
EqualizerPreamp
::
EqualizerPreamp
(
intf_thread_t
*
pIntf
)
:
VarPercent
(
pIntf
)
{
// Initial value
VarPercent
::
set
(
0.8
);
}
void
EqualizerPreamp
::
set
(
float
percentage
,
bool
updateVLC
)
{
VarPercent
::
set
(
percentage
);
// Avoid infinite loop
if
(
updateVLC
)
{
float
val
=
40
*
percentage
-
20
;
aout_instance_t
*
pAout
=
(
aout_instance_t
*
)
vlc_object_find
(
getIntf
(),
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
config_PutFloat
(
getIntf
(),
"equalizer-preamp"
,
val
);
if
(
pAout
)
{
// Update the audio output
var_SetFloat
(
pAout
,
"equalizer-preamp"
,
val
);
vlc_object_release
(
pAout
);
}
}
}
modules/gui/skins2/vars/equalizer.hpp
View file @
eb4bf298
...
...
@@ -56,4 +56,17 @@ class EqualizerBands: public SkinObject, public Observer<VarPercent>
};
/// Variable for equalizer preamp
class
EqualizerPreamp
:
public
VarPercent
{
public:
EqualizerPreamp
(
intf_thread_t
*
pIntf
);
virtual
~
EqualizerPreamp
()
{}
virtual
void
set
(
float
percentage
,
bool
updateVLC
);
void
set
(
float
percentage
)
{
set
(
percentage
,
true
);
}
};
#endif
modules/gui/skins2/vars/time.hpp
View file @
eb4bf298
...
...
@@ -5,7 +5,7 @@
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teuli
è
re <ipkiss@via.ecp.fr>
* Olivier Teuli
�
e <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -28,7 +28,7 @@
#include "../utils/var_percent.hpp"
#include <string>
/// Variable for VLC strem time
/// Variable for VLC stre
a
m time
class
StreamTime
:
public
VarPercent
{
public:
...
...
share/skins2/winamp2.xml
View file @
eb4bf298
...
...
@@ -248,34 +248,37 @@
<Button
x=
"254"
y=
"3"
up=
"eq_switch_up"
down=
"eq_switch_down"
over=
"eq_switch_up"
action=
"equalizer_window.setLayout(eq_small_layout)"
tooltiptext=
"Switch"
/>
<Button
x=
"264"
y=
"3"
up=
"eq_close_up"
down=
"eq_close_down"
over=
"eq_close_up"
action=
"equalizer_window.hide()"
tooltiptext=
"Close the window"
/>
<Checkbox
x=
"15"
y=
"18"
up1=
"eq_notok_up"
down1=
"eq_notok_down"
up2=
"eq_ok_up"
down2=
"eq_ok_down"
state=
"equalizer.isEnabled"
action1=
"equalizer.enable()"
action2=
"equalizer.disable()"
tooltiptext1=
"Enable equalizer"
tooltiptext2=
"Disable equalizer"
/>
<Slider
value=
"equalizer.band(0)"
x=
"78"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.preamp"
x=
"21"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
1)"
x=
"96"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
0)"
x=
"78"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
2)"
x=
"114"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
1)"
x=
"96"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
3)"
x=
"132"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
2)"
x=
"114"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
4)"
x=
"150"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
3)"
x=
"132"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
5)"
x=
"168"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
4)"
x=
"150"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
6)"
x=
"186"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
5)"
x=
"168"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
7)"
x=
"204"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
6)"
x=
"186"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(
8)"
x=
"222"
y=
"37
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(
7)"
x=
"204"
y=
"39
"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(9)"
x=
"240"
y=
"37"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<Slider
value=
"equalizer.band(8)"
x=
"222"
y=
"39"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
<Slider
value=
"equalizer.band(9)"
x=
"240"
y=
"39"
up=
"eq_slider_up"
down=
"eq_slider_down"
points=
"(6,55),(6,7)"
thickness=
"6"
tooltiptext=
""
>
<SliderBackground
image=
"eq_slider_bg"
nbhoriz=
"14"
nbvert=
"2"
padhoriz=
"1"
padvert=
"1"
/>
</Slider>
</Group>
...
...
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