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
4a30c2d7
Commit
4a30c2d7
authored
Apr 26, 2022
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/shout: use shout_set_meta()
parent
83072d6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+19
-10
No files found.
src/output/plugins/ShoutOutputPlugin.cxx
View file @
4a30c2d7
...
...
@@ -229,6 +229,20 @@ ShoutOutput::Create(EventLoop &, const ConfigBlock &block)
return
new
ShoutOutput
(
block
);
}
static
void
SetMeta
(
shout_t
&
connection
,
const
char
*
name
,
const
char
*
value
)
{
if
(
shout_set_meta
(
&
connection
,
name
,
value
)
!=
SHOUTERR_SUCCESS
)
throw
std
::
runtime_error
(
shout_get_error
(
&
connection
));
}
static
void
SetOptionalMeta
(
shout_t
&
connection
,
const
char
*
name
,
const
char
*
value
)
{
if
(
value
!=
nullptr
)
SetMeta
(
connection
,
name
,
value
);
}
inline
void
ShoutConfig
::
Setup
(
shout_t
&
connection
)
const
{
...
...
@@ -236,7 +250,6 @@ ShoutConfig::Setup(shout_t &connection) const
shout_set_port
(
&
connection
,
port
)
!=
SHOUTERR_SUCCESS
||
shout_set_password
(
&
connection
,
passwd
)
!=
SHOUTERR_SUCCESS
||
shout_set_mount
(
&
connection
,
mount
)
!=
SHOUTERR_SUCCESS
||
shout_set_name
(
&
connection
,
name
)
!=
SHOUTERR_SUCCESS
||
shout_set_user
(
&
connection
,
user
)
!=
SHOUTERR_SUCCESS
||
shout_set_public
(
&
connection
,
is_public
)
!=
SHOUTERR_SUCCESS
||
shout_set_format
(
&
connection
,
format
)
!=
SHOUTERR_SUCCESS
||
...
...
@@ -247,17 +260,13 @@ ShoutConfig::Setup(shout_t &connection) const
shout_set_agent
(
&
connection
,
"MPD"
)
!=
SHOUTERR_SUCCESS
)
throw
std
::
runtime_error
(
shout_get_error
(
&
connection
));
/* optional paramters */
if
(
genre
!=
nullptr
&&
shout_set_genre
(
&
connection
,
genre
))
throw
std
::
runtime_error
(
shout_get_error
(
&
connection
));
SetMeta
(
connection
,
SHOUT_META_NAME
,
name
);
if
(
description
!=
nullptr
&&
shout_set_description
(
&
connection
,
description
))
throw
std
::
runtime_error
(
shout_get_error
(
&
connection
));
/* optional paramters */
if
(
url
!=
nullptr
&&
shout_set_url
(
&
connection
,
url
))
throw
std
::
runtime_error
(
shout_get_error
(
&
connection
));
SetOptionalMeta
(
connection
,
SHOUT_META_GENRE
,
genre
);
SetOptionalMeta
(
connection
,
SHOUT_META_DESCRIPTION
,
description
);
SetOptionalMeta
(
connection
,
SHOUT_META_URL
,
url
);
if
(
quality
!=
nullptr
)
shout_set_audio_info
(
&
connection
,
SHOUT_AI_QUALITY
,
quality
);
...
...
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