Ejemplo n.º 1
0
        public void Load(Stream stream)
        {
            CanSave = true;

            Text = FileName;

            bars = new BarsLib.BARS(stream);

            if (bars.HasMetaData)
            {
                Nodes.Add("Meta Data");
            }

            if (bars.HasAudioFiles)
            {
                Nodes.Add(new AudioFolder("Audio"));
            }

            for (int i = 0; i < bars.AudioEntries.Count; i++)
            {
                var amtaWrapper = new MetaDataNodeWrapper(bars.AudioEntries[i].MetaData);
                amtaWrapper.ImageKey         = "MetaInfo";
                amtaWrapper.SelectedImageKey = amtaWrapper.ImageKey;

                string audioName = bars.AudioEntries[i].MetaData.Name;

                amtaWrapper.Text = $"{audioName}.amta";
                Nodes[0].Nodes.Add(amtaWrapper);

                if (bars.AudioEntries[i].AudioFile != null)
                {
                    BARSAudioFile audio = bars.AudioEntries[i].AudioFile;

                    AudioEntry node = new AudioEntry();
                    node.audioFile = audio;
                    node.Magic     = audio.Magic;
                    node.SetupMusic();

                    if (audio.Magic == "FWAV")
                    {
                        node.Text = audioName + ".bfwav";
                    }
                    else if (audio.Magic == "FSTP")
                    {
                        node.Text = audioName + ".bfstp";
                    }
                    else if (audio.Magic == "BWAV")
                    {
                        node.Text = audioName + ".bwav";
                    }
                    else
                    {
                        node.Text = $"{audioName}.{audio.Magic}";
                    }

                    Nodes[1].Nodes.Add(node);
                }
            }
        }
Ejemplo n.º 2
0
        public void Load(Stream stream)
        {
            CanSave = true;

            Text = FileName;

            bars = new BarsLib.BARS(stream);

            if (bars.AmtaList.Count > 0)
            {
                Nodes.Add("AMTA");
            }

            if (bars.audioList.Count > 0)
            {
                Nodes.Add("Audio");
            }

            for (int i = 0; i < bars.AmtaList.Count; i++)
            {
                var    amtaWrapper = new MetaDataNodeWrapper(bars.AmtaList[i]);
                string audioName   = bars.AmtaList[i].Name;

                amtaWrapper.Text = $"{audioName}.amta";
                Nodes[0].Nodes.Add(amtaWrapper);

                if (bars.audioList.Count > 0)
                {
                    BARSAudioFile audio = bars.audioList[i];

                    AudioEntry node = new AudioEntry();
                    node.Type = audio.AudioType;
                    node.Data = audio.data;
                    node.SetupMusic();

                    if (audio.AudioType == AudioType.Bfwav)
                    {
                        node.Text = audioName + ".bfwav";
                    }
                    else if (audio.AudioType == AudioType.Bfstp)
                    {
                        node.Text = audioName + ".bfstp";
                    }
                    else
                    {
                        node.Text = audioName + ".UNKOWN";
                    }

                    Nodes[1].Nodes.Add(node);
                }
            }

            ContextMenu = new ContextMenu();
            MenuItem save = new MenuItem("Save");

            ContextMenu.MenuItems.Add(save);
            save.Click += Save;
        }
Ejemplo n.º 3
0
        public void Load()
        {
            IsActive = true;
            CanSave  = true;

            Text = FileName;

            bars = new BarsLib.BARS(new MemoryStream(Data));
            Nodes.Add("AMTA");
            Nodes.Add("Audio");
            for (int i = 0; i < bars.AmtaList.Count; i++)
            {
                string audioName = bars.AmtaList[i].Name;

                Nodes[0].Nodes.Add(audioName + ".amta");
                BARSAudioFile audio = bars.audioList[i];

                AudioEntry node = new AudioEntry();
                node.Type = audio.AudioType;
                node.Data = audio.data;
                node.SetupMusic();

                if (audio.AudioType == AudioType.Bfwav)
                {
                    node.Text = audioName + ".bfwav";
                }
                else if (audio.AudioType == AudioType.Bfstp)
                {
                    node.Text = audioName + ".bfstp";
                }
                else
                {
                    node.Text = audioName + ".UNKOWN";
                }

                Nodes[1].Nodes.Add(node);
            }

            ContextMenu = new ContextMenu();
            MenuItem save = new MenuItem("Save");

            ContextMenu.MenuItems.Add(save);
            save.Click += Save;
        }
Ejemplo n.º 4
0
        public void Load()
        {
            IsActive = true;
            CanSave  = true;

            bars       = new BarsLib.BARS(new MemoryStream(Data));
            EditorRoot = new TreeNodeFile(FileName, this);
            EditorRoot.Nodes.Add("AMTA");
            EditorRoot.Nodes.Add("Audio");
            for (int i = 0; i < bars.AmtaList.Count; i++)
            {
                string audioName = bars.AmtaList[i].Name;

                EditorRoot.Nodes[0].Nodes.Add(audioName + ".amta");
                BARSAudioFile audio = bars.audioList[i];

                AudioEntry node = new AudioEntry();
                node.Type = audio.AudioType;
                node.Data = audio.data;
                node.SetupMusic();

                if (audio.AudioType == AudioType.Bfwav)
                {
                    node.Text = audioName + ".bfwav";
                }
                else if (audio.AudioType == AudioType.Bfstp)
                {
                    node.Text = audioName + ".bfstp";
                }
                else
                {
                    node.Text = audioName + ".UNKOWN";
                }

                EditorRoot.Nodes[1].Nodes.Add(node);
            }
        }
Ejemplo n.º 5
0
 public BarsProperty(BarsLib.BARS bars)
 {
     AudioCount = bars.AudioEntries.Count;
 }
Ejemplo n.º 6
0
 public BarsProperty(BarsLib.BARS bars)
 {
     AudioCount = bars.AmtaList.Count;
 }