From 7ae34d6c08292aad4203d7525df52d3c3eae49a7 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Mon, 5 Mar 2012 17:02:35 +0100 Subject: [PATCH] Some code cleanup --- Vocaluxe/Base/CBackgroundMusic.cs | 18 +++++------------- Vocaluxe/Base/CSettings.cs | 5 +++++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index ba8866bf..20203e29 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -31,22 +31,14 @@ namespace Vocaluxe.Base public static void Init() { - foreach(string path in Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.mp3", true, true)) + List templist = new List(); + + foreach(string ending in CSettings.MusicFileTypes) { - _BGMusicFileNames.Add(new PlaylistElement(path)); + templist.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, ending, true, true)); } - foreach(string path in Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.ogg", true, true)) - { - _BGMusicFileNames.Add(new PlaylistElement(path)); - } - - foreach(string path in Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wma", true, true)) - { - _BGMusicFileNames.Add(new PlaylistElement(path)); - } - - foreach(string path in Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wav", true, true)) + foreach (string path in templist) { _BGMusicFileNames.Add(new PlaylistElement(path)); } diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index bbd6164f..24ffda63 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -111,6 +111,11 @@ namespace Vocaluxe.Base public static bool TabNavigation = false; public const float BackgroundMusicFadeTime = 0.5f; + + public static List MusicFileTypes = new List() + { + "*.mp3","*.wma","*.ogg","*.wav" + }; public static string GetVersionText() {