예제 #1
0
 private void SaveDTA(SongsDTA dta)
 {
     HarmonixMetadata.SetSongsDTA(Song, dta.ToDTB());
 }
예제 #2
0
        private SongsDTA GetOrCreateDTA()
        {
            SongsDTA dta = HarmonixMetadata.GetSongsDTA(Song);

            return(dta ?? new SongsDTA());
        }
예제 #3
0
        private void EditForm_Load(object sender, EventArgs e)
        {
            SongData song = Data.Song;

            if (!Writable)
            {
                IdText.ReadOnly        = true;
                NameText.ReadOnly      = true;
                ArtistText.ReadOnly    = true;
                AlbumText.ReadOnly     = true;
                TrackNumeric.Enabled   = false;
                YearNumeric.Enabled    = false;
                GenreCombo.Enabled     = false;
                VocalistCombo.Enabled  = false;
                MasterCheckbox.Enabled = false;

                HopoNumeric.Enabled         = false;
                CharterText.Enabled         = false;
                PackText.ReadOnly           = true;
                VersionNumeric.Enabled      = false;
                PreviewStartNumeric.Enabled = false;
                PreviewEndNumeric.Enabled   = false;

                AnimationTempoCombo.Enabled = false;
                ScrollSpeedNumeric.Enabled  = false;
                BankCombo.Enabled           = false;

                BandTierNumeric.Enabled   = false;
                GuitarTierNumeric.Enabled = false;
                DrumsTierNumeric.Enabled  = false;
                VocalsTierNumeric.Enabled = false;
                BassTierNumeric.Enabled   = false;

                ReplaceChartButton.Enabled = false;

                ReplaceAudioButton.Enabled = false;
            }

            // Song Info
            IdText.Text            = song.ID;
            NameText.Text          = song.Name;
            ArtistText.Text        = song.Artist;
            AlbumText.Text         = song.Album;
            TrackNumeric.Value     = song.AlbumTrack;
            YearNumeric.Value      = song.Year;
            GenreCombo.Text        = song.TidyGenre;
            VocalistCombo.Text     = song.Vocalist;
            MasterCheckbox.Checked = song.Master;
            Bitmap albumart = song.AlbumArt;

            if (albumart != null)
            {
                AlbumArt.Image = albumart;
            }
            else
            {
                AlbumArt.Image = Program.Form.AlbumImage;
            }

            // Engine Data
            HopoNumeric.Value         = song.HopoThreshold;
            CharterText.Text          = song.Charter;
            PackText.Text             = song.Pack;
            VersionNumeric.Value      = song.Version;
            PreviewStartNumeric.Value = song.PreviewTimes[0];
            PreviewEndNumeric.Value   = song.PreviewTimes[1];

            // RB2 Data
            SongsDTA dta = HarmonixMetadata.GetSongsDTA(song);

            if (dta != null)
            {
                ScrollSpeedNumeric.Value = dta.SongScrollSpeed;
                switch (dta.AnimTempo)
                {
                case 0x10:
                    AnimationTempoCombo.SelectedIndex = 0;
                    break;

                case 0x20:
                    AnimationTempoCombo.SelectedIndex = 1;
                    break;

                case 0x40:
                    AnimationTempoCombo.SelectedIndex = 2;
                    break;

                default:
                    throw new FormatException();
                }
                switch (dta.Bank)
                {
                case "sfx/tambourine_bank.milo":
                    BankCombo.SelectedIndex = 0;
                    break;

                case "sfx/cowbell_bank.milo":
                    BankCombo.SelectedIndex = 1;
                    break;

                case "sfx/triangle_bank.milo":
                    BankCombo.SelectedIndex = 2;
                    break;

                case "sfx/handclap_bank.milo":
                    BankCombo.SelectedIndex = 3;
                    break;

                default:
                    throw new FormatException();
                }
            }
            BandTierNumeric.Value   = song.Difficulty[Instrument.Ambient];
            GuitarTierNumeric.Value = song.Difficulty[Instrument.Guitar];
            DrumsTierNumeric.Value  = song.Difficulty[Instrument.Drums];
            VocalsTierNumeric.Value = song.Difficulty[Instrument.Vocals];
            BassTierNumeric.Value   = song.Difficulty[Instrument.Bass];

            UpdateChartSizes();

            UpdateAudioSizes();

            Song = song;
        }