Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
d0ea236c
Commit
d0ea236c
authored
Aug 30, 2011
by
Akash Mehrotra
Committed by
Jean-Baptiste Kempf
Aug 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA: EQ Preset setter
parent
7384460f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
modules/lua/libs/equalizer.c
modules/lua/libs/equalizer.c
+44
-2
share/lua/http/requests/README.txt
share/lua/http/requests/README.txt
+3
-0
share/lua/intf/modules/httprequests.lua
share/lua/intf/modules/httprequests.lua
+2
-0
No files found.
modules/lua/libs/equalizer.c
View file @
d0ea236c
...
...
@@ -176,7 +176,7 @@ static int vlclua_equalizer_get( lua_State *L )
free
(
str
);
asprintf
(
&
str
,
"band_%d"
,
i
++
);
lua_setfield
(
L
,
-
2
,
str
);
free
(
str
);
free
(
str
);
}
free
(
psz_bands_origin
);
if
(
loc
!=
(
locale_t
)
0
)
...
...
@@ -239,6 +239,47 @@ static int vlclua_equalizer_set( lua_State *L )
return
1
;
}
/*****************************************************************************
* Set the preset specified by preset id
*****************************************************************************/
static
int
vlclua_equalizer_setpreset
(
lua_State
*
L
)
{
int
presetid
=
luaL_checknumber
(
L
,
1
);
if
(
presetid
>=
NB_PRESETS
||
presetid
<
0
)
return
0
;
input_thread_t
*
p_input
=
vlclua_get_input_internal
(
L
);
if
(
p_input
)
{
audio_output_t
*
p_aout
=
input_GetAout
(
p_input
);
vlc_object_release
(
p_input
);
if
(
!
p_aout
)
{
return
0
;
}
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
if
(
!
psz_af
||
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
{
vlc_object_release
(
p_aout
);
return
0
;
}
char
*
newstr
;
if
(
asprintf
(
&
newstr
,
"%6.1f"
,
eqz_preset_10b
[
presetid
].
f_amp
[
0
]
)
==
-
1
)
return
0
;
for
(
int
i
=
1
;
i
<
10
;
i
++
)
{
if
(
asprintf
(
&
newstr
,
"%s%6.1f"
,
newstr
,
eqz_preset_10b
[
presetid
].
f_amp
[
i
])
==
-
1
)
return
0
;
}
var_SetString
(
p_aout
,
"equalizer-bands"
,
newstr
);
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
eqz_preset_10b
[
presetid
].
f_preamp
);
var_SetString
(
p_aout
,
"equalizer-preset"
,
preset_list
[
presetid
]
);
vlc_object_release
(
p_aout
);
free
(
newstr
);
return
1
;
}
return
0
;
}
/****************************************************************************
* Enable/disable Equalizer
*****************************************************************************/
...
...
@@ -271,7 +312,8 @@ static const luaL_Reg vlclua_equalizer_reg[] = {
{
"equalizerget"
,
vlclua_equalizer_get
},
{
"equalizerset"
,
vlclua_equalizer_set
},
{
"enable"
,
vlclua_equalizer_enable
},
{
"presets"
,
vlclua_equalizer_get_presets
},
{
"presets"
,
vlclua_equalizer_get_presets
},
{
"setpreset"
,
vlclua_equalizer_setpreset
},
{
NULL
,
NULL
}
};
...
...
share/lua/http/requests/README.txt
View file @
d0ea236c
...
...
@@ -125,6 +125,9 @@ status.xml or status.json
0 -- disables the equalizer
1 -- enables the equalizer
>command=setpreset&val=<presetid>
set the equalizer preset as per the id specified
<Displays the equalizer band gains.
Band 0: 60 Hz, 1: 170 Hz, 2: 310 Hz, 3: 600 Hz, 4: 1 kHz,
5: 3 kHz, 6: 6 kHz, 7: 12 kHz , 8: 14 kHz , 9: 16 kHz
...
...
share/lua/intf/modules/httprequests.lua
View file @
d0ea236c
...
...
@@ -172,6 +172,8 @@ processcommands = function ()
vlc
.
equalizer
.
equalizerset
(
band
,
val
)
elseif
command
==
"enableeq"
then
if
val
==
'0'
then
vlc
.
equalizer
.
enable
(
false
)
else
vlc
.
equalizer
.
enable
(
true
)
end
elseif
command
==
"setpreset"
then
vlc
.
equalizer
.
setpreset
(
val
)
end
local
input
=
nil
...
...
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