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
d2358b42
Commit
d2358b42
authored
Jan 02, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Source: drop the "_instance" suffix from variable names
parent
e387d94f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
29 deletions
+28
-29
Source.cxx
src/output/Source.cxx
+25
-26
Source.hxx
src/output/Source.hxx
+3
-3
No files found.
src/output/Source.cxx
View file @
d2358b42
...
...
@@ -46,13 +46,12 @@ AudioOutputSource::Open(const AudioFormat audio_format, const MusicPipe &_pipe,
/* (re)open the filter */
if
(
filter_instance
!=
nullptr
&&
audio_format
!=
in_audio_format
)
if
(
filter
&&
audio_format
!=
in_audio_format
)
/* the filter must be reopened on all input format
changes */
CloseFilter
();
if
(
filter
_instance
==
nullptr
)
if
(
filter
==
nullptr
)
/* open the filter */
OpenFilter
(
audio_format
,
prepared_replay_gain_filter
,
...
...
@@ -60,7 +59,7 @@ AudioOutputSource::Open(const AudioFormat audio_format, const MusicPipe &_pipe,
prepared_filter
);
in_audio_format
=
audio_format
;
return
filter
_instance
->
GetOutAudioFormat
();
return
filter
->
GetOutAudioFormat
();
}
void
...
...
@@ -80,14 +79,14 @@ AudioOutputSource::Cancel() noexcept
current_chunk
=
nullptr
;
pipe
.
Cancel
();
if
(
replay_gain_filter
_instance
!=
nullptr
)
replay_gain_filter
_instance
->
Reset
();
if
(
replay_gain_filter
)
replay_gain_filter
->
Reset
();
if
(
other_replay_gain_filter
_instance
!=
nullptr
)
other_replay_gain_filter
_instance
->
Reset
();
if
(
other_replay_gain_filter
)
other_replay_gain_filter
->
Reset
();
if
(
filter
_instance
!=
nullptr
)
filter
_instance
->
Reset
();
if
(
filter
)
filter
->
Reset
();
}
void
...
...
@@ -99,19 +98,19 @@ try {
assert
(
audio_format
.
IsValid
());
/* the replay_gain filter cannot fail here */
if
(
prepared_replay_gain_filter
!=
nullptr
)
{
if
(
prepared_replay_gain_filter
)
{
replay_gain_serial
=
0
;
replay_gain_filter
_instance
=
replay_gain_filter
=
prepared_replay_gain_filter
->
Open
(
audio_format
);
}
if
(
prepared_other_replay_gain_filter
!=
nullptr
)
{
if
(
prepared_other_replay_gain_filter
)
{
other_replay_gain_serial
=
0
;
other_replay_gain_filter
_instance
=
other_replay_gain_filter
=
prepared_other_replay_gain_filter
->
Open
(
audio_format
);
}
filter
_instance
=
prepared_filter
.
Open
(
audio_format
);
filter
=
prepared_filter
.
Open
(
audio_format
);
}
catch
(...)
{
CloseFilter
();
throw
;
...
...
@@ -120,14 +119,14 @@ try {
void
AudioOutputSource
::
CloseFilter
()
noexcept
{
replay_gain_filter
_instance
.
reset
();
other_replay_gain_filter
_instance
.
reset
();
filter
_instance
.
reset
();
replay_gain_filter
.
reset
();
other_replay_gain_filter
.
reset
();
filter
.
reset
();
}
ConstBuffer
<
void
>
AudioOutputSource
::
GetChunkData
(
const
MusicChunk
&
chunk
,
Filter
*
replay_gain_filter
,
Filter
*
current_
replay_gain_filter
,
unsigned
*
replay_gain_serial_p
)
{
assert
(
!
chunk
.
IsEmpty
());
...
...
@@ -137,20 +136,20 @@ AudioOutputSource::GetChunkData(const MusicChunk &chunk,
assert
(
data
.
size
%
in_audio_format
.
GetFrameSize
()
==
0
);
if
(
!
data
.
empty
()
&&
replay_gain_filter
!=
nullptr
)
{
replay_gain_filter_set_mode
(
*
replay_gain_filter
,
if
(
!
data
.
empty
()
&&
current_
replay_gain_filter
!=
nullptr
)
{
replay_gain_filter_set_mode
(
*
current_
replay_gain_filter
,
replay_gain_mode
);
if
(
chunk
.
replay_gain_serial
!=
*
replay_gain_serial_p
&&
chunk
.
replay_gain_serial
!=
MusicChunk
::
IGNORE_REPLAY_GAIN
)
{
replay_gain_filter_set_info
(
*
replay_gain_filter
,
replay_gain_filter_set_info
(
*
current_
replay_gain_filter
,
chunk
.
replay_gain_serial
!=
0
?
&
chunk
.
replay_gain_info
:
nullptr
);
*
replay_gain_serial_p
=
chunk
.
replay_gain_serial
;
}
data
=
replay_gain_filter
->
FilterPCM
(
data
);
data
=
current_
replay_gain_filter
->
FilterPCM
(
data
);
}
return
data
;
...
...
@@ -159,7 +158,7 @@ AudioOutputSource::GetChunkData(const MusicChunk &chunk,
ConstBuffer
<
void
>
AudioOutputSource
::
FilterChunk
(
const
MusicChunk
&
chunk
)
{
auto
data
=
GetChunkData
(
chunk
,
replay_gain_filter
_instance
.
get
(),
auto
data
=
GetChunkData
(
chunk
,
replay_gain_filter
.
get
(),
&
replay_gain_serial
);
if
(
data
.
empty
())
return
data
;
...
...
@@ -168,7 +167,7 @@ AudioOutputSource::FilterChunk(const MusicChunk &chunk)
if
(
chunk
.
other
!=
nullptr
)
{
auto
other_data
=
GetChunkData
(
*
chunk
.
other
,
other_replay_gain_filter
_instance
.
get
(),
other_replay_gain_filter
.
get
(),
&
other_replay_gain_serial
);
if
(
other_data
.
empty
())
return
data
;
...
...
@@ -204,7 +203,7 @@ AudioOutputSource::FilterChunk(const MusicChunk &chunk)
/* apply filter chain */
return
filter
_instance
->
FilterPCM
(
data
);
return
filter
->
FilterPCM
(
data
);
}
bool
...
...
src/output/Source.hxx
View file @
d2358b42
...
...
@@ -77,14 +77,14 @@ class AudioOutputSource {
* The replay_gain_filter_plugin instance of this audio
* output.
*/
std
::
unique_ptr
<
Filter
>
replay_gain_filter
_instance
;
std
::
unique_ptr
<
Filter
>
replay_gain_filter
;
/**
* The replay_gain_filter_plugin instance of this audio
* output, to be applied to the second chunk during
* cross-fading.
*/
std
::
unique_ptr
<
Filter
>
other_replay_gain_filter
_instance
;
std
::
unique_ptr
<
Filter
>
other_replay_gain_filter
;
/**
* The buffer used to allocate the cross-fading result.
...
...
@@ -100,7 +100,7 @@ class AudioOutputSource {
* The filter object of this audio output. This is an
* instance of chain_filter_plugin.
*/
std
::
unique_ptr
<
Filter
>
filter
_instance
;
std
::
unique_ptr
<
Filter
>
filter
;
/**
* The #MusicChunk currently being processed (see
...
...
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