Beispiel #1
0
        public void readNoteLengthsFromFile(Dictionary <string, string> parsed_file)
        {
            var dict = new Dictionary <NoteLength, int>();

            foreach (var entry in parsed_file)
            {
                dict.Add(NoteLengthExtensions.getNoteLengthFromString(entry.Key), int.Parse(parsed_file[entry.Key]));
            }
            note_lengths = dict;
        }
Beispiel #2
0
        public Dictionary <NoteLength, string> getRestImagePaths(Dictionary <string, string> file_names)
        {
            var image_dict = new Dictionary <NoteLength, string>();

            foreach (string length_name in file_names.Keys)
            {
                NoteLength length = NoteLengthExtensions.getNoteLengthFromString(length_name);
                image_dict.Add(length, file_names[length_name]);
            }

            return(image_dict);
        }
Beispiel #3
0
        public Dictionary <NoteLength, ImageBrush> getLengthImages(Dictionary <string, string> uri_dict)
        {
            var image_dict = new Dictionary <NoteLength, ImageBrush>();

            foreach (var entry in uri_dict)
            {
                NoteLength length = NoteLengthExtensions.getNoteLengthFromString(entry.Key);
                var        brush  = new ImageBrush();
                brush.ImageSource = SettingsReader.getImageFromLocation(entry.Value);

                image_dict[length] = brush;
            }

            return(image_dict);
        }
        public Dictionary <NoteLength, ImageBrush> getLengthImages(Dictionary <string, string> uri_dict)
        {
            var needed_lengths = new List <NoteLength>()
            {
                NoteLength.Half, NoteLength.Quarter, NoteLength.Eighth, NoteLength.Sixeteenth, NoteLength.ThirtySecond
            };
            var image_dict = new Dictionary <NoteLength, ImageBrush>();

            foreach (var entry in uri_dict)
            {
                NoteLength length = NoteLengthExtensions.getNoteLengthFromString(entry.Key);
                if (needed_lengths.Contains(length))
                {
                    var brush = new ImageBrush();
                    brush.ImageSource = SettingsReader.getImageFromLocation(entry.Value);

                    image_dict[length] = brush;
                }
            }

            return(image_dict);
        }