SDXFrameWork  0.04
SDXFrameWork
 全て クラス ネームスペース 関数 変数 ページ
Movie.h
1 #pragma once
2 #include<Multimedia/SDX.h>
3 #include<Multimedia/Image.h>
4 
5 namespace SDX
6 {
8 class Movie
10 {
11 private:
12  std::string fileName;
13 public:
14 
16  Movie(const char *ファイル名)
17  {
18  this->fileName = ファイル名;
19  }
20 
22  bool Load(const char *ファイル名)
25  {
26  this->fileName = ファイル名;
27  return true;
28  }
29 
31  void Play(int 拡大率 , bool 途中キャンセルフラグ)
34  {
35  #ifdef DXLIB
36  if( 途中キャンセルフラグ )
37  {
38  PlayMovie( fileName.c_str() , 拡大率 , DX_MOVIEPLAYTYPE_BCANCEL ) ;
39  }else{
40  PlayMovie( fileName.c_str() , 拡大率 , DX_MOVIEPLAYTYPE_NORMAL ) ;
41  }
42  #elif defined(SDL)
43  #endif
44  }
45 };
46 
48 class MovieImage
50 {
51 private:
52  int handle;
53  bool isTrans;
54  MovieImage(const MovieImage &movie);
55  MovieImage& operator =(const MovieImage &movie);
56  int width;
57  int height;
58 public:
59  MovieImage():
60  isTrans(false)
61  {}
62 
64  MovieImage(const char *ファイル名)
65  {
66  Load(ファイル名);
67  }
68 
70  bool Load(const char *ファイル名)
72  {
73  #ifdef DXLIB
74  if(this->handle != NULL_HANDLE) DxLib::DeleteGraph(this->handle);
75  this->handle = DxLib::LoadGraph(ファイル名);
76  return (this->handle != -1);
77  #elif defined(SDL)
78  return false;
79  #endif
80  }
81 
83  bool Release()
85  {
86  #ifdef DXLIB
87  return !DxLib::DeleteGraph(this->handle);
88  #elif defined(SDL)
89  return false;
90  #endif
91  }
92 
94  int GetHandle()
95  {
96  return this->handle;
97  }
98 
100  bool Play()
101  {
102  #ifdef DXLIB
103  return !DxLib::PlayMovieToGraph( this->handle );
104  #elif defined(SDL)
105  return false;
106  #endif
107  }
108 
110  bool Pause()
111  {
112  #ifdef DXLIB
113  return !DxLib::PauseMovieToGraph( this->handle ) ;
114  #elif defined(SDL)
115  return false;
116  #endif
117  }
118 
120  int Seek(int 再生位置)
121  {
122  #ifdef DXLIB
123  return DxLib::SeekMovieToGraph( this->handle , 再生位置 ) ;
124  #elif defined(SDL)
125  return false;
126  #endif
127  }
128 
130  int Tell()
131  {
132  #ifdef DXLIB
133  return DxLib::TellMovieToGraph( this->handle ) ;
134  #elif defined(SDL)
135  return false;
136  #endif
137  }
138 
140  bool Check()
141  {
142  #ifdef DXLIB
143  return (DxLib::GetMovieStateToGraph( this->handle ) == 1);
144  #elif defined(SDL)
145  return false;
146  #endif
147  }
148 
150  bool Draw(int X座標,int Y座標 , bool 反転フラグ = false)
151  {
152  #ifdef DXLIB
153  if (反転フラグ) return !DxLib::DrawTurnGraph(X座標, Y座標, this->handle, this->isTrans);
154  else return !DxLib::DrawGraph(X座標, Y座標, this->handle, this->isTrans);
155  #elif defined(SDL)
156  return false;
157  #endif
158  }
159 
161  bool DrawExtend(int X座標A, int Y座標A, int X座標B, int Y座標B)
162  {
163  #ifdef DXLIB
164  return !DxLib::DrawExtendGraph(X座標A, Y座標A, X座標B, Y座標B, this->handle, this->isTrans);
165  #elif defined(SDL)
166  return false;
167  #endif
168  }
169 
171  bool DrawRotate(int X座標, int Y座標, double 拡大率, double 角度, bool 反転フラグ = false)
172  {
173  #ifdef DXLIB
174  return !DxLib::DrawRotaGraph(X座標, Y座標, 拡大率, 角度, this->handle, this->isTrans, 反転フラグ);
175  #elif defined(SDL)
176  return false;
177  #endif
178  }
179 
181  bool DrawRotateAxis(int X座標, int Y座標, int X軸, int Y軸, double 拡大率, double 角度, bool 反転フラグ = false)
182  {
183  #ifdef DXLIB
184  return !DxLib::DrawRotaGraph2(X座標, Y座標, X軸, Y軸, 拡大率, 角度, this->GetHandle(), this->isTrans, 反転フラグ);
185  #elif defined(SDL)
186  return false;
187  #endif
188  }
189 
191  bool DrawModify(int X頂点A, int Y頂点A, int X頂点B, int Y頂点B, int X頂点C, int Y頂点C, int X頂点D, int Y頂点D) const
192  {
193  #ifdef DXLIB
194  return !DxLib::DrawModiGraph( X頂点A, Y頂点A, X頂点B, Y頂点B, X頂点C, Y頂点C, X頂点D, Y頂点D, this->handle, this->isTrans);
195  #elif defined(SDL)
196  return false;
197  #endif
198  }
199 
201  bool DrawPart(int destX,int destY,int srcX, int srcY, int width, int height, bool isTurn)
202  {
203  #ifdef DXLIB
204  return !DxLib::DrawRectGraph( destX , destY , srcX , srcY , width , height , this->handle , this->isTrans , isTurn );
205  #elif defined(SDL)
206  return false;
207  #endif
208  }
209 
211  int GetWidth()
212  {
213  return width;
214  }
215 
217  int GetHeight()
218  {
219  return height;
220  }
221 
222 };
223 }
bool DrawExtend(int X座標A, int Y座標A, int X座標B, int Y座標B)
指定矩形内に描画.
Definition: Movie.h:161
bool DrawRotate(int X座標, int Y座標, double 拡大率, double 角度, bool 反転フラグ=false)
角度、拡大率を指定して描画.
Definition: Movie.h:171
int GetHeight()
高さを取得.
Definition: Movie.h:217
bool DrawRotateAxis(int X座標, int Y座標, int X軸, int Y軸, double 拡大率, double 角度, bool 反転フラグ=false)
角度、拡大率を指定して描画.
Definition: Movie.h:181
void Play(int 拡大率, bool 途中キャンセルフラグ)
動画を再生.
Definition: Movie.h:33
bool Check()
動画が再生中か取得.
Definition: Movie.h:140
bool DrawPart(int destX, int destY, int srcX, int srcY, int width, int height, bool isTurn)
一部を指定して描画.
Definition: Movie.h:201
bool Draw(int X座標, int Y座標, bool 反転フラグ=false)
指定座標に描画.
Definition: Movie.h:150
bool Load(const char *ファイル名)
ファイルの読込.
Definition: Movie.h:71
int GetWidth()
幅を取得.
Definition: Movie.h:211
bool Release()
ファイルの開放.
Definition: Movie.h:84
int Seek(int 再生位置)
動画の再生位置を設定.
Definition: Movie.h:120
int Tell()
動画の再生位置を取得.
Definition: Movie.h:130
Movie(const char *ファイル名)
動画ファイルの登録.
Definition: Movie.h:16
MovieImage(const char *ファイル名)
ファイルの読込.
Definition: Movie.h:64
int GetHandle()
ハンドルの取得.
Definition: Movie.h:94
bool Load(const char *ファイル名)
動画ファイルの登録.
Definition: Movie.h:24
bool Pause()
動画の停止.
Definition: Movie.h:110
bool Play()
動画の再生.
Definition: Movie.h:100
bool DrawModify(int X頂点A, int Y頂点A, int X頂点B, int Y頂点B, int X頂点C, int Y頂点C, int X頂点D, int Y頂点D) const
四角形に変形描画.
Definition: Movie.h:191