00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #pragma once
00036
00037
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
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
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
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 }