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
cfeeb7af
Commit
cfeeb7af
authored
Jan 30, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_encoder, ...: convert to C++
parent
ac887d3a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
8 deletions
+25
-8
Makefile.am
Makefile.am
+3
-3
audio_parser.h
src/audio_parser.h
+8
-0
pcm_volume.h
src/pcm_volume.h
+8
-0
run_convert.cxx
test/run_convert.cxx
+1
-1
run_encoder.cxx
test/run_encoder.cxx
+2
-2
software_volume.cxx
test/software_volume.cxx
+3
-2
No files found.
Makefile.am
View file @
cfeeb7af
...
...
@@ -1257,7 +1257,7 @@ endif
if
ENABLE_ENCODER
noinst_PROGRAMS
+=
test
/run_encoder
test_run_encoder_SOURCES
=
test
/run_encoder.c
\
test_run_encoder_SOURCES
=
test
/run_encoder.c
xx
\
test
/stdbin.h
\
src/tokenizer.c src/utils.c src/string_util.c
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
...
...
@@ -1295,7 +1295,7 @@ test_test_vorbis_encoder_LDADD = $(MPD_LIBS) \
$(GLIB_LIBS)
endif
test_software_volume_SOURCES
=
test
/software_volume.c
\
test_software_volume_SOURCES
=
test
/software_volume.c
xx
\
test
/stdbin.h
\
src/audio_check.c
\
src/audio_parser.c
...
...
@@ -1311,7 +1311,7 @@ test_run_normalize_SOURCES = test/run_normalize.c \
test_run_normalize_LDADD
=
\
$(GLIB_LIBS)
test_run_convert_SOURCES
=
test
/run_convert.c
\
test_run_convert_SOURCES
=
test
/run_convert.c
xx
\
src/dsd2pcm/dsd2pcm.c
\
src/audio_format.c
\
src/audio_check.c
\
...
...
src/audio_parser.h
View file @
cfeeb7af
...
...
@@ -31,6 +31,10 @@
struct
audio_format
;
#ifdef __cplusplus
extern
"C"
{
#endif
/**
* Parses a string in the form "SAMPLE_RATE:BITS:CHANNELS" into an
* #audio_format.
...
...
@@ -46,4 +50,8 @@ bool
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
bool
mask
,
GError
**
error_r
);
#ifdef __cplusplus
}
#endif
#endif
src/pcm_volume.h
View file @
cfeeb7af
...
...
@@ -65,6 +65,10 @@ pcm_volume_dither(void)
return
(
r
&
511
)
-
((
r
>>
9
)
&
511
);
}
#ifdef __cplusplus
extern
"C"
{
#endif
/**
* Adjust the volume of the specified PCM buffer.
*
...
...
@@ -79,4 +83,8 @@ pcm_volume(void *buffer, size_t length,
enum
sample_format
format
,
int
volume
);
#ifdef __cplusplus
}
#endif
#endif
test/run_convert.c
→
test/run_convert.c
xx
View file @
cfeeb7af
/*
* 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
...
...
test/run_encoder.c
→
test/run_encoder.c
xx
View file @
cfeeb7af
/*
* 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
...
...
@@ -51,7 +51,6 @@ int main(int argc, char **argv)
struct
encoder
*
encoder
;
struct
config_param
*
param
;
static
char
buffer
[
32768
];
ssize_t
nbytes
;
/* parse command line */
...
...
@@ -110,6 +109,7 @@ int main(int argc, char **argv)
/* do it */
ssize_t
nbytes
;
while
((
nbytes
=
read
(
0
,
buffer
,
sizeof
(
buffer
)))
>
0
)
{
ret
=
encoder_write
(
encoder
,
buffer
,
nbytes
,
&
error
);
if
(
!
ret
)
{
...
...
test/software_volume.c
→
test/software_volume.c
xx
View file @
cfeeb7af
/*
* 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
...
...
@@ -59,7 +59,8 @@ int main(int argc, char **argv)
audio_format_init
(
&
audio_format
,
48000
,
SAMPLE_FORMAT_S16
,
2
);
while
((
nbytes
=
read
(
0
,
buffer
,
sizeof
(
buffer
)))
>
0
)
{
if
(
!
pcm_volume
(
buffer
,
nbytes
,
audio_format
.
format
,
if
(
!
pcm_volume
(
buffer
,
nbytes
,
sample_format
(
audio_format
.
format
),
PCM_VOLUME_1
/
2
))
{
g_printerr
(
"pcm_volume() has failed
\n
"
);
return
2
;
...
...
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