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
6c48aa5f
Commit
6c48aa5f
authored
Sep 24, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad: move code to tag/MixRamp.cxx
parent
d82547ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
5 deletions
+96
-5
Makefile.am
Makefile.am
+1
-0
MadDecoderPlugin.cxx
src/decoder/plugins/MadDecoderPlugin.cxx
+2
-5
MixRamp.cxx
src/tag/MixRamp.cxx
+63
-0
MixRamp.hxx
src/tag/MixRamp.hxx
+30
-0
No files found.
Makefile.am
View file @
6c48aa5f
...
@@ -768,6 +768,7 @@ libtag_a_SOURCES =\
...
@@ -768,6 +768,7 @@ libtag_a_SOURCES =\
src/tag/Set.cxx src/tag/Set.hxx
\
src/tag/Set.cxx src/tag/Set.hxx
\
src/tag/VorbisComment.cxx src/tag/VorbisComment.hxx
\
src/tag/VorbisComment.cxx src/tag/VorbisComment.hxx
\
src/tag/ReplayGain.cxx src/tag/ReplayGain.hxx
\
src/tag/ReplayGain.cxx src/tag/ReplayGain.hxx
\
src/tag/MixRamp.cxx src/tag/MixRamp.hxx
\
src/tag/ApeLoader.cxx src/tag/ApeLoader.hxx
\
src/tag/ApeLoader.cxx src/tag/ApeLoader.hxx
\
src/tag/ApeReplayGain.cxx src/tag/ApeReplayGain.hxx
\
src/tag/ApeReplayGain.cxx src/tag/ApeReplayGain.hxx
\
src/tag/ApeTag.cxx src/tag/ApeTag.hxx
src/tag/ApeTag.cxx src/tag/ApeTag.hxx
...
...
src/decoder/plugins/MadDecoderPlugin.cxx
View file @
6c48aa5f
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "tag/TagRva2.hxx"
#include "tag/TagRva2.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagHandler.hxx"
#include "tag/ReplayGain.hxx"
#include "tag/ReplayGain.hxx"
#include "tag/MixRamp.hxx"
#include "CheckAudioFormat.hxx"
#include "CheckAudioFormat.hxx"
#include "util/StringUtil.hxx"
#include "util/StringUtil.hxx"
#include "util/ASCII.hxx"
#include "util/ASCII.hxx"
...
@@ -303,11 +304,7 @@ parse_id3_mixramp(struct id3_tag *tag)
...
@@ -303,11 +304,7 @@ parse_id3_mixramp(struct id3_tag *tag)
id3_ucs4_latin1duplicate
(
id3_field_getstring
id3_ucs4_latin1duplicate
(
id3_field_getstring
(
&
frame
->
fields
[
2
]));
(
&
frame
->
fields
[
2
]));
if
(
StringEqualsCaseASCII
(
key
,
"mixramp_start"
))
{
ParseMixRampTag
(
result
,
key
,
value
);
result
.
SetStart
(
value
);
}
else
if
(
StringEqualsCaseASCII
(
key
,
"mixramp_end"
))
{
result
.
SetEnd
(
value
);
}
free
(
key
);
free
(
key
);
free
(
value
);
free
(
value
);
...
...
src/tag/MixRamp.cxx
0 → 100644
View file @
6c48aa5f
/*
* Copyright (C) 2003-2014 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 "MixRamp.hxx"
#include "MixRampInfo.hxx"
#include "util/ASCII.hxx"
#include <assert.h>
template
<
typename
T
>
static
bool
ParseMixRampTagTemplate
(
MixRampInfo
&
info
,
const
T
t
)
{
const
char
*
value
;
if
((
value
=
t
[
"mixramp_start"
])
!=
nullptr
)
{
info
.
SetStart
(
value
);
return
true
;
}
else
if
((
value
=
t
[
"mixramp_end"
])
!=
nullptr
)
{
info
.
SetEnd
(
value
);
return
true
;
}
else
return
false
;
}
bool
ParseMixRampTag
(
MixRampInfo
&
info
,
const
char
*
name
,
const
char
*
value
)
{
assert
(
name
!=
nullptr
);
assert
(
value
!=
nullptr
);
struct
NameValue
{
const
char
*
name
;
const
char
*
value
;
gcc_pure
const
char
*
operator
[](
const
char
*
n
)
const
{
return
StringEqualsCaseASCII
(
name
,
n
)
?
value
:
nullptr
;
}
};
return
ParseMixRampTagTemplate
(
info
,
NameValue
{
name
,
value
});
}
src/tag/MixRamp.hxx
0 → 100644
View file @
6c48aa5f
/*
* Copyright (C) 2003-2014 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_TAG_MIXRAMP_HXX
#define MPD_TAG_MIXRAMP_HXX
#include "check.h"
class
MixRampInfo
;
bool
ParseMixRampTag
(
MixRampInfo
&
info
,
const
char
*
name
,
const
char
*
value
);
#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