
#ifndef _SCRUB_VIEW_H_
#define _SCRUB_VIEW_H_

#include "FootageBrowser.H"
#include <FL/Fl.H>
#include <FL/Fl_Gl_Window.H>
#include <stdint.h>
#include <string>


class ScrubView: public Fl_Gl_Window
{
	public:
		ScrubView( int x, int y, int w, int h, const char *l = 0 );
		~ScrubView();
		void draw();
		void seek_position( int64_t pos );
		int64_t getLength() { return m_fBrowser.getLength(); }
		const char* current_file() { return m_fBrowser.m_current_file.c_str(); }
		double position_in_clip() { return m_fBrowser.m_position_in_clip; }
		void scrub_clip_position( double pos );
		void addFolder( const char* folder ) { m_fBrowser.addFolder( folder ); }
		void clear() { m_fBrowser.clear(); }
		void play();
		void stop();
		void nextFrame();
		void lift( float r, float g, float b ) { m_fBrowser.lift( r, g, b ); m_dirty = true; }
		void gain( float r, float g, float b ) { m_fBrowser.gain( r, g, b ); m_dirty = true; }
		void gamma( float r, float g, float b ) { m_fBrowser.gamma( r, g, b ); m_dirty = true; }
		FootageBrowser m_fBrowser;
		bool m_dirty;
	private:
		int64_t m_position;
		bool m_scrub_clip;
		double m_scrub_clip_position;
		bool m_next_frame;

};


#endif /* _SCRUB_VIEW_H_ */

