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