Newer
Older
PrismSoftware / ECTrainer2 / MovieObject.h
#pragma once

#include <vector>
#include <string>

#include "myWinUtils.h"


// 構成要素
struct Element {
	float x;	// X座標
	float y;	// Y座標
	float d;	// サイズ

	Element(float X, float Y, float D) {
		x = X;
		y = Y;
		d = D;
	}
};

// フレーム情報
struct FrameInfo {
	float eTime;	// 時間
	std::vector<Element> elements;	// 要素群
};

// 映像オブジェクトクラス
class MovieObject {
	std::vector<FrameInfo> _frame;
	int _lastAccess;

public:
	// コンストラクタ
	MovieObject();
	// テーブルからデータをセット
	int SetData(mwut::STR_TABLE table);
	// ファイル名からデータをセット
	int SetData(const std::string& filename);
	// 指定時間のオブジェクト情報を返す
	std::vector<Element> GetElements(float sTime);
	// フレーム数を返す
	int GetNumFrames() { return (int)_frame.size(); }
	// 空かどうか
	bool IsEmpty() { return _frame.size() < 1; }
	// 消去
	void Clear() { _frame.clear(); _lastAccess = 0; }
};