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
e1c43ec6
Commit
e1c43ec6
authored
Mar 26, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ucl' of
git://github.com/neheb/MPD
into v0.21.x
parents
4dd10894
85c27840
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
15 deletions
+53
-15
NEWS
NEWS
+1
-0
Stats.cxx
src/Stats.cxx
+2
-2
PlayerCommands.cxx
src/command/PlayerCommands.cxx
+2
-3
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+1
-1
WinmmMixerPlugin.cxx
src/mixer/plugins/WinmmMixerPlugin.cxx
+1
-1
HaikuOutputPlugin.cxx
src/output/plugins/HaikuOutputPlugin.cxx
+1
-2
PcmMix.cxx
src/pcm/PcmMix.cxx
+2
-3
CrossFade.cxx
src/player/CrossFade.cxx
+2
-3
Math.hxx
src/util/Math.hxx
+41
-0
No files found.
NEWS
View file @
e1c43ec6
...
...
@@ -5,6 +5,7 @@ ver 0.21.22 (not yet released)
- rss: support MIME type application/xml
* mixer
- android: new mixer plugin for "sles" output
* fix build failures with uClibc-ng
ver 0.21.21 (2020/03/19)
* configuration
...
...
src/Stats.cxx
View file @
e1c43ec6
...
...
@@ -29,9 +29,9 @@
#include "system/Clock.hxx"
#include "Log.hxx"
#include "time/ChronoUtil.hxx"
#include "util/Math.hxx"
#include <chrono>
#include <cmath>
#ifndef _WIN32
/**
...
...
@@ -121,7 +121,7 @@ stats_print(Response &r, const Partition &partition)
#else
(
unsigned
)
std
::
chrono
::
duration_cast
<
std
::
chrono
::
seconds
>
(
std
::
chrono
::
steady_clock
::
now
()
-
start_time
).
count
(),
#endif
std
::
lround
(
partition
.
pc
.
GetTotalPlayTime
().
count
()));
lround
(
partition
.
pc
.
GetTotalPlayTime
().
count
()));
#ifdef ENABLE_DATABASE
const
Database
*
db
=
partition
.
instance
.
GetDatabase
();
...
...
src/command/PlayerCommands.cxx
View file @
e1c43ec6
...
...
@@ -34,13 +34,12 @@
#include "util/StringBuffer.hxx"
#include "util/ScopeExit.hxx"
#include "util/Exception.hxx"
#include "util/Math.hxx"
#ifdef ENABLE_DATABASE
#include "db/update/Service.hxx"
#endif
#include <cmath>
#define COMMAND_STATUS_STATE "state"
#define COMMAND_STATUS_REPEAT "repeat"
#define COMMAND_STATUS_SINGLE "single"
...
...
@@ -154,7 +153,7 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
if
(
pc
.
GetCrossFade
()
>
FloatDuration
::
zero
())
r
.
Format
(
COMMAND_STATUS_CROSSFADE
": %lu
\n
"
,
std
::
lround
(
pc
.
GetCrossFade
().
count
()));
lround
(
pc
.
GetCrossFade
().
count
()));
if
(
pc
.
GetMixRampDelay
()
>
FloatDuration
::
zero
())
r
.
Format
(
COMMAND_STATUS_MIXRAMPDELAY
": %f
\n
"
,
...
...
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
e1c43ec6
...
...
@@ -26,11 +26,11 @@
#include "util/ScopeExit.hxx"
#include "util/ConstBuffer.hxx"
#include "util/Domain.hxx"
#include "util/Math.hxx"
#include "Log.hxx"
#include <neaacdec.h>
#include <cmath>
#include <exception>
#include <assert.h>
...
...
src/mixer/plugins/WinmmMixerPlugin.cxx
View file @
e1c43ec6
...
...
@@ -20,13 +20,13 @@
#include "mixer/MixerInternal.hxx"
#include "output/OutputAPI.hxx"
#include "output/plugins/WinmmOutputPlugin.hxx"
#include "util/Math.hxx"
#include <mmsystem.h>
#include <stdexcept>
#include <assert.h>
#include <math.h>
#include <windows.h>
class
WinmmMixer
final
:
public
Mixer
{
...
...
src/output/plugins/HaikuOutputPlugin.cxx
View file @
e1c43ec6
...
...
@@ -22,6 +22,7 @@
#include "../OutputAPI.hxx"
#include "mixer/MixerList.hxx"
#include "util/Domain.hxx"
#include "util/Math.hxx"
#include "system/Error.hxx"
#include "Log.hxx"
...
...
@@ -37,8 +38,6 @@
#include <StringList.h>
#include <SoundPlayer.h>
#include <cmath>
#include <string.h>
#define UTF8_PLAY "\xE2\x96\xB6"
...
...
src/pcm/PcmMix.cxx
View file @
e1c43ec6
...
...
@@ -22,11 +22,10 @@
#include "Clamp.hxx"
#include "Traits.hxx"
#include "util/Clamp.hxx"
#include "util/Math.hxx"
#include "PcmDither.cxx" // including the .cxx file to get inlined templates
#include <cmath>
#include <assert.h>
template
<
SampleFormat
F
,
class
Traits
=
SampleTraits
<
F
>>
...
...
@@ -225,7 +224,7 @@ pcm_mix(PcmDither &dither, void *buffer1, const void *buffer2, size_t size,
s
=
sin
(
M_PI_2
*
portion1
);
s
*=
s
;
int
vol1
=
std
::
lround
(
s
*
PCM_VOLUME_1S
);
int
vol1
=
lround
(
s
*
PCM_VOLUME_1S
);
vol1
=
Clamp
<
int
>
(
vol1
,
0
,
PCM_VOLUME_1S
);
return
pcm_add_vol
(
dither
,
buffer1
,
buffer2
,
size
,
...
...
src/player/CrossFade.cxx
View file @
e1c43ec6
...
...
@@ -23,10 +23,9 @@
#include "AudioFormat.hxx"
#include "util/NumberParser.hxx"
#include "util/Domain.hxx"
#include "util/Math.hxx"
#include "Log.hxx"
#include <cmath>
#include <assert.h>
static
constexpr
Domain
cross_fade_domain
(
"cross_fade"
);
...
...
@@ -112,7 +111,7 @@ CrossFadeSettings::Calculate(SignedSongTime total_time,
if
(
mixramp_delay
<=
FloatDuration
::
zero
()
||
!
mixramp_start
||
!
mixramp_prev_end
)
{
chunks
=
std
::
lround
(
duration
/
chunk_duration
);
chunks
=
lround
(
duration
/
chunk_duration
);
}
else
{
/* Calculate mixramp overlap. */
const
auto
mixramp_overlap_current
=
...
...
src/util/Math.hxx
0 → 100644
View file @
e1c43ec6
/*
* Copyright (C) 2018 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MATH_HXX
#define MATH_HXX
#if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) && !defined(_GLIBCXX_USE_C99_MATH)
#include <boost/math/special_functions/round.hpp>
using
boost
::
math
::
lround
;
#else
#include <cmath>
using
std
::
lround
;
#endif
#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