From d0f9062b561632030ad73fcf91bd9d69af4c05e9 Mon Sep 17 00:00:00 2001 From: Tim Siegel Date: Sun, 5 Dec 2021 10:33:56 -0500 Subject: [PATCH 1/3] mpdconf.example: fix a few spelling typos --- doc/mpdconf.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/mpdconf.example b/doc/mpdconf.example index 9ef3b42ef..eaa5e6411 100644 --- a/doc/mpdconf.example +++ b/doc/mpdconf.example @@ -79,7 +79,7 @@ # This setting sets the address for the daemon to listen on. Careful attention # should be paid if this is assigned to anything other than the default, any. # This setting can deny access to control of the daemon. Not effective if -# systemd socket activiation is in use. +# systemd socket activation is in use. # # For network #bind_to_address "any" @@ -185,7 +185,7 @@ # cache_directory "~/.local/share/mpd/cache" #} # -# An example of database config for a sattelite setup +# An example of database config for a satellite setup # #music_directory "nfs://fileserver.local/srv/mp3" #database { From 4e276256c088694c5a009633ef4469233884312f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 23 Nov 2021 13:40:02 -0800 Subject: [PATCH 2/3] more braced init list conversion Signed-off-by: Rosen Penev --- src/LocateUri.cxx | 10 ++++------ src/lib/curl/Escape.cxx | 2 +- src/pcm/LibsamplerateResampler.cxx | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/LocateUri.cxx b/src/LocateUri.cxx index c534a6db7..716318097 100644 --- a/src/LocateUri.cxx +++ b/src/LocateUri.cxx @@ -48,15 +48,14 @@ LocateFileUri(const char *uri, const Client *client /* this path was relative to the music directory */ // TODO: don't use suffix.data() (ok for now because we know it's null-terminated) - return LocatedUri(LocatedUri::Type::RELATIVE, - suffix.data()); + return {LocatedUri::Type::RELATIVE, suffix.data()}; } #endif if (client != nullptr) client->AllowFile(path); - return LocatedUri(LocatedUri::Type::PATH, uri, std::move(path)); + return {LocatedUri::Type::PATH, uri, std::move(path)}; } static LocatedUri @@ -90,8 +89,7 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri const auto suffix = storage->MapToRelativeUTF8(uri); if (suffix.data() != nullptr) // TODO: don't use suffix.data() (ok for now because we know it's null-terminated) - return LocatedUri(LocatedUri::Type::RELATIVE, - suffix.data()); + return {LocatedUri::Type::RELATIVE, suffix.data()}; } if (kind == UriPluginKind::STORAGE && @@ -99,7 +97,7 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri throw std::invalid_argument("Unsupported URI scheme"); #endif - return LocatedUri(LocatedUri::Type::ABSOLUTE, uri); + return {LocatedUri::Type::ABSOLUTE, uri}; } LocatedUri diff --git a/src/lib/curl/Escape.cxx b/src/lib/curl/Escape.cxx index ab832eac9..e6912b6d7 100644 --- a/src/lib/curl/Escape.cxx +++ b/src/lib/curl/Escape.cxx @@ -60,7 +60,7 @@ CurlUnescape(CURL *curl, StringView src) noexcept int outlength; CurlString tmp(curl_easy_unescape(curl, src.data, src.size, &outlength)); - return std::string(tmp.c_str(), outlength); + return {tmp.c_str(), size_t(outlength)}; } std::string diff --git a/src/pcm/LibsamplerateResampler.cxx b/src/pcm/LibsamplerateResampler.cxx index 6b9c23d33..a09189163 100644 --- a/src/pcm/LibsamplerateResampler.cxx +++ b/src/pcm/LibsamplerateResampler.cxx @@ -140,8 +140,7 @@ LibsampleratePcmResampler::Resample2(ConstBuffer src) throw FormatRuntimeError("libsamplerate has failed: %s", src_strerror(result)); - return ConstBuffer(data.data_out, - data.output_frames_gen * channels); + return {data.data_out, size_t(data.output_frames_gen * channels)}; } ConstBuffer From bea821f1945484d3b99ec6339bf2017b0f1e117c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Dec 2021 21:14:04 +0100 Subject: [PATCH 3/3] doc/user.rst: add MixRamp documentation --- doc/protocol.rst | 8 +++++--- doc/user.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/doc/protocol.rst b/doc/protocol.rst index e2bb6466d..24f9fb80f 100644 --- a/doc/protocol.rst +++ b/doc/protocol.rst @@ -479,7 +479,7 @@ Querying :program:`MPD`'s status current song in seconds, but with higher resolution. - ``duration`` [#since_0_20]_: Duration of the current song in seconds. - ``bitrate``: instantaneous bitrate in kbps - - ``xfade``: ``crossfade`` in seconds + - ``xfade``: ``crossfade`` in seconds (see :ref:`crossfading`) - ``mixrampdb``: ``mixramp`` threshold in dB - ``mixrampdelay``: ``mixrampdelay`` in seconds - ``audio``: The format emitted by the decoder plugin during @@ -519,17 +519,19 @@ Playback options .. _command_crossfade: :command:`crossfade {SECONDS}` - Sets crossfading between songs. + Sets crossfading between songs. See :ref:`crossfading`. .. _command_mixrampdb: :command:`mixrampdb {deciBels}` - Sets the threshold at which songs will be overlapped. Like crossfading but doesn't fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See http://sourceforge.net/projects/mixramp + Sets the threshold at which songs will be overlapped. + See :ref:`mixramp`. .. _command_mixrampdelay: :command:`mixrampdelay {SECONDS}` Additional time subtracted from the overlap calculated by mixrampdb. A value of "nan" disables MixRamp overlapping and falls back to crossfading. + See :ref:`mixramp`. .. _command_random: diff --git a/doc/user.rst b/doc/user.rst index dda0d3cbf..a273def79 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -622,6 +622,51 @@ enabled by setting ``volume_normalization`` to ``yes``. It supports 16 bit PCM only. +.. _crossfading: + +Cross-Fading +------------ + +If ``crossfade`` is set to a positive number, then adjacent songs are +cross-faded by this number of seconds. This is a run-time setting +:ref:`which can be controlled by clients `, +e.g. with :program:`mpc`:: + + mpc crossfade 10 + mpc crossfade 0 + +Zero means cross-fading is disabled. + +Cross-fading is only possible if both songs have the same audio +format. At the cost of quality loss and higher CPU usage, you can +make sure this is always given by configuring +:ref:`audio_output_format`. + +.. _mixramp: + +MixRamp +^^^^^^^ + +MixRamp tags describe the loudness levels at start and end of a song +and can be used by MPD to find the best time to begin cross-fading. +MPD enables MixRamp if: + +- Cross-fade is enabled +- :ref:`mixrampdelay ` is set to a positive + value, e.g.:: + mpc mixrampdelay 1 +- :ref:`mixrampdb ` is set to a reasonable value, + e.g.:: + mpc mixrampdb -17 +- both songs have MixRamp tags +- both songs have the same audio format (or :ref:`audio_output_format` + is configured) + +The `MixRamp `__ tool can be +used to add MixRamp tags to your song files. + + + Client Connections ------------------