C# Class MediaPortal.D3D

The base class for all the graphics (D3D) samples, it derives from windows forms
Inheritance: MediaPortal.UserInterface.Controls.MPForm
Mostrar archivo Open project: MediaPortal/MediaPortal-1

Protected Properties

Property Type Description
AdapterInfo MediaPortal.GraphicsAdapterInfo
AppActive bool
AutoHideMouse bool
AutoHideTaskbar bool
ExitToTray bool
FrameStatsLine1 string
FrameStatsLine2 string
Frames int
FullscreenOverride bool
IsDisplayTurnedOn bool
IsInAwayMode bool
IsUserPresent bool
IsVisible bool
KeyEventTimer System.DateTime
LastCursorPosition Point
LastRect RECT
MinimizeOnFocusLoss bool
MinimizeOnGuiExit bool
MinimizeOnStartup bool
MouseCursor bool
MouseTimeOutFullscreen int
MouseTimeOutMP int
MouseTimeOutTimer System.DateTime
NeedRecreateSwapChain bool
PlaylistPlayer MediaPortal.Playlists.PlayListPlayer
PreviousKeyEvent System.Windows.Forms.KeyPressEventArgs
ScreenNumberOverride int
ScreenSaverEventTimer System.DateTime
ShuttingDown bool
SkinOverride string
SplashScreen MediaPortal.SplashScreen
UseEnhancedVideoRenderer bool
UseMadVideoRenderer bool
Volume int
WINDOWS_NATIVE_RESOLUTION System.Drawing.Size
Windowed bool
WindowedOverride bool
_backupBounds System.Drawing.Rectangle
_backupscreen System.Windows.Forms.Screen
_firstLoadedScreen bool
_presentParams PresentParameters
_presentParamsBackup PresentParameters
_restoreLoadedScreen bool
_screenFocus System.Windows.Forms.Screen

Public Methods

Method Description
ShowMouseCursor ( bool visible ) : void

Wrapper for shown/hiding cursor

Protected Methods

Method Description
BuildPresentParams ( bool windowed ) : void

Build D3D presentation parameters

CalcMaxClientArea ( ) : Size

Calculates the maximum client area if skin is larger than working area

D3D ( ) : System

Constructor

Dispose ( bool disposing ) : void

Clean up any resources

FrameMove ( ) : void

FullRender ( ) : void

Called when nothing else needs to be done and it's time to render

GetStats ( ) : void

Get the statistics

HandleMessage ( ) : void

Message Loop - Handles ANSI and Unicode Messages and dispatch them

HideTaskBar ( bool hide ) : void

Hides the task bar

Init ( ) : bool

Init graphics device

InitializeDevice ( ) : void

Initialization of the D3D Device

InitializeDeviceObjects ( ) : void

KeyDownEvent ( KeyEventArgs e ) : void

KeyPressEvent ( KeyPressEventArgs e ) : void

MinimizeToTray ( ) : void

Minimized MP To System Tray

MouseClickEvent ( MouseEventArgs e ) : void

MouseDoubleClickEvent ( MouseEventArgs e ) : void

MouseMoveEvent ( MouseEventArgs e ) : void

NotifyIconRestore ( Object sender, EventArgs e ) : void

OnDeviceLost ( Object sender, EventArgs e ) : void

OnEnumeration ( ) : void

OnExit ( ) : void

OnFormClosing ( FormClosingEventArgs formClosingEventArgs ) : void

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.onformclosing.aspx

OnGotFocus ( EventArgs e ) : void

Raises the GotFocus event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.ongotfocus.aspx

OnKeyPress ( KeyPressEventArgs e ) : void

Raises the KeyPress event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onkeypress.aspx

OnLostFocus ( EventArgs e ) : void

Raises the Lost Focus event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onlostfocus.aspx

OnMouseMove ( MouseEventArgs e ) : void

Raises the MouseMove event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onmousemove.aspx

OnPaint ( PaintEventArgs e ) : void

OnPaintEvent ( ) : void

