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
37c27fa6
Commit
37c27fa6
authored
Dec 19, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Interface: convert need_fully_defined_audio_format to flag
parent
093ca5d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
Interface.hxx
src/output/Interface.hxx
+7
-12
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+1
-3
No files found.
src/output/Interface.hxx
View file @
37c27fa6
...
...
@@ -28,12 +28,16 @@ struct Tag;
class
AudioOutput
{
const
unsigned
flags
;
bool
need_fully_defined_audio_format
=
false
;
protected
:
static
constexpr
unsigned
FLAG_ENABLE_DISABLE
=
0x1
;
static
constexpr
unsigned
FLAG_PAUSE
=
0x2
;
/**
* This output requires an "audio_format" setting which
* evaluates AudioFormat::IsFullyDefined().
*/
static
constexpr
unsigned
FLAG_NEED_FULLY_DEFINED_AUDIO_FORMAT
=
0x4
;
public
:
explicit
AudioOutput
(
unsigned
_flags
)
:
flags
(
_flags
)
{}
virtual
~
AudioOutput
()
=
default
;
...
...
@@ -50,16 +54,7 @@ public:
}
bool
GetNeedFullyDefinedAudioFormat
()
const
{
return
need_fully_defined_audio_format
;
}
/**
* Plugins shall call this method if they require an
* "audio_format" setting which evaluates
* AudioFormat::IsFullyDefined().
*/
void
NeedFullyDefinedAudioFormat
()
{
need_fully_defined_audio_format
=
true
;
return
flags
&
FLAG_NEED_FULLY_DEFINED_AUDIO_FORMAT
;
}
/**
...
...
src/output/plugins/ShoutOutputPlugin.cxx
View file @
37c27fa6
...
...
@@ -97,12 +97,10 @@ ShoutSetAudioInfo(shout_t *shout_conn, const AudioFormat &audio_format)
}
ShoutOutput
::
ShoutOutput
(
const
ConfigBlock
&
block
)
:
AudioOutput
(
FLAG_PAUSE
),
:
AudioOutput
(
FLAG_PAUSE
|
FLAG_NEED_FULLY_DEFINED_AUDIO_FORMAT
),
shout_conn
(
shout_new
()),
prepared_encoder
(
CreateConfiguredEncoder
(
block
,
true
))
{
NeedFullyDefinedAudioFormat
();
const
char
*
host
=
require_block_string
(
block
,
"host"
);
const
char
*
mount
=
require_block_string
(
block
,
"mount"
);
unsigned
port
=
block
.
GetBlockValue
(
"port"
,
0u
);
...
...
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