コード例 #1
0
        void btnLoad_Click(object sender, System.EventArgs e)
        {
            if (openDia.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (openDia.FileName != "")
                {
                    filepath = openDia.FileName;

                    Type[] extraTypes = new Type[]
                    {
                        typeof(List <string>),
                        typeof(List <CueInfo>)
                    };

                    this.filepath = openDia.FileName;

                    jjaxFile = SerializationHelper.Deserialize <JJax>(
                        filepath, false, "", extraTypes);

                    for (int i = 0; i < this.jjaxFile.SoundCategories.Count; i++)
                    {
                        lstCate.Items.Add(jjaxFile.SoundCategories[i]);
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Creates a new AudioManager.
        /// </summary>
        /// <param name="jJaxFilepath">The filepath for the J-Jax file.</param>
        public AudioManager(string jJaxFilepath)
            : base("AudioManager")
        {
            JJax file = null;

            try
            {
                file = XmlHelper.DeserializeContent <JJax>(jJaxFilepath + ".JJAX");
            }
            catch (FileNotFoundException)
            {
                new Error("No JJFile found at: " + jJaxFilepath, Seriousness.CriticalError);
            }
            catch
            {
                new Error("Problem with JJax file: " + jJaxFilepath, Seriousness.CriticalError);
            }

            if (file != null)
            {
                if (file.Info.Count > 0)
                {
                    for (int i = 0; i < file.Info.Count; i++)
                    {
                        cueInfos.Add(file.Info[i]);
                    }
                }
                else
                {
                    new Error("No sounds found in: " + jJaxFilepath, Seriousness.Error);
                }

                if (file.SoundCategories.Count > 0)
                {
                    for (int i = 0; i < file.SoundCategories.Count; i++)
                    {
                        categories.Add(new JJaxCategory(file.SoundCategories[i]));
                    }
                }
                else
                {
                    new Error("No sound categories found in: " + jJaxFilepath, Seriousness.Warning);
                }
            }
        }
コード例 #3
0
        public Form1()
        {
            InitializeComponent();

            ClearCueInfo();

            string filter = "J-Jax File (*.JJAX)|*.JJAX";

            saveDia.InitialDirectory = @"C:\";
            saveDia.Filter           = filter;

            openDia.InitialDirectory = @"C:\";
            openDia.Filter           = filter;

            openSndDia.InitialDirectory = @"C:\";
            openSndDia.Filter           = "Built Content File (*.xnb)|*.xnb";

            jjaxFile = new JJax();

            jjaxFile.SoundCategories = new List <string>()
            {
                "Background"
            };

            lstCate.Items.Add("Background");

            try
            {
                Crosswalk.Message temp =
                    SerializationHelper.Deserialize <Crosswalk.Message>("Temp", false, ".temp");

                projectFilepath = temp.Messages[0];
                rootPath        = temp.Messages[1];

                saveDia.InitialDirectory    = rootPath + "Content\\";
                openDia.InitialDirectory    = rootPath + "Content\\";
                openSndDia.InitialDirectory = rootPath + "Content\\";
            }
            catch { }
        }