/// <summary> /// Вызывается при срабатывании таймера смены темы. /// </summary> private void ThemeTimer_Tick(object sender, object e) { if (DefaultTheme == PlayerTheme.None) { PlayerTheme theme = BackgroundTheme; while (theme == BackgroundTheme) { theme = (PlayerTheme)RandomFactory.Next(1, SubstrateColorsCount + 1); } BackgroundTheme = theme; ChangeElementsColor(); } if (!NoAlbums) { if (--albumsGridCounter == 0) { albumsGridCounter = 2; GoToAlbumsGridState(); } else { CancelAlbumsGridState(); } } }
/// <summary> /// Сменяет тему проигрывателя. /// </summary> public void NextTheme() { ThemeTimer.Stop(); albumsGridCounter = 1; CancelAlbumsGridState(); if (DefaultTheme == PlayerTheme.None) { PlayerTheme theme = BackgroundTheme; while (theme == BackgroundTheme) { theme = (PlayerTheme)RandomFactory.Next(1, SubstrateColorsCount + 1); } BackgroundTheme = theme; } else { BackgroundTheme = DefaultTheme; } if (DefaultShapesType == PlayerShapesType.None) { PlayerShapesType type = Type; while (type == Type) { type = (PlayerShapesType)RandomFactory.Next(1, ShapeTypesCount); } Type = type; } else { Type = DefaultShapesType; } ThemeTimer.Start(); }