Exemplo n.º 1
0
        private void loadSongFromFile(string fileName)
        {
            this.CurrentSong = SongManager.LoadSong(fileName);

            if (this.currentSong.Patterns.Count > 0)
            {
                if (this.currentSong.PlayOrder.Count > 0)
                {
                    this.currentPattern = this.currentSong.Patterns[this.currentSong.PlayOrder[0]];
                }
                else
                {
                    this.currentPattern = this.currentSong.Patterns[0];
                }
            }

            this.songFileName = fileName;
            this.bindControls();

            if (this.currentSong.Effects.Count > 0)
            {
                this.lstFX.ClearSelected();
                this.lstFX.SelectedIndex = 0;
            }

            checkSawtoothExists();

            this.lstInstruments.ClearSelected();
            this.lstInstruments.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        private void initializeSong(bool defaultValues)
        {
            Pattern defaultPattern;
            Instrument defaultInstrument;

            this.Looped = true;

            if (defaultValues)
            {
                defaultPattern = new Pattern(this.channels);
                defaultPattern.Name = WYZTracker.Core.Properties.Resources.New;

                this.patterns.Add(defaultPattern);

                defaultInstrument = new Instrument();
                defaultInstrument.ID = "0";
                defaultInstrument.Name = WYZTracker.Core.Properties.Resources.Piano;
                defaultInstrument.SetVolumeLength(4);
                defaultInstrument.Looped = true;
                defaultInstrument.LoopStart = 3;
                defaultInstrument.Volumes[0] = 8;
                defaultInstrument.Volumes[1] = 7;
                defaultInstrument.Volumes[2] = 6;
                defaultInstrument.Volumes[3] = 5;

                this.Instruments.Add(defaultInstrument);

                defaultInstrument = new Instrument();
                defaultInstrument.ID = "R";
                defaultInstrument.Name = "Sawtooth";
                defaultInstrument.Looped = false;
                defaultInstrument.LoopStart = 0;
                this.Instruments.Add(defaultInstrument);

                this.mutedChannels = new bool[this.channels + 1];

                this.ChipFrequency = (int) LibAYEmu.ChipSpeedsByMachine.MSX;
                this.defaultMsxFreqs = true;
                this.parameterValue = this.chipFrequency;
            }
        }
Exemplo n.º 3
0
        private void initializeSong()
        {
            this.CurrentSong = new Song(Song.DEFAULT_CHANNELS_COUNT);
            this.currentSong.Name = WYZTracker.Properties.Resources.NewSong;
            this.currentSong.Tempo = 4;
            this.currentPattern = this.currentSong.Patterns[0];
            this.currentSong.PlayOrder.Add(0);
            this.currentSong.Frequencies = NoteFileLoader.LoadDefaultNotes();

            this.CurrentInstrument = this.currentSong.Instruments[0];
            this.CurrentEffect = null;
        }