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
d0157af1
Commit
d0157af1
authored
Aug 07, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter/Internal: rename struct AudioOutput to FilteredAudioOutput
Prepare to add an abstract class AudioOutput, to be implemented by plugins, to get rid of the C-style vtable.
parent
fc046205
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
132 additions
and
132 deletions
+132
-132
MixerControl.cxx
src/mixer/MixerControl.cxx
+1
-1
MixerControl.hxx
src/mixer/MixerControl.hxx
+3
-2
MixerPlugin.hxx
src/mixer/MixerPlugin.hxx
+3
-3
AlsaMixerPlugin.cxx
src/mixer/plugins/AlsaMixerPlugin.cxx
+1
-1
HaikuMixerPlugin.cxx
src/mixer/plugins/HaikuMixerPlugin.cxx
+1
-1
NullMixerPlugin.cxx
src/mixer/plugins/NullMixerPlugin.cxx
+1
-1
OssMixerPlugin.cxx
src/mixer/plugins/OssMixerPlugin.cxx
+2
-1
PulseMixerPlugin.cxx
src/mixer/plugins/PulseMixerPlugin.cxx
+1
-1
RoarMixerPlugin.cxx
src/mixer/plugins/RoarMixerPlugin.cxx
+1
-1
SoftwareMixerPlugin.cxx
src/mixer/plugins/SoftwareMixerPlugin.cxx
+1
-1
WinmmMixerPlugin.cxx
src/mixer/plugins/WinmmMixerPlugin.cxx
+1
-1
Control.cxx
src/output/Control.cxx
+1
-1
Control.hxx
src/output/Control.hxx
+6
-7
Finish.cxx
src/output/Finish.cxx
+3
-3
Init.cxx
src/output/Init.cxx
+6
-6
Internal.cxx
src/output/Internal.cxx
+10
-10
Internal.hxx
src/output/Internal.hxx
+4
-4
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+1
-1
MultipleOutputs.hxx
src/output/MultipleOutputs.hxx
+0
-1
OutputPlugin.cxx
src/output/OutputPlugin.cxx
+12
-12
OutputPlugin.hxx
src/output/OutputPlugin.hxx
+25
-25
Wrapper.hxx
src/output/Wrapper.hxx
+13
-13
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+1
-1
AoOutputPlugin.cxx
src/output/plugins/AoOutputPlugin.cxx
+1
-1
FifoOutputPlugin.cxx
src/output/plugins/FifoOutputPlugin.cxx
+1
-1
HaikuOutputPlugin.cxx
src/output/plugins/HaikuOutputPlugin.cxx
+1
-1
JackOutputPlugin.cxx
src/output/plugins/JackOutputPlugin.cxx
+2
-2
NullOutputPlugin.cxx
src/output/plugins/NullOutputPlugin.cxx
+1
-1
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+9
-9
OpenALOutputPlugin.cxx
src/output/plugins/OpenALOutputPlugin.cxx
+1
-1
OssOutputPlugin.cxx
src/output/plugins/OssOutputPlugin.cxx
+1
-1
PipeOutputPlugin.cxx
src/output/plugins/PipeOutputPlugin.cxx
+1
-1
PulseOutputPlugin.cxx
src/output/plugins/PulseOutputPlugin.cxx
+1
-1
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+1
-1
RoarOutputPlugin.cxx
src/output/plugins/RoarOutputPlugin.cxx
+2
-2
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+1
-1
SndioOutputPlugin.cxx
src/output/plugins/SndioOutputPlugin.cxx
+1
-1
SolarisOutputPlugin.cxx
src/output/plugins/SolarisOutputPlugin.cxx
+1
-1
WinmmOutputPlugin.cxx
src/output/plugins/WinmmOutputPlugin.cxx
+1
-1
HttpdInternal.hxx
src/output/plugins/httpd/HttpdInternal.hxx
+2
-2
SlesOutputPlugin.cxx
src/output/plugins/sles/SlesOutputPlugin.cxx
+2
-2
read_mixer.cxx
test/read_mixer.cxx
+1
-1
run_output.cxx
test/run_output.cxx
+3
-3
No files found.
src/mixer/MixerControl.cxx
View file @
d0157af1
...
...
@@ -25,7 +25,7 @@
Mixer
*
mixer_new
(
EventLoop
&
event_loop
,
const
MixerPlugin
&
plugin
,
AudioOutput
&
ao
,
const
MixerPlugin
&
plugin
,
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
const
ConfigBlock
&
block
)
{
...
...
src/mixer/MixerControl.hxx
View file @
d0157af1
...
...
@@ -27,7 +27,7 @@
class
Mixer
;
class
EventLoop
;
struct
AudioOutput
;
struct
Filtered
AudioOutput
;
struct
MixerPlugin
;
class
MixerListener
;
struct
ConfigBlock
;
...
...
@@ -36,7 +36,8 @@ struct ConfigBlock;
* Throws std::runtime_error on error.
*/
Mixer
*
mixer_new
(
EventLoop
&
event_loop
,
const
MixerPlugin
&
plugin
,
AudioOutput
&
ao
,
mixer_new
(
EventLoop
&
event_loop
,
const
MixerPlugin
&
plugin
,
FilteredAudioOutput
&
ao
,
MixerListener
&
listener
,
const
ConfigBlock
&
block
);
...
...
src/mixer/MixerPlugin.hxx
View file @
d0157af1
...
...
@@ -28,7 +28,7 @@
#define MPD_MIXER_PLUGIN_HXX
struct
ConfigBlock
;
struct
AudioOutput
;
struct
Filtered
AudioOutput
;
class
Mixer
;
class
MixerListener
;
class
EventLoop
;
...
...
@@ -39,11 +39,11 @@ struct MixerPlugin {
*
* Throws std::runtime_error on error.
*
* @param ao the associated AudioOutput
* @param ao the associated
#
AudioOutput
* @param param the configuration section
* @return a mixer object
*/
Mixer
*
(
*
init
)(
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
Mixer
*
(
*
init
)(
EventLoop
&
event_loop
,
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
const
ConfigBlock
&
block
);
...
...
src/mixer/plugins/AlsaMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -173,7 +173,7 @@ AlsaMixer::Configure(const ConfigBlock &block)
}
static
Mixer
*
alsa_mixer_init
(
EventLoop
&
event_loop
,
gcc_unused
AudioOutput
&
ao
,
alsa_mixer_init
(
EventLoop
&
event_loop
,
gcc_unused
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/HaikuMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -48,7 +48,7 @@ public:
};
static
Mixer
*
haiku_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
haiku_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
gcc_unused
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/NullMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -51,7 +51,7 @@ public:
static
Mixer
*
null_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
gcc_unused
AudioOutput
&
ao
,
gcc_unused
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
gcc_unused
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/OssMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -97,7 +97,8 @@ OssMixer::Configure(const ConfigBlock &block)
}
static
Mixer
*
oss_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
gcc_unused
AudioOutput
&
ao
,
oss_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
gcc_unused
FilteredAudioOutput
&
ao
,
MixerListener
&
listener
,
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/PulseMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -161,7 +161,7 @@ pulse_mixer_on_change(PulseMixer &pm,
}
static
Mixer
*
pulse_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
pulse_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
gcc_unused
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/RoarMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -45,7 +45,7 @@ public:
};
static
Mixer
*
roar_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
roar_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
gcc_unused
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/SoftwareMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -58,7 +58,7 @@ public:
static
Mixer
*
software_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
gcc_unused
AudioOutput
&
ao
,
gcc_unused
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
gcc_unused
const
ConfigBlock
&
block
)
{
...
...
src/mixer/plugins/WinmmMixerPlugin.cxx
View file @
d0157af1
...
...
@@ -64,7 +64,7 @@ winmm_volume_encode(int volume)
}
static
Mixer
*
winmm_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
winmm_mixer_init
(
gcc_unused
EventLoop
&
event_loop
,
Filtered
AudioOutput
&
ao
,
MixerListener
&
listener
,
gcc_unused
const
ConfigBlock
&
block
)
{
...
...
src/output/Control.cxx
View file @
d0157af1
...
...
@@ -38,7 +38,7 @@ static constexpr PeriodClock::Duration REOPEN_AFTER = std::chrono::seconds(10);
struct
notify
audio_output_client_notify
;
AudioOutputControl
::
AudioOutputControl
(
AudioOutput
*
_output
,
AudioOutputControl
::
AudioOutputControl
(
Filtered
AudioOutput
*
_output
,
AudioOutputClient
&
_client
)
:
output
(
_output
),
client
(
_client
),
thread
(
BIND_THIS_METHOD
(
Task
))
...
...
src/output/Control.hxx
View file @
d0157af1
...
...
@@ -38,7 +38,7 @@
#include <stdint.h>
enum
class
ReplayGainMode
:
uint8_t
;
struct
AudioOutput
;
struct
Filtered
AudioOutput
;
struct
MusicChunk
;
struct
ConfigBlock
;
class
MusicPipe
;
...
...
@@ -50,7 +50,7 @@ class AudioOutputClient;
* Controller for an #AudioOutput and its output thread.
*/
class
AudioOutputControl
{
AudioOutput
*
output
;
Filtered
AudioOutput
*
output
;
/**
* The PlayerControl object which "owns" this output. This
...
...
@@ -209,7 +209,8 @@ public:
*/
mutable
Mutex
mutex
;
AudioOutputControl
(
AudioOutput
*
_output
,
AudioOutputClient
&
_client
);
AudioOutputControl
(
FilteredAudioOutput
*
_output
,
AudioOutputClient
&
_client
);
#ifndef NDEBUG
~
AudioOutputControl
()
{
...
...
@@ -303,16 +304,14 @@ public:
void
CommandAsync
(
Command
cmd
)
noexcept
;
/**
* Sends a command to the #AudioOutput object and waits for
* completion.
* Sends a command to the object and waits for completion.
*
* Caller must lock the mutex.
*/
void
CommandWait
(
Command
cmd
)
noexcept
;
/**
* Lock the #AudioOutput object and execute the command
* synchronously.
* Lock the object and execute the command synchronously.
*/
void
LockCommandWait
(
Command
cmd
)
noexcept
;
...
...
src/output/Finish.cxx
View file @
d0157af1
...
...
@@ -23,7 +23,7 @@
#include "mixer/MixerControl.hxx"
#include "filter/FilterInternal.hxx"
AudioOutput
::~
AudioOutput
()
FilteredAudioOutput
::~
Filtered
AudioOutput
()
{
if
(
mixer
!=
nullptr
)
mixer_free
(
mixer
);
...
...
@@ -34,14 +34,14 @@ AudioOutput::~AudioOutput()
}
void
AudioOutput
::
BeginDestroy
()
noexcept
Filtered
AudioOutput
::
BeginDestroy
()
noexcept
{
if
(
mixer
!=
nullptr
)
mixer_auto_close
(
mixer
);
}
void
AudioOutput
::
FinishDestroy
()
noexcept
Filtered
AudioOutput
::
FinishDestroy
()
noexcept
{
ao_plugin_finish
(
this
);
}
src/output/Init.cxx
View file @
d0157af1
...
...
@@ -50,7 +50,7 @@
#define AUDIO_OUTPUT_FORMAT "format"
#define AUDIO_FILTERS "filters"
AudioOutput
::
AudioOutput
(
const
AudioOutputPlugin
&
_plugin
,
FilteredAudioOutput
::
Filtered
AudioOutput
(
const
AudioOutputPlugin
&
_plugin
,
const
ConfigBlock
&
block
)
:
plugin
(
_plugin
)
{
...
...
@@ -108,7 +108,7 @@ audio_output_mixer_type(const ConfigBlock &block) noexcept
}
static
Mixer
*
audio_output_load_mixer
(
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
audio_output_load_mixer
(
EventLoop
&
event_loop
,
Filtered
AudioOutput
&
ao
,
const
ConfigBlock
&
block
,
const
MixerPlugin
*
plugin
,
PreparedFilter
&
filter_chain
,
...
...
@@ -148,7 +148,7 @@ audio_output_load_mixer(EventLoop &event_loop, AudioOutput &ao,
}
void
AudioOutput
::
Configure
(
const
ConfigBlock
&
block
)
Filtered
AudioOutput
::
Configure
(
const
ConfigBlock
&
block
)
{
if
(
!
block
.
IsNull
())
{
name
=
block
.
GetBlockValue
(
AUDIO_OUTPUT_NAME
);
...
...
@@ -192,7 +192,7 @@ AudioOutput::Configure(const ConfigBlock &block)
}
inline
void
AudioOutput
::
Setup
(
EventLoop
&
event_loop
,
Filtered
AudioOutput
::
Setup
(
EventLoop
&
event_loop
,
const
ReplayGainConfig
&
replay_gain_config
,
MixerListener
&
mixer_listener
,
const
ConfigBlock
&
block
)
...
...
@@ -249,7 +249,7 @@ AudioOutput::Setup(EventLoop &event_loop,
convert_filter
.
Set
(
convert_filter_prepare
()));
}
AudioOutput
*
Filtered
AudioOutput
*
audio_output_new
(
EventLoop
&
event_loop
,
const
ReplayGainConfig
&
replay_gain_config
,
const
ConfigBlock
&
block
,
...
...
@@ -278,7 +278,7 @@ audio_output_new(EventLoop &event_loop,
plugin
->
name
);
}
AudioOutput
*
ao
=
ao_plugin_init
(
event_loop
,
*
plugin
,
block
);
auto
*
ao
=
ao_plugin_init
(
event_loop
,
*
plugin
,
block
);
assert
(
ao
!=
nullptr
);
try
{
...
...
src/output/Internal.cxx
View file @
d0157af1
...
...
@@ -29,7 +29,7 @@
#include "util/StringBuffer.hxx"
void
AudioOutput
::
Enable
()
Filtered
AudioOutput
::
Enable
()
{
try
{
ao_plugin_enable
(
*
this
);
...
...
@@ -40,13 +40,13 @@ AudioOutput::Enable()
}
void
AudioOutput
::
Disable
()
noexcept
Filtered
AudioOutput
::
Disable
()
noexcept
{
ao_plugin_disable
(
*
this
);
}
void
AudioOutput
::
ConfigureConvertFilter
()
Filtered
AudioOutput
::
ConfigureConvertFilter
()
{
try
{
convert_filter_set
(
convert_filter
.
Get
(),
out_audio_format
);
...
...
@@ -57,7 +57,7 @@ AudioOutput::ConfigureConvertFilter()
}
void
AudioOutput
::
OpenOutputAndConvert
(
AudioFormat
desired_audio_format
)
Filtered
AudioOutput
::
OpenOutputAndConvert
(
AudioFormat
desired_audio_format
)
{
out_audio_format
=
desired_audio_format
;
...
...
@@ -98,7 +98,7 @@ AudioOutput::OpenOutputAndConvert(AudioFormat desired_audio_format)
}
void
AudioOutput
::
CloseOutput
(
bool
drain
)
noexcept
Filtered
AudioOutput
::
CloseOutput
(
bool
drain
)
noexcept
{
if
(
drain
)
ao_plugin_drain
(
*
this
);
...
...
@@ -109,21 +109,21 @@ AudioOutput::CloseOutput(bool drain) noexcept
}
void
AudioOutput
::
OpenSoftwareMixer
()
noexcept
Filtered
AudioOutput
::
OpenSoftwareMixer
()
noexcept
{
if
(
mixer
!=
nullptr
&&
mixer
->
IsPlugin
(
software_mixer_plugin
))
software_mixer_set_filter
(
*
mixer
,
volume_filter
.
Get
());
}
void
AudioOutput
::
CloseSoftwareMixer
()
noexcept
Filtered
AudioOutput
::
CloseSoftwareMixer
()
noexcept
{
if
(
mixer
!=
nullptr
&&
mixer
->
IsPlugin
(
software_mixer_plugin
))
software_mixer_set_filter
(
*
mixer
,
nullptr
);
}
void
AudioOutput
::
Close
(
bool
drain
)
noexcept
Filtered
AudioOutput
::
Close
(
bool
drain
)
noexcept
{
CloseOutput
(
drain
);
CloseSoftwareMixer
();
...
...
@@ -133,13 +133,13 @@ AudioOutput::Close(bool drain) noexcept
}
void
AudioOutput
::
BeginPause
()
noexcept
Filtered
AudioOutput
::
BeginPause
()
noexcept
{
ao_plugin_cancel
(
*
this
);
}
bool
AudioOutput
::
IteratePause
()
noexcept
Filtered
AudioOutput
::
IteratePause
()
noexcept
{
try
{
return
ao_plugin_pause
(
*
this
);
...
...
src/output/Internal.hxx
View file @
d0157af1
...
...
@@ -33,7 +33,7 @@ struct ConfigBlock;
struct
AudioOutputPlugin
;
struct
ReplayGainConfig
;
struct
AudioOutput
{
struct
Filtered
AudioOutput
{
/**
* The device's configured display name.
*/
...
...
@@ -108,10 +108,10 @@ struct AudioOutput {
/**
* Throws #std::runtime_error on error.
*/
AudioOutput
(
const
AudioOutputPlugin
&
_plugin
,
Filtered
AudioOutput
(
const
AudioOutputPlugin
&
_plugin
,
const
ConfigBlock
&
block
);
~
AudioOutput
();
~
Filtered
AudioOutput
();
private
:
void
Configure
(
const
ConfigBlock
&
block
);
...
...
@@ -188,7 +188,7 @@ extern struct notify audio_output_client_notify;
/**
* Throws #std::runtime_error on error.
*/
AudioOutput
*
Filtered
AudioOutput
*
audio_output_new
(
EventLoop
&
event_loop
,
const
ReplayGainConfig
&
replay_gain_config
,
const
ConfigBlock
&
block
,
...
...
src/output/MultipleOutputs.cxx
View file @
d0157af1
...
...
@@ -49,7 +49,7 @@ MultipleOutputs::~MultipleOutputs()
i
->
FinishDestroy
();
}
static
AudioOutput
*
static
Filtered
AudioOutput
*
LoadOutput
(
EventLoop
&
event_loop
,
const
ReplayGainConfig
&
replay_gain_config
,
MixerListener
&
mixer_listener
,
...
...
src/output/MultipleOutputs.hxx
View file @
d0157af1
...
...
@@ -42,7 +42,6 @@ class EventLoop;
class
MixerListener
;
class
AudioOutputClient
;
struct
MusicChunk
;
struct
AudioOutput
;
struct
ReplayGainConfig
;
class
MultipleOutputs
{
...
...
src/output/OutputPlugin.cxx
View file @
d0157af1
...
...
@@ -21,7 +21,7 @@
#include "OutputPlugin.hxx"
#include "Internal.hxx"
AudioOutput
*
Filtered
AudioOutput
*
ao_plugin_init
(
EventLoop
&
event_loop
,
const
AudioOutputPlugin
&
plugin
,
const
ConfigBlock
&
block
)
...
...
@@ -32,39 +32,39 @@ ao_plugin_init(EventLoop &event_loop,
}
void
ao_plugin_finish
(
AudioOutput
*
ao
)
noexcept
ao_plugin_finish
(
Filtered
AudioOutput
*
ao
)
noexcept
{
ao
->
plugin
.
finish
(
ao
);
}
void
ao_plugin_enable
(
AudioOutput
&
ao
)
ao_plugin_enable
(
Filtered
AudioOutput
&
ao
)
{
if
(
ao
.
plugin
.
enable
!=
nullptr
)
ao
.
plugin
.
enable
(
&
ao
);
}
void
ao_plugin_disable
(
AudioOutput
&
ao
)
noexcept
ao_plugin_disable
(
Filtered
AudioOutput
&
ao
)
noexcept
{
if
(
ao
.
plugin
.
disable
!=
nullptr
)
ao
.
plugin
.
disable
(
&
ao
);
}
void
ao_plugin_open
(
AudioOutput
&
ao
,
AudioFormat
&
audio_format
)
ao_plugin_open
(
Filtered
AudioOutput
&
ao
,
AudioFormat
&
audio_format
)
{
ao
.
plugin
.
open
(
&
ao
,
audio_format
);
}
void
ao_plugin_close
(
AudioOutput
&
ao
)
noexcept
ao_plugin_close
(
Filtered
AudioOutput
&
ao
)
noexcept
{
ao
.
plugin
.
close
(
&
ao
);
}
std
::
chrono
::
steady_clock
::
duration
ao_plugin_delay
(
AudioOutput
&
ao
)
noexcept
ao_plugin_delay
(
Filtered
AudioOutput
&
ao
)
noexcept
{
return
ao
.
plugin
.
delay
!=
nullptr
?
ao
.
plugin
.
delay
(
&
ao
)
...
...
@@ -72,34 +72,34 @@ ao_plugin_delay(AudioOutput &ao) noexcept
}
void
ao_plugin_send_tag
(
AudioOutput
&
ao
,
const
Tag
&
tag
)
ao_plugin_send_tag
(
Filtered
AudioOutput
&
ao
,
const
Tag
&
tag
)
{
if
(
ao
.
plugin
.
send_tag
!=
nullptr
)
ao
.
plugin
.
send_tag
(
&
ao
,
tag
);
}
size_t
ao_plugin_play
(
AudioOutput
&
ao
,
const
void
*
chunk
,
size_t
size
)
ao_plugin_play
(
Filtered
AudioOutput
&
ao
,
const
void
*
chunk
,
size_t
size
)
{
return
ao
.
plugin
.
play
(
&
ao
,
chunk
,
size
);
}
void
ao_plugin_drain
(
AudioOutput
&
ao
)
ao_plugin_drain
(
Filtered
AudioOutput
&
ao
)
{
if
(
ao
.
plugin
.
drain
!=
nullptr
)
ao
.
plugin
.
drain
(
&
ao
);
}
void
ao_plugin_cancel
(
AudioOutput
&
ao
)
noexcept
ao_plugin_cancel
(
Filtered
AudioOutput
&
ao
)
noexcept
{
if
(
ao
.
plugin
.
cancel
!=
nullptr
)
ao
.
plugin
.
cancel
(
&
ao
);
}
bool
ao_plugin_pause
(
AudioOutput
&
ao
)
ao_plugin_pause
(
Filtered
AudioOutput
&
ao
)
{
return
ao
.
plugin
.
pause
!=
nullptr
&&
ao
.
plugin
.
pause
(
&
ao
);
}
src/output/OutputPlugin.hxx
View file @
d0157af1
...
...
@@ -29,7 +29,7 @@
struct
ConfigBlock
;
struct
AudioFormat
;
struct
Tag
;
struct
AudioOutput
;
struct
Filtered
AudioOutput
;
struct
MixerPlugin
;
class
EventLoop
;
...
...
@@ -57,12 +57,12 @@ struct AudioOutputPlugin {
* @param param the configuration section, or nullptr if there is
* no configuration
*/
AudioOutput
*
(
*
init
)(
EventLoop
&
event_loop
,
const
ConfigBlock
&
block
);
Filtered
AudioOutput
*
(
*
init
)(
EventLoop
&
event_loop
,
const
ConfigBlock
&
block
);
/**
* Free resources allocated by this device.
*/
void
(
*
finish
)(
AudioOutput
*
data
);
void
(
*
finish
)(
Filtered
AudioOutput
*
data
);
/**
* Enable the device. This may allocate resources, preparing
...
...
@@ -70,13 +70,13 @@ struct AudioOutputPlugin {
*
* Throws #std::runtime_error on error.
*/
void
(
*
enable
)(
AudioOutput
*
data
);
void
(
*
enable
)(
Filtered
AudioOutput
*
data
);
/**
* Disables the device. It is closed before this method is
* called.
*/
void
(
*
disable
)(
AudioOutput
*
data
);
void
(
*
disable
)(
Filtered
AudioOutput
*
data
);
/**
* Really open the device.
...
...
@@ -86,12 +86,12 @@ struct AudioOutputPlugin {
* @param audio_format the audio format in which data is going
* to be delivered; may be modified by the plugin
*/
void
(
*
open
)(
AudioOutput
*
data
,
AudioFormat
&
audio_format
);
void
(
*
open
)(
Filtered
AudioOutput
*
data
,
AudioFormat
&
audio_format
);
/**
* Close the device.
*/
void
(
*
close
)(
AudioOutput
*
data
);
void
(
*
close
)(
Filtered
AudioOutput
*
data
);
/**
* Returns a positive number if the output thread shall further
...
...
@@ -102,13 +102,13 @@ struct AudioOutputPlugin {
*
* @return the duration to wait
*/
std
::
chrono
::
steady_clock
::
duration
(
*
delay
)(
AudioOutput
*
data
)
noexcept
;
std
::
chrono
::
steady_clock
::
duration
(
*
delay
)(
Filtered
AudioOutput
*
data
)
noexcept
;
/**
* Display metadata for the next chunk. Optional method,
* because not all devices can display metadata.
*/
void
(
*
send_tag
)(
AudioOutput
*
data
,
const
Tag
&
tag
);
void
(
*
send_tag
)(
Filtered
AudioOutput
*
data
,
const
Tag
&
tag
);
/**
* Play a chunk of audio data.
...
...
@@ -117,19 +117,19 @@ struct AudioOutputPlugin {
*
* @return the number of bytes played
*/
size_t
(
*
play
)(
AudioOutput
*
data
,
size_t
(
*
play
)(
Filtered
AudioOutput
*
data
,
const
void
*
chunk
,
size_t
size
);
/**
* Wait until the device has finished playing.
*/
void
(
*
drain
)(
AudioOutput
*
data
);
void
(
*
drain
)(
Filtered
AudioOutput
*
data
);
/**
* Try to cancel data which may still be in the device's
* buffers.
*/
void
(
*
cancel
)(
AudioOutput
*
data
);
void
(
*
cancel
)(
Filtered
AudioOutput
*
data
);
/**
* Pause the device. If supported, it may perform a special
...
...
@@ -142,7 +142,7 @@ struct AudioOutputPlugin {
* @return false on error (output will be closed by caller),
* true for continue to pause
*/
bool
(
*
pause
)(
AudioOutput
*
data
);
bool
(
*
pause
)(
Filtered
AudioOutput
*
data
);
/**
* The mixer plugin associated with this output plugin. This
...
...
@@ -162,43 +162,43 @@ ao_plugin_test_default_device(const AudioOutputPlugin *plugin)
}
gcc_malloc
AudioOutput
*
Filtered
AudioOutput
*
ao_plugin_init
(
EventLoop
&
event_loop
,
const
AudioOutputPlugin
&
plugin
,
const
ConfigBlock
&
block
);
void
ao_plugin_finish
(
AudioOutput
*
ao
)
noexcept
;
ao_plugin_finish
(
Filtered
AudioOutput
*
ao
)
noexcept
;
void
ao_plugin_enable
(
AudioOutput
&
ao
);
ao_plugin_enable
(
Filtered
AudioOutput
&
ao
);
void
ao_plugin_disable
(
AudioOutput
&
ao
)
noexcept
;
ao_plugin_disable
(
Filtered
AudioOutput
&
ao
)
noexcept
;
void
ao_plugin_open
(
AudioOutput
&
ao
,
AudioFormat
&
audio_format
);
ao_plugin_open
(
Filtered
AudioOutput
&
ao
,
AudioFormat
&
audio_format
);
void
ao_plugin_close
(
AudioOutput
&
ao
)
noexcept
;
ao_plugin_close
(
Filtered
AudioOutput
&
ao
)
noexcept
;
gcc_pure
std
::
chrono
::
steady_clock
::
duration
ao_plugin_delay
(
AudioOutput
&
ao
)
noexcept
;
ao_plugin_delay
(
Filtered
AudioOutput
&
ao
)
noexcept
;
void
ao_plugin_send_tag
(
AudioOutput
&
ao
,
const
Tag
&
tag
);
ao_plugin_send_tag
(
Filtered
AudioOutput
&
ao
,
const
Tag
&
tag
);
size_t
ao_plugin_play
(
AudioOutput
&
ao
,
const
void
*
chunk
,
size_t
size
);
ao_plugin_play
(
Filtered
AudioOutput
&
ao
,
const
void
*
chunk
,
size_t
size
);
void
ao_plugin_drain
(
AudioOutput
&
ao
);
ao_plugin_drain
(
Filtered
AudioOutput
&
ao
);
void
ao_plugin_cancel
(
AudioOutput
&
ao
)
noexcept
;
ao_plugin_cancel
(
Filtered
AudioOutput
&
ao
)
noexcept
;
bool
ao_plugin_pause
(
AudioOutput
&
ao
);
ao_plugin_pause
(
Filtered
AudioOutput
&
ao
);
#endif
src/output/Wrapper.hxx
View file @
d0157af1
...
...
@@ -30,68 +30,68 @@ struct Tag;
template
<
class
T
>
struct
AudioOutputWrapper
{
static
T
&
Cast
(
AudioOutput
&
ao
)
{
static
T
&
Cast
(
Filtered
AudioOutput
&
ao
)
{
return
ContainerCast
(
ao
,
&
T
::
base
);
}
static
AudioOutput
*
Init
(
EventLoop
&
event_loop
,
static
Filtered
AudioOutput
*
Init
(
EventLoop
&
event_loop
,
const
ConfigBlock
&
block
)
{
T
*
t
=
T
::
Create
(
event_loop
,
block
);
return
&
t
->
base
;
}
static
void
Finish
(
AudioOutput
*
ao
)
{
static
void
Finish
(
Filtered
AudioOutput
*
ao
)
{
T
*
t
=
&
Cast
(
*
ao
);
delete
t
;
}
static
void
Enable
(
AudioOutput
*
ao
)
{
static
void
Enable
(
Filtered
AudioOutput
*
ao
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
Enable
();
}
static
void
Disable
(
AudioOutput
*
ao
)
{
static
void
Disable
(
Filtered
AudioOutput
*
ao
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
Disable
();
}
static
void
Open
(
AudioOutput
*
ao
,
AudioFormat
&
audio_format
)
{
static
void
Open
(
Filtered
AudioOutput
*
ao
,
AudioFormat
&
audio_format
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
Open
(
audio_format
);
}
static
void
Close
(
AudioOutput
*
ao
)
{
static
void
Close
(
Filtered
AudioOutput
*
ao
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
Close
();
}
gcc_pure
static
std
::
chrono
::
steady_clock
::
duration
Delay
(
AudioOutput
*
ao
)
noexcept
{
static
std
::
chrono
::
steady_clock
::
duration
Delay
(
Filtered
AudioOutput
*
ao
)
noexcept
{
T
&
t
=
Cast
(
*
ao
);
return
t
.
Delay
();
}
static
void
SendTag
(
AudioOutput
*
ao
,
const
Tag
&
tag
)
{
static
void
SendTag
(
Filtered
AudioOutput
*
ao
,
const
Tag
&
tag
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
SendTag
(
tag
);
}
static
size_t
Play
(
AudioOutput
*
ao
,
const
void
*
chunk
,
size_t
size
)
{
static
size_t
Play
(
Filtered
AudioOutput
*
ao
,
const
void
*
chunk
,
size_t
size
)
{
T
&
t
=
Cast
(
*
ao
);
return
t
.
Play
(
chunk
,
size
);
}
static
void
Drain
(
AudioOutput
*
ao
)
{
static
void
Drain
(
Filtered
AudioOutput
*
ao
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
Drain
();
}
static
void
Cancel
(
AudioOutput
*
ao
)
{
static
void
Cancel
(
Filtered
AudioOutput
*
ao
)
{
T
&
t
=
Cast
(
*
ao
);
t
.
Cancel
();
}
static
bool
Pause
(
AudioOutput
*
ao
)
{
static
bool
Pause
(
Filtered
AudioOutput
*
ao
)
{
T
&
t
=
Cast
(
*
ao
);
return
t
.
Pause
();
}
...
...
src/output/plugins/AlsaOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -64,7 +64,7 @@ class AlsaOutput final
friend
struct
AudioOutputWrapper
<
AlsaOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
Manual
<
PcmExport
>
pcm_export
;
...
...
src/output/plugins/AoOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -40,7 +40,7 @@ static unsigned ao_output_ref;
class
AoOutput
{
friend
struct
AudioOutputWrapper
<
AoOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
size_t
write_size
;
int
driver
;
...
...
src/output/plugins/FifoOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -37,7 +37,7 @@
class
FifoOutput
{
friend
struct
AudioOutputWrapper
<
FifoOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
AllocatedPath
path
;
std
::
string
path_utf8
;
...
...
src/output/plugins/HaikuOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -48,7 +48,7 @@ class HaikuOutput {
friend
int
haiku_output_get_volume
(
HaikuOutput
&
haiku
);
friend
bool
haiku_output_set_volume
(
HaikuOutput
&
haiku
,
unsigned
volume
);
AudioOutput
base
;
Filtered
AudioOutput
base
;
size_t
write_size
;
...
...
src/output/plugins/JackOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -43,7 +43,7 @@ static constexpr unsigned MAX_PORTS = 16;
static
constexpr
size_t
jack_sample_size
=
sizeof
(
jack_default_audio_sample_t
);
struct
JackOutput
{
AudioOutput
base
;
Filtered
AudioOutput
base
;
/**
* libjack options passed to jack_client_open().
...
...
@@ -443,7 +443,7 @@ JackOutput::Disable()
}
}
static
AudioOutput
*
static
Filtered
AudioOutput
*
mpd_jack_init
(
EventLoop
&
,
const
ConfigBlock
&
block
)
{
jack_set_error_function
(
mpd_jack_error
);
...
...
src/output/plugins/NullOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -26,7 +26,7 @@
class
NullOutput
{
friend
struct
AudioOutputWrapper
<
NullOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
bool
sync
;
...
...
src/output/plugins/OSXOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -36,7 +36,7 @@
#include <memory>
struct
OSXOutput
{
AudioOutput
base
;
Filtered
AudioOutput
base
;
/* configuration settings */
OSType
component_subtype
;
...
...
@@ -103,7 +103,7 @@ OSXOutput::OSXOutput(const ConfigBlock &block)
sync_sample_rate
=
block
.
GetBlockValue
(
"sync_sample_rate"
,
false
);
}
static
AudioOutput
*
static
Filtered
AudioOutput
*
osx_output_init
(
EventLoop
&
,
const
ConfigBlock
&
block
)
{
OSXOutput
*
oo
=
new
OSXOutput
(
block
);
...
...
@@ -128,7 +128,7 @@ osx_output_init(EventLoop &, const ConfigBlock &block)
}
static
void
osx_output_finish
(
AudioOutput
*
ao
)
osx_output_finish
(
Filtered
AudioOutput
*
ao
)
{
OSXOutput
*
oo
=
(
OSXOutput
*
)
ao
;
...
...
@@ -514,7 +514,7 @@ osx_render(void *vdata,
}
static
void
osx_output_enable
(
AudioOutput
*
ao
)
osx_output_enable
(
Filtered
AudioOutput
*
ao
)
{
char
errormsg
[
1024
];
OSXOutput
*
oo
=
(
OSXOutput
*
)
ao
;
...
...
@@ -550,7 +550,7 @@ osx_output_enable(AudioOutput *ao)
}
static
void
osx_output_disable
(
AudioOutput
*
ao
)
osx_output_disable
(
Filtered
AudioOutput
*
ao
)
{
OSXOutput
*
oo
=
(
OSXOutput
*
)
ao
;
...
...
@@ -562,7 +562,7 @@ osx_output_disable(AudioOutput *ao)
}
static
void
osx_output_close
(
AudioOutput
*
ao
)
osx_output_close
(
Filtered
AudioOutput
*
ao
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
...
...
@@ -573,7 +573,7 @@ osx_output_close(AudioOutput *ao)
}
static
void
osx_output_open
(
AudioOutput
*
ao
,
AudioFormat
&
audio_format
)
osx_output_open
(
Filtered
AudioOutput
*
ao
,
AudioFormat
&
audio_format
)
{
char
errormsg
[
1024
];
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
...
...
@@ -663,14 +663,14 @@ osx_output_open(AudioOutput *ao, AudioFormat &audio_format)
}
static
size_t
osx_output_play
(
AudioOutput
*
ao
,
const
void
*
chunk
,
size_t
size
)
osx_output_play
(
Filtered
AudioOutput
*
ao
,
const
void
*
chunk
,
size_t
size
)
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
return
od
->
ring_buffer
->
push
((
uint8_t
*
)
chunk
,
size
);
}
static
std
::
chrono
::
steady_clock
::
duration
osx_output_delay
(
AudioOutput
*
ao
)
noexcept
osx_output_delay
(
Filtered
AudioOutput
*
ao
)
noexcept
{
OSXOutput
*
od
=
(
OSXOutput
*
)
ao
;
return
od
->
ring_buffer
->
write_available
()
...
...
src/output/plugins/OpenALOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -39,7 +39,7 @@ class OpenALOutput {
/* should be enough for buffer size = 2048 */
static
constexpr
unsigned
NUM_BUFFERS
=
16
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
char
*
device_name
;
ALCdevice
*
device
;
...
...
src/output/plugins/OssOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -63,7 +63,7 @@
class
OssOutput
{
friend
struct
AudioOutputWrapper
<
OssOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
#ifdef AFMT_S24_PACKED
Manual
<
PcmExport
>
pcm_export
;
...
...
src/output/plugins/PipeOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -31,7 +31,7 @@
class
PipeOutput
{
friend
struct
AudioOutputWrapper
<
PipeOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
std
::
string
cmd
;
FILE
*
fh
;
...
...
src/output/plugins/PulseOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -47,7 +47,7 @@
class
PulseOutput
{
friend
struct
AudioOutputWrapper
<
PulseOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
char
*
name
;
const
char
*
server
;
...
...
src/output/plugins/RecorderOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -45,7 +45,7 @@ static constexpr Domain recorder_domain("recorder");
class
RecorderOutput
{
friend
struct
AudioOutputWrapper
<
RecorderOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
/**
* The configured encoder plugin.
...
...
src/output/plugins/RoarOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -39,7 +39,7 @@
class
RoarOutput
{
friend
struct
AudioOutputWrapper
<
RoarOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
std
::
string
host
,
name
;
...
...
@@ -54,7 +54,7 @@ class RoarOutput {
public
:
RoarOutput
(
const
ConfigBlock
&
block
);
operator
AudioOutput
*
()
{
operator
Filtered
AudioOutput
*
()
{
return
&
base
;
}
...
...
src/output/plugins/ShoutOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -40,7 +40,7 @@
static
constexpr
unsigned
DEFAULT_CONN_TIMEOUT
=
2
;
struct
ShoutOutput
final
{
AudioOutput
base
;
Filtered
AudioOutput
base
;
shout_t
*
shout_conn
;
shout_metadata_t
*
shout_meta
;
...
...
src/output/plugins/SndioOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -47,7 +47,7 @@ static constexpr Domain sndio_output_domain("sndio_output");
class
SndioOutput
{
friend
struct
AudioOutputWrapper
<
SndioOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
char
*
const
device
;
const
unsigned
buffer_time
;
/* in ms */
struct
sio_hdl
*
sio_hdl
;
...
...
src/output/plugins/SolarisOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -53,7 +53,7 @@ struct audio_info {
class
SolarisOutput
{
friend
struct
AudioOutputWrapper
<
SolarisOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
/* configuration */
const
char
*
const
device
;
...
...
src/output/plugins/WinmmOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -42,7 +42,7 @@ struct WinmmBuffer {
class
WinmmOutput
{
friend
struct
AudioOutputWrapper
<
WinmmOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
const
UINT
device_id
;
HWAVEOUT
handle
;
...
...
src/output/plugins/httpd/HttpdInternal.hxx
View file @
d0157af1
...
...
@@ -52,7 +52,7 @@ struct Tag;
class
HttpdOutput
final
:
ServerSocket
,
DeferredMonitor
{
friend
struct
AudioOutputWrapper
<
HttpdOutput
>
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
/**
* True if the audio output is open and accepts client
...
...
@@ -160,7 +160,7 @@ public:
static
HttpdOutput
*
Create
(
EventLoop
&
event_loop
,
const
ConfigBlock
&
block
);
static
constexpr
HttpdOutput
*
Cast
(
AudioOutput
*
ao
)
{
static
constexpr
HttpdOutput
*
Cast
(
Filtered
AudioOutput
*
ao
)
{
return
&
ContainerCast
(
*
ao
,
&
HttpdOutput
::
base
);
}
...
...
src/output/plugins/sles/SlesOutputPlugin.cxx
View file @
d0157af1
...
...
@@ -43,7 +43,7 @@ class SlesOutput {
static
constexpr
unsigned
N_BUFFERS
=
3
;
static
constexpr
size_t
BUFFER_SIZE
=
65536
;
AudioOutput
base
;
Filtered
AudioOutput
base
;
SLES
::
Object
engine_object
,
mix_object
,
play_object
;
SLES
::
Play
play
;
...
...
@@ -89,7 +89,7 @@ class SlesOutput {
public
:
SlesOutput
(
const
ConfigBlock
&
block
);
operator
AudioOutput
*
()
{
operator
Filtered
AudioOutput
*
()
{
return
&
base
;
}
...
...
test/read_mixer.cxx
View file @
d0157af1
...
...
@@ -51,7 +51,7 @@ try {
EventLoop
event_loop
;
Mixer
*
mixer
=
mixer_new
(
event_loop
,
alsa_mixer_plugin
,
*
(
AudioOutput
*
)
nullptr
,
*
(
Filtered
AudioOutput
*
)
nullptr
,
*
(
MixerListener
*
)
nullptr
,
ConfigBlock
());
...
...
test/run_output.cxx
View file @
d0157af1
...
...
@@ -49,7 +49,7 @@ filter_plugin_by_name(gcc_unused const char *name) noexcept
return
NULL
;
}
static
AudioOutput
*
static
Filtered
AudioOutput
*
load_audio_output
(
EventLoop
&
event_loop
,
const
char
*
name
)
{
const
auto
*
param
=
config_find_block
(
ConfigBlockOption
::
AUDIO_OUTPUT
,
...
...
@@ -63,7 +63,7 @@ load_audio_output(EventLoop &event_loop, const char *name)
}
static
void
run_output
(
AudioOutput
&
ao
,
AudioFormat
audio_format
)
run_output
(
Filtered
AudioOutput
&
ao
,
AudioFormat
audio_format
)
{
/* open the audio output */
...
...
@@ -127,7 +127,7 @@ try {
/* initialize the audio output */
AudioOutput
*
ao
=
load_audio_output
(
io_thread
.
GetEventLoop
(),
argv
[
2
]);
auto
*
ao
=
load_audio_output
(
io_thread
.
GetEventLoop
(),
argv
[
2
]);
/* parse the audio format */
...
...
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