Repaints the current window independent of WM_PAINT messages

OnProcess ( ) : void

OnStartup ( ) : void

RecoverDevice ( ) : void

Render ( float timePassed ) : void

RestoreFromTray ( ) : void

Restores MP from System Tray

ResumePlayer ( ) : void

Restore player from saved state

SavePlayerState ( ) : void

Save player state (when form was resized)

ShowLastActiveModule ( ) : bool

ToggleFullscreen ( ) : void

UpdateStats ( ) : void

Update the various statistics the simulation keeps track of

Private Methods

Method Description
CleanupEnvironment ( ) : void

Set our variables to not active and not ready

ConfirmDevice ( Caps caps, VertexProcessingType vertexProcessingType, Format adapterFormat, Format backBufferFormat ) : bool

CreateDirectX9ExDevice ( ) : void

Creates a DirectX9Ex Device

Exit ( object sender, EventArgs e ) : void

Exit Form

FindAdapterForScreen ( Screen screen ) : MediaPortal.GraphicsAdapterInfo

Finds the adapter that has the specified screen on its primary monitor

GetCapabilities ( ) : Caps

GetForegroundWindow ( ) : IntPtr
GetMonitorInfo ( IntPtr hWnd, MonitorInformation &info ) : bool
InitializeComponent ( ) : void

Initialize Menus and Event Handlers

MenuItemConfiguration ( object sender, EventArgs e ) : void

MenuItemDVD ( object sender, EventArgs e ) : void

MenuItemFullscreen ( object sender, EventArgs e ) : void

MenuItemMiniTV ( object sender, EventArgs e ) : void

toggles default and minitv mode

MenuItemMovies ( object sender, EventArgs e ) : void

MenuItemMusic ( object sender, EventArgs e ) : void

MenuItemPictures ( object sender, EventArgs e ) : void

MenuItemTV ( object sender, EventArgs e ) : void

NotifyIconExit ( Object sender, EventArgs e ) : void

OnClick ( object sender, MouseEventArgs e ) : void

OnIdle ( object sender, EventArgs e ) : void

OnKeyDown ( object sender, KeyEventArgs e ) : void

OnKeyPress ( object sender, KeyPressEventArgs e ) : void

OnLoad ( object sender, EventArgs e ) : void

OnMouseDoubleClick ( object sender, MouseEventArgs e ) : void

OnMouseMove ( object sender, MouseEventArgs e ) : void

RecreateSwapChain ( bool useBackup ) : void

reset device if back buffer does not match skin dimensions (e.g. 16:10 display with 16:9 skin, 720p skin on 1080p display etc.)

ShowCursor ( bool bShow ) : int
StartConfiguration ( ) : void

Start Configuration.exe

TVDelayThread ( ) : void

ToggleMiniTV ( ) : void

UpdateMouseCursor ( ) : void

Automatically hides or show mouse cursor when over form

Method Details

BuildPresentParams() protected method

Build D3D presentation parameters
protected BuildPresentParams ( bool windowed ) : void
windowed bool true for window, false for fullscreen
return void

CalcMaxClientArea() protected method

Calculates the maximum client area if skin is larger than working area
protected CalcMaxClientArea ( ) : Size
return System.Drawing.Size

D3D() protected method

Constructor
protected D3D ( ) : System
return System

Dispose() protected method

Clean up any resources
protected Dispose ( bool disposing ) : void
disposing bool
return void

FrameMove() protected method

protected FrameMove ( ) : void
return void

FullRender() protected method

Called when nothing else needs to be done and it's time to render
protected FullRender ( ) : void
return void

GetStats() protected method

Get the statistics
protected GetStats ( ) : void
return void

HandleMessage() protected method

Message Loop - Handles ANSI and Unicode Messages and dispatch them
protected HandleMessage ( ) : void
return void

HideTaskBar() protected static method

Hides the task bar
protected static HideTaskBar ( bool hide ) : void
hide bool hides taskbar on true, shows it on false
return void

Init() protected method

