mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
WIP music prefs
This commit is contained in:
parent
8053f5397f
commit
d4016aa084
3 changed files with 30 additions and 0 deletions
|
|
@ -220,6 +220,11 @@ inline fun AppPreferences.updateScreensaverPreferences(block: ScreensaverPrefere
|
||||||
screensaverPreference = screensaverPreference.toBuilder().apply(block).build()
|
screensaverPreference = screensaverPreference.toBuilder().apply(block).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline fun AppPreferences.updateMusicPreferences(block: MusicPreferences.Builder.() -> Unit): AppPreferences =
|
||||||
|
update {
|
||||||
|
musicPreferences = musicPreferences.toBuilder().apply(block).build()
|
||||||
|
}
|
||||||
|
|
||||||
fun SubtitlePreferences.Builder.resetSubtitles() {
|
fun SubtitlePreferences.Builder.resetSubtitles() {
|
||||||
fontSize = SubtitleSettings.FontSize.defaultValue.toInt()
|
fontSize = SubtitleSettings.FontSize.defaultValue.toInt()
|
||||||
fontColor = SubtitleSettings.FontColor.defaultValue.toArgb()
|
fontColor = SubtitleSettings.FontColor.defaultValue.toArgb()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.github.damontecres.wholphin.ui.detail.music
|
||||||
|
|
||||||
|
import com.github.damontecres.wholphin.R
|
||||||
|
import com.github.damontecres.wholphin.preferences.AppPreferences
|
||||||
|
import com.github.damontecres.wholphin.preferences.AppSwitchPreference
|
||||||
|
import com.github.damontecres.wholphin.preferences.updateMusicPreferences
|
||||||
|
|
||||||
|
fun getMusicPreferences() =
|
||||||
|
listOf(
|
||||||
|
AppSwitchPreference<AppPreferences>(
|
||||||
|
title = R.string.bold_font,
|
||||||
|
defaultValue = false,
|
||||||
|
getter = { it.musicPreferences.showAlbumArt },
|
||||||
|
setter = { prefs, value ->
|
||||||
|
prefs.updateMusicPreferences { showAlbumArt = value }
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
@ -178,6 +178,12 @@ message PhotoPreferences{
|
||||||
bool slideshow_play_videos = 2;
|
bool slideshow_play_videos = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message MusicPreferences {
|
||||||
|
bool show_lyrics = 1;
|
||||||
|
bool show_visualizer = 2;
|
||||||
|
bool show_album_Art = 3;
|
||||||
|
}
|
||||||
|
|
||||||
message AppPreferences {
|
message AppPreferences {
|
||||||
// The currently signed in server and user IDs, mostly for restoring a session
|
// The currently signed in server and user IDs, mostly for restoring a session
|
||||||
string current_server_id = 1;
|
string current_server_id = 1;
|
||||||
|
|
@ -194,4 +200,5 @@ message AppPreferences {
|
||||||
AdvancedPreferences advanced_preferences = 10;
|
AdvancedPreferences advanced_preferences = 10;
|
||||||
bool sign_in_automatically = 11;
|
bool sign_in_automatically = 11;
|
||||||
PhotoPreferences photo_preferences = 12;
|
PhotoPreferences photo_preferences = 12;
|
||||||
|
MusicPreferences music_preferences = 13;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue