DSPlay.h

Go to the documentation of this file.
00001 //===========================================================================
00002 //Copyright (C) 2004 Zentaro Kavanagh
00003 //
00004 //Copyright (C) 2004 Commonwealth Scientific and Industrial Research
00005 // Orgainisation (CSIRO) Australia
00006 //
00007 //Redistribution and use in source and binary forms, with or without
00008 //modification, are permitted provided that the following conditions
00009 //are met:
00010 //
00011 //- Redistributions of source code must retain the above copyright
00012 //  notice, this list of conditions and the following disclaimer.
00013 //
00014 //- Redistributions in binary form must reproduce the above copyright
00015 //  notice, this list of conditions and the following disclaimer in the
00016 //  documentation and/or other materials provided with the distribution.
00017 //
00018 //- Neither the name of Zentaro Kavanagh nor the names of contributors 
00019 //  may be used to endorse or promote products derived from this software 
00020 //  without specific prior written permission.
00021 //
00022 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023 //``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024 //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00025 //PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
00026 //CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00027 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00028 //PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00029 //PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00030 //LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00031 //NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00032 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 //===========================================================================
00034 
00035 #pragma once
00036 
00037 //Unmanaged Includes
00038 #pragma unmanaged
00039 
00040 #include <uuids.h>
00041 #include <dshow.h>
00042 
00043 #include <d3d9.h>
00044 #include <vmr9.h>
00045 #include <dvdmedia.h>
00046 #include <string>
00047 
00048 #include "ICMMLCallbacks.h"
00049 #include "ICMMLAppControl.h"
00050 #include "libCMMLTags/libCMMLTags.h"
00051 #include "CMMLCallbackProxy.h"
00052 
00053 
00054 #include <fstream>
00055 
00056 //Managed Includes
00057 #pragma managed
00058 
00059 using namespace System::IO;
00060 #using "System.Drawing.dll"
00061 
00062 #using "libCMMLTagsDotNET.dll"
00063 using namespace illiminable::libCMMLTagsDotNET;
00064 
00065 #include "libDSPlayDotNet.h"
00066 #include "IDNCMMLCallbacks.h"
00067 #include "IDNMediaEvent.h"
00068 
00069 using namespace illiminable::libiWrapper;
00070 using namespace std;
00071 
00072 namespace illiminable {
00073 namespace libDSPlayDotNET
00074 {
00075 
00076         public __gc class DSPlay 
00077         {
00078         public:
00079                 DSPlay(void);
00080 
00082                 DSPlay(IntPtr inWindowHandle, Int32 inLeft, Int32 inTop, Int32 inWidth, Int32 inHeight);
00083                 ~DSPlay(void);
00084 
00086                 bool loadFile(String* inFileName);
00087 
00089                 bool play();
00090 
00092                 bool pause();
00093 
00095                 bool stop();
00096 
00098                 long getVolume();
00099 
00101                 long getBalance();
00102 
00104                 bool setVolume(long inVolume);
00105 
00107                 bool setBalance(long inBalance);
00108 
00110                 Int64 averageTimePerFrame();
00111 
00113                 Int64 averageFrameRate();
00114 
00116                 Int32 videoWidth();
00117 
00119                 Int32 videoHeight();
00120 
00122                 bool stepFrame();
00123 
00125                 bool canStepFrame();
00126 
00128                 Int64 seek(Int64 inTime);
00129 
00131                 Int64 seekStart();
00132 
00134                 Int64 queryPosition();
00135 
00137                 void repaint();
00138 
00140                 bool isLoaded();
00141 
00143                 Int64 fileSize();
00144 
00146                 Int64 fileDuration();
00147 
00149                 System::Drawing::Bitmap* GetImage();
00150         
00152                 bool setMediaEventCallback(IDNMediaEvent* inMediaEventCallback);
00153 
00155                 IDNMediaEvent* getMediaEventCallback();
00156 
00158                 bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
00159 
00161                 bool checkEvents();
00162 
00164                 void releaseInterfaces();
00165 
00166         protected:
00167 
00169                 void GetVideoInformation();
00170                 //static wstring toWStr(std::string inString);
00171                 IGraphBuilder* mGraphBuilder;
00172                 IMediaControl* mMediaControl;
00173                 IMediaSeeking* mMediaSeeking;
00174                 IMediaEvent* mMediaEvent;
00175                 IBasicAudio* mBasicAudio;
00176                 ICMMLAppControl* mCMMLAppControl;
00177                 IVideoWindow* mVideoWindow;
00178                 IBaseFilter* mVideoRenderFilter;
00179                 IVideoFrameStep* mVideoFrameStep;
00180 
00181                 IVMRWindowlessControl* mVMR7Window;
00182                 IVMRWindowlessControl9* mVMR9Window;
00183 
00184                 Int32 mLeft;
00185                 Int32 mTop;
00186                 Int32 mWidth;
00187                 Int32 mHeight;
00188 
00189                 HANDLE mEventHandle;
00190                 IntPtr mWindowHandle;
00191 
00192                 //IDNCMMLCallbacks* mDNCMMLCallbacks;
00193                 CMMLCallbackProxy* mCMMLProxy;
00194                 IDNMediaEvent* mDNMediaEvent;
00195 
00196                 bool mIsLoaded;
00197                 __int64 mFileSize;
00198                 bool isFileAnnodex(String* inFilename);
00199 
00200                 __value enum eVideoRenderer {
00201                         VR_VIDEO_WINDOW,
00202                         VR_VMR7,
00203                         VR_VMR9,
00204                         VR_NONE = 100
00205 
00206                 };
00207                 eVideoRenderer mVideoRenderType;
00208 
00209                 fstream* debugLog;
00210 
00211                 __int64 mAvgTimePerFrame;
00212                 int mVideoWidth;
00213                 int mVideoHeight;
00214                 
00215                 
00216 
00217         };
00218 }
00219 }

Generated on Tue Feb 15 14:54:22 2005 for oggdsf by  doxygen 1.3.9