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
7a2af0fb
Commit
7a2af0fb
authored
Jan 07, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/recorder: move more functions into the struct
parent
d8312772
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+13
-12
No files found.
src/output/plugins/RecorderOutputPlugin.cxx
View file @
7a2af0fb
...
...
@@ -69,6 +69,8 @@ struct RecorderOutput {
return
base
.
Configure
(
param
,
error_r
);
}
static
RecorderOutput
*
Create
(
const
config_param
&
param
,
Error
&
error
);
bool
Configure
(
const
config_param
&
param
,
Error
&
error
);
bool
Open
(
AudioFormat
&
audio_format
,
Error
&
error
);
...
...
@@ -82,6 +84,8 @@ struct RecorderOutput {
bool
EncoderToFile
(
Error
&
error
);
void
SendTag
(
const
Tag
&
tag
);
size_t
Play
(
const
void
*
chunk
,
size_t
size
,
Error
&
error
);
};
static
constexpr
Domain
recorder_output_domain
(
"recorder_output"
);
...
...
@@ -116,8 +120,8 @@ RecorderOutput::Configure(const config_param ¶m, Error &error)
return
true
;
}
static
Audio
Output
*
recorder_output_init
(
const
config_param
&
param
,
Error
&
error
)
Recorder
Output
*
RecorderOutput
::
Create
(
const
config_param
&
param
,
Error
&
error
)
{
RecorderOutput
*
recorder
=
new
RecorderOutput
();
...
...
@@ -131,7 +135,7 @@ recorder_output_init(const config_param ¶m, Error &error)
return
nullptr
;
}
return
&
recorder
->
base
;
return
recorder
;
}
static
void
...
...
@@ -252,14 +256,11 @@ recorder_output_send_tag(AudioOutput *ao, const Tag &tag)
recorder
.
SendTag
(
tag
);
}
static
size_t
recorder_output_play
(
AudioOutput
*
ao
,
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
inline
size_t
RecorderOutput
::
Play
(
const
void
*
chunk
,
size_t
size
,
Error
&
error
)
{
RecorderOutput
*
recorder
=
(
RecorderOutput
*
)
ao
;
return
encoder_write
(
recorder
->
encoder
,
chunk
,
size
,
error
)
&&
recorder
->
EncoderToFile
(
error
)
return
encoder_write
(
encoder
,
chunk
,
size
,
error
)
&&
EncoderToFile
(
error
)
?
size
:
0
;
}
...
...
@@ -268,7 +269,7 @@ typedef AudioOutputWrapper<RecorderOutput> Wrapper;
const
struct
AudioOutputPlugin
recorder_output_plugin
=
{
"recorder"
,
nullptr
,
recorder_output_i
nit
,
&
Wrapper
::
I
nit
,
recorder_output_finish
,
nullptr
,
nullptr
,
...
...
@@ -276,7 +277,7 @@ const struct AudioOutputPlugin recorder_output_plugin = {
&
Wrapper
::
Close
,
nullptr
,
recorder_output_send_tag
,
recorder_output_p
lay
,
&
Wrapper
::
P
lay
,
nullptr
,
nullptr
,
nullptr
,
...
...
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