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
cf2b8146
Commit
cf2b8146
authored
8 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Init: migrate Configure() from class Error to C++ exceptions
parent
bbe7a373
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
Init.cxx
src/output/Init.cxx
+5
-14
Internal.hxx
src/output/Internal.hxx
+1
-1
No files found.
src/output/Init.cxx
View file @
cf2b8146
...
@@ -58,9 +58,7 @@ AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin,
...
@@ -58,9 +58,7 @@ AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin,
assert
(
plugin
.
close
!=
nullptr
);
assert
(
plugin
.
close
!=
nullptr
);
assert
(
plugin
.
play
!=
nullptr
);
assert
(
plugin
.
play
!=
nullptr
);
Error
error
;
Configure
(
block
);
if
(
!
Configure
(
block
,
error
))
throw
std
::
runtime_error
(
error
.
GetMessage
());
}
}
static
const
AudioOutputPlugin
*
static
const
AudioOutputPlugin
*
...
@@ -155,16 +153,13 @@ audio_output_load_mixer(EventLoop &event_loop, AudioOutput &ao,
...
@@ -155,16 +153,13 @@ audio_output_load_mixer(EventLoop &event_loop, AudioOutput &ao,
gcc_unreachable
();
gcc_unreachable
();
}
}
bool
void
AudioOutput
::
Configure
(
const
ConfigBlock
&
block
,
Error
&
error
)
AudioOutput
::
Configure
(
const
ConfigBlock
&
block
)
{
{
if
(
!
block
.
IsNull
())
{
if
(
!
block
.
IsNull
())
{
name
=
block
.
GetBlockValue
(
AUDIO_OUTPUT_NAME
);
name
=
block
.
GetBlockValue
(
AUDIO_OUTPUT_NAME
);
if
(
name
==
nullptr
)
{
if
(
name
==
nullptr
)
error
.
Set
(
config_domain
,
throw
std
::
runtime_error
(
"Missing
\"
name
\"
configuration"
);
"Missing
\"
name
\"
configuration"
);
return
false
;
}
const
char
*
p
=
block
.
GetBlockValue
(
AUDIO_OUTPUT_FORMAT
);
const
char
*
p
=
block
.
GetBlockValue
(
AUDIO_OUTPUT_FORMAT
);
if
(
p
!=
nullptr
)
if
(
p
!=
nullptr
)
...
@@ -208,10 +203,6 @@ AudioOutput::Configure(const ConfigBlock &block, Error &error)
...
@@ -208,10 +203,6 @@ AudioOutput::Configure(const ConfigBlock &block, Error &error)
"Failed to initialize filter chain for '%s'"
,
"Failed to initialize filter chain for '%s'"
,
name
);
name
);
}
}
/* done */
return
true
;
}
}
static
bool
static
bool
...
...
This diff is collapsed.
Click to expand it.
src/output/Internal.hxx
View file @
cf2b8146
...
@@ -291,7 +291,7 @@ struct AudioOutput {
...
@@ -291,7 +291,7 @@ struct AudioOutput {
~
AudioOutput
();
~
AudioOutput
();
private
:
private
:
bool
Configure
(
const
ConfigBlock
&
block
,
Error
&
error
);
void
Configure
(
const
ConfigBlock
&
block
);
public
:
public
:
void
StartThread
();
void
StartThread
();
...
...
This diff is collapsed.
Click to expand it.
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