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
2d038232
Commit
2d038232
authored
Oct 22, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Control: fold Configure() into the constructor
parent
bba144ec
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
19 deletions
+13
-19
Control.cxx
src/output/Control.cxx
+6
-10
Control.hxx
src/output/Control.hxx
+5
-6
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+2
-3
No files found.
src/output/Control.cxx
View file @
2d038232
...
@@ -33,11 +33,15 @@
...
@@ -33,11 +33,15 @@
static
constexpr
PeriodClock
::
Duration
REOPEN_AFTER
=
std
::
chrono
::
seconds
(
10
);
static
constexpr
PeriodClock
::
Duration
REOPEN_AFTER
=
std
::
chrono
::
seconds
(
10
);
AudioOutputControl
::
AudioOutputControl
(
std
::
unique_ptr
<
FilteredAudioOutput
>
_output
,
AudioOutputControl
::
AudioOutputControl
(
std
::
unique_ptr
<
FilteredAudioOutput
>
_output
,
AudioOutputClient
&
_client
)
noexcept
AudioOutputClient
&
_client
,
const
ConfigBlock
&
block
)
:
output
(
std
::
move
(
_output
)),
:
output
(
std
::
move
(
_output
)),
name
(
output
->
GetName
()),
name
(
output
->
GetName
()),
client
(
_client
),
client
(
_client
),
thread
(
BIND_THIS_METHOD
(
Task
))
thread
(
BIND_THIS_METHOD
(
Task
)),
tags
(
block
.
GetBlockValue
(
"tags"
,
true
)),
always_on
(
block
.
GetBlockValue
(
"always_on"
,
false
)),
enabled
(
block
.
GetBlockValue
(
"enabled"
,
true
))
{
{
}
}
...
@@ -57,14 +61,6 @@ AudioOutputControl::~AudioOutputControl() noexcept
...
@@ -57,14 +61,6 @@ AudioOutputControl::~AudioOutputControl() noexcept
StopThread
();
StopThread
();
}
}
void
AudioOutputControl
::
Configure
(
const
ConfigBlock
&
block
)
{
tags
=
block
.
GetBlockValue
(
"tags"
,
true
);
always_on
=
block
.
GetBlockValue
(
"always_on"
,
false
);
enabled
=
block
.
GetBlockValue
(
"enabled"
,
true
);
}
std
::
unique_ptr
<
FilteredAudioOutput
>
std
::
unique_ptr
<
FilteredAudioOutput
>
AudioOutputControl
::
Steal
()
noexcept
AudioOutputControl
::
Steal
()
noexcept
{
{
...
...
src/output/Control.hxx
View file @
2d038232
...
@@ -249,8 +249,12 @@ public:
...
@@ -249,8 +249,12 @@ public:
*/
*/
mutable
Mutex
mutex
;
mutable
Mutex
mutex
;
/**
* Throws on error.
*/
AudioOutputControl
(
std
::
unique_ptr
<
FilteredAudioOutput
>
_output
,
AudioOutputControl
(
std
::
unique_ptr
<
FilteredAudioOutput
>
_output
,
AudioOutputClient
&
_client
)
noexcept
;
AudioOutputClient
&
_client
,
const
ConfigBlock
&
block
);
/**
/**
* Move the contents of an existing instance, and convert that
* Move the contents of an existing instance, and convert that
...
@@ -264,11 +268,6 @@ public:
...
@@ -264,11 +268,6 @@ public:
AudioOutputControl
(
const
AudioOutputControl
&
)
=
delete
;
AudioOutputControl
(
const
AudioOutputControl
&
)
=
delete
;
AudioOutputControl
&
operator
=
(
const
AudioOutputControl
&
)
=
delete
;
AudioOutputControl
&
operator
=
(
const
AudioOutputControl
&
)
=
delete
;
/**
* Throws on error.
*/
void
Configure
(
const
ConfigBlock
&
block
);
[[
gnu
::
pure
]]
[[
gnu
::
pure
]]
const
char
*
GetName
()
const
noexcept
;
const
char
*
GetName
()
const
noexcept
;
...
...
src/output/MultipleOutputs.cxx
View file @
2d038232
...
@@ -80,9 +80,8 @@ LoadOutputControl(EventLoop &event_loop, EventLoop &rt_event_loop,
...
@@ -80,9 +80,8 @@ LoadOutputControl(EventLoop &event_loop, EventLoop &rt_event_loop,
replay_gain_config
,
replay_gain_config
,
mixer_listener
,
mixer_listener
,
block
,
defaults
,
filter_factory
);
block
,
defaults
,
filter_factory
);
auto
control
=
std
::
make_unique
<
AudioOutputControl
>
(
std
::
move
(
output
),
client
);
return
std
::
make_unique
<
AudioOutputControl
>
(
std
::
move
(
output
),
control
->
Configure
(
block
);
client
,
block
);
return
control
;
}
}
void
void
...
...
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