#ifndef __DIRECTORY_LOADER
#define __DIRECTORY_LOADER

#include <vdr/thread.h>

#include "digitalcamera.h"
#include "facts-base.h"

#define DL_BUFLEN 255

class cDirectoryLoader : public cThread {

private:
	char PathOnCamera[DL_BUFLEN];
	DigitalCamera *dCam;
	
	// Total numbers of files to download
	int fileCount;
	// current file
	int currentFile;
	
	char Message[FACTSHEET_BUFLEN];
	
	void Download(void);
	void OSDStatus(const char* prefix, bool printFileCount = true);
	
protected:
	virtual void Action(void);

public:
	cDirectoryLoader();
	
	void Start( const char* pathOnCamera );
	void StartNoThread( DigitalCamera *camera, const char* pathOnCamera );
		
	void Stop(void);
	
	int GetFileCount(void);
	int GetCurrentFile(void);
	
	const char* GetMessage();
};

#endif
