#ifndef __DIRECTORY_LOADER
#define __DIRECTORY_LOADER

#include <vdr/thread.h>

#include "digitalcamera.h"

#define DL_BUFLEN 255

class cDirectoryLoader : public cThread {

private:
	// Is thread running
	bool running;
	// Should downloading process give OSD messages
	bool verbose;
	
	char PathOnCamera[DL_BUFLEN];
	DigitalCamera *dCam;
	
	// Total numbers of files to download
	int fileCount;
	// current file
	int currentFile;
protected:
	virtual void Action(void);

public:
	cDirectoryLoader();
	virtual ~cDirectoryLoader();
	
	void Start( const char* pathOnCamera );
	void StartNoThread( DigitalCamera *camera, const char* pathOnCamera );
	
	void Download(void);
	void OSDStatus(const char* prefix);
		
	void Stop(void);
	
	void SetVerbose( bool on );
	int GetFileCount(void);
	int GetCurrentFile(void);
};

#endif
