Exemple #1
0
        public List <string> ParseImageLocations()
        {
            List <String> output = new List <string>();

            if (!String.IsNullOrWhiteSpace(ImageLocations))
            {
                output.AddRange(ImageLocations.Split('|'));
            }
            return(output);
        }
Exemple #2
0
        public void Dispose(bool save)
        {
            if (save) Save();

            p_WindowHeight = 0;
            p_WindowWidth = 0;
            p_Volume = 0;
            p_Trigger = string.Empty;
            p_Silent = false;
            p_RightSeparator = string.Empty;
            p_LeftSeparator = string.Empty;
            p_RadioStations.Clear();
            p_PlayMode = 0;
            p_PlaylistURL = string.Empty;

            //foreach (UI.PlaylistItem item in p_Playlist)
            //{
                //item.Dispose();
            //}
            //p_Playlist.Clear();

            p_PlaylistFormat = string.Empty;
            p_OutputDevice = 0;
            p_Notifications = false;
            p_MusicFolder = string.Empty;
            p_MusicFilter = string.Empty;
            p_ImageQuality = ImageQualities.Low;
            p_ImageLocation = ImageLocations.None;
            p_GlobalCommands = false;

            p_URL = string.Empty;
        }
Exemple #3
0
        public bool Load(string url)
        {
            p_URL = url;

            if (!File.Exists(p_URL)) return false;

            try
            {
                XmlDocument xml = new XmlDocument();
                xml.Load(p_URL);
                XmlNode node = xml.SelectSingleNode("Steamp3.Settings");

                p_GlobalCommands = Global.StringToBool(Global.GetXmlValue(node.SelectSingleNode("GlobalCommands"), string.Empty, "1"), "1");
                p_ImageLocation = (ImageLocations)Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("Image"), "Location", "1"));
                p_ImageQuality = (ImageQualities)Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("Image"), "Quality", "1"));
                p_MusicFilter = Global.GetXmlValue(node.SelectSingleNode("Music"), "Filter", ".mp3;.m4a;.wav;.wma;.ogg;.flac");
                p_MusicFolder = Global.GetXmlValue(node.SelectSingleNode("Music"), "Folder", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic));
                p_Notifications = Global.StringToBool(Global.GetXmlValue(node.SelectSingleNode("Notifications"), string.Empty, "1"), "1");
                p_OutputDevice = Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("OutputDevice"), string.Empty, "0"));
                p_PlaylistFormat = Global.GetXmlValue(node.SelectSingleNode("Playlist"), "Format", "{Artist} - {Title}");
                //LoadPlaylist(node.SelectSingleNode("Playlist"));
                p_PlaylistURL = Global.GetXmlValue(node.SelectSingleNode("Playlist"), "URL", string.Empty);
                p_PlayMode = Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("PlayMode"), string.Empty, "1"));
                LoadRadioStations(node.SelectSingleNode("Radio"));
                p_LeftSeparator = Global.GetXmlValue(node.SelectSingleNode("Separator"), "Left", "[");
                p_RightSeparator = Global.GetXmlValue(node.SelectSingleNode("Separator"), "Right", "]");
                p_Silent = Global.StringToBool(Global.GetXmlValue(node.SelectSingleNode("Silent"), string.Empty, "0"), "1");
                p_Trigger = Global.GetXmlValue(node.SelectSingleNode("Trigger"), string.Empty, string.Empty);
                p_Volume = Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("Volume"), string.Empty, "100"));
                p_WindowWidth = Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("Window"), "Width", "680"));
                p_WindowHeight = Global.StringToInt(Global.GetXmlValue(node.SelectSingleNode("Window"), "Height", "472"));

                return true;
            }
            catch
            {
                return false;
            }
        }
Exemple #4
0
 public void Default()
 {
     //p_URL = string.Empty;
     p_GlobalCommands = true;
     p_ImageLocation = ImageLocations.LastFM;
     p_ImageQuality = ImageQualities.Medium;
     p_MusicFilter = ".mp3;.m4a;.wav;.wma;.ogg;.flac";
     p_MusicFolder = p_MusicFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
     p_Notifications = false;
     p_OutputDevice = 0;
     p_PlaylistFormat = "{Artist} - {Title}";
     //p_Playlist = new List<UI.PlaylistItem>();
     p_PlaylistURL = string.Empty;
     p_PlayMode = 1;
     p_RadioStations = new List<UI.Station>();
     p_LeftSeparator = "[";
     p_RightSeparator = "]";
     p_Silent = false;
     p_Trigger = string.Empty;
     p_Volume = 100;
     p_WindowWidth = 680;
     p_WindowHeight = 472;
 }