MidiVid Home 

MidiVidInterface Class Reference

List of all members.

Detailed Description

The MidiVidInterface is how plugins gain access to functionality within MidiVid. Every plugin, when created, is given a pointer to the MidiVidInterface through their MVBasePlug::pMVI member. The MidiVidInterface gives plugins access to the Direct3D device, the back buffer, the MIDI continuous controllers, and some useful machine stats. It also provides a number of functions to assist plugins in many ways, including creating rendering buffers and choosing or opening source streams.


Public Member Functions

virtual HWND GetHWnd (void)
 Handle of the main window.
virtual HINSTANCE GetHInst (void)
 Handle of the application instance.
virtual IDirect3DDevice9 * GetDevice (void)
 Pointer to the D3D device interface.
virtual D3DSURFACE_DESC & GetDesc (void)
 D3DSURFACE_DESC information for the current back buffer.
virtual IDirectSound8 * GetDS (void)
virtual Surface GetTarget (void)
 Pointer to the current back buffer.
virtual bool CPUIDPresent (void) const
virtual bool MMXPresent (void) const
virtual bool CMOVPresent (void) const
virtual long CPUSpeed (void) const
 Approximate CPU speed, in KHz (eg, 3200 == 3.2GHz).
virtual long GetRAMKB (void) const
 Amount of physical RAM installed in the machine.
virtual bool NonPow2Textures (void) const
 Does the hardware support non-power-of-two textures?
virtual bool ChooseNearestTexSize (void) const
 User preference for the texture resize mode.
virtual const char * GetVertexShaderProfile (void)
 Vertex shader profile supported by the current D3D device (may be empty on old cards).
virtual const char * GetPixelShaderProfile (void)
 Pixel shader profile supported by the current D3D device (may be empty on old cards).
virtual BYTE GetMIDIControl (BYTE Channel, BYTE Which)
 Get the value of a MIDI continous controller.
virtual DWORD GetMIDIClock (void)
 Get the value of the MIDI clock (24 ticks = 1/4 note).
virtual long ValidateFilename (char *pFilename, long BufLen)
 Try to find this file, change the path if necessary.
virtual bool IsPowerOfTwo (DWORD Value)
 Returns true if the value is a power of two, false otherwise.
virtual DWORD ChooseNearPowerOfTwo (DWORD Value)
 Returns a power-of-two size, either nearest, or next larger, based on the user prefs.
virtual Texture CreateOffscreenBuffer (long XSize, long YSize, D3DFORMAT Format=D3DFMT_UNKNOWN, DWORD Usage=D3DUSAGE_DYNAMIC, D3DPOOL MemPool=D3DPOOL_DEFAULT)
 Create an off-screen buffer matching the current display format.
virtual Surface CreateOffscreenSurface (long XSize, long YSize, D3DFORMAT Format=D3DFMT_UNKNOWN, D3DPOOL MemPool=D3DPOOL_SYSTEMMEM)
 Create an off-screen buffer matching the current display format.
virtual void GetTargetDesc (D3DSURFACE_DESC &desc, bool bForce=false)
virtual char * ChooseSource (HWND hCallWnd, char *pName)
 Allow the user to open a source data stream. pName is the default name of the file or source.
virtual MVSourcePlugCreateSource (char *pName, bool bForcePow2=false)
 Creates a source plugin from a file or source name.
virtual VertexShader CompileVertexShader (CompileShaderInfo &Info)
 Compiles a vertex shader from HLSL code. Displays an error dialog if compilation errors occur.
virtual PixelShader CompilePixelShader (CompileShaderInfo &Info)
 Compiles a pixel shader from HLSL code. Displays an error dialog if compilation errors occur.
virtual float * GetFreqTable (void)
virtual int GetFreqTableSize (void)
virtual bool BassKick (void)
virtual float BassKickValue (void)
virtual float BassKickValue (int Index)
virtual int GetNumberOfBassKickValues (void)


Member Function Documentation

MidiVidInterface::GetHWnd void   )  [virtual]
 

Returns:
The handle of the main MidiVid application window - Use this handle as the parent for dialogs presented within plugins.

