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
815d7206
Commit
815d7206
authored
Jan 28, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output: rename struct audio_output to AudioOutput
parent
e0dc7213
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
278 additions
and
277 deletions
+278
-277
PlayerControl.hxx
src/PlayerControl.hxx
+1
-1
ConfigTemplates.cxx
src/config/ConfigTemplates.cxx
+1
-1
MixerAll.cxx
src/mixer/MixerAll.cxx
+3
-3
MixerControl.hxx
src/mixer/MixerControl.hxx
+1
-1
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+6
-6
MultipleOutputs.hxx
src/output/MultipleOutputs.hxx
+5
-5
OutputCommand.cxx
src/output/OutputCommand.cxx
+3
-3
OutputControl.cxx
src/output/OutputControl.cxx
+24
-24
OutputControl.hxx
src/output/OutputControl.hxx
+13
-13
OutputFinish.cxx
src/output/OutputFinish.cxx
+2
-2
OutputInit.cxx
src/output/OutputInit.cxx
+6
-6
OutputInternal.hxx
src/output/OutputInternal.hxx
+7
-7
OutputPlugin.cxx
src/output/OutputPlugin.cxx
+12
-12
OutputPlugin.hxx
src/output/OutputPlugin.hxx
+25
-24
OutputPrint.cxx
src/output/OutputPrint.cxx
+1
-1
OutputState.cxx
src/output/OutputState.cxx
+2
-2
OutputThread.cxx
src/output/OutputThread.cxx
+19
-19
OutputThread.hxx
src/output/OutputThread.hxx
+2
-2
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+10
-10
AoOutputPlugin.cxx
src/output/plugins/AoOutputPlugin.cxx
+6
-6
FifoOutputPlugin.cxx
src/output/plugins/FifoOutputPlugin.cxx
+8
-8
HttpdInternal.hxx
src/output/plugins/HttpdInternal.hxx
+3
-3
HttpdOutputPlugin.cxx
src/output/plugins/HttpdOutputPlugin.cxx
+12
-12
JackOutputPlugin.cxx
src/output/plugins/JackOutputPlugin.cxx
+10
-10
NullOutputPlugin.cxx
src/output/plugins/NullOutputPlugin.cxx
+8
-8
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+9
-9
OpenALOutputPlugin.cxx
src/output/plugins/OpenALOutputPlugin.cxx
+8
-8
OssOutputPlugin.cxx
src/output/plugins/OssOutputPlugin.cxx
+10
-10
PipeOutputPlugin.cxx
src/output/plugins/PipeOutputPlugin.cxx
+6
-6
PulseOutputPlugin.cxx
src/output/plugins/PulseOutputPlugin.cxx
+11
-11
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+6
-6
RoarOutputPlugin.cxx
src/output/plugins/RoarOutputPlugin.cxx
+9
-9
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+10
-10
SolarisOutputPlugin.cxx
src/output/plugins/SolarisOutputPlugin.cxx
+7
-7
WinmmOutputPlugin.cxx
src/output/plugins/WinmmOutputPlugin.cxx
+8
-8
run_output.cxx
test/run_output.cxx
+4
-4
No files found.
src/PlayerControl.hxx
View file @
815d7206
...
...
@@ -47,7 +47,7 @@ enum class PlayerCommand : uint8_t {
CLOSE_AUDIO
,
/**
* At least one
audio_o
utput.enabled flag has been modified;
* At least one
AudioO
utput.enabled flag has been modified;
* commit those changes to the output threads.
*/
UPDATE_AUDIO
,
...
...
src/config/ConfigTemplates.cxx
View file @
815d7206
...
...
@@ -42,7 +42,7 @@ const ConfigTemplate config_templates[] = {
{
"zeroconf_enabled"
,
false
,
false
},
{
"password"
,
true
,
false
},
{
"default_permissions"
,
false
,
false
},
{
"
audio_o
utput"
,
true
,
true
},
{
"
AudioO
utput"
,
true
,
true
},
{
"audio_output_format"
,
false
,
false
},
{
"mixer_type"
,
false
,
false
},
{
"replaygain"
,
false
,
false
},
...
...
src/mixer/MixerAll.cxx
View file @
815d7206
...
...
@@ -33,7 +33,7 @@
static
constexpr
Domain
mixer_domain
(
"mixer"
);
static
int
output_mixer_get_volume
(
const
audio_o
utput
&
ao
)
output_mixer_get_volume
(
const
AudioO
utput
&
ao
)
{
if
(
!
ao
.
enabled
)
return
-
1
;
...
...
@@ -73,7 +73,7 @@ MultipleOutputs::GetVolume() const
}
static
bool
output_mixer_set_volume
(
audio_o
utput
&
ao
,
unsigned
volume
)
output_mixer_set_volume
(
AudioO
utput
&
ao
,
unsigned
volume
)
{
assert
(
volume
<=
100
);
...
...
@@ -108,7 +108,7 @@ MultipleOutputs::SetVolume(unsigned volume)
}
static
int
output_mixer_get_software_volume
(
const
audio_o
utput
&
ao
)
output_mixer_get_software_volume
(
const
AudioO
utput
&
ao
)
{
if
(
!
ao
.
enabled
)
return
-
1
;
...
...
src/mixer/MixerControl.hxx
View file @
815d7206
...
...
@@ -46,7 +46,7 @@ mixer_close(Mixer *mixer);
/**
* Close the mixer unless the plugin's "global" flag is set. This is
* called when the #
audio_o
utput is closed.
* called when the #
AudioO
utput is closed.
*/
void
mixer_auto_close
(
Mixer
*
mixer
);
...
...
src/output/MultipleOutputs.cxx
View file @
815d7206
...
...
@@ -50,11 +50,11 @@ MultipleOutputs::~MultipleOutputs()
}
}
static
audio_o
utput
*
static
AudioO
utput
*
LoadOutput
(
PlayerControl
&
pc
,
const
config_param
&
param
)
{
Error
error
;
audio_o
utput
*
output
=
audio_output_new
(
param
,
pc
,
error
);
AudioO
utput
*
output
=
audio_output_new
(
param
,
pc
,
error
);
if
(
output
==
nullptr
)
{
if
(
param
.
line
>
0
)
FormatFatalError
(
"line %i: %s"
,
...
...
@@ -89,7 +89,7 @@ MultipleOutputs::Configure(PlayerControl &pc)
}
}
audio_o
utput
*
AudioO
utput
*
MultipleOutputs
::
FindByName
(
const
char
*
name
)
const
{
for
(
auto
i
:
outputs
)
...
...
@@ -146,7 +146,7 @@ MultipleOutputs::AllowPlay()
}
static
void
audio_output_reset_reopen
(
struct
audio_o
utput
*
ao
)
audio_output_reset_reopen
(
AudioO
utput
*
ao
)
{
const
ScopeLock
protect
(
ao
->
mutex
);
...
...
@@ -259,7 +259,7 @@ MultipleOutputs::Open(const AudioFormat audio_format,
*/
gcc_pure
static
bool
chunk_is_consumed_in
(
const
struct
audio_o
utput
*
ao
,
chunk_is_consumed_in
(
const
AudioO
utput
*
ao
,
gcc_unused
const
MusicPipe
*
pipe
,
const
struct
music_chunk
*
chunk
)
{
...
...
@@ -299,7 +299,7 @@ MultipleOutputs::ClearTailChunk(gcc_unused const struct music_chunk *chunk,
assert
(
pipe
->
Contains
(
chunk
));
for
(
unsigned
i
=
0
,
n
=
outputs
.
size
();
i
!=
n
;
++
i
)
{
audio_o
utput
*
ao
=
outputs
[
i
];
AudioO
utput
*
ao
=
outputs
[
i
];
/* this mutex will be unlocked by the caller when it's
ready */
...
...
src/output/MultipleOutputs.hxx
View file @
815d7206
...
...
@@ -39,11 +39,11 @@ class MusicBuffer;
class
MusicPipe
;
struct
music_chunk
;
struct
PlayerControl
;
struct
audio_o
utput
;
struct
AudioO
utput
;
class
Error
;
class
MultipleOutputs
{
std
::
vector
<
audio_o
utput
*>
outputs
;
std
::
vector
<
AudioO
utput
*>
outputs
;
AudioFormat
input_audio_format
;
...
...
@@ -86,13 +86,13 @@ public:
/**
* Returns the "i"th audio output device.
*/
const
audio_o
utput
&
Get
(
unsigned
i
)
const
{
const
AudioO
utput
&
Get
(
unsigned
i
)
const
{
assert
(
i
<
Size
());
return
*
outputs
[
i
];
}
audio_o
utput
&
Get
(
unsigned
i
)
{
AudioO
utput
&
Get
(
unsigned
i
)
{
assert
(
i
<
Size
());
return
*
outputs
[
i
];
...
...
@@ -103,7 +103,7 @@ public:
* Returns nullptr if the name does not exist.
*/
gcc_pure
audio_o
utput
*
FindByName
(
const
char
*
name
)
const
;
AudioO
utput
*
FindByName
(
const
char
*
name
)
const
;
/**
* Checks the "enabled" flag of all audio outputs, and if one has
...
...
src/output/OutputCommand.cxx
View file @
815d7206
...
...
@@ -40,7 +40,7 @@ audio_output_enable_index(MultipleOutputs &outputs, unsigned idx)
if
(
idx
>=
outputs
.
Size
())
return
false
;
audio_o
utput
&
ao
=
outputs
.
Get
(
idx
);
AudioO
utput
&
ao
=
outputs
.
Get
(
idx
);
if
(
ao
.
enabled
)
return
true
;
...
...
@@ -60,7 +60,7 @@ audio_output_disable_index(MultipleOutputs &outputs, unsigned idx)
if
(
idx
>=
outputs
.
Size
())
return
false
;
audio_o
utput
&
ao
=
outputs
.
Get
(
idx
);
AudioO
utput
&
ao
=
outputs
.
Get
(
idx
);
if
(
!
ao
.
enabled
)
return
true
;
...
...
@@ -86,7 +86,7 @@ audio_output_toggle_index(MultipleOutputs &outputs, unsigned idx)
if
(
idx
>=
outputs
.
Size
())
return
false
;
audio_o
utput
&
ao
=
outputs
.
Get
(
idx
);
AudioO
utput
&
ao
=
outputs
.
Get
(
idx
);
const
bool
enabled
=
ao
.
enabled
=
!
ao
.
enabled
;
idle_add
(
IDLE_OUTPUT
);
...
...
src/output/OutputControl.cxx
View file @
815d7206
...
...
@@ -41,9 +41,9 @@ struct notify audio_output_client_notify;
/**
* Waits for command completion.
*
* @param ao the #
audio_o
utput instance; must be locked
* @param ao the #
AudioO
utput instance; must be locked
*/
static
void
ao_command_wait
(
struct
audio_o
utput
*
ao
)
static
void
ao_command_wait
(
AudioO
utput
*
ao
)
{
while
(
ao
->
command
!=
AO_COMMAND_NONE
)
{
ao
->
mutex
.
unlock
();
...
...
@@ -53,12 +53,12 @@ static void ao_command_wait(struct audio_output *ao)
}
/**
* Sends a command to the #
audio_o
utput object, but does not wait for
* Sends a command to the #
AudioO
utput object, but does not wait for
* completion.
*
* @param ao the #
audio_o
utput instance; must be locked
* @param ao the #
AudioO
utput instance; must be locked
*/
static
void
ao_command_async
(
struct
audio_o
utput
*
ao
,
static
void
ao_command_async
(
AudioO
utput
*
ao
,
enum
audio_output_command
cmd
)
{
assert
(
ao
->
command
==
AO_COMMAND_NONE
);
...
...
@@ -67,31 +67,31 @@ static void ao_command_async(struct audio_output *ao,
}
/**
* Sends a command to the #
audio_o
utput object and waits for
* Sends a command to the #
AudioO
utput object and waits for
* completion.
*
* @param ao the #
audio_o
utput instance; must be locked
* @param ao the #
AudioO
utput instance; must be locked
*/
static
void
ao_command
(
struct
audio_o
utput
*
ao
,
enum
audio_output_command
cmd
)
ao_command
(
AudioO
utput
*
ao
,
enum
audio_output_command
cmd
)
{
ao_command_async
(
ao
,
cmd
);
ao_command_wait
(
ao
);
}
/**
* Lock the #
audio_o
utput object and execute the command
* Lock the #
AudioO
utput object and execute the command
* synchronously.
*/
static
void
ao_lock_command
(
struct
audio_o
utput
*
ao
,
enum
audio_output_command
cmd
)
ao_lock_command
(
AudioO
utput
*
ao
,
enum
audio_output_command
cmd
)
{
const
ScopeLock
protect
(
ao
->
mutex
);
ao_command
(
ao
,
cmd
);
}
void
audio_output_set_replay_gain_mode
(
struct
audio_o
utput
*
ao
,
audio_output_set_replay_gain_mode
(
AudioO
utput
*
ao
,
ReplayGainMode
mode
)
{
if
(
ao
->
replay_gain_filter
!=
nullptr
)
...
...
@@ -101,7 +101,7 @@ audio_output_set_replay_gain_mode(struct audio_output *ao,
}
void
audio_output_enable
(
struct
audio_o
utput
*
ao
)
audio_output_enable
(
AudioO
utput
*
ao
)
{
if
(
!
ao
->
thread
.
IsDefined
())
{
if
(
ao
->
plugin
->
enable
==
nullptr
)
{
...
...
@@ -119,7 +119,7 @@ audio_output_enable(struct audio_output *ao)
}
void
audio_output_disable
(
struct
audio_o
utput
*
ao
)
audio_output_disable
(
AudioO
utput
*
ao
)
{
if
(
!
ao
->
thread
.
IsDefined
())
{
if
(
ao
->
plugin
->
disable
==
nullptr
)
...
...
@@ -139,7 +139,7 @@ audio_output_disable(struct audio_output *ao)
* Object must be locked (and unlocked) by the caller.
*/
static
bool
audio_output_open
(
struct
audio_o
utput
*
ao
,
audio_output_open
(
AudioO
utput
*
ao
,
const
AudioFormat
audio_format
,
const
MusicPipe
&
mp
)
{
...
...
@@ -199,7 +199,7 @@ audio_output_open(struct audio_output *ao,
* the caller.
*/
static
void
audio_output_close_locked
(
struct
audio_o
utput
*
ao
)
audio_output_close_locked
(
AudioO
utput
*
ao
)
{
assert
(
ao
!=
nullptr
);
assert
(
ao
->
allow_play
);
...
...
@@ -216,7 +216,7 @@ audio_output_close_locked(struct audio_output *ao)
}
bool
audio_output_update
(
struct
audio_o
utput
*
ao
,
audio_output_update
(
AudioO
utput
*
ao
,
const
AudioFormat
audio_format
,
const
MusicPipe
&
mp
)
{
...
...
@@ -233,7 +233,7 @@ audio_output_update(struct audio_output *ao,
}
void
audio_output_play
(
struct
audio_o
utput
*
ao
)
audio_output_play
(
AudioO
utput
*
ao
)
{
const
ScopeLock
protect
(
ao
->
mutex
);
...
...
@@ -246,7 +246,7 @@ audio_output_play(struct audio_output *ao)
}
}
void
audio_output_pause
(
struct
audio_o
utput
*
ao
)
void
audio_output_pause
(
AudioO
utput
*
ao
)
{
if
(
ao
->
mixer
!=
nullptr
&&
ao
->
plugin
->
pause
==
nullptr
)
/* the device has no pause mode: close the mixer,
...
...
@@ -262,7 +262,7 @@ void audio_output_pause(struct audio_output *ao)
}
void
audio_output_drain_async
(
struct
audio_o
utput
*
ao
)
audio_output_drain_async
(
AudioO
utput
*
ao
)
{
const
ScopeLock
protect
(
ao
->
mutex
);
...
...
@@ -271,7 +271,7 @@ audio_output_drain_async(struct audio_output *ao)
ao_command_async
(
ao
,
AO_COMMAND_DRAIN
);
}
void
audio_output_cancel
(
struct
audio_o
utput
*
ao
)
void
audio_output_cancel
(
AudioO
utput
*
ao
)
{
const
ScopeLock
protect
(
ao
->
mutex
);
...
...
@@ -282,7 +282,7 @@ void audio_output_cancel(struct audio_output *ao)
}
void
audio_output_allow_play
(
struct
audio_o
utput
*
ao
)
audio_output_allow_play
(
AudioO
utput
*
ao
)
{
const
ScopeLock
protect
(
ao
->
mutex
);
...
...
@@ -292,7 +292,7 @@ audio_output_allow_play(struct audio_output *ao)
}
void
audio_output_release
(
struct
audio_o
utput
*
ao
)
audio_output_release
(
AudioO
utput
*
ao
)
{
if
(
ao
->
always_on
)
audio_output_pause
(
ao
);
...
...
@@ -300,7 +300,7 @@ audio_output_release(struct audio_output *ao)
audio_output_close
(
ao
);
}
void
audio_output_close
(
struct
audio_o
utput
*
ao
)
void
audio_output_close
(
AudioO
utput
*
ao
)
{
assert
(
ao
!=
nullptr
);
assert
(
!
ao
->
open
||
!
ao
->
fail_timer
.
IsDefined
());
...
...
@@ -309,7 +309,7 @@ void audio_output_close(struct audio_output *ao)
audio_output_close_locked
(
ao
);
}
void
audio_output_finish
(
struct
audio_o
utput
*
ao
)
void
audio_output_finish
(
AudioO
utput
*
ao
)
{
audio_output_close
(
ao
);
...
...
src/output/OutputControl.hxx
View file @
815d7206
...
...
@@ -24,26 +24,26 @@
#include <stddef.h>
struct
audio_o
utput
;
struct
AudioO
utput
;
struct
AudioFormat
;
struct
config_param
;
class
MusicPipe
;
void
audio_output_set_replay_gain_mode
(
audio_o
utput
*
ao
,
audio_output_set_replay_gain_mode
(
AudioO
utput
*
ao
,
ReplayGainMode
mode
);
/**
* Enables the device.
*/
void
audio_output_enable
(
audio_o
utput
*
ao
);
audio_output_enable
(
AudioO
utput
*
ao
);
/**
* Disables the device.
*/
void
audio_output_disable
(
audio_o
utput
*
ao
);
audio_output_disable
(
AudioO
utput
*
ao
);
/**
* Opens or closes the device, depending on the "enabled" flag.
...
...
@@ -51,18 +51,18 @@ audio_output_disable(audio_output *ao);
* @return true if the device is open
*/
bool
audio_output_update
(
audio_o
utput
*
ao
,
audio_output_update
(
AudioO
utput
*
ao
,
AudioFormat
audio_format
,
const
MusicPipe
&
mp
);
void
audio_output_play
(
audio_o
utput
*
ao
);
audio_output_play
(
AudioO
utput
*
ao
);
void
audio_output_pause
(
audio_o
utput
*
ao
);
audio_output_pause
(
AudioO
utput
*
ao
);
void
audio_output_drain_async
(
audio_o
utput
*
ao
);
audio_output_drain_async
(
AudioO
utput
*
ao
);
/**
* Clear the "allow_play" flag and send the "CANCEL" command
...
...
@@ -70,25 +70,25 @@ audio_output_drain_async(audio_output *ao);
* audio_output_allow_play().
*/
void
audio_output_cancel
(
audio_o
utput
*
ao
);
audio_output_cancel
(
AudioO
utput
*
ao
);
/**
* Set the "allow_play" and signal the thread.
*/
void
audio_output_allow_play
(
audio_o
utput
*
ao
);
audio_output_allow_play
(
AudioO
utput
*
ao
);
void
audio_output_close
(
audio_o
utput
*
ao
);
audio_output_close
(
AudioO
utput
*
ao
);
/**
* Closes the audio output, but if the "always_on" flag is set, put it
* into pause mode instead.
*/
void
audio_output_release
(
audio_o
utput
*
ao
);
audio_output_release
(
AudioO
utput
*
ao
);
void
audio_output_finish
(
audio_o
utput
*
ao
);
audio_output_finish
(
AudioO
utput
*
ao
);
#endif
src/output/OutputFinish.cxx
View file @
815d7206
...
...
@@ -26,7 +26,7 @@
#include <assert.h>
void
ao_base_finish
(
struct
audio_o
utput
*
ao
)
ao_base_finish
(
AudioO
utput
*
ao
)
{
assert
(
!
ao
->
open
);
assert
(
!
ao
->
fail_timer
.
IsDefined
());
...
...
@@ -41,7 +41,7 @@ ao_base_finish(struct audio_output *ao)
}
void
audio_output_free
(
struct
audio_o
utput
*
ao
)
audio_output_free
(
AudioO
utput
*
ao
)
{
assert
(
!
ao
->
open
);
assert
(
!
ao
->
fail_timer
.
IsDefined
());
...
...
src/output/OutputInit.cxx
View file @
815d7206
...
...
@@ -93,7 +93,7 @@ audio_output_mixer_type(const config_param ¶m)
}
static
Mixer
*
audio_output_load_mixer
(
struct
audio_o
utput
*
ao
,
audio_output_load_mixer
(
AudioO
utput
*
ao
,
const
config_param
&
param
,
const
struct
mixer_plugin
*
plugin
,
Filter
&
filter_chain
,
...
...
@@ -128,7 +128,7 @@ audio_output_load_mixer(struct audio_output *ao,
}
bool
ao_base_init
(
struct
audio_o
utput
*
ao
,
ao_base_init
(
AudioO
utput
*
ao
,
const
AudioOutputPlugin
*
plugin
,
const
config_param
&
param
,
Error
&
error
)
{
...
...
@@ -214,7 +214,7 @@ ao_base_init(struct audio_output *ao,
}
static
bool
audio_output_setup
(
struct
audio_o
utput
*
ao
,
const
config_param
&
param
,
audio_output_setup
(
AudioO
utput
*
ao
,
const
config_param
&
param
,
Error
&
error
)
{
...
...
@@ -279,7 +279,7 @@ audio_output_setup(struct audio_output *ao, const config_param ¶m,
return
true
;
}
struct
audio_o
utput
*
AudioO
utput
*
audio_output_new
(
const
config_param
&
param
,
PlayerControl
&
pc
,
Error
&
error
)
...
...
@@ -304,7 +304,7 @@ audio_output_new(const config_param ¶m,
}
}
else
{
LogWarning
(
output_domain
,
"No '
audio_o
utput' defined in config file"
);
"No '
AudioO
utput' defined in config file"
);
plugin
=
audio_output_detect
(
error
);
if
(
plugin
==
nullptr
)
...
...
@@ -315,7 +315,7 @@ audio_output_new(const config_param ¶m,
plugin
->
name
);
}
struct
audio_o
utput
*
ao
=
ao_plugin_init
(
plugin
,
param
,
error
);
AudioO
utput
*
ao
=
ao_plugin_init
(
plugin
,
param
,
error
);
if
(
ao
==
nullptr
)
return
nullptr
;
...
...
src/output/OutputInternal.hxx
View file @
815d7206
...
...
@@ -60,7 +60,7 @@ enum audio_output_command {
AO_COMMAND_KILL
};
struct
audio_o
utput
{
struct
AudioO
utput
{
/**
* The device's configured display name.
*/
...
...
@@ -272,31 +272,31 @@ struct audio_output {
extern
struct
notify
audio_output_client_notify
;
static
inline
bool
audio_output_is_open
(
const
struct
audio_o
utput
*
ao
)
audio_output_is_open
(
const
AudioO
utput
*
ao
)
{
return
ao
->
open
;
}
static
inline
bool
audio_output_command_is_finished
(
const
struct
audio_o
utput
*
ao
)
audio_output_command_is_finished
(
const
AudioO
utput
*
ao
)
{
return
ao
->
command
==
AO_COMMAND_NONE
;
}
struct
audio_o
utput
*
AudioO
utput
*
audio_output_new
(
const
config_param
&
param
,
PlayerControl
&
pc
,
Error
&
error
);
bool
ao_base_init
(
struct
audio_o
utput
*
ao
,
ao_base_init
(
AudioO
utput
*
ao
,
const
AudioOutputPlugin
*
plugin
,
const
config_param
&
param
,
Error
&
error
);
void
ao_base_finish
(
struct
audio_o
utput
*
ao
);
ao_base_finish
(
AudioO
utput
*
ao
);
void
audio_output_free
(
struct
audio_o
utput
*
ao
);
audio_output_free
(
AudioO
utput
*
ao
);
#endif
src/output/OutputPlugin.cxx
View file @
815d7206
...
...
@@ -21,7 +21,7 @@
#include "OutputPlugin.hxx"
#include "OutputInternal.hxx"
struct
audio_o
utput
*
AudioO
utput
*
ao_plugin_init
(
const
AudioOutputPlugin
*
plugin
,
const
config_param
&
param
,
Error
&
error
)
...
...
@@ -33,13 +33,13 @@ ao_plugin_init(const AudioOutputPlugin *plugin,
}
void
ao_plugin_finish
(
struct
audio_o
utput
*
ao
)
ao_plugin_finish
(
AudioO
utput
*
ao
)
{
ao
->
plugin
->
finish
(
ao
);
}
bool
ao_plugin_enable
(
struct
audio_o
utput
*
ao
,
Error
&
error_r
)
ao_plugin_enable
(
AudioO
utput
*
ao
,
Error
&
error_r
)
{
return
ao
->
plugin
->
enable
!=
nullptr
?
ao
->
plugin
->
enable
(
ao
,
error_r
)
...
...
@@ -47,27 +47,27 @@ ao_plugin_enable(struct audio_output *ao, Error &error_r)
}
void
ao_plugin_disable
(
struct
audio_o
utput
*
ao
)
ao_plugin_disable
(
AudioO
utput
*
ao
)
{
if
(
ao
->
plugin
->
disable
!=
nullptr
)
ao
->
plugin
->
disable
(
ao
);
}
bool
ao_plugin_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
ao_plugin_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
return
ao
->
plugin
->
open
(
ao
,
audio_format
,
error
);
}
void
ao_plugin_close
(
struct
audio_o
utput
*
ao
)
ao_plugin_close
(
AudioO
utput
*
ao
)
{
ao
->
plugin
->
close
(
ao
);
}
unsigned
ao_plugin_delay
(
struct
audio_o
utput
*
ao
)
ao_plugin_delay
(
AudioO
utput
*
ao
)
{
return
ao
->
plugin
->
delay
!=
nullptr
?
ao
->
plugin
->
delay
(
ao
)
...
...
@@ -75,35 +75,35 @@ ao_plugin_delay(struct audio_output *ao)
}
void
ao_plugin_send_tag
(
struct
audio_o
utput
*
ao
,
const
Tag
*
tag
)
ao_plugin_send_tag
(
AudioO
utput
*
ao
,
const
Tag
*
tag
)
{
if
(
ao
->
plugin
->
send_tag
!=
nullptr
)
ao
->
plugin
->
send_tag
(
ao
,
tag
);
}
size_t
ao_plugin_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
ao_plugin_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
return
ao
->
plugin
->
play
(
ao
,
chunk
,
size
,
error
);
}
void
ao_plugin_drain
(
struct
audio_o
utput
*
ao
)
ao_plugin_drain
(
AudioO
utput
*
ao
)
{
if
(
ao
->
plugin
->
drain
!=
nullptr
)
ao
->
plugin
->
drain
(
ao
);
}
void
ao_plugin_cancel
(
struct
audio_o
utput
*
ao
)
ao_plugin_cancel
(
AudioO
utput
*
ao
)
{
if
(
ao
->
plugin
->
cancel
!=
nullptr
)
ao
->
plugin
->
cancel
(
ao
);
}
bool
ao_plugin_pause
(
struct
audio_o
utput
*
ao
)
ao_plugin_pause
(
AudioO
utput
*
ao
)
{
return
ao
->
plugin
->
pause
!=
nullptr
&&
ao
->
plugin
->
pause
(
ao
);
}
src/output/OutputPlugin.hxx
View file @
815d7206
...
...
@@ -27,6 +27,7 @@
struct
config_param
;
struct
AudioFormat
;
struct
Tag
;
struct
AudioOutput
;
class
Error
;
/**
...
...
@@ -53,13 +54,13 @@ struct AudioOutputPlugin {
* @return nullptr on error, or an opaque pointer to the plugin's
* data
*/
struct
audio_o
utput
*
(
*
init
)(
const
config_param
&
param
,
AudioO
utput
*
(
*
init
)(
const
config_param
&
param
,
Error
&
error
);
/**
* Free resources allocated by this device.
*/
void
(
*
finish
)(
struct
audio_o
utput
*
data
);
void
(
*
finish
)(
AudioO
utput
*
data
);
/**
* Enable the device. This may allocate resources, preparing
...
...
@@ -69,13 +70,13 @@ struct AudioOutputPlugin {
*
* @return true on success, false on error
*/
bool
(
*
enable
)(
struct
audio_o
utput
*
data
,
Error
&
error
);
bool
(
*
enable
)(
AudioO
utput
*
data
,
Error
&
error
);
/**
* Disables the device. It is closed before this method is
* called.
*/
void
(
*
disable
)(
struct
audio_o
utput
*
data
);
void
(
*
disable
)(
AudioO
utput
*
data
);
/**
* Really open the device.
...
...
@@ -83,13 +84,13 @@ struct AudioOutputPlugin {
* @param audio_format the audio format in which data is going
* to be delivered; may be modified by the plugin
*/
bool
(
*
open
)(
struct
audio_o
utput
*
data
,
AudioFormat
&
audio_format
,
bool
(
*
open
)(
AudioO
utput
*
data
,
AudioFormat
&
audio_format
,
Error
&
error
);
/**
* Close the device.
*/
void
(
*
close
)(
struct
audio_o
utput
*
data
);
void
(
*
close
)(
AudioO
utput
*
data
);
/**
* Returns a positive number if the output thread shall delay
...
...
@@ -99,33 +100,33 @@ struct AudioOutputPlugin {
*
* @return the number of milliseconds to wait
*/
unsigned
(
*
delay
)(
struct
audio_o
utput
*
data
);
unsigned
(
*
delay
)(
AudioO
utput
*
data
);
/**
* Display metadata for the next chunk. Optional method,
* because not all devices can display metadata.
*/
void
(
*
send_tag
)(
struct
audio_o
utput
*
data
,
const
Tag
*
tag
);
void
(
*
send_tag
)(
AudioO
utput
*
data
,
const
Tag
*
tag
);
/**
* Play a chunk of audio data.
*
* @return the number of bytes played, or 0 on error
*/
size_t
(
*
play
)(
struct
audio_o
utput
*
data
,
size_t
(
*
play
)(
AudioO
utput
*
data
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
);
/**
* Wait until the device has finished playing.
*/
void
(
*
drain
)(
struct
audio_o
utput
*
data
);
void
(
*
drain
)(
AudioO
utput
*
data
);
/**
* Try to cancel data which may still be in the device's
* buffers.
*/
void
(
*
cancel
)(
struct
audio_o
utput
*
data
);
void
(
*
cancel
)(
AudioO
utput
*
data
);
/**
* Pause the device. If supported, it may perform a special
...
...
@@ -138,7 +139,7 @@ struct AudioOutputPlugin {
* @return false on error (output will be closed then), true
* for continue to pause
*/
bool
(
*
pause
)(
struct
audio_o
utput
*
data
);
bool
(
*
pause
)(
AudioO
utput
*
data
);
/**
* The mixer plugin associated with this output plugin. This
...
...
@@ -158,45 +159,45 @@ ao_plugin_test_default_device(const AudioOutputPlugin *plugin)
}
gcc_malloc
struct
audio_o
utput
*
AudioO
utput
*
ao_plugin_init
(
const
AudioOutputPlugin
*
plugin
,
const
config_param
&
param
,
Error
&
error
);
void
ao_plugin_finish
(
struct
audio_o
utput
*
ao
);
ao_plugin_finish
(
AudioO
utput
*
ao
);
bool
ao_plugin_enable
(
struct
audio_o
utput
*
ao
,
Error
&
error
);
ao_plugin_enable
(
AudioO
utput
*
ao
,
Error
&
error
);
void
ao_plugin_disable
(
struct
audio_o
utput
*
ao
);
ao_plugin_disable
(
AudioO
utput
*
ao
);
bool
ao_plugin_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
ao_plugin_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
);
void
ao_plugin_close
(
struct
audio_o
utput
*
ao
);
ao_plugin_close
(
AudioO
utput
*
ao
);
gcc_pure
unsigned
ao_plugin_delay
(
struct
audio_o
utput
*
ao
);
ao_plugin_delay
(
AudioO
utput
*
ao
);
void
ao_plugin_send_tag
(
struct
audio_o
utput
*
ao
,
const
Tag
*
tag
);
ao_plugin_send_tag
(
AudioO
utput
*
ao
,
const
Tag
*
tag
);
size_t
ao_plugin_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
ao_plugin_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
);
void
ao_plugin_drain
(
struct
audio_o
utput
*
ao
);
ao_plugin_drain
(
AudioO
utput
*
ao
);
void
ao_plugin_cancel
(
struct
audio_o
utput
*
ao
);
ao_plugin_cancel
(
AudioO
utput
*
ao
);
bool
ao_plugin_pause
(
struct
audio_o
utput
*
ao
);
ao_plugin_pause
(
AudioO
utput
*
ao
);
#endif
src/output/OutputPrint.cxx
View file @
815d7206
...
...
@@ -32,7 +32,7 @@ void
printAudioDevices
(
Client
&
client
,
const
MultipleOutputs
&
outputs
)
{
for
(
unsigned
i
=
0
,
n
=
outputs
.
Size
();
i
!=
n
;
++
i
)
{
const
audio_o
utput
&
ao
=
outputs
.
Get
(
i
);
const
AudioO
utput
&
ao
=
outputs
.
Get
(
i
);
client_printf
(
client
,
"outputid: %i
\n
"
...
...
src/output/OutputState.cxx
View file @
815d7206
...
...
@@ -41,7 +41,7 @@ void
audio_output_state_save
(
FILE
*
fp
,
const
MultipleOutputs
&
outputs
)
{
for
(
unsigned
i
=
0
,
n
=
outputs
.
Size
();
i
!=
n
;
++
i
)
{
const
audio_o
utput
&
ao
=
outputs
.
Get
(
i
);
const
AudioO
utput
&
ao
=
outputs
.
Get
(
i
);
fprintf
(
fp
,
AUDIO_DEVICE_STATE
"%d:%s
\n
"
,
ao
.
enabled
,
ao
.
name
);
...
...
@@ -69,7 +69,7 @@ audio_output_state_read(const char *line, MultipleOutputs &outputs)
return
true
;
name
=
endptr
+
1
;
audio_o
utput
*
ao
=
outputs
.
FindByName
(
name
);
AudioO
utput
*
ao
=
outputs
.
FindByName
(
name
);
if
(
ao
==
NULL
)
{
FormatDebug
(
output_domain
,
"Ignoring device state for '%s'"
,
name
);
...
...
src/output/OutputThread.cxx
View file @
815d7206
...
...
@@ -40,7 +40,7 @@
#include <assert.h>
#include <string.h>
static
void
ao_command_finished
(
struct
audio_o
utput
*
ao
)
static
void
ao_command_finished
(
AudioO
utput
*
ao
)
{
assert
(
ao
->
command
!=
AO_COMMAND_NONE
);
ao
->
command
=
AO_COMMAND_NONE
;
...
...
@@ -51,7 +51,7 @@ static void ao_command_finished(struct audio_output *ao)
}
static
bool
ao_enable
(
struct
audio_o
utput
*
ao
)
ao_enable
(
AudioO
utput
*
ao
)
{
Error
error
;
bool
success
;
...
...
@@ -74,10 +74,10 @@ ao_enable(struct audio_output *ao)
}
static
void
ao_close
(
struct
audio_o
utput
*
ao
,
bool
drain
);
ao_close
(
AudioO
utput
*
ao
,
bool
drain
);
static
void
ao_disable
(
struct
audio_o
utput
*
ao
)
ao_disable
(
AudioO
utput
*
ao
)
{
if
(
ao
->
open
)
ao_close
(
ao
,
false
);
...
...
@@ -92,7 +92,7 @@ ao_disable(struct audio_output *ao)
}
static
AudioFormat
ao_filter_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
format
,
ao_filter_open
(
AudioO
utput
*
ao
,
AudioFormat
&
format
,
Error
&
error_r
)
{
assert
(
format
.
IsValid
());
...
...
@@ -121,7 +121,7 @@ ao_filter_open(struct audio_output *ao, AudioFormat &format,
}
static
void
ao_filter_close
(
struct
audio_o
utput
*
ao
)
ao_filter_close
(
AudioO
utput
*
ao
)
{
if
(
ao
->
replay_gain_filter
!=
nullptr
)
ao
->
replay_gain_filter
->
Close
();
...
...
@@ -132,7 +132,7 @@ ao_filter_close(struct audio_output *ao)
}
static
void
ao_open
(
struct
audio_o
utput
*
ao
)
ao_open
(
AudioO
utput
*
ao
)
{
bool
success
;
Error
error
;
...
...
@@ -207,7 +207,7 @@ ao_open(struct audio_output *ao)
}
static
void
ao_close
(
struct
audio_o
utput
*
ao
,
bool
drain
)
ao_close
(
AudioO
utput
*
ao
,
bool
drain
)
{
assert
(
ao
->
open
);
...
...
@@ -233,7 +233,7 @@ ao_close(struct audio_output *ao, bool drain)
}
static
void
ao_reopen_filter
(
struct
audio_o
utput
*
ao
)
ao_reopen_filter
(
AudioO
utput
*
ao
)
{
Error
error
;
...
...
@@ -266,7 +266,7 @@ ao_reopen_filter(struct audio_output *ao)
}
static
void
ao_reopen
(
struct
audio_o
utput
*
ao
)
ao_reopen
(
AudioO
utput
*
ao
)
{
if
(
!
ao
->
config_audio_format
.
IsFullyDefined
())
{
if
(
ao
->
open
)
{
...
...
@@ -297,7 +297,7 @@ ao_reopen(struct audio_output *ao)
* was issued
*/
static
bool
ao_wait
(
struct
audio_o
utput
*
ao
)
ao_wait
(
AudioO
utput
*
ao
)
{
while
(
true
)
{
unsigned
delay
=
ao_plugin_delay
(
ao
);
...
...
@@ -312,7 +312,7 @@ ao_wait(struct audio_output *ao)
}
static
const
void
*
ao_chunk_data
(
struct
audio_o
utput
*
ao
,
const
struct
music_chunk
*
chunk
,
ao_chunk_data
(
AudioO
utput
*
ao
,
const
struct
music_chunk
*
chunk
,
Filter
*
replay_gain_filter
,
unsigned
*
replay_gain_serial_p
,
size_t
*
length_r
)
...
...
@@ -352,7 +352,7 @@ ao_chunk_data(struct audio_output *ao, const struct music_chunk *chunk,
}
static
const
void
*
ao_filter_chunk
(
struct
audio_o
utput
*
ao
,
const
struct
music_chunk
*
chunk
,
ao_filter_chunk
(
AudioO
utput
*
ao
,
const
struct
music_chunk
*
chunk
,
size_t
*
length_r
)
{
size_t
length
;
...
...
@@ -422,7 +422,7 @@ ao_filter_chunk(struct audio_output *ao, const struct music_chunk *chunk,
}
static
bool
ao_play_chunk
(
struct
audio_o
utput
*
ao
,
const
struct
music_chunk
*
chunk
)
ao_play_chunk
(
AudioO
utput
*
ao
,
const
struct
music_chunk
*
chunk
)
{
assert
(
ao
!=
nullptr
);
assert
(
ao
->
filter
!=
nullptr
);
...
...
@@ -485,7 +485,7 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
}
static
const
struct
music_chunk
*
ao_next_chunk
(
struct
audio_o
utput
*
ao
)
ao_next_chunk
(
AudioO
utput
*
ao
)
{
return
ao
->
chunk
!=
nullptr
/* continue the previous play() call */
...
...
@@ -503,7 +503,7 @@ ao_next_chunk(struct audio_output *ao)
* tail of the pipe was already reached
*/
static
bool
ao_play
(
struct
audio_o
utput
*
ao
)
ao_play
(
AudioO
utput
*
ao
)
{
bool
success
;
const
struct
music_chunk
*
chunk
;
...
...
@@ -547,7 +547,7 @@ ao_play(struct audio_output *ao)
return
true
;
}
static
void
ao_pause
(
struct
audio_o
utput
*
ao
)
static
void
ao_pause
(
AudioO
utput
*
ao
)
{
bool
ret
;
...
...
@@ -578,7 +578,7 @@ static void ao_pause(struct audio_output *ao)
static
void
audio_output_task
(
void
*
arg
)
{
struct
audio_output
*
ao
=
(
struct
audio_o
utput
*
)
arg
;
AudioOutput
*
ao
=
(
AudioO
utput
*
)
arg
;
FormatThreadName
(
"output:%s"
,
ao
->
name
);
...
...
@@ -680,7 +680,7 @@ audio_output_task(void *arg)
}
}
void
audio_output_thread_start
(
struct
audio_o
utput
*
ao
)
void
audio_output_thread_start
(
AudioO
utput
*
ao
)
{
assert
(
ao
->
command
==
AO_COMMAND_NONE
);
...
...
src/output/OutputThread.hxx
View file @
815d7206
...
...
@@ -20,9 +20,9 @@
#ifndef MPD_OUTPUT_THREAD_HXX
#define MPD_OUTPUT_THREAD_HXX
struct
audio_o
utput
;
struct
AudioO
utput
;
void
audio_output_thread_start
(
audio_o
utput
*
ao
);
audio_output_thread_start
(
AudioO
utput
*
ao
);
#endif
src/output/plugins/AlsaOutputPlugin.cxx
View file @
815d7206
...
...
@@ -44,7 +44,7 @@ typedef snd_pcm_sframes_t alsa_writei_t(snd_pcm_t * pcm, const void *buffer,
snd_pcm_uframes_t
size
);
struct
AlsaOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
Manual
<
PcmExport
>
pcm_export
;
...
...
@@ -169,7 +169,7 @@ alsa_configure(AlsaOutput *ad, const config_param ¶m)
#endif
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
alsa_init
(
const
config_param
&
param
,
Error
&
error
)
{
AlsaOutput
*
ad
=
new
AlsaOutput
();
...
...
@@ -185,7 +185,7 @@ alsa_init(const config_param ¶m, Error &error)
}
static
void
alsa_finish
(
struct
audio_o
utput
*
ao
)
alsa_finish
(
AudioO
utput
*
ao
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -197,7 +197,7 @@ alsa_finish(struct audio_output *ao)
}
static
bool
alsa_output_enable
(
struct
audio_o
utput
*
ao
,
gcc_unused
Error
&
error
)
alsa_output_enable
(
AudioO
utput
*
ao
,
gcc_unused
Error
&
error
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -206,7 +206,7 @@ alsa_output_enable(struct audio_output *ao, gcc_unused Error &error)
}
static
void
alsa_output_disable
(
struct
audio_o
utput
*
ao
)
alsa_output_disable
(
AudioO
utput
*
ao
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -671,7 +671,7 @@ alsa_setup_or_dsd(AlsaOutput *ad, AudioFormat &audio_format,
}
static
bool
alsa_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
alsa_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -774,7 +774,7 @@ alsa_recover(AlsaOutput *ad, int err)
}
static
void
alsa_drain
(
struct
audio_o
utput
*
ao
)
alsa_drain
(
AudioO
utput
*
ao
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -795,7 +795,7 @@ alsa_drain(struct audio_output *ao)
}
static
void
alsa_cancel
(
struct
audio_o
utput
*
ao
)
alsa_cancel
(
AudioO
utput
*
ao
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -805,7 +805,7 @@ alsa_cancel(struct audio_output *ao)
}
static
void
alsa_close
(
struct
audio_o
utput
*
ao
)
alsa_close
(
AudioO
utput
*
ao
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
@@ -814,7 +814,7 @@ alsa_close(struct audio_output *ao)
}
static
size_t
alsa_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
alsa_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
...
...
src/output/plugins/AoOutputPlugin.cxx
View file @
815d7206
...
...
@@ -35,7 +35,7 @@ static ao_sample_format OUR_AO_FORMAT_INITIALIZER;
static
unsigned
ao_output_ref
;
struct
AoOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
size_t
write_size
;
int
driver
;
...
...
@@ -152,7 +152,7 @@ AoOutput::Configure(const config_param ¶m, Error &error)
return
true
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
ao_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
AoOutput
*
ad
=
new
AoOutput
();
...
...
@@ -172,7 +172,7 @@ ao_output_init(const config_param ¶m, Error &error)
}
static
void
ao_output_finish
(
struct
audio_o
utput
*
ao
)
ao_output_finish
(
AudioO
utput
*
ao
)
{
AoOutput
*
ad
=
(
AoOutput
*
)
ao
;
...
...
@@ -187,7 +187,7 @@ ao_output_finish(struct audio_output *ao)
}
static
void
ao_output_close
(
struct
audio_o
utput
*
ao
)
ao_output_close
(
AudioO
utput
*
ao
)
{
AoOutput
*
ad
=
(
AoOutput
*
)
ao
;
...
...
@@ -195,7 +195,7 @@ ao_output_close(struct audio_output *ao)
}
static
bool
ao_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
ao_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
ao_sample_format
format
=
OUR_AO_FORMAT_INITIALIZER
;
...
...
@@ -251,7 +251,7 @@ static int ao_play_deconst(ao_device *device, const void *output_samples,
}
static
size_t
ao_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
ao_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
AoOutput
*
ad
=
(
AoOutput
*
)
ao
;
...
...
src/output/plugins/FifoOutputPlugin.cxx
View file @
815d7206
...
...
@@ -36,7 +36,7 @@
#define FIFO_BUFFER_SIZE 65536
/* pipe capacity on Linux >= 2.6.11 */
struct
FifoOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
AllocatedPath
path
;
std
::
string
path_utf8
;
...
...
@@ -172,7 +172,7 @@ fifo_open(FifoOutput *fd, Error &error)
return
fd
->
Open
(
error
);
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
fifo_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
FifoOutput
*
fd
=
new
FifoOutput
();
...
...
@@ -204,7 +204,7 @@ fifo_output_init(const config_param ¶m, Error &error)
}
static
void
fifo_output_finish
(
struct
audio_o
utput
*
ao
)
fifo_output_finish
(
AudioO
utput
*
ao
)
{
FifoOutput
*
fd
=
(
FifoOutput
*
)
ao
;
...
...
@@ -214,7 +214,7 @@ fifo_output_finish(struct audio_output *ao)
}
static
bool
fifo_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
fifo_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
gcc_unused
Error
&
error
)
{
FifoOutput
*
fd
=
(
FifoOutput
*
)
ao
;
...
...
@@ -225,7 +225,7 @@ fifo_output_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
fifo_output_close
(
struct
audio_o
utput
*
ao
)
fifo_output_close
(
AudioO
utput
*
ao
)
{
FifoOutput
*
fd
=
(
FifoOutput
*
)
ao
;
...
...
@@ -233,7 +233,7 @@ fifo_output_close(struct audio_output *ao)
}
static
void
fifo_output_cancel
(
struct
audio_o
utput
*
ao
)
fifo_output_cancel
(
AudioO
utput
*
ao
)
{
FifoOutput
*
fd
=
(
FifoOutput
*
)
ao
;
char
buf
[
FIFO_BUFFER_SIZE
];
...
...
@@ -252,7 +252,7 @@ fifo_output_cancel(struct audio_output *ao)
}
static
unsigned
fifo_output_delay
(
struct
audio_o
utput
*
ao
)
fifo_output_delay
(
AudioO
utput
*
ao
)
{
FifoOutput
*
fd
=
(
FifoOutput
*
)
ao
;
...
...
@@ -262,7 +262,7 @@ fifo_output_delay(struct audio_output *ao)
}
static
size_t
fifo_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
fifo_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
FifoOutput
*
fd
=
(
FifoOutput
*
)
ao
;
...
...
src/output/plugins/HttpdInternal.hxx
View file @
815d7206
...
...
@@ -51,7 +51,7 @@ struct Encoder;
struct
Tag
;
class
HttpdOutput
final
:
ServerSocket
,
DeferredMonitor
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
/**
* True if the audio output is open and accepts client
...
...
@@ -157,7 +157,7 @@ public:
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
#endif
static
constexpr
HttpdOutput
*
Cast
(
audio_o
utput
*
ao
)
{
static
constexpr
HttpdOutput
*
Cast
(
AudioO
utput
*
ao
)
{
return
ContainerCast
(
ao
,
HttpdOutput
,
base
);
}
...
...
@@ -175,7 +175,7 @@ public:
bool
Configure
(
const
config_param
&
param
,
Error
&
error
);
audio_o
utput
*
InitAndConfigure
(
const
config_param
&
param
,
AudioO
utput
*
InitAndConfigure
(
const
config_param
&
param
,
Error
&
error
)
{
if
(
!
Init
(
param
,
error
))
return
nullptr
;
...
...
src/output/plugins/HttpdOutputPlugin.cxx
View file @
815d7206
...
...
@@ -139,12 +139,12 @@ HttpdOutput::Init(const config_param ¶m, Error &error)
return
ao_base_init
(
&
base
,
&
httpd_output_plugin
,
param
,
error
);
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
httpd_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
HttpdOutput
*
httpd
=
new
HttpdOutput
(
io_thread_get
());
audio_o
utput
*
result
=
httpd
->
InitAndConfigure
(
param
,
error
);
AudioO
utput
*
result
=
httpd
->
InitAndConfigure
(
param
,
error
);
if
(
result
==
nullptr
)
delete
httpd
;
...
...
@@ -152,7 +152,7 @@ httpd_output_init(const config_param ¶m, Error &error)
}
static
void
httpd_output_finish
(
struct
audio_o
utput
*
ao
)
httpd_output_finish
(
AudioO
utput
*
ao
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -276,7 +276,7 @@ HttpdOutput::ReadPage()
}
static
bool
httpd_output_enable
(
struct
audio_o
utput
*
ao
,
Error
&
error
)
httpd_output_enable
(
AudioO
utput
*
ao
,
Error
&
error
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -284,7 +284,7 @@ httpd_output_enable(struct audio_output *ao, Error &error)
}
static
void
httpd_output_disable
(
struct
audio_o
utput
*
ao
)
httpd_output_disable
(
AudioO
utput
*
ao
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -329,7 +329,7 @@ HttpdOutput::Open(AudioFormat &audio_format, Error &error)
}
static
bool
httpd_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
httpd_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -358,7 +358,7 @@ HttpdOutput::Close()
}
static
void
httpd_output_close
(
struct
audio_o
utput
*
ao
)
httpd_output_close
(
AudioO
utput
*
ao
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -411,7 +411,7 @@ HttpdOutput::Delay() const
}
static
unsigned
httpd_output_delay
(
struct
audio_o
utput
*
ao
)
httpd_output_delay
(
AudioO
utput
*
ao
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -476,7 +476,7 @@ HttpdOutput::Play(const void *chunk, size_t size, Error &error)
}
static
size_t
httpd_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
httpd_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -485,7 +485,7 @@ httpd_output_play(struct audio_output *ao, const void *chunk, size_t size,
}
static
bool
httpd_output_pause
(
struct
audio_o
utput
*
ao
)
httpd_output_pause
(
AudioO
utput
*
ao
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -548,7 +548,7 @@ HttpdOutput::SendTag(const Tag *tag)
}
static
void
httpd_output_tag
(
struct
audio_o
utput
*
ao
,
const
Tag
*
tag
)
httpd_output_tag
(
AudioO
utput
*
ao
,
const
Tag
*
tag
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
@@ -573,7 +573,7 @@ HttpdOutput::CancelAllClients()
}
static
void
httpd_output_cancel
(
struct
audio_o
utput
*
ao
)
httpd_output_cancel
(
AudioO
utput
*
ao
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
src/output/plugins/JackOutputPlugin.cxx
View file @
815d7206
...
...
@@ -42,7 +42,7 @@ enum {
static
const
size_t
jack_sample_size
=
sizeof
(
jack_default_audio_sample_t
);
struct
JackOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
/**
* libjack options passed to jack_client_open().
...
...
@@ -310,7 +310,7 @@ parse_port_list(const char *source, char **dest, Error &error)
return
n
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
mpd_jack_init
(
const
config_param
&
param
,
Error
&
error
)
{
JackOutput
*
jd
=
new
JackOutput
();
...
...
@@ -389,7 +389,7 @@ mpd_jack_init(const config_param ¶m, Error &error)
}
static
void
mpd_jack_finish
(
struct
audio_o
utput
*
ao
)
mpd_jack_finish
(
AudioO
utput
*
ao
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -404,7 +404,7 @@ mpd_jack_finish(struct audio_output *ao)
}
static
bool
mpd_jack_enable
(
struct
audio_o
utput
*
ao
,
Error
&
error
)
mpd_jack_enable
(
AudioO
utput
*
ao
,
Error
&
error
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -415,7 +415,7 @@ mpd_jack_enable(struct audio_output *ao, Error &error)
}
static
void
mpd_jack_disable
(
struct
audio_o
utput
*
ao
)
mpd_jack_disable
(
AudioO
utput
*
ao
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -579,7 +579,7 @@ mpd_jack_start(JackOutput *jd, Error &error)
}
static
bool
mpd_jack_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
mpd_jack_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -604,7 +604,7 @@ mpd_jack_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
mpd_jack_close
(
gcc_unused
struct
audio_o
utput
*
ao
)
mpd_jack_close
(
gcc_unused
AudioO
utput
*
ao
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -612,7 +612,7 @@ mpd_jack_close(gcc_unused struct audio_output *ao)
}
static
unsigned
mpd_jack_delay
(
struct
audio_o
utput
*
ao
)
mpd_jack_delay
(
AudioO
utput
*
ao
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -689,7 +689,7 @@ mpd_jack_write_samples(JackOutput *jd, const void *src,
}
static
size_t
mpd_jack_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
mpd_jack_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
@@ -734,7 +734,7 @@ mpd_jack_play(struct audio_output *ao, const void *chunk, size_t size,
}
static
bool
mpd_jack_pause
(
struct
audio_o
utput
*
ao
)
mpd_jack_pause
(
AudioO
utput
*
ao
)
{
JackOutput
*
jd
=
(
JackOutput
*
)
ao
;
...
...
src/output/plugins/NullOutputPlugin.cxx
View file @
815d7206
...
...
@@ -23,7 +23,7 @@
#include "Timer.hxx"
struct
NullOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
bool
sync
;
...
...
@@ -39,7 +39,7 @@ struct NullOutput {
}
};
static
struct
audio_o
utput
*
static
AudioO
utput
*
null_init
(
const
config_param
&
param
,
Error
&
error
)
{
NullOutput
*
nd
=
new
NullOutput
();
...
...
@@ -55,7 +55,7 @@ null_init(const config_param ¶m, Error &error)
}
static
void
null_finish
(
struct
audio_o
utput
*
ao
)
null_finish
(
AudioO
utput
*
ao
)
{
NullOutput
*
nd
=
(
NullOutput
*
)
ao
;
...
...
@@ -64,7 +64,7 @@ null_finish(struct audio_output *ao)
}
static
bool
null_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
null_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
gcc_unused
Error
&
error
)
{
NullOutput
*
nd
=
(
NullOutput
*
)
ao
;
...
...
@@ -76,7 +76,7 @@ null_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
null_close
(
struct
audio_o
utput
*
ao
)
null_close
(
AudioO
utput
*
ao
)
{
NullOutput
*
nd
=
(
NullOutput
*
)
ao
;
...
...
@@ -85,7 +85,7 @@ null_close(struct audio_output *ao)
}
static
unsigned
null_delay
(
struct
audio_o
utput
*
ao
)
null_delay
(
AudioO
utput
*
ao
)
{
NullOutput
*
nd
=
(
NullOutput
*
)
ao
;
...
...
@@ -95,7 +95,7 @@ null_delay(struct audio_output *ao)
}
static
size_t
null_play
(
struct
audio_o
utput
*
ao
,
gcc_unused
const
void
*
chunk
,
size_t
size
,
null_play
(
AudioO
utput
*
ao
,
gcc_unused
const
void
*
chunk
,
size_t
size
,
gcc_unused
Error
&
error
)
{
NullOutput
*
nd
=
(
NullOutput
*
)
ao
;
...
...
@@ -112,7 +112,7 @@ null_play(struct audio_output *ao, gcc_unused const void *chunk, size_t size,
}
static
void
null_cancel
(
struct
audio_o
utput
*
ao
)
null_cancel
(
AudioO
utput
*
ao
)
{
NullOutput
*
nd
=
(
NullOutput
*
)
ao
;
...
...
src/output/plugins/OSXOutputPlugin.cxx
View file @
815d7206
...
...
@@ -33,7 +33,7 @@
#include <CoreServices/CoreServices.h>
struct
OSXOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
/* configuration settings */
OSType
component_subtype
;
...
...
@@ -77,7 +77,7 @@ osx_output_configure(OSXOutput *oo, const config_param ¶m)
}
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
osx_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
OSXOutput
*
oo
=
new
OSXOutput
();
...
...
@@ -92,7 +92,7 @@ osx_output_init(const config_param ¶m, Error &error)
}
static
void
osx_output_finish
(
struct
audio_o
utput
*
ao
)
osx_output_finish
(
AudioO
utput
*
ao
)
{
OSXOutput
*
oo
=
(
OSXOutput
*
)
ao
;
...
...
@@ -231,7 +231,7 @@ osx_render(void *vdata,
}
static
bool
osx_output_enable
(
struct
audio_o
utput
*
ao
,
Error
&
error
)
osx_output_enable
(
AudioO
utput
*
ao
,
Error
&
error
)
{
OSXOutput
*
oo
=
(
OSXOutput
*
)
ao
;
...
...
@@ -282,7 +282,7 @@ osx_output_enable(struct audio_output *ao, Error &error)
}
static
void
osx_output_disable
(
struct
audio_o
utput
*
ao
)
osx_output_disable
(
AudioO
utput
*
ao
)
{
OSXOutput
*
oo
=
(
OSXOutput
*
)
ao
;
...
...
@@ -290,7 +290,7 @@ osx_output_disable(struct audio_output *ao)
}
static
void
osx_output_cancel
(
struct
audio_o
utput
*
ao
)
osx_output_cancel
(
AudioO
utput
*
ao
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
...
...
@@ -299,7 +299,7 @@ osx_output_cancel(struct audio_output *ao)
}
static
void
osx_output_close
(
struct
audio_o
utput
*
ao
)
osx_output_close
(
AudioO
utput
*
ao
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
...
...
@@ -310,7 +310,7 @@ osx_output_close(struct audio_output *ao)
}
static
bool
osx_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
osx_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
...
...
@@ -383,7 +383,7 @@ osx_output_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
size_t
osx_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
osx_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
gcc_unused
Error
&
error
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
...
...
src/output/plugins/OpenALOutputPlugin.cxx
View file @
815d7206
...
...
@@ -37,7 +37,7 @@
#define NUM_BUFFERS 16
struct
OpenALOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
const
char
*
device_name
;
ALCdevice
*
device
;
...
...
@@ -133,7 +133,7 @@ openal_setup_context(OpenALOutput *od, Error &error)
return
true
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
openal_init
(
const
config_param
&
param
,
Error
&
error
)
{
const
char
*
device_name
=
param
.
GetBlockValue
(
"device"
);
...
...
@@ -153,7 +153,7 @@ openal_init(const config_param ¶m, Error &error)
}
static
void
openal_finish
(
struct
audio_o
utput
*
ao
)
openal_finish
(
AudioO
utput
*
ao
)
{
OpenALOutput
*
od
=
(
OpenALOutput
*
)
ao
;
...
...
@@ -162,7 +162,7 @@ openal_finish(struct audio_output *ao)
}
static
bool
openal_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
openal_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
OpenALOutput
*
od
=
(
OpenALOutput
*
)
ao
;
...
...
@@ -196,7 +196,7 @@ openal_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
openal_close
(
struct
audio_o
utput
*
ao
)
openal_close
(
AudioO
utput
*
ao
)
{
OpenALOutput
*
od
=
(
OpenALOutput
*
)
ao
;
...
...
@@ -208,7 +208,7 @@ openal_close(struct audio_output *ao)
}
static
unsigned
openal_delay
(
struct
audio_o
utput
*
ao
)
openal_delay
(
AudioO
utput
*
ao
)
{
OpenALOutput
*
od
=
(
OpenALOutput
*
)
ao
;
...
...
@@ -221,7 +221,7 @@ openal_delay(struct audio_output *ao)
}
static
size_t
openal_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
openal_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
gcc_unused
Error
&
error
)
{
OpenALOutput
*
od
=
(
OpenALOutput
*
)
ao
;
...
...
@@ -253,7 +253,7 @@ openal_play(struct audio_output *ao, const void *chunk, size_t size,
}
static
void
openal_cancel
(
struct
audio_o
utput
*
ao
)
openal_cancel
(
AudioO
utput
*
ao
)
{
OpenALOutput
*
od
=
(
OpenALOutput
*
)
ao
;
...
...
src/output/plugins/OssOutputPlugin.cxx
View file @
815d7206
...
...
@@ -57,7 +57,7 @@
#endif
struct
OssOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
#ifdef AFMT_S24_PACKED
Manual
<
PcmExport
>
pcm_export
;
...
...
@@ -149,7 +149,7 @@ oss_output_test_default_device(void)
return
false
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
oss_open_default
(
Error
&
error
)
{
int
err
[
ARRAY_SIZE
(
default_devices
)];
...
...
@@ -199,7 +199,7 @@ oss_open_default(Error &error)
return
NULL
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
oss_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
const
char
*
device
=
param
.
GetBlockValue
(
"device"
);
...
...
@@ -218,7 +218,7 @@ oss_output_init(const config_param ¶m, Error &error)
}
static
void
oss_output_finish
(
struct
audio_o
utput
*
ao
)
oss_output_finish
(
AudioO
utput
*
ao
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
@@ -229,7 +229,7 @@ oss_output_finish(struct audio_output *ao)
#ifdef AFMT_S24_PACKED
static
bool
oss_output_enable
(
struct
audio_o
utput
*
ao
,
gcc_unused
Error
&
error
)
oss_output_enable
(
AudioO
utput
*
ao
,
gcc_unused
Error
&
error
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
@@ -238,7 +238,7 @@ oss_output_enable(struct audio_output *ao, gcc_unused Error &error)
}
static
void
oss_output_disable
(
struct
audio_o
utput
*
ao
)
oss_output_disable
(
AudioO
utput
*
ao
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
@@ -680,7 +680,7 @@ oss_reopen(OssOutput *od, Error &error)
}
static
bool
oss_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
oss_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
@@ -702,7 +702,7 @@ oss_output_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
oss_output_close
(
struct
audio_o
utput
*
ao
)
oss_output_close
(
AudioO
utput
*
ao
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
@@ -710,7 +710,7 @@ oss_output_close(struct audio_output *ao)
}
static
void
oss_output_cancel
(
struct
audio_o
utput
*
ao
)
oss_output_cancel
(
AudioO
utput
*
ao
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
@@ -721,7 +721,7 @@ oss_output_cancel(struct audio_output *ao)
}
static
size_t
oss_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
oss_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
OssOutput
*
od
=
(
OssOutput
*
)
ao
;
...
...
src/output/plugins/PipeOutputPlugin.cxx
View file @
815d7206
...
...
@@ -29,7 +29,7 @@
#include <stdio.h>
struct
PipeOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
std
::
string
cmd
;
FILE
*
fh
;
...
...
@@ -61,7 +61,7 @@ PipeOutput::Configure(const config_param ¶m, Error &error)
return
true
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
pipe_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
PipeOutput
*
pd
=
new
PipeOutput
();
...
...
@@ -81,7 +81,7 @@ pipe_output_init(const config_param ¶m, Error &error)
}
static
void
pipe_output_finish
(
struct
audio_o
utput
*
ao
)
pipe_output_finish
(
AudioO
utput
*
ao
)
{
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
...
...
@@ -90,7 +90,7 @@ pipe_output_finish(struct audio_output *ao)
}
static
bool
pipe_output_open
(
struct
audio_o
utput
*
ao
,
pipe_output_open
(
AudioO
utput
*
ao
,
gcc_unused
AudioFormat
&
audio_format
,
Error
&
error
)
{
...
...
@@ -107,7 +107,7 @@ pipe_output_open(struct audio_output *ao,
}
static
void
pipe_output_close
(
struct
audio_o
utput
*
ao
)
pipe_output_close
(
AudioO
utput
*
ao
)
{
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
...
...
@@ -115,7 +115,7 @@ pipe_output_close(struct audio_output *ao)
}
static
size_t
pipe_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
pipe_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
...
...
src/output/plugins/PulseOutputPlugin.cxx
View file @
815d7206
...
...
@@ -42,7 +42,7 @@
#define MPD_PULSE_NAME "Music Player Daemon"
struct
PulseOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
const
char
*
name
;
const
char
*
server
;
...
...
@@ -323,7 +323,7 @@ pulse_output_setup_context(PulseOutput *po, Error &error)
return
true
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
pulse_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
PulseOutput
*
po
;
...
...
@@ -349,7 +349,7 @@ pulse_output_init(const config_param ¶m, Error &error)
}
static
void
pulse_output_finish
(
struct
audio_o
utput
*
ao
)
pulse_output_finish
(
AudioO
utput
*
ao
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
...
...
@@ -358,7 +358,7 @@ pulse_output_finish(struct audio_output *ao)
}
static
bool
pulse_output_enable
(
struct
audio_o
utput
*
ao
,
Error
&
error
)
pulse_output_enable
(
AudioO
utput
*
ao
,
Error
&
error
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
...
...
@@ -404,7 +404,7 @@ pulse_output_enable(struct audio_output *ao, Error &error)
}
static
void
pulse_output_disable
(
struct
audio_o
utput
*
ao
)
pulse_output_disable
(
AudioO
utput
*
ao
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
...
...
@@ -548,7 +548,7 @@ pulse_output_setup_stream(PulseOutput *po, const pa_sample_spec *ss,
}
static
bool
pulse_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
pulse_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
...
...
@@ -616,7 +616,7 @@ pulse_output_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
pulse_output_close
(
struct
audio_o
utput
*
ao
)
pulse_output_close
(
AudioO
utput
*
ao
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
pa_operation
*
o
;
...
...
@@ -702,7 +702,7 @@ pulse_output_stream_pause(PulseOutput *po, bool pause,
}
static
unsigned
pulse_output_delay
(
struct
audio_o
utput
*
ao
)
pulse_output_delay
(
AudioO
utput
*
ao
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
unsigned
result
=
0
;
...
...
@@ -720,7 +720,7 @@ pulse_output_delay(struct audio_output *ao)
}
static
size_t
pulse_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
pulse_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
...
...
@@ -785,7 +785,7 @@ pulse_output_play(struct audio_output *ao, const void *chunk, size_t size,
}
static
void
pulse_output_cancel
(
struct
audio_o
utput
*
ao
)
pulse_output_cancel
(
AudioO
utput
*
ao
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
pa_operation
*
o
;
...
...
@@ -818,7 +818,7 @@ pulse_output_cancel(struct audio_output *ao)
}
static
bool
pulse_output_pause
(
struct
audio_o
utput
*
ao
)
pulse_output_pause
(
AudioO
utput
*
ao
)
{
PulseOutput
*
po
=
(
PulseOutput
*
)
ao
;
...
...
src/output/plugins/RecorderOutputPlugin.cxx
View file @
815d7206
...
...
@@ -35,7 +35,7 @@
#include <errno.h>
struct
RecorderOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
/**
* The configured encoder plugin.
...
...
@@ -107,7 +107,7 @@ RecorderOutput::Configure(const config_param ¶m, Error &error)
return
true
;
}
static
audio_o
utput
*
static
AudioO
utput
*
recorder_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
RecorderOutput
*
recorder
=
new
RecorderOutput
();
...
...
@@ -127,7 +127,7 @@ recorder_output_init(const config_param ¶m, Error &error)
}
static
void
recorder_output_finish
(
struct
audio_o
utput
*
ao
)
recorder_output_finish
(
AudioO
utput
*
ao
)
{
RecorderOutput
*
recorder
=
(
RecorderOutput
*
)
ao
;
...
...
@@ -181,7 +181,7 @@ RecorderOutput::EncoderToFile(Error &error)
}
static
bool
recorder_output_open
(
struct
audio_o
utput
*
ao
,
recorder_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
...
...
@@ -216,7 +216,7 @@ recorder_output_open(struct audio_output *ao,
}
static
void
recorder_output_close
(
struct
audio_o
utput
*
ao
)
recorder_output_close
(
AudioO
utput
*
ao
)
{
RecorderOutput
*
recorder
=
(
RecorderOutput
*
)
ao
;
...
...
@@ -233,7 +233,7 @@ recorder_output_close(struct audio_output *ao)
}
static
size_t
recorder_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
recorder_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
RecorderOutput
*
recorder
=
(
RecorderOutput
*
)
ao
;
...
...
src/output/plugins/RoarOutputPlugin.cxx
View file @
815d7206
...
...
@@ -36,7 +36,7 @@
#undef new
class
RoarOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
std
::
string
host
,
name
;
...
...
@@ -52,7 +52,7 @@ public:
RoarOutput
()
:
err
(
ROAR_ERROR_NONE
)
{}
operator
audio_o
utput
*
()
{
operator
AudioO
utput
*
()
{
return
&
base
;
}
...
...
@@ -136,7 +136,7 @@ RoarOutput::Configure(const config_param ¶m)
:
ROAR_ROLE_MUSIC
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
roar_init
(
const
config_param
&
param
,
Error
&
error
)
{
RoarOutput
*
self
=
new
RoarOutput
();
...
...
@@ -151,7 +151,7 @@ roar_init(const config_param ¶m, Error &error)
}
static
void
roar_finish
(
struct
audio_o
utput
*
ao
)
roar_finish
(
AudioO
utput
*
ao
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
...
...
@@ -227,7 +227,7 @@ RoarOutput::Open(AudioFormat &audio_format, Error &error)
}
static
bool
roar_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
roar_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
...
...
@@ -248,7 +248,7 @@ RoarOutput::Close()
}
static
void
roar_close
(
struct
audio_o
utput
*
ao
)
roar_close
(
AudioO
utput
*
ao
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
self
->
Close
();
...
...
@@ -283,7 +283,7 @@ RoarOutput::Cancel()
}
static
void
roar_cancel
(
struct
audio_o
utput
*
ao
)
roar_cancel
(
AudioO
utput
*
ao
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
...
...
@@ -308,7 +308,7 @@ RoarOutput::Play(const void *chunk, size_t size, Error &error)
}
static
size_t
roar_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
roar_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
...
...
@@ -403,7 +403,7 @@ RoarOutput::SendTag(const Tag &tag)
}
static
void
roar_send_tag
(
struct
audio_o
utput
*
ao
,
const
Tag
*
meta
)
roar_send_tag
(
AudioO
utput
*
ao
,
const
Tag
*
meta
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
self
->
SendTag
(
*
meta
);
...
...
src/output/plugins/ShoutOutputPlugin.cxx
View file @
815d7206
...
...
@@ -39,7 +39,7 @@
static
constexpr
unsigned
DEFAULT_CONN_TIMEOUT
=
2
;
struct
ShoutOutput
final
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
shout_t
*
shout_conn
;
shout_metadata_t
*
shout_meta
;
...
...
@@ -275,7 +275,7 @@ ShoutOutput::Configure(const config_param ¶m, Error &error)
return
true
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
my_shout_init_driver
(
const
config_param
&
param
,
Error
&
error
)
{
ShoutOutput
*
sd
=
new
ShoutOutput
();
...
...
@@ -363,7 +363,7 @@ static void close_shout_conn(ShoutOutput * sd)
}
static
void
my_shout_finish_driver
(
struct
audio_o
utput
*
ao
)
my_shout_finish_driver
(
AudioO
utput
*
ao
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -379,7 +379,7 @@ my_shout_finish_driver(struct audio_output *ao)
}
static
void
my_shout_drop_buffered_audio
(
struct
audio_o
utput
*
ao
)
my_shout_drop_buffered_audio
(
AudioO
utput
*
ao
)
{
gcc_unused
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -388,7 +388,7 @@ my_shout_drop_buffered_audio(struct audio_output *ao)
}
static
void
my_shout_close_device
(
struct
audio_o
utput
*
ao
)
my_shout_close_device
(
AudioO
utput
*
ao
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -414,7 +414,7 @@ shout_connect(ShoutOutput *sd, Error &error)
}
static
bool
my_shout_open_device
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
my_shout_open_device
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -437,7 +437,7 @@ my_shout_open_device(struct audio_output *ao, AudioFormat &audio_format,
}
static
unsigned
my_shout_delay
(
struct
audio_o
utput
*
ao
)
my_shout_delay
(
AudioO
utput
*
ao
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -449,7 +449,7 @@ my_shout_delay(struct audio_output *ao)
}
static
size_t
my_shout_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
my_shout_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -461,7 +461,7 @@ my_shout_play(struct audio_output *ao, const void *chunk, size_t size,
}
static
bool
my_shout_pause
(
struct
audio_o
utput
*
ao
)
my_shout_pause
(
AudioO
utput
*
ao
)
{
static
char
silence
[
1020
];
...
...
@@ -494,7 +494,7 @@ shout_tag_to_metadata(const Tag *tag, char *dest, size_t size)
snprintf
(
dest
,
size
,
"%s - %s"
,
artist
,
title
);
}
static
void
my_shout_set_tag
(
struct
audio_o
utput
*
ao
,
static
void
my_shout_set_tag
(
AudioO
utput
*
ao
,
const
Tag
*
tag
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
src/output/plugins/SolarisOutputPlugin.cxx
View file @
815d7206
...
...
@@ -50,7 +50,7 @@ struct audio_info {
#endif
struct
SolarisOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
/* configuration */
const
char
*
device
;
...
...
@@ -76,7 +76,7 @@ solaris_output_test_default_device(void)
access
(
"/dev/audio"
,
W_OK
)
==
0
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
solaris_output_init
(
const
config_param
&
param
,
Error
&
error_r
)
{
SolarisOutput
*
so
=
new
SolarisOutput
();
...
...
@@ -91,7 +91,7 @@ solaris_output_init(const config_param ¶m, Error &error_r)
}
static
void
solaris_output_finish
(
struct
audio_o
utput
*
ao
)
solaris_output_finish
(
AudioO
utput
*
ao
)
{
SolarisOutput
*
so
=
(
SolarisOutput
*
)
ao
;
...
...
@@ -100,7 +100,7 @@ solaris_output_finish(struct audio_output *ao)
}
static
bool
solaris_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
solaris_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
SolarisOutput
*
so
=
(
SolarisOutput
*
)
ao
;
...
...
@@ -151,7 +151,7 @@ solaris_output_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
solaris_output_close
(
struct
audio_o
utput
*
ao
)
solaris_output_close
(
AudioO
utput
*
ao
)
{
SolarisOutput
*
so
=
(
SolarisOutput
*
)
ao
;
...
...
@@ -159,7 +159,7 @@ solaris_output_close(struct audio_output *ao)
}
static
size_t
solaris_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
solaris_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
SolarisOutput
*
so
=
(
SolarisOutput
*
)
ao
;
...
...
@@ -175,7 +175,7 @@ solaris_output_play(struct audio_output *ao, const void *chunk, size_t size,
}
static
void
solaris_output_cancel
(
struct
audio_o
utput
*
ao
)
solaris_output_cancel
(
AudioO
utput
*
ao
)
{
SolarisOutput
*
so
=
(
SolarisOutput
*
)
ao
;
...
...
src/output/plugins/WinmmOutputPlugin.cxx
View file @
815d7206
...
...
@@ -38,7 +38,7 @@ struct WinmmBuffer {
};
struct
WinmmOutput
{
struct
audio_o
utput
base
;
AudioO
utput
base
;
UINT
device_id
;
HWAVEOUT
handle
;
...
...
@@ -108,7 +108,7 @@ fail:
return
false
;
}
static
struct
audio_o
utput
*
static
AudioO
utput
*
winmm_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
WinmmOutput
*
wo
=
new
WinmmOutput
();
...
...
@@ -128,7 +128,7 @@ winmm_output_init(const config_param ¶m, Error &error)
}
static
void
winmm_output_finish
(
struct
audio_o
utput
*
ao
)
winmm_output_finish
(
AudioO
utput
*
ao
)
{
WinmmOutput
*
wo
=
(
WinmmOutput
*
)
ao
;
...
...
@@ -137,7 +137,7 @@ winmm_output_finish(struct audio_output *ao)
}
static
bool
winmm_output_open
(
struct
audio_o
utput
*
ao
,
AudioFormat
&
audio_format
,
winmm_output_open
(
AudioO
utput
*
ao
,
AudioFormat
&
audio_format
,
Error
&
error
)
{
WinmmOutput
*
wo
=
(
WinmmOutput
*
)
ao
;
...
...
@@ -194,7 +194,7 @@ winmm_output_open(struct audio_output *ao, AudioFormat &audio_format,
}
static
void
winmm_output_close
(
struct
audio_o
utput
*
ao
)
winmm_output_close
(
AudioO
utput
*
ao
)
{
WinmmOutput
*
wo
=
(
WinmmOutput
*
)
ao
;
...
...
@@ -263,7 +263,7 @@ winmm_drain_buffer(WinmmOutput *wo, WinmmBuffer *buffer,
}
static
size_t
winmm_output_play
(
struct
audio_o
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
winmm_output_play
(
AudioO
utput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
WinmmOutput
*
wo
=
(
WinmmOutput
*
)
ao
;
...
...
@@ -318,7 +318,7 @@ winmm_stop(WinmmOutput *wo)
}
static
void
winmm_output_drain
(
struct
audio_o
utput
*
ao
)
winmm_output_drain
(
AudioO
utput
*
ao
)
{
WinmmOutput
*
wo
=
(
WinmmOutput
*
)
ao
;
...
...
@@ -327,7 +327,7 @@ winmm_output_drain(struct audio_output *ao)
}
static
void
winmm_output_cancel
(
struct
audio_o
utput
*
ao
)
winmm_output_cancel
(
AudioO
utput
*
ao
)
{
WinmmOutput
*
wo
=
(
WinmmOutput
*
)
ao
;
...
...
test/run_output.cxx
View file @
815d7206
...
...
@@ -80,7 +80,7 @@ PlayerControl::PlayerControl(gcc_unused MultipleOutputs &_outputs,
:
outputs
(
_outputs
)
{}
PlayerControl
::~
PlayerControl
()
{}
static
struct
audio_o
utput
*
static
AudioO
utput
*
load_audio_output
(
const
char
*
name
)
{
const
struct
config_param
*
param
;
...
...
@@ -95,7 +95,7 @@ load_audio_output(const char *name)
32
,
4
);
Error
error
;
struct
audio_o
utput
*
ao
=
AudioO
utput
*
ao
=
audio_output_new
(
*
param
,
dummy_player_control
,
error
);
if
(
ao
==
nullptr
)
LogError
(
error
);
...
...
@@ -104,7 +104,7 @@ load_audio_output(const char *name)
}
static
bool
run_output
(
struct
audio_o
utput
*
ao
,
AudioFormat
audio_format
)
run_output
(
AudioO
utput
*
ao
,
AudioFormat
audio_format
)
{
/* open the audio output */
...
...
@@ -197,7 +197,7 @@ int main(int argc, char **argv)
/* initialize the audio output */
struct
audio_o
utput
*
ao
=
load_audio_output
(
argv
[
2
]);
AudioO
utput
*
ao
=
load_audio_output
(
argv
[
2
]);
if
(
ao
==
NULL
)
return
1
;
...
...
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