/* Initialize a MidiOptions from the section properties of an INI text file */
        public MidiOptions(SectionINI section)
        {
            title    = section.Section;
            filename = section.GetString("filename");
            tracks   = section.GetBoolArray("tracks");
            mute     = section.GetBoolArray("mute");
            if (mute != null && section.Properties["version"] == "2.5.0")
            {
                // MidiSheetMusic 2.5 stored the mute value incorrectly
                for (int i = 0; i < mute.Length; i++)
                {
                    mute[i] = false;
                }
            }

            instruments = section.GetIntArray("instruments");
            int[] timesig = section.GetIntArray("time");
            if (timesig != null && timesig.Length == 4)
            {
                time = new TimeSignature(timesig[0], timesig[1], timesig[2], timesig[3]);
            }
            useDefaultInstruments = section.GetBool("useDefaultInstruments");
            scrollVert            = section.GetBool("scrollVert");
            smoothScroll          = section.GetBool("smoothScroll");
            largeNoteSize         = section.GetBool("largeNoteSize");
            showLyrics            = section.GetBool("showLyrics");
            twoStaffs             = section.GetBool("twoStaffs");
            showNoteLetters       = section.GetInt("showNoteLetters");
            transpose             = section.GetInt("transpose");
            key                     = section.GetInt("key");
            combineInterval         = section.GetInt("combineInterval");
            showMeasures            = section.GetBool("showMeasures");
            playMeasuresInLoop      = section.GetBool("playMeasuresInLoop");
            playMeasuresInLoopStart = section.GetInt("playMeasuresInLoopStart");
            playMeasuresInLoopEnd   = section.GetInt("playMeasuresInLoopEnd");

            Color color = section.GetColor("shadeColor");

            if (color != Color.White)
            {
                shadeColor = color;
            }
            color = section.GetColor("shade2Color");
            if (color != Color.White)
            {
                shade2Color = color;
            }
            colors = section.GetColorArray("colors");
        }
Beispiel #2
0
        /* Initialize a MidiOptions from the section properties of an INI text file */
        public MidiOptions(SectionINI section)
        {
            tracks      = section.GetBoolArray("tracks");
            mute        = section.GetBoolArray("mute");
            instruments = section.GetIntArray("instruments");
            int[] timesig = section.GetIntArray("time");
            if (timesig != null && timesig.Length == 4)
            {
                time = new TimeSignature(timesig[0], timesig[1], timesig[2], timesig[3]);
            }
            useDefaultInstruments = section.GetBool("useDefaultInstruments");
            scrollVert            = section.GetBool("scrollVert");
            largeNoteSize         = section.GetBool("largeNoteSize");
            showLyrics            = section.GetBool("showLyrics");
            twoStaffs             = section.GetBool("twoStaffs");
            showNoteLetters       = section.GetInt("showNoteLetters");
            transpose             = section.GetInt("transpose");
            key                     = section.GetInt("key");
            combineInterval         = section.GetInt("combineInterval");
            showMeasures            = section.GetBool("showMeasures");
            playMeasuresInLoop      = section.GetBool("playMeasuresInLoop");
            playMeasuresInLoopStart = section.GetInt("playMeasuresInLoopStart");
            playMeasuresInLoopEnd   = section.GetInt("playMeasuresInLoopEnd");

            Color color = section.GetColor("shadeColor");

            if (color != Color.White)
            {
                shadeColor = color;
            }
            color = section.GetColor("shade2Color");
            if (color != Color.White)
            {
                shade2Color = color;
            }
            colors = section.GetColorArray("colors");
        }