예제 #1
0
        public void ApplyKeySignature()
        {
            KeySignature temp = Parameters.KeySignature;

            Parameters.KeySignature = LayoutController.StringToEnum <KeySignature>(keySignature + "Maj");
            geneticSong.ApplyKeySignature(keySignature);
            Parameters.KeySignature = temp;
            int defaultNumberElem = ScoreStaffs.defaultNumberElem;

            for (int i = 0; i < scores.Count; i++)
            {
                ScoreStaffs ss   = scores[i];
                Grid        grid = (Grid)ss.borderStaff.Child;
                grid.Children.RemoveRange(defaultNumberElem, grid.Children.Count - defaultNumberElem);
                ss.setContent(geneticSong.songGenomes[i]);
                ss.AddTempoInfo(geneticSong.tempos[i].ToString());
                ss.AddIndexTag(i + 1);
            }

            foreach (WrapPanel wp in keySignatures)
            {
                ((Image)wp.Children[0]).Source = LayoutController.GetKeySignature(keySignature, Clefs[0].ToString());
                ((Image)wp.Children[1]).Source = LayoutController.GetKeySignature(keySignature, Clefs[1].ToString());
            }

            MarkSavedScore(true);
        }
예제 #2
0
        private void ChangeKeySignature(string Name)
        {
            int i = 0;

            while (i < keySignatureTags.Count)
            {
                ((Image)fieldGrid.Children[keySignatureTags[i++]]).Source = LayoutController.GetKeySignature(Name, Parameters.Clefs[0].ToString());
                ((Image)fieldGrid.Children[keySignatureTags[i++]]).Source = LayoutController.GetKeySignature(Name, Parameters.Clefs[1].ToString());
            }
        }
예제 #3
0
        /// <summary>
        /// Gets the formatted image of the key signature corresponding to the index-th part.
        /// NOTE: The first part has index 0.
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Clef"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public static Image DrawKeySignature(string Name, Clef Clef, byte index)
        {
            Image image = new Image();

            image.Source            = LayoutController.GetKeySignature(Name, Clef.ToString());
            image.VerticalAlignment = VerticalAlignment.Top;
            image.Width             = 60;
            image.Margin            = new Thickness(0, LayoutController.KeySignatureTopMargin[index], 0, 0);

            return(image);
        }
예제 #4
0
        public void UpdateFieldOctave(byte partIndex)
        {
            UpdatePopulation();

            int i = partIndex;

            while (i < keySignatureTags.Count)
            {
                ((Image)fieldGrid.Children[keySignatureTags[i]]).Source = LayoutController.GetKeySignature(KeySignatureAccidental, Parameters.Clefs[partIndex].ToString());
                i += 2;
            }

            MarkSavedField();
        }