Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
871bf3b8
Commit
871bf3b8
authored
Oct 16, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: add command "getvol"
Closes
https://github.com/MusicPlayerDaemon/MPD/issues/979
parent
08360e40
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
0 deletions
+28
-0
NEWS
NEWS
+2
-0
protocol.rst
doc/protocol.rst
+10
-0
AllCommands.cxx
src/command/AllCommands.cxx
+1
-0
OtherCommands.cxx
src/command/OtherCommands.cxx
+12
-0
OtherCommands.hxx
src/command/OtherCommands.hxx
+3
-0
No files found.
NEWS
View file @
871bf3b8
ver 0.23 (not yet released)
* protocol
- new command "getvol"
ver 0.22.1 (not yet released)
* output
...
...
doc/protocol.rst
View file @
871bf3b8
...
...
@@ -522,6 +522,16 @@ Playback options
Sets volume to ``VOL``, the range of
volume is 0-100.
:command:`getvol`
Read the volume. The result is a ``volume:`` line like in
:ref:`status <command_status>`. If there is no mixer, MPD will
emit an empty response. Example::
getvol
volume: 42
OK
:command:`single {STATE}` [#since_0_15]_
Sets single state to ``STATE``,
``STATE`` should be ``0``, ``1`` or ``oneshot`` [#since_0_20]_.
...
...
src/command/AllCommands.cxx
View file @
871bf3b8
...
...
@@ -113,6 +113,7 @@ static constexpr struct command commands[] = {
#ifdef ENABLE_CHROMAPRINT
{
"getfingerprint"
,
PERMISSION_READ
,
1
,
1
,
handle_getfingerprint
},
#endif
{
"getvol"
,
PERMISSION_READ
,
0
,
0
,
handle_getvol
},
{
"idle"
,
PERMISSION_READ
,
0
,
-
1
,
handle_idle
},
{
"kill"
,
PERMISSION_ADMIN
,
-
1
,
-
1
,
handle_kill
},
#ifdef ENABLE_DATABASE
...
...
src/command/OtherCommands.cxx
View file @
871bf3b8
...
...
@@ -319,6 +319,18 @@ handle_rescan(Client &client, Request args, Response &r)
}
CommandResult
handle_getvol
(
Client
&
client
,
Request
,
Response
&
r
)
{
auto
&
partition
=
client
.
GetPartition
();
const
auto
volume
=
volume_level_get
(
partition
.
outputs
);
if
(
volume
>=
0
)
r
.
Format
(
"volume: %i
\n
"
,
volume
);
return
CommandResult
::
OK
;
}
CommandResult
handle_setvol
(
Client
&
client
,
Request
args
,
Response
&
r
)
{
unsigned
level
=
args
.
ParseUnsigned
(
0
,
100
);
...
...
src/command/OtherCommands.hxx
View file @
871bf3b8
...
...
@@ -48,6 +48,9 @@ CommandResult
handle_rescan
(
Client
&
client
,
Request
request
,
Response
&
response
);
CommandResult
handle_getvol
(
Client
&
client
,
Request
request
,
Response
&
response
);
CommandResult
handle_setvol
(
Client
&
client
,
Request
request
,
Response
&
response
);
CommandResult
...
...
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