MidiVidInterface::GetHInst void   )  [virtual]
 

Returns:
The instance handle of the MidiVid application.

MidiVidInterface::GetDevice void   )  [inline, virtual]
 

Returns:
A pointer to the current D3D Device Interface.

MidiVidInterface::GetDesc void   )  [inline, virtual]
 

Returns:
A D3DSURFACE_DESC structure containing the information for the current back buffer.

MidiVidInterface::GetDS void   )  [virtual]
 

Returns:
A pointer to the current IDirectSound interface

MidiVidInterface::GetTarget void   )  [virtual]
 

Returns:
A pointer to the IDirect3DSurface9 interface of the current back buffer.

MidiVidInterface::CPUIDPresent void   )  const [inline, virtual]
 

Returns:
A boolean indicating whether the CPUID instruction is supported by the current processor.

MidiVidInterface::MMXPresent void   )  const [inline, virtual]
 

Returns:
true if MMX instructions are supported by this processor

MidiVidInterface::CMOVPresent void   )  const [inline, virtual]
 

Returns:
true if the CMOV instruction is supported by this processor

MidiVidInterface::CPUSpeed void   )  const [inline, virtual]
 

Returns:
The speed, in MHz, of the current machine CPU.

MidiVidInterface::GetRAMKB void   )  const [inline, virtual]
 

Returns:
The amount of physical memory installed on the machine.

MidiVidInterface::NonPow2Textures void   )  const [inline, virtual]
 

Returns:
true if the current Direct3D Device supports rendering with non power-of-two sized textures. Note that this is very probably conditional support, meaning that non power-of-two textures cannot be used with D3DTADDRESS_WRAP, and cannot use dependent reads in their pixel shaders.

MidiVidInterface::ChooseNearestTexSize void   )  const [inline, virtual]
 

Returns:
true if the user has specified that they wish to preserve memory over quality in cases where textures are required to be a power-of-two size for correct display. False if the user has chosen to preserve quality over memory (also known as choose larger, or next larger mode).

MidiVidInterface::GetVertexShaderProfile void   )  [inline, virtual]
 

Returns:
A pointer to a null terminated string containing the name of the maximum vertex shader profile supported by the current Direct3D Device. If the string is empty, no D3D9 capable hardware is present. This string can be used as the pProfile paramter to the D3DXCompileShader function when compiling vertex shaders.

MidiVidInterface::GetPixelShaderProfile void   )  [inline, virtual]
 

Returns:
A pointer to a null terminated string containing the name of the maximum pixel shader profile supported by the current Direct3D Device. If the string is empty, no D3D9 capable pixel shader hardware is present. This string can be used as the pProfile paramter to the D3DXCompileShader function when compiling pixel shaders.

MidiVidInterface::GetMIDIControl BYTE  Channel,
BYTE  Which
[virtual]
 

Parameters:
Channel The MIDI channel to query the value for (generally you use your MVPlug::StartChan value).
Which The MIDI controller number to query (0-127).
Returns:
The current value of a MIDI continous controller.

MidiVidInterface::GetMIDIClock void   )  [virtual]
 

Get the value of the MIDI clock (24 ticks = 1/4 note). This is the current running MIDI program time, based on the tempo of the master MIDI clock. A MIDI song start message will reset this clock.

MidiVidInterface::ValidateFilename char *  pFilename,
long  BufLen
[virtual]
 

This function will check to see if a file exists at the indicated location. If it doesn't, it checks to see if the file exists in the same folder as the current Performance file. If the file is found there, the filename is changed.

Parameters:
pFilename The full path of the file to validate
BufLen The length of the character array pointed to by pFilename.
Returns:
0 if the file was found at the specified location, or -1 if the file could not be found. If the filename is found in the performance folder, the return value will be either the original buffer length if buffer is large enough to hold the modified file path, or the size of buffer required to hold the new file path.
See also:
Bundling a Performance

MidiVidInterface::IsPowerOfTwo DWORD  Value  )  [virtual]
 

Returns:
true if Value is a power of two, false otherwise

MidiVidInterface::ChooseNearPowerOfTwo DWORD  Value  )  [virtual]
 

