#pragma once
#include <Windows.h>
#include <tchar.h>
#include <vector>
#include <string>
#include "myOpenCV.h"
#include "RingBuffer.h"
class BaseProcess;
class Marker;
class MovieObject;
enum class STIM_PAGE;
struct StimInfo {
int type; // 1:画像 2:動画
std::string filename; // 提示ファイル
float dulation; // 時間(sec)
std::string csvfile; // ターゲット座標ファイル(無い場合は_アンダーバー)
};
class Stimulus : public BaseProcess
{
public:
private:
const cv::String OPENING_FILE = "../images/ECT_toppage.png";
const cv::String CALIB_FILE = "../images/calib.png";
const cv::String CALIB_COMPLETE_FILE = "../images/CalibComplete.png";
const cv::String CALIB_FAILED_FILE = "../images/CalibFailed.png";
const cv::String WHITE_FILE = "../images/white.png";
const std::string STIM_CONFIG_FILE = "StimConfig.txt";
std::vector<StimInfo> _StimInfoSet; // 実験設定
MovieObject* _pMovieObject; // ターゲット情報
int _StimNo; // 刺激データ番号 -1:停止
DWORD _StartTime; // 刺激提示開始時間
RingBuffer<cv::Mat> _Display; // 表示画像
RingBuffer<std::wstring> _Movie; // 動画情報
// 刺激を設定
bool SetStimulus();
// 動画オブジェクトの
void LoadMovieObject();
// 基本処理
bool Routine();
// イベント処理
bool EventProc(MSG& msg);
// 画像にマーカーを描画
//void StimWithMarker();
public:
// コンストラクタ
Stimulus(ECTrainer* pEct);
// デストラクタ
~Stimulus();
// 初期化
bool Init();
// 動画情報を返す
std::wstring GetMovie() { return _Movie.Get(); }
// 動画情報の更新状態
bool IsNewMovie() { return _Movie.IsNew(); }
// 表示画像を返す
cv::Mat GetDisplay() { return _Display.Get(); }
// 表示画像の更新状態
bool IsNewDisplay() { return _Display.IsNew(); }
};