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
78c5d884
Commit
78c5d884
authored
Nov 02, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new command "devices", prints devices and their states
git-svn-id:
https://svn.musicpd.org/mpd/trunk@2486
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
44eb26c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
7 deletions
+26
-7
TODO
TODO
+0
-2
audio.c
src/audio.c
+12
-3
audio.h
src/audio.h
+2
-0
command.c
src/command.c
+12
-2
No files found.
TODO
View file @
78c5d884
...
...
@@ -15,8 +15,6 @@
*) Optimize read() on clients
*) Make each audioOutput device enable/disable by the client
*) add command
*) command that takes file/url's (no directory's) and returns the songid
*) allow to specify position in playlist where to insert song(s)
...
...
src/audio.c
View file @
78c5d884
...
...
@@ -197,9 +197,7 @@ void finishAudioDriver() {
free
(
audioOutputArray
);
audioOutputArray
=
NULL
;
/* don't set to zero cause we're gonna use this for enabling
and disabling devices */
/*audioOutputArraySize = 0;*/
audioOutputArraySize
=
0
;
}
int
isCurrentAudioFormat
(
AudioFormat
*
audioFormat
)
{
...
...
@@ -318,3 +316,14 @@ int disableAudioDevice(FILE * fp, int device) {
return
0
;
}
void
printAudioDevices
(
FILE
*
fp
)
{
int
i
;
for
(
i
=
0
;
i
<
audioOutputArraySize
;
i
++
)
{
myfprintf
(
fp
,
"deviceid: %i
\n
"
,
i
);
myfprintf
(
fp
,
"devicename: %s
\n
"
,
audioOutputArray
[
i
]
->
name
);
myfprintf
(
fp
,
"deviceenabled: %i
\n
"
,
(
int
)
pdAudioDevicesEnabled
[
i
]);
}
}
src/audio.h
View file @
78c5d884
...
...
@@ -71,4 +71,6 @@ int enableAudioDevice(FILE * fp, int device);
int
disableAudioDevice
(
FILE
*
fp
,
int
device
);
void
printAudioDevices
(
FILE
*
fp
);
#endif
src/command.c
View file @
78c5d884
...
...
@@ -82,8 +82,9 @@
#define COMMAND_URL_HANDLERS "urlhandlers"
#define COMMAND_PLCHANGES "plchanges"
#define COMMAND_CURRENTSONG "currentsong"
#define COMMAND_ENABLE_DEV "enable_device"
#define COMMAND_DISABLE_DEV "disable_device"
#define COMMAND_ENABLE_DEV "enabledevice"
#define COMMAND_DISABLE_DEV "disabledevice"
#define COMMAND_DEVICES "devices"
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
...
...
@@ -790,6 +791,14 @@ int handleDisableDevice(FILE * fp, unsigned int * permission,
return
disableAudioDevice
(
fp
,
device
);
}
int
handleDevices
(
FILE
*
fp
,
unsigned
int
*
permission
,
int
argArrayLength
,
char
**
argArray
)
{
printAudioDevices
(
fp
);
return
0
;
}
void
initCommands
()
{
commandList
=
makeList
(
free
);
...
...
@@ -840,6 +849,7 @@ void initCommands() {
addCommand
(
COMMAND_PLCHANGES
,
PERMISSION_READ
,
1
,
1
,
handlePlaylistChanges
,
NULL
);
addCommand
(
COMMAND_ENABLE_DEV
,
PERMISSION_ADMIN
,
1
,
1
,
handleEnableDevice
,
NULL
);
addCommand
(
COMMAND_DISABLE_DEV
,
PERMISSION_ADMIN
,
1
,
1
,
handleDisableDevice
,
NULL
);
addCommand
(
COMMAND_DEVICES
,
PERMISSION_ADMIN
,
0
,
0
,
handleDevices
,
NULL
);
sortList
(
commandList
);
}
...
...
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