Пример #1
0
        private void loadSelectedTrack()
        {
            string selectedFilePath;
            ListBoxFileInfoObject listBoxFile;

            if (lbFiles.SelectedIndices.Count == 1)
            {
                listBoxFile      = (ListBoxFileInfoObject)(this.lbFiles.Items[this.lbFiles.SelectedIndex]);
                selectedFilePath = listBoxFile.FilePath;

                using (FileStream fs =
                           File.Open(selectedFilePath, FileMode.Open, FileAccess.Read))
                {
                    Type formatType = FormatUtil.getObjectType(fs);
                    if (formatType != null)
                    {
                        this.vgmData = (IGd3TagFormat)Activator.CreateInstance(formatType);
                        this.vgmData.Initialize(fs, selectedFilePath);

                        this.tbGameEn.Text   = this.vgmData.GetGameTagEn();
                        this.tbGameJp.Text   = this.vgmData.GetGameTagJp();
                        this.cbSystemEn.Text = this.vgmData.GetSystemTagEn();
                        this.cbSystemJp.Text = this.vgmData.GetSystemTagJp();
                        this.tbArtistEn.Text = this.vgmData.GetArtistTagEn();
                        this.tbArtistJp.Text = this.vgmData.GetArtistTagJp();
                        this.tbGameDate.Text = this.vgmData.GetDateTag();
                        this.tbRipper.Text   = this.vgmData.GetRipperTag();
                        this.tbTitleEn.Text  = this.vgmData.GetTitleTagEn();
                        this.tbTitleJp.Text  = this.vgmData.GetTitleTagJp();
                        this.tbComments.Text = this.vgmData.GetCommentTag();
                    }
                }
            }
        }
Пример #2
0
        private void loadCurrentTagInformation()
        {
            using (FileStream fs =
                       File.Open(this.nodeTagInfo.FilePath, FileMode.Open, FileAccess.Read))
            {
                this.vgmData =
                    (IGd3TagFormat)Activator.CreateInstance(Type.GetType(this.nodeTagInfo.ObjectType));

                this.vgmData.Initialize(fs, this.nodeTagInfo.FilePath);

                this.tbGameEn.Text   = this.vgmData.GetGameTagEn();
                this.tbGameJp.Text   = this.vgmData.GetGameTagJp();
                this.cbSystemEn.Text = this.vgmData.GetSystemTagEn();
                this.cbSystemJp.Text = this.vgmData.GetSystemTagJp();
                this.tbArtistEn.Text = this.vgmData.GetArtistTagEn();
                this.tbArtistJp.Text = this.vgmData.GetArtistTagJp();
                this.tbGameDate.Text = this.vgmData.GetDateTag();
                this.tbRipper.Text   = this.vgmData.GetRipperTag();
                this.tbTitleEn.Text  = this.vgmData.GetTitleTagEn();
                this.tbTitleJp.Text  = this.vgmData.GetTitleTagJp();
                this.tbComments.Text = this.vgmData.GetCommentTag();
            }
        }
Пример #3
0
        protected override void DoTaskForFile(string pPath,
                                              IVgmtWorkerStruct pVgmTagUpdaterStruct, DoWorkEventArgs e)
        {
            VgmTagUpdaterStruct vgmTagUpdaterStruct = (VgmTagUpdaterStruct)pVgmTagUpdaterStruct;

            Type          formatType = null;
            IGd3TagFormat vgmData    = null;

            using (FileStream fs = File.OpenRead(pPath))
            {
                formatType = FormatUtil.getObjectType(fs);
                if (formatType != null)
                {
                    vgmData = (IGd3TagFormat)Activator.CreateInstance(formatType);
                    vgmData.Initialize(fs, pPath);
                }
            }

            if (vgmData != null)
            {
                if (vgmTagUpdaterStruct.DoGameTagEn)
                {
                    vgmData.SetGameTagEn(vgmTagUpdaterStruct.GameTagEn);
                }

                if (vgmTagUpdaterStruct.DoGameTagJp)
                {
                    vgmData.SetGameTagJp(vgmTagUpdaterStruct.GameTagJp);
                }

                if (vgmTagUpdaterStruct.DoSystemTagEn)
                {
                    vgmData.SetSystemTagEn(vgmTagUpdaterStruct.SystemTagEn);
                }

                if (vgmTagUpdaterStruct.DoSystemTagJp)
                {
                    vgmData.SetSystemTagJp(vgmTagUpdaterStruct.SystemTagJp);
                }

                if (vgmTagUpdaterStruct.DoArtistTagEn)
                {
                    vgmData.SetArtistTagEn(vgmTagUpdaterStruct.ArtistTagEn);
                }

                if (vgmTagUpdaterStruct.DoArtistTagJp)
                {
                    vgmData.SetArtistTagJp(vgmTagUpdaterStruct.ArtistTagJp);
                }

                if (vgmTagUpdaterStruct.DoDateTag)
                {
                    vgmData.SetDateTag(vgmTagUpdaterStruct.DateTag);
                }

                if (vgmTagUpdaterStruct.DoRipperTag)
                {
                    vgmData.SetRipperTag(vgmTagUpdaterStruct.RipperTag);
                }

                if (vgmTagUpdaterStruct.DoCommentTag)
                {
                    vgmData.SetCommentTag(vgmTagUpdaterStruct.CommentTag);
                }

                if (vgmTagUpdaterStruct.DoTitleTagEn)
                {
                    vgmData.SetTitleTagEn(vgmTagUpdaterStruct.TitleTagEn);
                }

                if (vgmTagUpdaterStruct.DoTitleTagJp)
                {
                    vgmData.SetTitleTagJp(vgmTagUpdaterStruct.TitleTagJp);
                }

                vgmData.UpdateTags();
            }
        }