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
de0c3e71
Commit
de0c3e71
authored
Dec 30, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MusicChunk: split struct MusicChunkInfo from struct MusicChunk
parent
1194998c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
MusicChunk.cxx
src/MusicChunk.cxx
+3
-3
MusicChunk.hxx
src/MusicChunk.hxx
+16
-10
No files found.
src/MusicChunk.cxx
View file @
de0c3e71
...
...
@@ -24,12 +24,12 @@
#include <assert.h>
MusicChunk
::
MusicChunk
()
noexcept
=
default
;
MusicChunk
::~
MusicChunk
()
noexcept
=
default
;
MusicChunk
Info
::
MusicChunkInfo
()
noexcept
=
default
;
MusicChunk
Info
::~
MusicChunkInfo
()
noexcept
=
default
;
#ifndef NDEBUG
bool
MusicChunk
::
CheckFormat
(
const
AudioFormat
other_format
)
const
noexcept
MusicChunk
Info
::
CheckFormat
(
const
AudioFormat
other_format
)
const
noexcept
{
assert
(
other_format
.
IsValid
());
...
...
src/MusicChunk.hxx
View file @
de0c3e71
...
...
@@ -37,12 +37,12 @@ static constexpr size_t CHUNK_SIZE = 4096;
struct
AudioFormat
;
struct
Tag
;
struct
MusicChunk
;
/**
* A chunk of music data. Its format is defined by the
* MusicPipe::Push() caller.
* Meta information for #MusicChunk.
*/
struct
MusicChunk
{
struct
MusicChunk
Info
{
/** the next chunk in a linked list */
MusicChunk
*
next
;
...
...
@@ -94,18 +94,15 @@ struct MusicChunk {
*/
unsigned
replay_gain_serial
;
/** the data (probably PCM) */
uint8_t
data
[
CHUNK_SIZE
];
#ifndef NDEBUG
AudioFormat
audio_format
;
#endif
MusicChunk
()
noexcept
;
~
MusicChunk
()
noexcept
;
MusicChunk
Info
()
noexcept
;
~
MusicChunk
Info
()
noexcept
;
MusicChunk
(
const
MusicChunk
&
)
=
delete
;
MusicChunk
&
operator
=
(
const
MusicChunk
&
)
=
delete
;
MusicChunk
Info
(
const
MusicChunkInfo
&
)
=
delete
;
MusicChunk
Info
&
operator
=
(
const
MusicChunkInfo
&
)
=
delete
;
bool
IsEmpty
()
const
{
return
length
==
0
&&
tag
==
nullptr
;
...
...
@@ -119,6 +116,15 @@ struct MusicChunk {
gcc_pure
bool
CheckFormat
(
AudioFormat
audio_format
)
const
noexcept
;
#endif
};
/**
* A chunk of music data. Its format is defined by the
* MusicPipe::Push() caller.
*/
struct
MusicChunk
:
MusicChunkInfo
{
/** the data (probably PCM) */
uint8_t
data
[
CHUNK_SIZE
];
/**
* Prepares appending to the music chunk. Returns a buffer
...
...
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