Skip to content

Commit 0433742

Browse files
Merge pull request #8 from darrell-k/master
2 parents d9cde23 + 2a4dde2 commit 0433742

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

HTML/EN/plugins/DSDPlayer/settings/player.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@
8282
</select>
8383
[% END %]
8484

85+
[% WRAPPER settingGroup title="PLUGIN_DSDPLAYER_GAIN" desc="PLUGIN_DSDPLAYER_GAIN_DESC" %]
86+
<select class="stdedit" name="pref_gain" id="gain">
87+
[% FOREACH option = {
88+
'0' => '0 dB',
89+
'1' => '1 dB',
90+
'2' => '2 dB',
91+
'3' => '3 dB',
92+
'4' => '4 dB',
93+
'5' => '5 dB',
94+
'6' => '6 dB',
95+
} %]
96+
<option [% IF prefs.gain == option.key %]selected [% END %]value="[% option.key %]">
97+
[% option.value %]
98+
</option>
99+
[%- END -%]
100+
</select>
101+
[% END %]
102+
85103
[% WRAPPER settingGroup title="PLUGIN_DSDPLAYER_OTHER" desc="PLUGIN_DSDPLAYER_OTHER_DESC" %]
86104
<div class="input">
87105
<input class="input" type="text" name="pref_flags" value="[% prefs.flags %]" placeholder="Flags" id="flags" />

PlayerSettings.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ sub handler {
3535
if ($params->{'saveSettings'}) {
3636

3737
$prefs->client($client)->set('usedop', $params->{'pref_usedop'} || 0);
38+
$prefs->client($client)->set('gain', $params->{'pref_gain'} || 0);
3839

3940
my $quality= $params->{'pref_quality'} || "";
4041
my $filter = $params->{'pref_filter'} || "";
@@ -48,7 +49,8 @@ sub handler {
4849

4950
$prefs->client($client)->set('resample', "$quality$filter$steep:$flags:$att:$precision:$end:$start:$phase");
5051

51-
$log->debug("usdop: " . $params->{'pref_usedop'});
52+
$log->debug("usedop: " . $params->{'pref_usedop'});
53+
$log->debug("gain: " . $params->{'pref_gain'});
5254
$log->debug("resample: $quality$filter$steep:$flags:$att:$precision:$end:$start:$phase");
5355

5456
Plugins::DSDPlayer::Plugin::setupTranscoder($client);
@@ -61,6 +63,7 @@ sub handler {
6163
$params->{'dopavail'} = $client->maxSupportedSamplerate >= 176400 ? 1 : 0;
6264

6365
$params->{'prefs'}->{'usedop'} = $prefs->client($client)->get('usedop');
66+
$params->{'prefs'}->{'gain'} = $prefs->client($client)->get('gain');
6467

6568
my $resample = $prefs->client($client)->get('resample');
6669
my ($recipe, $flags, $att, $precision, $end, $start, $phase) = split(":", $resample);

Plugin.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ sub setupTranscoder {
3131

3232
my $usedop = $prefs->client($client)->get('usedop');
3333
my $resample = $prefs->client($client)->get('resample') || "::::::";
34+
my $gain = $prefs->client($client)->get('gain');
3435

3536
my $cmdTable = "[dsdplay] -R $resample " . '$START$ $END$ $RESAMPLE$ $FILE$';
37+
$cmdTable .= " | [sox] -q -t flac - -t flac -C 0 - gain -l $gain" if $gain;
3638
my $cmdTableDoP = "[dsdplay] -R $resample -u " . '$START$ $END$ $RESAMPLE$ $FILE$';
3739
my $capabilities = { F => 'noArgs', T => 'START=-s %t', U => 'END=-e %v', D => 'RESAMPLE=-r %d' };
3840

strings.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ PLUGIN_DSDPLAYER_OTHER
7070
EN Other Params
7171

7272
PLUGIN_DSDPLAYER_OTHER_DESC
73-
EN Specifiy additional parameters for soxr resampling.
73+
EN Specify additional parameters for soxr resampling.
7474

7575
PLUGIN_DSDPLAYER_NONE
7676
EN (none selected)
7777

78+
PLUGIN_DSDPLAYER_GAIN
79+
EN Add gain
80+
81+
PLUGIN_DSDPLAYER_GAIN_DESC
82+
EN Many DSD/DSF files (especially SACD rips) are mastered to a peak of -6dB. This makes their volume low compared to other files. You can increase the level when resampling to PCM. If your chosen gain introduces audible distortion for any of your files, reduce it.

0 commit comments

Comments
 (0)