Пример #1
0
        private void PopulateInfo(MyMusicStage myMusicStage)
        {
            VGMStreamPlayer.StopCurrentVGMStreamPlayback();
            _CurrentMyMusicStage         = myMusicStage;
            _CurrentMyMusicStageOriginal = SoundEntryCollectionBackup.MyMusicStagesPerID[myMusicStage.MyMusicStageID];
            if (myMusicStage.BGMStage.BGMDBID != null)
            {
                _CurrentSoundDBStage               = SoundEntryCollection.SoundDBStagesPerID[(int)(myMusicStage.BGMStage.BGMDBID)];
                _CurrentSoundDBStageOriginal       = SoundEntryCollectionBackup.SoundDBStagesPerID[(int)(myMusicStage.BGMStage.BGMDBID)];
                _ListSoundDB.Enabled               = true;
                btnRestoreSoundDBStageList.Visible = true;
            }
            else
            {
                _CurrentSoundDBStage               = null;
                _CurrentSoundDBStageOriginal       = null;
                _ListSoundDB.Enabled               = false;
                btnRestoreSoundDBStageList.Visible = false;
            }

            lblMyMusicIDValue.Text = myMusicStage.MyMusicStageID.ToString();
            lblSoundDBIDValue.Text = myMusicStage.BGMStage.BGMDBID.ToString();

            _ListMyMusic.Items = myMusicStage.BGMs;
            if (_CurrentSoundDBStage != null)
            {
                _ListSoundDB.Items = _CurrentSoundDBStage.SoundEntries;
            }
            else
            {
                _ListSoundDB.Items = null;
            }
        }
Пример #2
0
        private void btnPlay_Click(object sender, EventArgs e)
        {
            if (_Player != null && _Reader != null && _Reader.FileLoaded)
            {
                //In case launching a new player, reset the old one
                if (_CurrentVGMStreamPlayer != null && _CurrentVGMStreamPlayer != this)
                {
                    StopCurrentVGMStreamPlayback();
                }

                if (_Player.PlaybackState == PlaybackState.Playing)
                {
                    _Player.Stop();
                    btnPlay.Image = Properties.Resources.icon_play;
                }
                else
                {
                    if (_CurrentVGMStreamPlayer == null)
                    {
                        _Player.Init(_Reader);
                    }
                    _Player.Play();
                    _Timer.Start();
                    _CurrentVGMStreamPlayer = this;
                    btnPlay.Image           = Properties.Resources.icon_stop;
                }
            }
        }
Пример #3
0
        private void txtBGM_TextChanged(object sender, EventArgs e)
        {
            TextBox         textAreaBGM     = (TextBox)sender;
            string          nameBGM         = textAreaBGM.Text;
            int             index           = Convert.ToInt32(textAreaBGM.Name.Replace("txtBGM", string.Empty));
            string          file            = "snd_bgm_" + nameBGM + ".nus3bank";
            VGMStreamPlayer vgmStreamPlayer = ((VGMStreamPlayer)(this.Controls.Find("playerBGM" + index, true)[0]));

            if (VGMStreamPlayer.CurrentVGMStreamPlayer == vgmStreamPlayer)
            {
                VGMStreamPlayer.StopCurrentVGMStreamPlayback();
            }
            Button buttonBGMAdvanced = (Button)(this.Controls.Find("btnBGMAdv" + index, true)[0]);

            file = SoundEntryCollection.GetBGMFullPath(file);
            if (!string.IsNullOrEmpty(file) && SoundEntryCollection.SoundEntriesBGMsPerName.ContainsKey(nameBGM))
            {
                vgmStreamPlayer.File = file;
                textAreaBGM.Tag      = SoundEntryCollection.SoundEntriesBGMsPerName[nameBGM];
                if (textAreaBGM.Tag == null)
                {
                    throw new Exception("Problem finding SoundEntryBGM");
                }
                buttonBGMAdvanced.Enabled = true;
            }
            else
            {
                vgmStreamPlayer.File      = null;
                vgmStreamPlayer.Enabled   = false;
                buttonBGMAdvanced.Enabled = false;
                textAreaBGM.Tag           = null;
            }

            if (_LoadingSound)
            {
                return;
            }

            //Update BGMFiles
            SoundEntryBGM mainBGM = _CurrentSoundEntry.BGMFiles[0];

            _CurrentSoundEntry.BGMFiles.Clear();
            for (int i = 1; i <= 5; i++)
            {
                TextBox txtBGM = (TextBox)(this.Controls.Find("txtBGM" + i, true)[0]);
                if (txtBGM.Tag != null)
                {
                    _CurrentSoundEntry.BGMFiles.Add(new SoundEntryBGM(SoundEntryCollection, _CurrentSoundEntry, ((BGMEntry)txtBGM.Tag).BGMID));
                }
                else if (i == 1)
                {
                    _CurrentSoundEntry.BGMFiles.Add(mainBGM);
                }
            }
        }
        private void RefreshVGMPlayer()
        {
            if (VGMStreamPlayer.CurrentVGMStreamPlayer == vgmStream)
            {
                VGMStreamPlayer.StopCurrentVGMStreamPlayback();
            }

            if (string.IsNullOrEmpty(_VGMStreamFile))
            {
                vgmStream.File = null;
            }
            else
            {
                vgmStream.File = _VGMStreamFile;
            }
        }