Returns the nearest power-of-two value either above or below the specified value, based on the preferences set by the user for the current performance. If the user has chosen to preserve quality, the returned value will always be equal or greater than the requested value. If the user has chosen to preserve memory, the value will be the closest power of two, either larger or smaller, to the specified value.

Parameters:
Value The value to determine a suitable power-of-two alternative for.
Returns:
A power-of-two size, either nearest, or next larger, based on the user prefs
See also:
Performance Options Video tab

MidiVidInterface::CreateOffscreenBuffer long  XSize,
long  YSize,
D3DFORMAT  Format = D3DFMT_UNKNOWN,
DWORD  Usage = D3DUSAGE_DYNAMIC,
D3DPOOL  MemPool = D3DPOOL_DEFAULT
[virtual]
 

Create an off-screen D3DTexture buffer

Parameters:
XSize Width of the texture buffer to create
YSize Height of the texture buffer to create
Format The D3DFORMAT of the texture to create. Defaults to D3DFMT_UNKNOWN , which returns a texture in the same format as the back buffer.
Usage The D3DUSAGE flags for the created texture. Defaults to D3DUSAGE_DYNAMIC.
MemPool the D3DPOOL flags for the created texture. Defaults to D3DPOOL_DEFAULT.

MidiVidInterface::CreateOffscreenSurface long  XSize,
long  YSize,
D3DFORMAT  Format = D3DFMT_UNKNOWN,
D3DPOOL  MemPool = D3DPOOL_SYSTEMMEM
[virtual]
 

Create an off-screen D3DSurface buffer

Parameters:
XSize Width of the texture buffer to create
YSize Height of the texture buffer to create
Format The D3DFORMAT of the texture to create. Defaults to D3DFMT_UNKNOWN , which returns a texture in the same format as the back buffer.
MemPool the D3DPOOL flags for the created texture. Defaults to D3DPOOL_SYSTEMMEM.

MidiVidInterface::GetTargetDesc D3DSURFACE_DESC &  desc,
bool  bForce = false
[virtual]
 

Returns:
A pointer to the IDirect3DSurface9 interface of the current back buffer

MidiVidInterface::ChooseSource HWND  hCallWnd,
char *  pName
[virtual]
 

ChooseSource presents the user with a dialog box allowing them to select from any of the file types handled by MVSourcePlug objects registered with MidiVid, including non-file sources like the frame buffer and capture sources. The chosen source is returned as either a file path, or a unique string identifier which can later be used by the MidiVidInterface::CreateSource function to create an instance of the data source.

Parameters:
hCallWnd The window handle of the dialog calling the ChooseSource function, used as the parent for the window this function creates.
pName a pointer to the name of the current data source, or null if no source is currently in use.
Returns:
A pointer to a temporary buffer containing the name of the chosen source. Copy this string to a member within your plugin. The return value will be null if the user cancels the selection.
See also:
CreateSource

MidiVidInterface::CreateSource char *  pName,
bool  bForcePow2 = false
[virtual]
 

Creates a source plugin from a file path or source identifier.

Parameters:
pName The name of the source to open. This should be the string returned by MidiVidInterface::ChooseSource, or a fully qualified path to a file of a known supported type, such as AVI.
bForcePow2 Tells MidiVid whether the source data should be scaled to a power-of-two size in order to enable certain rendering abilities. Most video cards which support non power-of-two sized textures provide conditional support, meaning that non power-of-two textures cannot be used with D3DTADDRESS_WRAP, and cannot use dependent reads in their pixel shaders. If your plugin wants to tile the source texture over a polygon, or will use dependant reads to access the texture, pass true in this parameter.
See also:
ChooseSource

MidiVidInterface::CompileVertexShader CompileShaderInfo Info  )  [virtual]
 

See also:
CompileShaderInfo

MidiVidInterface::CompilePixelShader CompileShaderInfo Info  )  [virtual]
 

See also:
CompileShaderInfo


The documentation for this class was generated from the following files:

MidiVid GPU Version 1.0
Copyright (c) 2005 Jason Dorie and VUTAG
Generated on: Sun Jan 25 23:45:41 2009