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
458a1bee
Commit
458a1bee
authored
Jun 17, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AudioFormat: move MAX_CHANNELS to pcm/ChannelDefs.hxx
Reduce header dependencies.
parent
47bb1cd8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
14 deletions
+38
-14
AudioFormat.hxx
src/AudioFormat.hxx
+1
-11
ChannelDefs.hxx
src/pcm/ChannelDefs.hxx
+34
-0
Dop.cxx
src/pcm/Dop.cxx
+1
-1
PcmChannels.cxx
src/pcm/PcmChannels.cxx
+1
-1
PcmDsd.hxx
src/pcm/PcmDsd.hxx
+1
-1
No files found.
src/AudioFormat.hxx
View file @
458a1bee
...
...
@@ -21,6 +21,7 @@
#define MPD_AUDIO_FORMAT_HXX
#include "pcm/SampleFormat.hxx"
#include "pcm/ChannelDefs.hxx"
#include "util/Compiler.h"
#include <chrono>
...
...
@@ -30,8 +31,6 @@
template
<
size_t
CAPACITY
>
class
StringBuffer
;
static
constexpr
unsigned
MAX_CHANNELS
=
8
;
/**
* This structure describes the format of a raw PCM stream.
*/
...
...
@@ -185,15 +184,6 @@ audio_valid_sample_rate(unsigned sample_rate) noexcept
}
/**
* Checks whether the number of channels is valid.
*/
constexpr
bool
audio_valid_channel_count
(
unsigned
channels
)
noexcept
{
return
channels
>=
1
&&
channels
<=
MAX_CHANNELS
;
}
/**
* Returns false if the format is not valid for playback with MPD.
* This function performs some basic validity checks.
*/
...
...
src/pcm/ChannelDefs.hxx
0 → 100644
View file @
458a1bee
/*
* Copyright 2003-2019 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_PCM_CHANNEL_DEFS_HXX
#define MPD_PCM_CHANNEL_DEFS_HXX
static
constexpr
unsigned
MAX_CHANNELS
=
8
;
/**
* Checks whether the number of channels is valid.
*/
constexpr
bool
audio_valid_channel_count
(
unsigned
channels
)
noexcept
{
return
channels
>=
1
&&
channels
<=
MAX_CHANNELS
;
}
#endif
src/pcm/Dop.cxx
View file @
458a1bee
...
...
@@ -19,7 +19,7 @@
#include "Dop.hxx"
#include "Buffer.hxx"
#include "
AudioFormat
.hxx"
#include "
ChannelDefs
.hxx"
#include "util/ConstBuffer.hxx"
#include <assert.h>
...
...
src/pcm/PcmChannels.cxx
View file @
458a1bee
...
...
@@ -18,10 +18,10 @@
*/
#include "PcmChannels.hxx"
#include "ChannelDefs.hxx"
#include "Buffer.hxx"
#include "Silence.hxx"
#include "Traits.hxx"
#include "AudioFormat.hxx"
#include "util/ConstBuffer.hxx"
#include "util/WritableBuffer.hxx"
...
...
src/pcm/PcmDsd.hxx
View file @
458a1bee
...
...
@@ -21,7 +21,7 @@
#define MPD_PCM_DSD_HXX
#include "Buffer.hxx"
#include "
AudioFormat
.hxx"
#include "
ChannelDefs
.hxx"
#include <array>
...
...
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