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
85003429
Commit
85003429
authored
Oct 15, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/roar: use std::string
parent
6db77dcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
RoarOutputPlugin.cxx
src/output/RoarOutputPlugin.cxx
+10
-12
No files found.
src/output/RoarOutputPlugin.cxx
View file @
85003429
...
...
@@ -29,6 +29,8 @@
#include <glib.h>
#include <string>
/* libroar/services.h declares roar_service_stream::new - work around
this C++ problem */
#define new _new
...
...
@@ -38,10 +40,10 @@
class
RoarOutput
{
struct
audio_output
base
;
std
::
string
host
,
name
;
roar_vs_t
*
vss
;
int
err
;
char
*
host
;
char
*
name
;
int
role
;
struct
roar_connection
con
;
struct
roar_audio_info
info
;
...
...
@@ -50,13 +52,7 @@ class RoarOutput {
public
:
RoarOutput
()
:
err
(
ROAR_ERROR_NONE
),
host
(
nullptr
),
name
(
nullptr
)
{}
~
RoarOutput
()
{
g_free
(
host
);
g_free
(
name
);
}
:
err
(
ROAR_ERROR_NONE
)
{}
operator
audio_output
*
()
{
return
&
base
;
...
...
@@ -133,8 +129,8 @@ roar_output_set_volume(RoarOutput *roar, unsigned volume)
inline
void
RoarOutput
::
Configure
(
const
config_param
&
param
)
{
host
=
param
.
DupBlockString
(
"server"
,
nullptr
);
name
=
param
.
DupBlockString
(
"name"
,
"MPD"
);
host
=
param
.
GetBlockValue
(
"server"
,
""
);
name
=
param
.
GetBlockValue
(
"name"
,
"MPD"
);
const
char
*
_role
=
param
.
GetBlockValue
(
"role"
,
"music"
);
role
=
_role
!=
nullptr
...
...
@@ -205,7 +201,9 @@ RoarOutput::Open(AudioFormat &audio_format, Error &error)
{
const
ScopeLock
protect
(
mutex
);
if
(
roar_simple_connect
(
&
con
,
host
,
name
)
<
0
)
{
if
(
roar_simple_connect
(
&
con
,
host
.
empty
()
?
nullptr
:
host
.
c_str
(),
name
.
c_str
())
<
0
)
{
error
.
Set
(
roar_output_domain
,
"Failed to connect to Roar server"
);
return
false
;
...
...
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