Пример #5
0
        public static void StopCurrentVGMStreamPlayback()
        {
            if (_CurrentVGMStreamPlayer == null)
            {
                return;
            }

            _CurrentVGMStreamPlayer._Reader.ResetVGM();
            _CurrentVGMStreamPlayer._Timer.Stop();
            _CurrentVGMStreamPlayer.lblTime.Text  = "00:00" + _CurrentVGMStreamPlayer._FormatTotalTime;
            _CurrentVGMStreamPlayer.btnPlay.Image = Properties.Resources.icon_play;
            if (_Player.PlaybackState == PlaybackState.Playing)
            {
                _Player.Stop();
                _Player.Dispose();
                _Player = new WaveOut();
            }
            _CurrentVGMStreamPlayer = null;
        }
Пример #6
0
        private void PopulateInfo(SoundEntry sEntry)
        {
            _LoadingSound = true;

            VGMStreamPlayer.StopCurrentVGMStreamPlayback();
            ClearBindings(this);

            _CurrentSoundEntry = sEntry;

            if (SoundEntryCollectionBackup.SoundEntriesPerID.ContainsKey(sEntry.SoundID))
            {
                _CurrentSoundEntryOriginal = SoundEntryCollectionBackup.SoundEntriesPerID[sEntry.SoundID];
                btnRestoreDBFile.Visible   = true;
                btnRestoreMSBT.Visible     = true;
            }
            else
            {
                _CurrentSoundEntryOriginal = null;
                btnRestoreDBFile.Visible   = false;
                btnRestoreMSBT.Visible     = false;
            }

            for (int i = 1; i <= 5; i++)
            {
                TextBox txtBGM = (TextBox)(this.Controls.Find("txtBGM" + i, true)[0]);
                if (sEntry.BGMFiles.Count >= i)
                {
                    txtBGM.Text = sEntry.BGMFiles[i - 1].BGMEntry.BGMTitle;
                }
                else
                {
                    txtBGM.Text = string.Empty;
                }
            }

            ddlSoundSource.SelectedItem          = _EnumSoundSource.FirstOrDefault(p => p.Value == (int)sEntry.SoundSource);
            ddlSoundMixType.SelectedItem         = _EnumSoundMixType.FirstOrDefault(p => p.Value == (int)sEntry.SoundMixType);
            ddlBackRotationBehavior.SelectedItem = _EnumBackgroundBehavior.FirstOrDefault(p => p.Value == (int)sEntry.SoundTestBackImageBehavior);
            ddlGroupStageCreation.SelectedItem   = _EnumIcons.FirstOrDefault(p => p.Value == (int)sEntry.StageCreationGroupID);
            if (ddlGroupStageCreation.SelectedItem == null)
            {
                ddlGroupStageCreation.SelectedIndex = 0;
            }
            ddlSoundIconID.SelectedItem = _EnumIcons.FirstOrDefault(p => p.Value == (int)sEntry.IconID);
            if (ddlSoundIconID.SelectedItem == null)
            {
                ddlSoundIconID.SelectedIndex = 0;
            }

            listCharacterBackgroundRotation.Items.Clear();
            foreach (string chara in sEntry.AssociatedFightersName)
            {
                listCharacterBackgroundRotation.Items.Add(chara);
            }

            txtOrderSoundTest.Text     = sEntry.SoundTestOrder.ToString();
            txtOrderStageCreation.Text = sEntry.StageCreationOrder.ToString();

            //Properties supporting binding
            txtTitle.DataBindings.Add("Text", sEntry, "Title");
            txtTitleSoundTest.DataBindings.Add("Text", sEntry, "SoundTestTitle");
            txtDescription.DataBindings.Add("Text", sEntry, "Description");
            txtDescription2.DataBindings.Add("Text", sEntry, "Description2");
            txtSource.DataBindings.Add("Text", sEntry, "Source");

            txtShort17.DataBindings.Add("Text", sEntry, "Int17");

            chkInSoundTest.DataBindings.Add("Checked", sEntry, "InSoundTest");
            chkUnknownByte2.DataBindings.Add("Checked", sEntry, "Byte2");
            chkUnknownByte3.DataBindings.Add("Checked", sEntry, "Byte3");
            chkUnknownByte4.DataBindings.Add("Checked", sEntry, "Byte4");
            chkRegionJPN.DataBindings.Add("Checked", sEntry, "InRegionJPN");
            chkRegionUSEUR.DataBindings.Add("Checked", sEntry, "InRegionEUUS");

            _LoadingSound = false;
        }