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
37897d15
Commit
37897d15
authored
Jul 07, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/flac: move class FlacMetadataChain to separate source
parent
b1535917
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
76 deletions
+127
-76
Makefile.am
Makefile.am
+1
-0
FlacCommon.cxx
src/decoder/plugins/FlacCommon.cxx
+1
-0
FlacDecoderPlugin.cxx
src/decoder/plugins/FlacDecoderPlugin.cxx
+1
-1
FlacMetadata.cxx
src/decoder/plugins/FlacMetadata.cxx
+0
-15
FlacMetadata.hxx
src/decoder/plugins/FlacMetadata.hxx
+0
-60
FlacMetadataChain.cxx
src/lib/xiph/FlacMetadataChain.cxx
+37
-0
FlacMetadataChain.hxx
src/lib/xiph/FlacMetadataChain.hxx
+87
-0
No files found.
Makefile.am
View file @
37897d15
...
...
@@ -1200,6 +1200,7 @@ if ENABLE_FLAC
libdecoder_a_SOURCES
+=
\
src/lib/xiph/FlacMetadataIterator.hxx
\
src/lib/xiph/FlacIOHandle.cxx src/lib/xiph/FlacIOHandle.hxx
\
src/lib/xiph/FlacMetadataChain.cxx src/lib/xiph/FlacMetadataChain.hxx
\
src/decoder/plugins/FlacInput.cxx src/decoder/plugins/FlacInput.hxx
\
src/decoder/plugins/FlacMetadata.cxx src/decoder/plugins/FlacMetadata.hxx
\
src/decoder/plugins/FlacPcm.cxx src/decoder/plugins/FlacPcm.hxx
\
...
...
src/decoder/plugins/FlacCommon.cxx
View file @
37897d15
...
...
@@ -25,6 +25,7 @@
#include "FlacCommon.hxx"
#include "FlacMetadata.hxx"
#include "Log.hxx"
#include "input/InputStream.hxx"
#include <exception>
...
...
src/decoder/plugins/FlacDecoderPlugin.cxx
View file @
37897d15
...
...
@@ -22,7 +22,7 @@
#include "FlacStreamDecoder.hxx"
#include "FlacDomain.hxx"
#include "FlacCommon.hxx"
#include "
FlacMetadata
.hxx"
#include "
lib/xiph/FlacMetadataChain
.hxx"
#include "OggCodec.hxx"
#include "fs/Path.hxx"
#include "fs/NarrowPath.hxx"
...
...
src/decoder/plugins/FlacMetadata.cxx
View file @
37897d15
...
...
@@ -20,7 +20,6 @@
#include "config.h"
#include "FlacMetadata.hxx"
#include "lib/xiph/XiphTags.hxx"
#include "lib/xiph/FlacMetadataIterator.hxx"
#include "MixRampInfo.hxx"
#include "tag/Handler.hxx"
#include "tag/Table.hxx"
...
...
@@ -160,17 +159,3 @@ flac_vorbis_comments_to_tag(const FLAC__StreamMetadata_VorbisComment *comment)
flac_scan_comments
(
comment
,
h
);
return
tag_builder
.
Commit
();
}
void
FlacMetadataChain
::
Scan
(
TagHandler
&
handler
)
noexcept
{
FlacMetadataIterator
iterator
(
chain
);
do
{
FLAC__StreamMetadata
*
block
=
iterator
.
GetBlock
();
if
(
block
==
nullptr
)
break
;
flac_scan_metadata
(
block
,
handler
);
}
while
(
iterator
.
Next
());
}
src/decoder/plugins/FlacMetadata.hxx
View file @
37897d15
...
...
@@ -20,71 +20,11 @@
#ifndef MPD_FLAC_METADATA_H
#define MPD_FLAC_METADATA_H
#include "Compiler.h"
#include "lib/xiph/FlacIOHandle.hxx"
#include <FLAC/metadata.h>
class
TagHandler
;
class
MixRampInfo
;
class
FlacMetadataChain
{
FLAC__Metadata_Chain
*
chain
;
public
:
FlacMetadataChain
()
:
chain
(
::
FLAC__metadata_chain_new
())
{}
~
FlacMetadataChain
()
{
::
FLAC__metadata_chain_delete
(
chain
);
}
explicit
operator
FLAC__Metadata_Chain
*
()
{
return
chain
;
}
bool
Read
(
const
char
*
path
)
noexcept
{
return
::
FLAC__metadata_chain_read
(
chain
,
path
);
}
bool
Read
(
FLAC__IOHandle
handle
,
FLAC__IOCallbacks
callbacks
)
noexcept
{
return
::
FLAC__metadata_chain_read_with_callbacks
(
chain
,
handle
,
callbacks
);
}
bool
Read
(
InputStream
&
is
)
noexcept
{
return
Read
(
::
ToFlacIOHandle
(
is
),
::
GetFlacIOCallbacks
(
is
));
}
bool
ReadOgg
(
const
char
*
path
)
noexcept
{
return
::
FLAC__metadata_chain_read_ogg
(
chain
,
path
);
}
bool
ReadOgg
(
FLAC__IOHandle
handle
,
FLAC__IOCallbacks
callbacks
)
noexcept
{
return
::
FLAC__metadata_chain_read_ogg_with_callbacks
(
chain
,
handle
,
callbacks
);
}
bool
ReadOgg
(
InputStream
&
is
)
{
return
ReadOgg
(
::
ToFlacIOHandle
(
is
),
::
GetFlacIOCallbacks
(
is
));
}
gcc_pure
FLAC__Metadata_ChainStatus
GetStatus
()
const
noexcept
{
return
::
FLAC__metadata_chain_status
(
chain
);
}
gcc_pure
const
char
*
GetStatusString
()
const
noexcept
{
return
FLAC__Metadata_ChainStatusString
[
GetStatus
()];
}
void
Scan
(
TagHandler
&
handler
)
noexcept
;
};
struct
Tag
;
struct
ReplayGainInfo
;
...
...
src/lib/xiph/FlacMetadataChain.cxx
0 → 100644
View file @
37897d15
/*
* Copyright 2003-2018 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "FlacMetadataChain.hxx"
#include "FlacMetadataIterator.hxx"
#include "decoder/plugins/FlacMetadata.hxx"
void
FlacMetadataChain
::
Scan
(
TagHandler
&
handler
)
noexcept
{
FlacMetadataIterator
iterator
(
chain
);
do
{
FLAC__StreamMetadata
*
block
=
iterator
.
GetBlock
();
if
(
block
==
nullptr
)
break
;
flac_scan_metadata
(
block
,
handler
);
}
while
(
iterator
.
Next
());
}
src/lib/xiph/FlacMetadataChain.hxx
0 → 100644
View file @
37897d15
/*
* Copyright 2003-2018 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_FLAC_METADATA_CHAIN_HXX
#define MPD_FLAC_METADATA_CHAIN_HXX
#include "FlacIOHandle.hxx"
#include "Compiler.h"
#include <FLAC/metadata.h>
class
TagHandler
;
class
FlacMetadataChain
{
FLAC__Metadata_Chain
*
chain
;
public
:
FlacMetadataChain
()
:
chain
(
::
FLAC__metadata_chain_new
())
{}
~
FlacMetadataChain
()
{
::
FLAC__metadata_chain_delete
(
chain
);
}
explicit
operator
FLAC__Metadata_Chain
*
()
{
return
chain
;
}
bool
Read
(
const
char
*
path
)
noexcept
{
return
::
FLAC__metadata_chain_read
(
chain
,
path
);
}
bool
Read
(
FLAC__IOHandle
handle
,
FLAC__IOCallbacks
callbacks
)
noexcept
{
return
::
FLAC__metadata_chain_read_with_callbacks
(
chain
,
handle
,
callbacks
);
}
bool
Read
(
InputStream
&
is
)
noexcept
{
return
Read
(
::
ToFlacIOHandle
(
is
),
::
GetFlacIOCallbacks
(
is
));
}
bool
ReadOgg
(
const
char
*
path
)
noexcept
{
return
::
FLAC__metadata_chain_read_ogg
(
chain
,
path
);
}
bool
ReadOgg
(
FLAC__IOHandle
handle
,
FLAC__IOCallbacks
callbacks
)
noexcept
{
return
::
FLAC__metadata_chain_read_ogg_with_callbacks
(
chain
,
handle
,
callbacks
);
}
bool
ReadOgg
(
InputStream
&
is
)
{
return
ReadOgg
(
::
ToFlacIOHandle
(
is
),
::
GetFlacIOCallbacks
(
is
));
}
gcc_pure
FLAC__Metadata_ChainStatus
GetStatus
()
const
noexcept
{
return
::
FLAC__metadata_chain_status
(
chain
);
}
gcc_pure
const
char
*
GetStatusString
()
const
noexcept
{
return
FLAC__Metadata_ChainStatusString
[
GetStatus
()];
}
void
Scan
(
TagHandler
&
handler
)
noexcept
;
};
#endif
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