diff options
Diffstat (limited to 'apps/dsp.c')
-rw-r--r-- | apps/dsp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index e0cea6d41b..ada16b0d89 100644 --- a/apps/dsp.c +++ b/apps/dsp.c | |||
@@ -26,16 +26,13 @@ | |||
26 | #include "dsp.h" | 26 | #include "dsp.h" |
27 | #include "eq.h" | 27 | #include "eq.h" |
28 | #include "kernel.h" | 28 | #include "kernel.h" |
29 | #include "playback.h" | ||
30 | #include "system.h" | 29 | #include "system.h" |
31 | #include "settings.h" | 30 | #include "settings.h" |
32 | #include "replaygain.h" | 31 | #include "replaygain.h" |
33 | #include "misc.h" | ||
34 | #include "tdspeed.h" | 32 | #include "tdspeed.h" |
35 | #include "buffer.h" | 33 | #include "buffer.h" |
36 | #include "fixedpoint.h" | 34 | #include "fixedpoint.h" |
37 | #include "fracmul.h" | 35 | #include "fracmul.h" |
38 | #include "pcmbuf.h" | ||
39 | 36 | ||
40 | /* Define LOGF_ENABLE to enable logf output in this file */ | 37 | /* Define LOGF_ENABLE to enable logf output in this file */ |
41 | /*#define LOGF_ENABLE*/ | 38 | /*#define LOGF_ENABLE*/ |
@@ -1479,6 +1476,20 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value) | |||
1479 | return 1; | 1476 | return 1; |
1480 | } | 1477 | } |
1481 | 1478 | ||
1479 | int get_replaygain_mode(bool have_track_gain, bool have_album_gain) | ||
1480 | { | ||
1481 | int type; | ||
1482 | |||
1483 | bool track = ((global_settings.replaygain_type == REPLAYGAIN_TRACK) | ||
1484 | || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) | ||
1485 | && global_settings.playlist_shuffle)); | ||
1486 | |||
1487 | type = (!track && have_album_gain) ? REPLAYGAIN_ALBUM | ||
1488 | : have_track_gain ? REPLAYGAIN_TRACK : -1; | ||
1489 | |||
1490 | return type; | ||
1491 | } | ||
1492 | |||
1482 | void dsp_set_replaygain(void) | 1493 | void dsp_set_replaygain(void) |
1483 | { | 1494 | { |
1484 | long gain = 0; | 1495 | long gain = 0; |