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
44652fdb
Commit
44652fdb
authored
6 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/jack: convert callback functions to static methods
parent
2892a6f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
22 deletions
+17
-22
JackOutputPlugin.cxx
src/output/plugins/JackOutputPlugin.cxx
+17
-22
No files found.
src/output/plugins/JackOutputPlugin.cxx
View file @
44652fdb
...
@@ -104,11 +104,19 @@ struct JackOutput final : AudioOutput {
...
@@ -104,11 +104,19 @@ struct JackOutput final : AudioOutput {
*/
*/
void
Disconnect
()
noexcept
;
void
Disconnect
()
noexcept
;
void
Shutdown
(
std
::
exception_ptr
e
)
noexcept
{
void
Shutdown
(
const
char
*
reason
)
noexcept
{
const
std
::
lock_guard
<
Mutex
>
lock
(
mutex
);
const
std
::
lock_guard
<
Mutex
>
lock
(
mutex
);
error
=
std
::
move
(
e
);
error
=
std
::
make_exception_ptr
(
FormatRuntimeError
(
"JACK connection shutdown: %s"
,
reason
));
}
}
static
void
OnShutdown
(
jack_status_t
,
const
char
*
reason
,
void
*
arg
)
noexcept
{
auto
&
j
=
*
(
JackOutput
*
)
arg
;
j
.
Shutdown
(
reason
);
}
/**
/**
* Throws on error.
* Throws on error.
*/
*/
...
@@ -123,6 +131,11 @@ struct JackOutput final : AudioOutput {
...
@@ -123,6 +131,11 @@ struct JackOutput final : AudioOutput {
jack_nframes_t
GetAvailable
()
const
noexcept
;
jack_nframes_t
GetAvailable
()
const
noexcept
;
void
Process
(
jack_nframes_t
nframes
);
void
Process
(
jack_nframes_t
nframes
);
static
int
Process
(
jack_nframes_t
nframes
,
void
*
arg
)
noexcept
{
auto
&
j
=
*
(
JackOutput
*
)
arg
;
j
.
Process
(
nframes
);
return
0
;
}
/**
/**
* @return the number of frames that were written
* @return the number of frames that were written
...
@@ -350,24 +363,6 @@ JackOutput::Process(jack_nframes_t nframes)
...
@@ -350,24 +363,6 @@ JackOutput::Process(jack_nframes_t nframes)
nframes
);
nframes
);
}
}
static
int
mpd_jack_process
(
jack_nframes_t
nframes
,
void
*
arg
)
{
JackOutput
&
jo
=
*
(
JackOutput
*
)
arg
;
jo
.
Process
(
nframes
);
return
0
;
}
static
void
mpd_jack_shutdown
(
jack_status_t
,
const
char
*
reason
,
void
*
arg
)
{
JackOutput
&
jo
=
*
(
JackOutput
*
)
arg
;
jo
.
Shutdown
(
std
::
make_exception_ptr
(
FormatRuntimeError
(
"JACK connection shutdown: %s"
,
reason
)));
}
static
void
static
void
mpd_jack_error
(
const
char
*
msg
)
mpd_jack_error
(
const
char
*
msg
)
{
{
...
@@ -403,8 +398,8 @@ JackOutput::Connect()
...
@@ -403,8 +398,8 @@ JackOutput::Connect()
throw
FormatRuntimeError
(
"Failed to connect to JACK server, status=%d"
,
throw
FormatRuntimeError
(
"Failed to connect to JACK server, status=%d"
,
status
);
status
);
jack_set_process_callback
(
client
,
mpd_jack_p
rocess
,
this
);
jack_set_process_callback
(
client
,
P
rocess
,
this
);
jack_on_info_shutdown
(
client
,
mpd_jack_s
hutdown
,
this
);
jack_on_info_shutdown
(
client
,
OnS
hutdown
,
this
);
for
(
unsigned
i
=
0
;
i
<
num_source_ports
;
++
i
)
{
for
(
unsigned
i
=
0
;
i
<
num_source_ports
;
++
i
)
{
ports
[
i
]
=
jack_port_register
(
client
,
ports
[
i
]
=
jack_port_register
(
client
,
...
...
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