/// <summary> /// Initialize Bass Library /// </summary> public static void Init() { if (!_initialized) { //Call to avoid the freeware splash screen. Didn't see it, but maybe it will appear if the Forms are used :D BassNet.Registration("*****@*****.**", "2X113120152222"); //Dummy calls made for loading the assemblies int bassVersion = Bass.BASS_GetVersion(); int bassMixVersion = BassMix.BASS_Mixer_GetVersion(); int bassfxVersion = BassFx.BASS_FX_GetVersion(); int plg = Bass.BASS_PluginLoad("bassflac.dll"); if (plg == 0) { throw new Exception(Bass.BASS_ErrorGetCode().ToString()); } if (!Bass.BASS_Init(-1, DEFAULT_SAMPLE_RATE, BASSInit.BASS_DEVICE_DEFAULT | BASSInit.BASS_DEVICE_MONO, IntPtr.Zero)) //Set Sample Rate / MONO { throw new Exception(Bass.BASS_ErrorGetCode().ToString()); } if (!Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_SRC, 1)) /* Качество преобразования частоты дискретизации по умолчанию. */ { throw new Exception(Bass.BASS_ErrorGetCode().ToString()); } if (!Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_FLOATDSP, true)) /*Set floating parameters to be passed*/ { throw new Exception(Bass.BASS_ErrorGetCode().ToString()); } _initialized = true; } }
static void Main() { BassNet.Registration(user + "@" + domain + ".com", bKey); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); }
public AudioService() { speechSynthesiser = new SpeechSynthesizer(); BassNet.Registration(Settings.Default.BassRegistrationEmail, Settings.Default.BassRegistrationKey); Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); Application.Current.Exit += (sender, args) => Bass.BASS_Free(); }
/// <summary> /// Loads BASS and all of its plugins. BASS DLLs must be located in the directory /// \Bass\x64 and \Bass\x86. /// </summary> /// <returns>True if BASS is successfully loaded, false if not.</returns> public static bool Load() { #region Error checking if (BassLoaded) { Trace.TraceInformation("There's no need to load BASS library again because it is already loaded."); return(true); } #endregion string Directory = String.Format( @"{0}Bass\{1}\", AppDomain.CurrentDomain.BaseDirectory, Environment.Is64BitProcess ? "x64" : "x86" ); BassNet.Registration("*****@*****.**", "2X28292820152222"); if (!LoadBass(Directory)) { return(false); } LoadBassPlugins(Directory); LoadBassEnc(Directory); return(true); }
/// <summary> /// Initializes the Bass audio engine. /// </summary> public static void StartAudioEngine(IntPtr windowHandle) { if (_engineStarted) { return; } BassNet.Registration("*****@*****.**", "2X1931822152222"); var mainDevice = GetMainDevice(); if (mainDevice == null) { throw new Exception("No sound card"); } InitialiseDevice(mainDevice.Id, windowHandle); var monitorDevice = GetMonitorDevice(); if (monitorDevice != null) { InitialiseDevice(monitorDevice.Id, windowHandle); } SetDevice(mainDevice); _engineStarted = true; }
private void Play(MemoryStream ms) { ms.Position = 0; using (FileStream file = new FileStream("music.ogg", FileMode.Create, System.IO.FileAccess.Write)) { byte[] bytes = new byte[ms.Length]; ms.Read(bytes, 0, (int)ms.Length); file.Write(bytes, 0, bytes.Length); ms.Close(); } if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)) { BassNet.Registration("*****@*****.**", "2X9231427152222"); int stream = Bass.BASS_StreamCreateFile("music.ogg", 0, 0, BASSFlag.BASS_SAMPLE_LOOP); if (stream != 0) { Bass.BASS_ChannelPlay(stream, false); } else { Console.WriteLine("Stream error: {0}", Bass.BASS_ErrorGetCode()); } float[] buffer = new float[1024]; Bass.BASS_ChannelGetData(stream, buffer, 1024); Console.WriteLine("Press key to stop"); Console.ReadKey(false); Bass.BASS_StreamFree(stream); Bass.BASS_Free(); } }
/// <summary> /// Initialize Bass Library /// </summary> public static void Init() { if (!_initialized) { //Call to avoid the freeware splash screen. Didn't see it, but maybe it will appear if the Forms are used :D BassNet.Registration("*****@*****.**", "2X155323152222"); //Dummy calls made for loading the assemblies int bassVersion = Un4seen.Bass.Bass.BASS_GetVersion(); int bassMixVersion = BassMix.BASS_Mixer_GetVersion(); int bassfxVersion = BassFx.BASS_FX_GetVersion(); int plg = Un4seen.Bass.Bass.BASS_PluginLoad("bassflac.dll"); if (plg == 0) { throw new Exception(Un4seen.Bass.Bass.BASS_ErrorGetCode().ToString()); } if (!Un4seen.Bass.Bass.BASS_Init(-1, DEFAULT_SAMPLE_RATE, BASSInit.BASS_DEVICE_DEFAULT | BASSInit.BASS_DEVICE_MONO, IntPtr.Zero)) //Set Sample Rate / MONO { throw new Exception(Un4seen.Bass.Bass.BASS_ErrorGetCode().ToString()); } if (!Un4seen.Bass.Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_MIXER_FILTER, 50)) /*Set filter for anti aliasing*/ { throw new Exception(Un4seen.Bass.Bass.BASS_ErrorGetCode().ToString()); } if (!Un4seen.Bass.Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_FLOATDSP, true)) /*Set floating parameters to be passed*/ { throw new Exception(Un4seen.Bass.Bass.BASS_ErrorGetCode().ToString()); } _initialized = true; } }
public DelayTool(ComboBox inlist, ComboBox outlist) { BassNet.Registration("*****@*****.**", "2X531420152222"); this.inlist = inlist; this.outlist = outlist; init(); }
public void InitaliseBassLibrary() { var bassPluginsLoaded = new Dictionary <int, string>(); // Register freeware license details. BassNet.Registration(_settings.BassLicenseEmail, _settings.BassLicenseKey); // Load BASS library with default output device and add-on DLLs. var bassInit = Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); bassPluginsLoaded = Bass.BASS_PluginLoadDirectory(_settings.BassAddOnsPath); // Make sure the BASS library initalised correctly and plugins where loaded successfully. if (!bassInit || bassPluginsLoaded == null) { var msg = string.Format("Error loading 'bass.dll' or the BASS Plug-In library! [BASS error code: {0}]", Bass.BASS_ErrorGetCode().ToString()); throw new TypeInitializationException("Un4seen.Bass.Bass", new Exception(msg)); } if (bassPluginsLoaded.Count < _settings.BassPluginCount) { logger.WarnFormat("Number of plugins loaded by BASS was lower than expected: {0} expected, {1} actually loaded", bassPluginsLoaded.Count, _settings.BassPluginCount); } LogBassPluginsLoaded(bassPluginsLoaded); }
static void Main(string[] args) { BassNet.Registration("*****@*****.**", "2X1837515183722"); BassNet.OmitCheckVersion = true; if (!Bass.LoadMe()) { System.Windows.Forms.MessageBox.Show("Unable to load bass.dll!", "Error", System.Windows.Forms.MessageBoxButtons.OK); return; } if (!Bass.BASS_Init(0, 48000, 0, IntPtr.Zero)) { System.Windows.Forms.MessageBox.Show("Unable to initialize the BASS library!", "Error", System.Windows.Forms.MessageBoxButtons.OK); } if (!BassWasapi.LoadMe()) { System.Windows.Forms.MessageBox.Show("Unable to load BassWasapi.dll!", "Error", System.Windows.Forms.MessageBoxButtons.OK); } Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm mainForm = new mainForm(); Application.Run(mainForm); }
public void RegisterBass(string mail, string code) { if (!String.IsNullOrEmpty(mail) && !String.IsNullOrEmpty(code)) { BassNet.Registration(mail, code); } }
public static void LoadConfigs() { BassNet.Registration("*****@*****.**", "2X9231425152222"); //Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0); }
private void SetupSoundSystemWithSoundtrack() { var registrationEmail = ProjectSettings.TryGet("Tooll.Sound.BassNetLicense.Email", ""); var registrationKey = ProjectSettings.TryGet("Tooll.Sound.BassNetLicense.Key", ""); if (!String.IsNullOrEmpty(registrationEmail) && !String.IsNullOrEmpty(registrationKey)) { BassNet.Registration(registrationEmail, registrationKey); } Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_LATENCY, IntPtr.Zero); while (!ProjectSettings.Contains("Soundtrack.Path") || !File.Exists((string)ProjectSettings["Soundtrack.Path"])) { ProjectSettings["Soundtrack.Path"] = UIHelper.PickFileWithDialog(".", ProjectSettings.TryGet("Soundtrack.Path", "."), "Select Soundtrack"); } if (!ProjectSettings.Contains("Soundtrack.ImagePath")) { ProjectSettings["Soundtrack.ImagePath"] = UIHelper.PickFileWithDialog(".", ProjectSettings.TryGet("Soundtrack.Path", "."), "Select optional frequency image for soundtrack"); } var soundFilePath = (string)ProjectSettings["Soundtrack.Path"]; SetProjectSoundFile(soundFilePath); }
public AudioAnalyzer(MainWindow inst) { windowInst = inst; BassNet.Registration("youremail", "yourregkey"); //Enter your data here! _lInt = new Interface(); _fft = new float[1024]; _lastlevel = 0; _hanctr = 0; _t = new DispatcherTimer(); _t.Tick += timerTick; _t.Interval = TimeSpan.FromMilliseconds(25); _t.IsEnabled = false; _process = new WASAPIPROC(Process); _spectrumdata = new List <byte>(); _vis = inst.visualizer; _initialized = false; devices = new List <AudioDevice>(); Init(); leds = new int[9, 9]; for (int x = 0; x < 9; x++) { for (int y = 0; y < 9; y++) { leds[x, y] = 0; } } }
public static void RegisterBASS() { if (!bassRegistered) { BassNet.Registration(StringUtil.Convert(StringUtil.Seq1), StringUtil.Convert(StringUtil.Seq2)); Bass.BASS_Init(0, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); plugInRefs = new List <int>(); plugInRefs.Add(Bass.BASS_PluginLoad("basswma.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("bassflac.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("bass_aac.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("bass_alac.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("bass_mpc.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("basswv.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("bass_ac3.dll")); plugInRefs.Add(Bass.BASS_PluginLoad("bass_ape.dll")); userAgentPtr = Marshal.StringToHGlobalAnsi(userAgent); Bass.BASS_SetConfigPtr(BASSConfig.BASS_CONFIG_NET_AGENT, userAgentPtr); Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_NET_PREBUF, 0); // so that we can display the buffering% Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_NET_PLAYLIST, 1); if (Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_WMA_PREBUF, 0) == false) { Console.WriteLine("ERROR: " + Enum.GetName(typeof(BASSError), Bass.BASS_ErrorGetCode())); } bassRegistered = true; } }
private void Initialize() { if (this.listBeatPositions == null) { this.listBeatPositions = new List <stBeatPos>(); } #region [ BASS registration ] // BASS.NET ユーザ登録(BASSスプラッシュが非表示になる)。 BassNet.Registration("*****@*****.**", "2X9181017152222"); #endregion #region [ BASS Version Check ] // BASS のバージョンチェック。 int nBASSVersion = Utils.HighWord(Bass.BASS_GetVersion()); if (nBASSVersion != Bass.BASSVERSION) { throw new DllNotFoundException(string.Format("bass.dll のバージョンが異なります({0})。このプログラムはバージョン{1}で動作します。", nBASSVersion, Bass.BASSVERSION)); } int nBASSFXVersion = Utils.HighWord(BassFx.BASS_FX_GetVersion()); if (nBASSFXVersion != BassFx.BASSFXVERSION) { throw new DllNotFoundException(string.Format("bass_fx.dll のバージョンが異なります({0})。このプログラムはバージョン{1}で動作します。", nBASSFXVersion, BassFx.BASSFXVERSION)); } #endregion #region [ BASS の設定。] //this.bIsBASSFree = true; //Debug.Assert( Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ), // 0:BASSストリームの自動更新を行わない。(サウンド出力しないため) // string.Format( "BASS_SetConfig() に失敗しました。[{0}", Bass.BASS_ErrorGetCode() ) ); #endregion #region [ BASS の初期化。] int nデバイス = 0; // 0:"no sound" … BASS からはデバイスへアクセスさせない。 int n周波数 = 44100; // 仮決め。lデバイス(≠ドライバ)がネイティブに対応している周波数であれば何でもいい?ようだ。いずれにしろBASSMXで自動的にリサンプリングされる。 if (!Bass.BASS_Init(nデバイス, n周波数, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)) { throw new Exception(string.Format("BASS の初期化に失敗しました。(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString())); } #endregion #region [ 指定されたサウンドファイルをBASSでオープンし、必要最小限の情報を取得する。] //this.hBassStream = Bass.BASS_StreamCreateFile( this.filename, 0, 0, BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE ); this.hBassStream = Bass.BASS_StreamCreateFile(this.filename, 0, 0, BASSFlag.BASS_STREAM_DECODE); if (this.hBassStream == 0) { throw new Exception(string.Format("{0}: サウンドストリームの生成に失敗しました。(BASS_StreamCreateFile)[{1}]", filename, Bass.BASS_ErrorGetCode().ToString())); } this.nTotalBytes = Bass.BASS_ChannelGetLength(this.hBassStream); this.nTotalSeconds = Bass.BASS_ChannelBytes2Seconds(this.hBassStream, nTotalBytes); if (!Bass.BASS_ChannelGetAttribute(this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref fFreq)) { string errmes = string.Format("サウンドストリームの周波数取得に失敗しました。(BASS_ChannelGetAttribute)[{0}]", Bass.BASS_ErrorGetCode().ToString()); Bass.BASS_Free(); throw new Exception(errmes); } #endregion }
public Form1() { InitializeComponent(); BassNet.Registration("*****@*****.**", "2X143820152222"); analyzer = new Analyzer(pb1, pb2, spectrum1, comboBox1); Timer timer = new Timer(); timer.Interval = 10; timer.Enabled = true; timer.Tick += Timer_Tick; label1.Text = label2.Text = ""; btn_exit.FlatAppearance.MouseDownBackColor = Color.FromArgb(150, Color.White); btn_exit.FlatAppearance.MouseOverBackColor = Color.FromArgb(50, Color.White); btn_mini.FlatAppearance.MouseDownBackColor = Color.FromArgb(150, Color.White); btn_mini.FlatAppearance.MouseOverBackColor = Color.FromArgb(50, Color.White); btn_back.FlatAppearance.MouseDownBackColor = Color.FromArgb(150, Color.White); btn_back.FlatAppearance.MouseOverBackColor = Color.FromArgb(50, Color.White); }
static void Main() { //passing a path argument sets the working directory of the exe to that file's directory; bypass it Directory.SetCurrentDirectory(Application.ExecutablePath.Replace(Path.GetFileName(Application.ExecutablePath), "")); if (!File.Exists("bass.dll")) { MessageBox.Show("bass.dll not found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Properties.Settings.Default.RegEmail == "" || Properties.Settings.Default.RegCode == "") { MessageBox.Show("You haven't set your BASS.NET registration details. A splash screen will be shown.\nYou can set details in app.config.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } BassNet.Registration(Properties.Settings.Default.RegEmail, Properties.Settings.Default.RegCode); if (init()) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); Bass.BASS_Free(); } else { MessageBox.Show("Init error: " + Bass.BASS_ErrorGetCode(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static BassEngine() { //注册Bass.Net,不注册就会弹出一个启动画面 BassNet.Registration("*****@*****.**", "2X34201017282922"); //判断当前系统是32位系统还是64位系统,并加载对应版本的bass.dll string exeFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().GetModules()[0].FullyQualifiedName); string libraryPathSetting = Un4seen.Bass.Utils.Is64Bit ? "Bass.LibraryPathX64" : "Bass.LibraryPathX86"; string bassDllBasePath = Path.Combine(exeFolder, ConfigurationManager.AppSettings[libraryPathSetting]); // now load all libs manually Un4seen.Bass.Bass.LoadMe(bassDllBasePath); var loadedPlugins = Un4seen.Bass.Bass.BASS_PluginLoadDirectory( string.Format(ConfigurationManager.AppSettings["Bass.PluginPathFormat"], bassDllBasePath)); if (loadedPlugins != null) { foreach (var item in loadedPlugins) { Debug.WriteLine(string.Format("Plugin loaded: {0}", item.Value)); } pluginHandles = loadedPlugins.Keys.ToList(); } else { pluginHandles = new List <int>(); } //BassMix.LoadMe(targetPath); //... //loadedPlugIns = Bass.BASS_PluginLoadDirectory(targetPath); //... SetConfigs(ConfigurationManager.AppSettings["Bass.SetConfigOnInitialization"]); }
//konstruktor public Cat_Audio_Form() { InitializeComponent(); this.Left = Screen.AllScreens[0].WorkingArea.Left; this.Top = Screen.AllScreens[0].WorkingArea.Top; this.Width = szer; this.Height = wys; SetupPanel.Visible = true; ResponsePanel.Visible = false; BassNet.Registration("*****@*****.**", "2X253829171365"); int liczba = Un4seen.BassAsio.BassAsio.BASS_ASIO_GetDeviceCount(); for (int i = 0; i < liczba; i++) { listDevices.Items.Add(Un4seen.BassAsio.BassAsio.BASS_ASIO_GetDeviceInfo(i).name); } try { listDevices.SelectedIndex = 0; } catch { } directory = Application.StartupPath; tBCD.Text = directory; stoper_freq = Stopwatch.Frequency; delta_tick = stoper_freq / 25; Visual_Setup(); }
public MainWindow() { BassNet.Registration("*****@*****.**", "2X28183316182322"); Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); SetBFX_EQ(); _sorting = 0; InitializeComponent(); }
public AudioService() { speechSynthesiser = new SpeechSynthesizer(); maryTtsPlayer = new SoundPlayerEx(); BassNet.Registration(BassRegistrationEmail, BassRegistrationKey); Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); Application.Current.Exit += (sender, args) => Bass.BASS_Free(); }
public SoundSource(int frequencyScanInterval = 1) { // here Registration for BASS.NET BassNet.Registration("*****@*****.**", "2X223152334323"); _deviceReady = Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); _timer = new Timer(frequencyScanInterval); _timer.Elapsed += TimerOnElapsed; }
/// <summary> /// API调试台 /// </summary> static void Main() { BassNet.Registration("*****@*****.**", "2X52325160022"); Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_CPSPEAKERS, IntPtr.Zero); var a = Bass.BASS_GetDeviceInfos(); Console.ReadLine(); }
private void RegisterBassKey() { // Keep Bass.Net from putting a popup on the screen if (bass_EMail.Length > 0 && bass_RegistrationKey.Length > 0) { BassNet.Registration(bass_EMail, bass_RegistrationKey); } }
/// <summary> /// 播放器初始化 /// </summary> /// <returns></returns> public bool Init() { //注册bass组件 BassNet.Registration("*****@*****.**", "2X17241816152222"); //初始化 return(Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)); }
public MainForm() { InitializeComponent(); BassNet.Registration("*****@*****.**", "2X28293417152222"); SoundManager.Instance.InitManager(); ConfigManager.Instance.Init(); }
public Player() { BassNet.Registration("*****@*****.**", "2X441017152222"); if (!(Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))) { throw new Exception("Error while initializing Player instance"); } }
static Account() { BassNet.Registration("*****@*****.**", "2X1425018152222"); if (!Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)) { Error.HandleBASSError("Failed to initizlize BASS! Error code: ", Bass.BASS_ErrorGetCode()); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { OperatingSystem os = Environment.OSVersion; PlatformID pid = os.Platform; GameFacade.Linux = (pid == PlatformID.MacOSX || pid == PlatformID.Unix); FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GraphicsDevice); base.Initialize(); GameFacade.SoundManager = new FSO.Client.Sound.SoundManager(); GameFacade.GameThread = Thread.CurrentThread; SceneMgr = new _3DLayer(); SceneMgr.Initialize(GraphicsDevice); GameFacade.Controller = new GameController(); GameFacade.Screens = uiLayer; GameFacade.Scenes = SceneMgr; GameFacade.GraphicsDevice = GraphicsDevice; GameFacade.GraphicsDeviceManager = Graphics; GameFacade.Cursor = new CursorManager(this.Window); if (!GameFacade.Linux) { GameFacade.Cursor.Init(FSO.Content.Content.Get().GetPath("")); } /** Init any computed values **/ GameFacade.Init(); GameFacade.Strings = new ContentStrings(); GameFacade.Controller.StartLoading(); GraphicsDevice.RasterizerState = new RasterizerState() { CullMode = CullMode.None }; if (!GameFacade.Linux) { BassNet.Registration("*****@*****.**", "2X3163018312422"); Bass.BASS_Init(-1, 8000, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero, System.Guid.Empty); } this.IsMouseVisible = true; this.IsFixedTimeStep = true; WorldContent.Init(this.Services, Content.RootDirectory); base.Screen.Layers.Add(SceneMgr); base.Screen.Layers.Add(uiLayer); GameFacade.LastUpdateState = base.Screen.State; if (!GlobalSettings.Default.Windowed) { Graphics.ToggleFullScreen(); } }