コード例 #1
0
 public AudioController(string fileName)
 {
     Engine = new Microsoft.Xna.Framework.Audio.AudioEngine(fileName);
     WaveBanks = new Dictionary<string, WaveBank>();
     SoundBanks = new Dictionary<string,SoundBank>();
     Cues = new List<Cue>();
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: limura/PackterViewer
        public MainForm(string[] args)
        {
            InitializeComponent();

            ConfigReader.Instance.ParseArgs(args);
            webBrowserVisibleChangeTimer.Interval = ConfigReader.Instance.MsgBoxCloseTimeSec;

            contentBuilder = new ContentBuilder();
            System.Diagnostics.Debug.Print(contentBuilder.OutputDirectory);
            contentManager = new ContentManager(packterDisplayControl.Services, contentBuilder.OutputDirectory);
            packterDisplayControl.RegisterData(contentBuilder, contentManager, ConfigReader.Instance.DefaultScale);
            if (ConfigReader.Instance.TickKeyInputAcceptMicrosecond != null)
            {
                packterDisplayControl.OverrideKeyInputAcceptGapTimeMicrosecond(ConfigReader.Instance.TickKeyInputAcceptMicrosecond.GetValueOrDefault());
            }

            intervalTimer.Tick    += new System.EventHandler(intervalTimer_Tick);
            intervalTimer.Interval = 100;
            intervalTimer.Start();

            webBrowserVisibleChangeTimer.Tick += new System.EventHandler(webBrowserVisibleChangeTimer_Tick);
            bgmTimer.Tick += new System.EventHandler(bgmTimer_Tick);

            webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);
            webBrowser.Navigate("about:blank");

            seThread = new System.Threading.Thread(new System.Threading.ThreadStart(SeThreadMain));
            seThread.Start();

            if (ConfigReader.Instance.XACTEnabled)
            {
                audioEngine = new Microsoft.Xna.Framework.Audio.AudioEngine(ConfigReader.Instance.XACTFileForAudioEngine);
                waveBank    = new Microsoft.Xna.Framework.Audio.WaveBank(audioEngine, ConfigReader.Instance.XACTFileForWaveBank);
                soundBank   = new Microsoft.Xna.Framework.Audio.SoundBank(audioEngine, ConfigReader.Instance.XACTFileForSoundBank);
            }

            System.Windows.Forms.Application.Idle += delegate
            {
                Invalidate();
                if (audioEngine != null)
                {
                    audioEngine.Update();
                }
            };
        }