#pragma once

#include "stdafx.h"

#include <shlwapi.h>
#pragma comment( lib, "shlwapi.lib" )

#define PROCESS_LIST	"ProcList.txt"	// 処理リストを記述したファイル名
#define DATE_STRING		64				// 日付文字列の長さ
#define DEFAULT_BASEDIR	"."
#define DEFAULT_REFFILE	"snapshot0.bmp"
#ifndef PARAM_FILE
#define PARAM_FILE		"Info.csv"
#endif

struct PParam
{
	char baseDir[PATH_LEN];
	char refFile[PATH_LEN];
	char dateStr[DATE_STRING];
	char fullDir[PATH_LEN];
	PParam()	// コンストラクタ（初期化）
	{ *baseDir = *refFile = *dateStr = *fullDir = '\0'; }
};

class CProcessList
{
private:
	PParam	*m_Param;
	int     m_NumParam;
	int     m_CurDate;
//	int     m_CurTOD;
//	int     m_CurSubject;
//	int     m_CurCount;
	bool	m_FirstTOD;
	bool    m_EndList;
	WIN32_FIND_DATA m_FindFile;
	HANDLE	m_Find;
	int		m_SelectFrame;

private:
	bool ReadFile();
	bool FindFirst();
	bool FindNext();
	void FindCalib(char *dir, char *ref, int refLen);

public:
	CProcessList(void);
	~CProcessList(void);
	bool Init();
	bool MoveNext();
	bool GetFrameDir(char *pathStr);
	bool MakeParamStr(char *buffer, int len);
	bool MakeFileStr(char *buffer, int len);
	bool IsFirstTOD() { return m_FirstTOD; }
	char* CurrentRefFile() { return m_Param[m_CurDate].refFile; };
	char* CurrentFolder() { return m_FindFile.cFileName; };
	char* CurrentDate() { return m_Param[m_CurDate].dateStr; };
	void SetSelectFrame(int f) { m_SelectFrame = f; }
	int GetSelectFrame() { return m_SelectFrame; }
};