Init graphics device
protected Init ( ) : bool
return bool

InitializeDevice() protected method

Initialization of the D3D Device
protected InitializeDevice ( ) : void
return void

InitializeDeviceObjects() protected method

protected InitializeDeviceObjects ( ) : void
return void

KeyDownEvent() protected method

protected KeyDownEvent ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void

KeyPressEvent() protected method

protected KeyPressEvent ( KeyPressEventArgs e ) : void
e System.Windows.Forms.KeyPressEventArgs
return void

MinimizeToTray() protected method

Minimized MP To System Tray
protected MinimizeToTray ( ) : void
return void

MouseClickEvent() protected method

protected MouseClickEvent ( MouseEventArgs e ) : void
e MouseEventArgs
return void

MouseDoubleClickEvent() protected method

protected MouseDoubleClickEvent ( MouseEventArgs e ) : void
e MouseEventArgs
return void

MouseMoveEvent() protected method

protected MouseMoveEvent ( MouseEventArgs e ) : void
e MouseEventArgs
return void

NotifyIconRestore() protected method

protected NotifyIconRestore ( Object sender, EventArgs e ) : void
sender Object
e System.EventArgs
return void

OnDeviceLost() protected method

protected OnDeviceLost ( Object sender, EventArgs e ) : void
sender Object
e System.EventArgs
return void

OnEnumeration() protected method

protected OnEnumeration ( ) : void
return void

OnExit() protected method

protected OnExit ( ) : void
return void

OnFormClosing() protected method

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.onformclosing.aspx
protected OnFormClosing ( FormClosingEventArgs formClosingEventArgs ) : void
formClosingEventArgs System.Windows.Forms.FormClosingEventArgs
return void

OnGotFocus() protected method

Raises the GotFocus event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.ongotfocus.aspx
protected OnGotFocus ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnKeyPress() protected method

Raises the KeyPress event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onkeypress.aspx
protected OnKeyPress ( KeyPressEventArgs e ) : void
e System.Windows.Forms.KeyPressEventArgs A KeyPressEventArgs that contains the event data.
return void

OnLostFocus() protected method

Raises the Lost Focus event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onlostfocus.aspx
protected OnLostFocus ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
return void

OnMouseMove() protected method

Raises the MouseMove event. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onmousemove.aspx
protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs A MouseEventArgs that contains the event data.
return void

OnPaint() protected method

protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnPaintEvent() protected method

Repaints the current window independent of WM_PAINT messages
protected OnPaintEvent ( ) : void
return void

OnProcess() protected method

protected OnProcess ( ) : void
return void

OnStartup() protected method

protected OnStartup ( ) : void
return void

RecoverDevice() protected method

protected RecoverDevice ( ) : void
return void

Render() protected method

protected Render ( float timePassed ) : void
timePassed float
return void

RestoreFromTray() protected method

Restores MP from System Tray
protected RestoreFromTray ( ) : void
return void

ResumePlayer() protected method

Restore player from saved state
protected ResumePlayer ( ) : void
return void

SavePlayerState() protected method

Save player state (when form was resized)
protected SavePlayerState ( ) : void
return void

ShowLastActiveModule() protected method

protected ShowLastActiveModule ( ) : bool
return bool

ShowMouseCursor() public method

Wrapper for shown/hiding cursor
public ShowMouseCursor ( bool visible ) : void
visible bool
return void

ToggleFullscreen() protected method

protected ToggleFullscreen ( ) : void
return void

UpdateStats() protected method

Update the various statistics the simulation keeps track of
protected UpdateStats ( ) : void
return void

Property Details

AdapterInfo protected_oe property

protected GraphicsAdapterInfo,MediaPortal AdapterInfo
return MediaPortal.GraphicsAdapterInfo

AppActive protected_oe property

protected bool AppActive
return bool

AutoHideMouse protected_oe property

protected bool AutoHideMouse
return bool

AutoHideTaskbar protected_oe property

protected bool AutoHideTaskbar
return bool

ExitToTray protected_oe property

