summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Greenslade <sean@seangreenslade.com>2017-03-14 19:36:24 -0700
committerMichał Cichoń <michcic@gmail.com>2017-05-17 04:37:39 +0200
commitc934c373e16acc7b7db6a374b1047649a0875dc3 (patch)
tree0a22ba27e4da52e99647955bbe9bacb1fb4fcae4
parentf3ccc0628f3340e1f77eb38084ece2521db9d737 (diff)
downloadpianobar-windows-c934c373e16acc7b7db6a374b1047649a0875dc3.tar.gz
pianobar-windows-c934c373e16acc7b7db6a374b1047649a0875dc3.tar.bz2
pianobar-windows-c934c373e16acc7b7db6a374b1047649a0875dc3.zip
Added gain_mul setting to soften effect of replaygain.
-rw-r--r--contrib/pianobar.16
-rw-r--r--src/main.c3
-rw-r--r--src/settings.c3
-rw-r--r--src/settings.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/contrib/pianobar.1 b/contrib/pianobar.1
index 910af9a..0619735 100644
--- a/contrib/pianobar.1
+++ b/contrib/pianobar.1
@@ -366,6 +366,12 @@ Your pandora.com username.
.B volume = 0
Initial volume correction in dB. Usually between -30 and +5.
+.TP
+.B gain_mul = 1.0
+Pandora sends a ReplayGain value with every song. This sets a multiplier so that the gain adjustment can be
+reduced. 0.0 means no gain adjustment, 1.0 means full gain adjustment, values inbetween reduce the magnitude
+of gain adjustment.
+
.SH REMOTE CONTROL
.B pianobar
can be controlled through a fifo. You have to create it yourself by executing
diff --git a/src/main.c b/src/main.c
index 3e6e85f..4f4214a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -31,6 +31,7 @@ THE SOFTWARE.
#include "ui.h"
#include "ui_dispatch.h"
#include "ui_readline.h"
+#include "settings.h"
/* authenticate user
*/
@@ -238,7 +239,7 @@ static void BarMainStartPlayback(BarApp_t *app)
}
else
{
- BarPlayer2SetGain(app->player, curSong->fileGain);
+ BarPlayer2SetGain(app->player, curSong->fileGain * app->settings.gainMul);
BarPlayer2Open(app->player, curSong->audioUrl);
/* throw event */
diff --git a/src/settings.c b/src/settings.c
index b15053d..4f0ef8c 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -172,6 +172,7 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->autoselect = true;
settings->history = 5;
settings->volume = 0;
+ settings->gainMul = 1.0;
settings->maxPlayerErrors = 5;
settings->sortOrder = BAR_SORT_NAME_AZ;
settings->loveIcon = strdup (" <3");
@@ -378,6 +379,8 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->atIcon = strdup (val);
} else if (streq ("volume", key)) {
settings->volume = atoi (val);
+ } else if (streq ("gain_mul", key)) {
+ settings->gainMul = (float)atof (val);
} else if (streq ("format_nowplaying_song", key)) {
free (settings->npSongFormat);
settings->npSongFormat = strdup (val);
diff --git a/src/settings.h b/src/settings.h
index e6067f3..f8225ce 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -87,6 +87,7 @@ typedef struct {
bool autoselect;
unsigned int history, maxPlayerErrors;
int volume;
+ float gainMul;
BarStationSorting_t sortOrder;
PianoAudioQuality_t audioQuality;
char *username;