public void Initialize() { try { if( mOverlay == null ) mOverlay = new Overlay(); mOverlay.Position = mPosition; mOverlay.Size = mSize; mOverlay.Renderer = OnRenderHandler; if( mOverlay != null && mOverlay.Initialized == false ) mOverlay.Initialise(); InitializeTimer(); } catch { // init Timer, so initialize will be called again InitializeTimer(); } }
public void Dispose() { try { if( mRenderTimer != null ) { mRenderTimer.Stop(); mRenderTimer.Dispose(); mRenderTimer = null; } if( mOverlay != null ) { mOverlay.Dispose(); mOverlay = null; } } catch { } }
/// <summary> /// Initialize the local variables /// </summary> /// <param name="aConfiguration">The Configuration</param> /// <param name="appHandle">Handler of the Root-Window</param> public Ingame(Configuration aConfiguration, App appHandle) { _anAppHandle = appHandle; _myConfiguration = aConfiguration; _time = 0; _totaltime = 0; _artist = ""; _title = ""; _hotkeyPause = "Space"; _hotkeyPrev = "P"; _hotkeyNext = "N"; _hotkeyStop = "Return"; _hotkeyVolumeUp = "+"; _hotkeyVolumeDown = "-"; _hotkeyHide = "O"; _colorBackground = Color.FromArgb(255, _myConfiguration.OverlayColorBack.Red, _myConfiguration.OverlayColorBack.Green, _myConfiguration.OverlayColorBack.Blue); _colorHotkeyTop = Color.FromArgb(255, _myConfiguration.OverlayColorHKTop.Red, _myConfiguration.OverlayColorHKTop.Green, _myConfiguration.OverlayColorHKTop.Blue); _colorHotkeyBackground = Color.FromArgb(255, _myConfiguration.OverlayColorHKBack.Red, _myConfiguration.OverlayColorHKBack.Green, _myConfiguration.OverlayColorHKBack.Blue); _colorLines = Color.FromArgb(255, _myConfiguration.OverlayColorLine.Red, _myConfiguration.OverlayColorLine.Green, _myConfiguration.OverlayColorLine.Blue); _colorFont = Color.FromArgb(255, _myConfiguration.OverlayColorFont.Red, _myConfiguration.OverlayColorFont.Green, _myConfiguration.OverlayColorFont.Blue); _colorProgress = Color.FromArgb(255, _myConfiguration.OverlayColorProgress.Red, _myConfiguration.OverlayColorProgress.Green, _myConfiguration.OverlayColorProgress.Blue); _visible = false; _updating = false; try { MyOverlay = new Overlay {Size = new Size(OverlayWidth, OverlayHeight)}; _overlayPosition = _myConfiguration.OverlayPosition; SetPosition(_overlayPosition); //Initialize the Overlay InitOverlay(); } catch(Exception) {} }