From 0bd3b7265203aec5678400341e1b3ede55ba6024 Mon Sep 17 00:00:00 2001 From: Max Bechtold Date: Thu, 27 Jun 2019 19:33:11 +0200 Subject: [PATCH] Mark entry point to allow volume adjustment per feed --- .../antennapod/core/service/playback/LocalPSMP.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 9a8353806..9c24e2f76 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -25,6 +25,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.ReentrantLock; +import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.feed.FeedPreferences; import de.danoeh.antennapod.core.feed.MediaType; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.util.RewindAfterPauseUtils; @@ -311,6 +313,17 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { UserPreferences.setPlaybackSpeed(String.valueOf(speed)); } setPlaybackParams(speed, UserPreferences.isSkipSilence()); + // TODO MAX Here and everywhere else volume is adapted + Playable playable = getPlayable(); + if (playable instanceof FeedMedia) { + FeedMedia feedMedia = (FeedMedia) playable; + FeedPreferences preferences = feedMedia.getItem().getFeed().getPreferences(); + + // TODO MAX Check if this feed should have volume adjusted (e.g. louder than others) + + + } + setVolume(UserPreferences.getLeftVolume(), UserPreferences.getRightVolume()); if (playerStatus == PlayerStatus.PREPARED && media.getPosition() > 0) {