tag/Riff: split into RiffId3.?xx and RiffFormat.hxx

This commit is contained in:
Max Kellermann 2021-02-16 19:21:31 +01:00
parent 75c8d2235b
commit ded2b31fbc
5 changed files with 42 additions and 17 deletions

View File

@ -18,7 +18,7 @@
*/
#include "Id3Load.hxx"
#include "Riff.hxx"
#include "RiffId3.hxx"
#include "Aiff.hxx"
#include "input/InputStream.hxx"

36
src/tag/RiffFormat.hxx Normal file
View File

@ -0,0 +1,36 @@
/*
* Copyright 2003-2021 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_RIFF_FORMAT_HXX
#define MPD_RIFF_FORMAT_HXX
#include <cstdint>
struct riff_header {
char id[4];
uint32_t size;
char format[4];
};
struct riff_chunk_header {
char id[4];
uint32_t size;
};
#endif

View File

@ -17,27 +17,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Riff.hxx"
#include "RiffId3.hxx"
#include "RiffFormat.hxx"
#include "input/InputStream.hxx"
#include "util/ByteOrder.hxx"
#include <cstdint>
#include <limits>
#include <stdexcept>
#include <string.h>
struct riff_header {
char id[4];
uint32_t size;
char format[4];
};
struct riff_chunk_header {
char id[4];
uint32_t size;
};
size_t
riff_seek_id3(InputStream &is, std::unique_lock<Mutex> &lock)
{

View File

@ -22,8 +22,8 @@
* A parser for the RIFF file format (e.g. WAV).
*/
#ifndef MPD_RIFF_HXX
#define MPD_RIFF_HXX
#ifndef MPD_RIFF_ID3_HXX
#define MPD_RIFF_ID3_HXX
#include "thread/Mutex.hxx"

View File

@ -45,7 +45,7 @@ if libid3tag_dep.found()
'Id3Scan.cxx',
'Id3ReplayGain.cxx',
'Rva2.cxx',
'Riff.cxx',
'RiffId3.cxx',
'Aiff.cxx',
]
endif