MidiVid Home 

MVSourcePlug.h

Go to the documentation of this file.
00001 /* 00002 00003 MVSourcePlug.h - MidVid Stream Source Plugin class definition 00004 00005 */ 00006 00007 #pragma once 00008 #ifndef MVSOURCEPLUG_H__ 00009 #define MVSOURCEPLUG_H__ 00010 00013 // Use the string "MVSourceChooserClass" as the class name for your custom control when you 00014 // wish to display the standard file source chooser control on your plugin config panel. 00015 00016 // ---------------------------------------------------------------------------- 00025 class MVSourcePlugDesc : public MVPlugDesc 00026 { 00027 public: 00028 virtual ~MVSourcePlugDesc() {;} 00029 00030 virtual bool IsFileSource(void) = 0; 00031 virtual bool IsAnimated(void) = 0; 00032 virtual int NumExtensions(void) = 0; 00033 virtual const char *GetExtension(int Num) = 0; 00034 virtual const char *GetIdentifier(void) {return 0;} 00035 00036 virtual bool IsConfigurable(void) {return false;} 00037 virtual bool Configure(HWND hWnd) {return true;} 00038 00039 virtual bool LoadConfig(TagStream &f) {return true;} 00040 virtual bool SaveConfig(TagStream &f) {return true;} 00041 }; 00042 00043 00044 // ---------------------------------------------------------------------------- 00048 struct MVSourceInfo 00049 { 00050 bool bHasVideo, bHasAudio; 00051 int Width, Height; 00052 D3DFORMAT Format; 00053 }; 00054 00055 // ---------------------------------------------------------------------------- 00063 class MVSourcePlug : public MVBasePlug 00064 { 00065 public: 00066 virtual ~MVSourcePlug() {;} 00067 00068 virtual bool IsConfigurable(void) {return false;} 00069 virtual bool IsFiniteLength(void) {return true;} 00070 virtual bool Configure(HWND hWnd) {return true;} 00071 00072 // It is the responsibility of the plugin using a given source to call these two functions to load / save the configuration of a stream if required 00073 virtual bool LoadConfig(TagStream &f) {return true;} 00074 virtual bool SaveConfig(TagStream &f) {return true;} 00075 00076 00077 // These two functions must be called, if necessary, before calling the Open() function on a stream 00078 virtual void SetLoopPlay(bool bLoop) = 0; 00079 virtual void SetPlayAudio(bool bAud) = 0; 00080 virtual void SetForcePow2(bool bPow2) = 0; 00081 00082 virtual bool Open(const char *pFilename) = 0; 00083 virtual bool GetInfo(MVSourceInfo &Info) = 0; 00084 00085 virtual bool HasAudio(void) = 0; 00086 virtual void SetVolume(BYTE Val) = 0; 00087 virtual void SetPan(BYTE Val) = 0; 00088 00089 virtual bool NoteOn(BYTE Velocity) = 0; 00090 00091 // Use these two functions to retrieve the info needed to render the source 00092 virtual Texture GetTexture(void) = 0; 00093 virtual D3DXVECTOR2 *GetCoords(void) = 0; 00094 00095 virtual bool NoteOff(void) = 0; 00096 virtual void Close(void) = 0; 00097 00098 virtual void Reset(void) = 0; 00099 00100 // Return true on success, false on error 00101 virtual bool Update(int msElapsed, bool &bAtEnd, bool &bFrameChanged) = 0; 00102 }; 00103 00104 00198 /* 00199 MVSourcePlug::IsConfigurable(void) //!< Can this source be configured? (local, per-stream) 00200 MVSourcePlug::IsFiniteLength(void) {return true;} //!< AVI or MPEG = true, BMP or VidCap = false 00201 MVSourcePlug::Configure(HWND hWnd) {return true;} //!< Execute configuration for the source (local, per-stream options only) 00202 00203 // It is the responsibility of the plugin using a given source to call these two functions to load / save the configuration of a stream if required 00204 MVSourcePlug::LoadConfig(TagFile &f) {return true;} //!< Read the source config from the indicated file 00205 MVSourcePlug::SaveConfig(TagFile &f) {return true;} //!< Write the source config to the indicated file 00206 00207 00208 // These two functions must be called, if necessary, before calling the Open() function on a stream 00209 MVSourcePlug::SetLoopPlay(bool bLoop) = 0; //!< For file sources - Specify that the file should loop back to the beginning during playback 00210 MVSourcePlug::SetPlayAudio(bool bAud) = 0; //!< For file sources - Specify that the file should stream audio during playback (if available) 00211 MVSourcePlug::SetForcePow2(bool bPow2) = 0; //!< Enforce power-of-two sizing, scaling if necessary, as tiling will be used 00212 00213 MVSourcePlug::Open(const char *pFilename) = 0; //!< Open the file (files) or just initialize the source (non-files) - true = success 00214 MVSourcePlug::GetInfo(MVSourceInfo &Info) = 0; //!< Retrieve information about the opened source 00215 00216 MVSourcePlug::HasAudio(void) = 0; //!< Does the opened source contain audio data? 00217 MVSourcePlug::SetVolume(BYTE Val) = 0; //!< 0 - 127 == off to full 00218 MVSourcePlug::SetPan(BYTE Val) = 0; //!< 0 - 127 == left to right (64 = center) 00219 00220 MVSourcePlug::NoteOn(BYTE Velocity) = 0; //!< To be called within NoteOn in the host plugin. Velocity = 0 - 127 00221 00222 // Use these two functions to retrieve the info needed to render the source 00223 MVSourcePlug::GetTexture(void) = 0; //!< Retrieve the texture used to render the stream 00224 MVSourcePlug::GetCoords(void) = 0; //!< Retrieve the upper left & lower right texture coordinates the image resides in 00225 00226 MVSourcePlug::NoteOff(void) = 0; //!< To be called within NoteOff in the host plugin 00227 MVSourcePlug::Close(void) = 0; //!< Close the stream, deallocate resources 00228 00229 MVSourcePlug::Reset(void) = 0; //!< "Manually" rewind the file back to the beginning 00230 00231 // Return true if you've completed a cycle, false if there are more frames 00232 MVSourcePlug::Update(int msElapsed) = 0; //!< Update the position in the file stream by the elapsed time 00233 */ 00234 00235 00236 #endif


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