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
5540fbae
Commit
5540fbae
authored
Feb 13, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: new command "config"
parent
0a0b4737
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+41
-0
command.c
src/command.c
+19
-0
No files found.
NEWS
View file @
5540fbae
...
...
@@ -3,6 +3,7 @@ ver 0.17 (2011/??/??)
- support client-to-client communication
- "update" and "rescan" need only "CONTROL" permission
- new command "seekcur" for simpler seeking within current song
- new command "config" dumps location of music directory
- add range parameter to command "load"
- print extra "playlist" object for embedded CUE sheets
* input:
...
...
doc/protocol.xml
View file @
5540fbae
...
...
@@ -1845,6 +1845,47 @@ OK
<title>
Reflection
</title>
<variablelist>
<varlistentry
id=
"command_config"
>
<term>
<cmdsynopsis>
<command>
config
</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Dumps configuration values that may be interesting for
the client. This command is only permitted to "local"
clients (connected via UNIX domain socket).
</para>
<para>
The following response attributes are available:
</para>
<informaltable>
<tgroup
cols=
"2"
>
<thead>
<row>
<entry>
Name
</entry>
<entry>
Description
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>
music_directory
</varname>
</entry>
<entry>
The absolute path of the music directory.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</listitem>
</varlistentry>
<varlistentry
id=
"command_commands"
>
<term>
<cmdsynopsis>
...
...
src/command.c
View file @
5540fbae
...
...
@@ -55,6 +55,7 @@
#include "path.h"
#include "replay_gain_config.h"
#include "idle.h"
#include "mapper.h"
#ifdef ENABLE_SQLITE
#include "sticker.h"
...
...
@@ -1697,6 +1698,23 @@ handle_not_commands(struct client *client,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[]);
static
enum
command_return
handle_config
(
struct
client
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
if
(
!
client_is_local
(
client
))
{
command_error
(
client
,
ACK_ERROR_PERMISSION
,
"Command only permitted to local clients"
);
return
COMMAND_RETURN_ERROR
;
}
const
char
*
path
=
mapper_get_music_directory
();
if
(
path
!=
NULL
)
client_printf
(
client
,
"music_directory: %s
\n
"
,
path
);
return
COMMAND_RETURN_OK
;
}
static
enum
command_return
handle_playlistclear
(
struct
client
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
GError
*
error
=
NULL
;
...
...
@@ -2139,6 +2157,7 @@ static const struct command commands[] = {
{
"clearerror"
,
PERMISSION_CONTROL
,
0
,
0
,
handle_clearerror
},
{
"close"
,
PERMISSION_NONE
,
-
1
,
-
1
,
handle_close
},
{
"commands"
,
PERMISSION_NONE
,
0
,
0
,
handle_commands
},
{
"config"
,
PERMISSION_ADMIN
,
0
,
0
,
handle_config
},
{
"consume"
,
PERMISSION_CONTROL
,
1
,
1
,
handle_consume
},
{
"count"
,
PERMISSION_READ
,
2
,
-
1
,
handle_count
},
{
"crossfade"
,
PERMISSION_CONTROL
,
1
,
1
,
handle_crossfade
},
...
...
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