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
85c2b396
Commit
85c2b396
authored
Nov 24, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/FakeDecoderAPI: move code to DumpReplayGainTuple()
parent
0759d721
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
18 deletions
+33
-18
FakeDecoderAPI.cxx
test/FakeDecoderAPI.cxx
+17
-9
dump_rva2.cxx
test/dump_rva2.cxx
+16
-9
No files found.
test/FakeDecoderAPI.cxx
View file @
85c2b396
...
...
@@ -121,18 +121,26 @@ FakeDecoder::SubmitTag(gcc_unused InputStream *is,
return
DecoderCommand
::
NONE
;
}
static
void
DumpReplayGainTuple
(
const
char
*
name
,
const
ReplayGainTuple
&
tuple
)
{
if
(
tuple
.
IsDefined
())
fprintf
(
stderr
,
"replay_gain[%s]: gain=%f peak=%f
\n
"
,
name
,
tuple
.
gain
,
tuple
.
peak
);
}
static
void
DumpReplayGainInfo
(
const
ReplayGainInfo
&
info
)
{
DumpReplayGainTuple
(
"album"
,
info
.
tuples
[
REPLAY_GAIN_ALBUM
]);
DumpReplayGainTuple
(
"track"
,
info
.
tuples
[
REPLAY_GAIN_TRACK
]);
}
void
FakeDecoder
::
SubmitReplayGain
(
const
ReplayGainInfo
*
rgi
)
{
const
ReplayGainTuple
*
tuple
=
&
rgi
->
tuples
[
REPLAY_GAIN_ALBUM
];
if
(
tuple
->
IsDefined
())
fprintf
(
stderr
,
"replay_gain[album]: gain=%f peak=%f
\n
"
,
tuple
->
gain
,
tuple
->
peak
);
tuple
=
&
rgi
->
tuples
[
REPLAY_GAIN_TRACK
];
if
(
tuple
->
IsDefined
())
fprintf
(
stderr
,
"replay_gain[track]: gain=%f peak=%f
\n
"
,
tuple
->
gain
,
tuple
->
peak
);
if
(
rgi
!=
nullptr
)
DumpReplayGainInfo
(
*
rgi
);
}
void
...
...
test/dump_rva2.cxx
View file @
85c2b396
...
...
@@ -45,6 +45,21 @@ config_get_string(gcc_unused enum ConfigOption option,
return
default_value
;
}
static
void
DumpReplayGainTuple
(
const
char
*
name
,
const
ReplayGainTuple
&
tuple
)
{
if
(
tuple
.
IsDefined
())
fprintf
(
stderr
,
"replay_gain[%s]: gain=%f peak=%f
\n
"
,
name
,
tuple
.
gain
,
tuple
.
peak
);
}
static
void
DumpReplayGainInfo
(
const
ReplayGainInfo
&
info
)
{
DumpReplayGainTuple
(
"album"
,
info
.
tuples
[
REPLAY_GAIN_ALBUM
]);
DumpReplayGainTuple
(
"track"
,
info
.
tuples
[
REPLAY_GAIN_TRACK
]);
}
int
main
(
int
argc
,
char
**
argv
)
try
{
#ifdef HAVE_LOCALE_H
...
...
@@ -79,15 +94,7 @@ try {
return
EXIT_FAILURE
;
}
const
ReplayGainTuple
*
tuple
=
&
replay_gain
.
tuples
[
REPLAY_GAIN_ALBUM
];
if
(
tuple
->
IsDefined
())
fprintf
(
stderr
,
"replay_gain[album]: gain=%f peak=%f
\n
"
,
tuple
->
gain
,
tuple
->
peak
);
tuple
=
&
replay_gain
.
tuples
[
REPLAY_GAIN_TRACK
];
if
(
tuple
->
IsDefined
())
fprintf
(
stderr
,
"replay_gain[track]: gain=%f peak=%f
\n
"
,
tuple
->
gain
,
tuple
->
peak
);
DumpReplayGainInfo
(
replay_gain
);
return
EXIT_SUCCESS
;
}
catch
(
const
std
::
exception
&
e
)
{
...
...
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