///<summary> ///</summary> public SharpModApp() { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; #if WINDOWS_PHONE // Handle hiding of the battery status bar when used on windows phone _graphics.IsFullScreen = true; _graphics.PreferredBackBufferWidth = 480; _graphics.PreferredBackBufferHeight = 800; // Frame rate is 30 fps by default for Windows Phone. TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0); #else /*now handle hires screens for xbox and windows*/ _graphics.IsFullScreen = false; _graphics.PreparingDeviceSettings += GraphicsPreparingDeviceSettings; // Frame Rate is 60 fps by default for Xbox 360 and Windows. TargetElapsedTime = TimeSpan.FromSeconds(1 / 60.0); #endif var dsei = new DynamicSoundEffectInstance(48000, AudioChannels.Stereo); var ms = new MemoryStream(ModResources.Babylon); _sm = ModuleLoader.Instance.LoadModule(ms); _mp = new ModulePlayer(_sm); _mp.RegisterRenderer(new XnaSoundRenderer(dsei)); _mp.DspAudioProcessor = new AudioProcessor(1024, 50); _mp.DspAudioProcessor.OnCurrentSampleChanged += DspAudioProcessor_OnCurrentSampleChanged; _mp.Start(); }
private void Form1_Load(object sender, EventArgs e) { Assembly asm = Assembly.GetExecutingAssembly(); List <string> a = new List <string>(); var type = typeof(Base.iDemo); foreach (Type t in asm.GetTypes()) { if (type.IsAssignableFrom(t) && t.Name.ToUpper() != "IDEMO") { a.Add(t.Name); } } a.Sort(); for (int i = 0; i < a.Count; i++) { listBox1.Items.Add(a[i]); } init(); string mod = Application.StartupPath + @"\starlitdeception.mod"; myMod = ModuleLoader.Instance.LoadModule(mod); player = new ModulePlayer(myMod); player.MixCfg.Rate = 48000; NAudioWaveChannelDriver drv = new NAudioWaveChannelDriver(NAudioWaveChannelDriver.Output.WaveOut); player.RegisterRenderer(drv); player.Start(); }