protected bool ExitToTray
return bool

FrameStatsLine1 protected_oe property

protected string FrameStatsLine1
return string

FrameStatsLine2 protected_oe property

protected string FrameStatsLine2
return string

Frames protected_oe property

protected int Frames
return int

FullscreenOverride protected_oe static_oe property

protected static bool FullscreenOverride
return bool

IsDisplayTurnedOn protected_oe property

protected bool IsDisplayTurnedOn
return bool

IsInAwayMode protected_oe property

protected bool IsInAwayMode
return bool

IsUserPresent protected_oe property

protected bool IsUserPresent
return bool

IsVisible protected_oe property

protected bool IsVisible
return bool

KeyEventTimer protected_oe property

protected DateTime,System KeyEventTimer
return System.DateTime

LastCursorPosition protected_oe property

protected Point LastCursorPosition
return Point

LastRect protected_oe property

protected RECT LastRect
return RECT

MinimizeOnFocusLoss protected_oe property

protected bool MinimizeOnFocusLoss
return bool

MinimizeOnGuiExit protected_oe property

protected bool MinimizeOnGuiExit
return bool

MinimizeOnStartup protected_oe property

protected bool MinimizeOnStartup
return bool

MouseCursor protected_oe property

protected bool MouseCursor
return bool

MouseTimeOutFullscreen protected_oe property

protected int MouseTimeOutFullscreen
return int

MouseTimeOutMP protected_oe property

protected int MouseTimeOutMP
return int

MouseTimeOutTimer protected_oe property

protected DateTime,System MouseTimeOutTimer
return System.DateTime

NeedRecreateSwapChain protected_oe property

protected bool NeedRecreateSwapChain
return bool

PlaylistPlayer protected_oe property

protected PlayListPlayer,MediaPortal.Playlists PlaylistPlayer
return MediaPortal.Playlists.PlayListPlayer

PreviousKeyEvent protected_oe property

protected KeyPressEventArgs,System.Windows.Forms PreviousKeyEvent
return System.Windows.Forms.KeyPressEventArgs

ScreenNumberOverride protected_oe static_oe property

protected static int ScreenNumberOverride
return int

ScreenSaverEventTimer protected_oe property

protected DateTime,System ScreenSaverEventTimer
return System.DateTime

ShuttingDown protected_oe property

protected bool ShuttingDown
return bool

SkinOverride protected_oe static_oe property

protected static string SkinOverride
return string

SplashScreen protected_oe static_oe property

protected static SplashScreen,MediaPortal SplashScreen
return MediaPortal.SplashScreen

UseEnhancedVideoRenderer protected_oe property

protected bool UseEnhancedVideoRenderer
return bool

UseMadVideoRenderer protected_oe property

protected bool UseMadVideoRenderer
return bool

Volume protected_oe static_oe property

protected static int Volume
return int

WINDOWS_NATIVE_RESOLUTION protected_oe static_oe property

protected static Size,System.Drawing WINDOWS_NATIVE_RESOLUTION
return System.Drawing.Size

Windowed protected_oe property

protected bool Windowed
return bool

WindowedOverride protected_oe static_oe property

protected static bool WindowedOverride
return bool

_backupBounds protected_oe static_oe property

protected static Rectangle,System.Drawing _backupBounds
return System.Drawing.Rectangle

_backupscreen protected_oe static_oe property

protected static Screen,System.Windows.Forms _backupscreen
return System.Windows.Forms.Screen

_firstLoadedScreen protected_oe static_oe property

protected static bool _firstLoadedScreen
return bool

_presentParams protected_oe property

protected PresentParameters _presentParams
return PresentParameters

_presentParamsBackup protected_oe property

protected PresentParameters _presentParamsBackup
return PresentParameters

_restoreLoadedScreen protected_oe static_oe property

protected static bool _restoreLoadedScreen
return bool

_screenFocus protected_oe static_oe property

protected static Screen,System.Windows.Forms _screenFocus
return System.Windows.Forms.Screen