add crossfade to example
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 7 Jul 2022 21:23:05 +0000 (23:23 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 7 Jul 2022 21:23:05 +0000 (23:23 +0200)
examples/full.py

index c4d62e699026f694acb32b2a521db78b38f1ca55..592ea29259a654025f2308f2cc45f7e4a9c0f066 100644 (file)
@@ -13,7 +13,12 @@ path.insert(1, dirname(dirname(abspath(__file__))))
 # pylint: disable=wrong-import-position
 from music_assistant.mass import MusicAssistant
 from music_assistant.models.config import MassConfig, MusicProviderConfig
-from music_assistant.models.enums import ProviderType, RepeatMode, PlayerState
+from music_assistant.models.enums import (
+    CrossFadeMode,
+    ProviderType,
+    RepeatMode,
+    PlayerState,
+)
 from music_assistant.models.player import Player
 
 
@@ -218,6 +223,8 @@ async def main():
         # try to play some music
         test_player1.active_queue.settings.shuffle_enabled = True
         test_player1.active_queue.settings.repeat_mode = RepeatMode.ALL
+        test_player1.active_queue.settings.crossfade_duration = 10
+        test_player1.active_queue.settings.crossfade_mode = CrossFadeMode.SMART
 
         # we can send a MediaItem object (such as Artist, Album, Track, Playlist)
         # we can also send an uri, such as spotify://track/abcdfefgh