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
4aeec4bb
Commit
4aeec4bb
authored
Apr 17, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/solaris: convert to C++
parent
750b2ad6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
29 deletions
+44
-29
Makefile.am
Makefile.am
+1
-1
OutputList.cxx
src/OutputList.cxx
+1
-1
SolarisOutputPlugin.cxx
src/output/SolarisOutputPlugin.cxx
+39
-24
SolarisOutputPlugin.hxx
src/output/SolarisOutputPlugin.hxx
+3
-3
No files found.
Makefile.am
View file @
4aeec4bb
...
...
@@ -880,7 +880,7 @@ endif
if
ENABLE_SOLARIS_OUTPUT
liboutput_plugins_a_SOURCES
+=
\
src/output/
solaris_output_plugin.c src/output/solaris_output_plugin.h
src/output/
SolarisOutputPlugin.cxx src/output/SolarisOutputPlugin.hxx
endif
if
ENABLE_WINMM_OUTPUT
...
...
src/OutputList.cxx
View file @
4aeec4bb
...
...
@@ -34,7 +34,7 @@
#include "output/RecorderOutputPlugin.hxx"
#include "output/RoarOutputPlugin.hxx"
#include "output/ShoutOutputPlugin.hxx"
#include "output/
solaris_output_plugin.h
"
#include "output/
SolarisOutputPlugin.hxx
"
#include "output/WinmmOutputPlugin.hxx"
const
struct
audio_output_plugin
*
const
audio_output_plugins
[]
=
{
...
...
src/output/
solaris_output_plugin.c
→
src/output/
SolarisOutputPlugin.cxx
View file @
4aeec4bb
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
solaris_output_plugin.h
"
#include "
SolarisOutputPlugin.hxx
"
#include "output_api.h"
#include "fd_util.h"
...
...
@@ -53,13 +53,22 @@ struct audio_info {
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "solaris_output"
struct
solaris_o
utput
{
struct
SolarisO
utput
{
struct
audio_output
base
;
/* configuration */
const
char
*
device
;
int
fd
;
bool
Initialize
(
const
config_param
*
param
,
GError
**
error_r
)
{
return
ao_base_init
(
&
base
,
&
solaris_output_plugin
,
param
,
error_r
);
}
void
Deinitialize
()
{
ao_base_finish
(
&
base
);
}
};
/**
...
...
@@ -81,13 +90,12 @@ solaris_output_test_default_device(void)
}
static
struct
audio_output
*
solaris_output_init
(
const
struct
config_param
*
param
,
GError
**
error_r
)
solaris_output_init
(
const
config_param
*
param
,
GError
**
error_r
)
{
struct
solaris_output
*
so
=
g_new
(
struct
solaris_output
,
1
);
if
(
!
ao_base_init
(
&
so
->
base
,
&
solaris_output_plugin
,
param
,
error_r
))
{
g_free
(
so
);
return
NULL
;
SolarisOutput
*
so
=
new
SolarisOutput
();
if
(
!
so
->
Initialize
(
param
,
error_r
))
{
delete
so
;
return
nullptr
;
}
so
->
device
=
config_get_block_string
(
param
,
"device"
,
"/dev/audio"
);
...
...
@@ -98,17 +106,17 @@ solaris_output_init(const struct config_param *param, GError **error_r)
static
void
solaris_output_finish
(
struct
audio_output
*
ao
)
{
struct
solaris_output
*
so
=
(
struct
solaris_o
utput
*
)
ao
;
SolarisOutput
*
so
=
(
SolarisO
utput
*
)
ao
;
ao_base_finish
(
&
so
->
base
);
g_free
(
so
)
;
so
->
Deinitialize
(
);
delete
so
;
}
static
bool
solaris_output_open
(
struct
audio_output
*
ao
,
struct
audio_format
*
audio_format
,
GError
**
error
)
{
struct
solaris_output
*
so
=
(
struct
solaris_o
utput
*
)
ao
;
SolarisOutput
*
so
=
(
SolarisO
utput
*
)
ao
;
struct
audio_info
info
;
int
ret
,
flags
;
...
...
@@ -161,7 +169,7 @@ solaris_output_open(struct audio_output *ao, struct audio_format *audio_format,
static
void
solaris_output_close
(
struct
audio_output
*
ao
)
{
struct
solaris_output
*
so
=
(
struct
solaris_o
utput
*
)
ao
;
SolarisOutput
*
so
=
(
SolarisO
utput
*
)
ao
;
close
(
so
->
fd
);
}
...
...
@@ -170,7 +178,7 @@ static size_t
solaris_output_play
(
struct
audio_output
*
ao
,
const
void
*
chunk
,
size_t
size
,
GError
**
error
)
{
struct
solaris_output
*
so
=
(
struct
solaris_o
utput
*
)
ao
;
SolarisOutput
*
so
=
(
SolarisO
utput
*
)
ao
;
ssize_t
nbytes
;
nbytes
=
write
(
so
->
fd
,
chunk
,
size
);
...
...
@@ -186,18 +194,25 @@ solaris_output_play(struct audio_output *ao, const void *chunk, size_t size,
static
void
solaris_output_cancel
(
struct
audio_output
*
ao
)
{
struct
solaris_output
*
so
=
(
struct
solaris_o
utput
*
)
ao
;
SolarisOutput
*
so
=
(
SolarisO
utput
*
)
ao
;
ioctl
(
so
->
fd
,
I_FLUSH
);
}
const
struct
audio_output_plugin
solaris_output_plugin
=
{
.
name
=
"solaris"
,
.
test_default_device
=
solaris_output_test_default_device
,
.
init
=
solaris_output_init
,
.
finish
=
solaris_output_finish
,
.
open
=
solaris_output_open
,
.
close
=
solaris_output_close
,
.
play
=
solaris_output_play
,
.
cancel
=
solaris_output_cancel
,
"solaris"
,
solaris_output_test_default_device
,
solaris_output_init
,
solaris_output_finish
,
nullptr
,
nullptr
,
solaris_output_open
,
solaris_output_close
,
nullptr
,
nullptr
,
solaris_output_play
,
nullptr
,
solaris_output_cancel
,
nullptr
,
nullptr
,
};
src/output/
solaris_output_plugin.h
→
src/output/
SolarisOutputPlugin.hxx
View file @
4aeec4bb
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_SOLARIS_OUTPUT_PLUGIN_H
#define MPD_SOLARIS_OUTPUT_PLUGIN_H
#ifndef MPD_SOLARIS_OUTPUT_PLUGIN_H
XX
#define MPD_SOLARIS_OUTPUT_PLUGIN_H
XX
extern
const
struct
audio_output_plugin
solaris_output_plugin
;
...
...
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