pcm/PcmConvert: move the Domain instance to Domain.cxx
Rename pcm_convert_domain to pcm_domain. Move it out so we can use it without depending on the whole PcmConvert library.
This commit is contained in:
@@ -331,6 +331,7 @@ libevent_a_SOURCES = \
|
|||||||
# PCM library
|
# PCM library
|
||||||
|
|
||||||
libpcm_a_SOURCES = \
|
libpcm_a_SOURCES = \
|
||||||
|
src/pcm/Domain.cxx src/pcm/Domain.hxx \
|
||||||
src/pcm/Traits.hxx \
|
src/pcm/Traits.hxx \
|
||||||
src/pcm/PcmBuffer.cxx src/pcm/PcmBuffer.hxx \
|
src/pcm/PcmBuffer.cxx src/pcm/PcmBuffer.hxx \
|
||||||
src/pcm/PcmExport.cxx src/pcm/PcmExport.hxx \
|
src/pcm/PcmExport.cxx src/pcm/PcmExport.hxx \
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "ChannelsConverter.hxx"
|
#include "ChannelsConverter.hxx"
|
||||||
#include "PcmChannels.hxx"
|
#include "PcmChannels.hxx"
|
||||||
#include "PcmConvert.hxx"
|
#include "Domain.hxx"
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ PcmChannelsConverter::Open(SampleFormat _format,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error.Format(pcm_convert_domain,
|
error.Format(pcm_domain,
|
||||||
"PCM channel conversion for %s is not implemented",
|
"PCM channel conversion for %s is not implemented",
|
||||||
sample_format_to_string(format));
|
sample_format_to_string(format));
|
||||||
return false;
|
return false;
|
||||||
|
23
src/pcm/Domain.cxx
Normal file
23
src/pcm/Domain.cxx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2003-2013 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 "Domain.hxx"
|
||||||
|
#include "util/Domain.hxx"
|
||||||
|
|
||||||
|
const Domain pcm_domain("pcm");
|
27
src/pcm/Domain.hxx
Normal file
27
src/pcm/Domain.hxx
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2003-2013 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 PCM_DOMAIN_HXX
|
||||||
|
#define PCM_DOMAIN_HXX
|
||||||
|
|
||||||
|
class Domain;
|
||||||
|
|
||||||
|
extern const Domain pcm_domain;
|
||||||
|
|
||||||
|
#endif
|
@@ -20,7 +20,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "FormatConverter.hxx"
|
#include "FormatConverter.hxx"
|
||||||
#include "PcmFormat.hxx"
|
#include "PcmFormat.hxx"
|
||||||
#include "PcmConvert.hxx"
|
#include "Domain.hxx"
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ PcmFormatConverter::Convert(ConstBuffer<void> src, Error &error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result == nullptr) {
|
if (result == nullptr) {
|
||||||
error.Format(pcm_convert_domain,
|
error.Format(pcm_domain,
|
||||||
"PCM conversion from %s to %s is not implemented",
|
"PCM conversion from %s to %s is not implemented",
|
||||||
sample_format_to_string(src_format),
|
sample_format_to_string(src_format),
|
||||||
sample_format_to_string(dest_format));
|
sample_format_to_string(dest_format));
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "PcmConvert.hxx"
|
#include "PcmConvert.hxx"
|
||||||
|
#include "Domain.hxx"
|
||||||
#include "ConfiguredResampler.hxx"
|
#include "ConfiguredResampler.hxx"
|
||||||
#include "AudioFormat.hxx"
|
#include "AudioFormat.hxx"
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
@@ -29,8 +30,6 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
const Domain pcm_convert_domain("pcm_convert");
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
pcm_convert_global_init(Error &error)
|
pcm_convert_global_init(Error &error)
|
||||||
{
|
{
|
||||||
@@ -131,7 +130,7 @@ PcmConvert::Convert(const void *src, size_t src_size,
|
|||||||
auto d = dsd.ToFloat(format.channels,
|
auto d = dsd.ToFloat(format.channels,
|
||||||
false, s);
|
false, s);
|
||||||
if (d.IsNull()) {
|
if (d.IsNull()) {
|
||||||
error.Set(pcm_convert_domain,
|
error.Set(pcm_domain,
|
||||||
"DSD to PCM conversion failed");
|
"DSD to PCM conversion failed");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@@ -82,8 +82,6 @@ public:
|
|||||||
Error &error);
|
Error &error);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const Domain pcm_convert_domain;
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
pcm_convert_global_init(Error &error);
|
pcm_convert_global_init(Error &error);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user