#ifndef MOC_SEEKBAR_H
#define MOC_SEEKBAR_H
 
#include <QWidget>
#include <QtWidgets>
#include "disp_qt.h"

QT_BEGIN_NAMESPACE
class MainWindow;
QT_END_NAMESPACE

class DispQtMainwinSeekslider : public QSlider
{
Q_OBJECT
public:
	DispQtMainwinSeekslider(MainWindow *main_window = 0, QWidget *parent = 0);
	void mainwin_seekslider_config_style_apply(bool);
	void mainwin_seekslider_set_timelen(int timelen);
	void mainwin_seekslider_set_timepos(int);

protected:
	void wheelEvent(QWheelEvent *event);
	void mousePressEvent(QMouseEvent *event);
	void mouseReleaseEvent(QMouseEvent *event);
	void mouseMoveEvent(QMouseEvent *event);
	bool event(QEvent *event);
	void keyPressEvent(QKeyEvent *event);

private:
	MainWindow *main_window;
	bool mouse_is_pressed, mouse_is_moved_while_pressed;
	int time_len_ms;
};

class DispQtMainwinSeekbar : public QWidget
{
Q_OBJECT
public:
	DispQtMainwinSeekbar(MainWindow *main_window = 0, QWidget *parent = 0);
	void mainwinseekbar_set_currfileinfos(struct dispqt_currfileinfo_s *cur);

Q_SIGNALS:
	//void signal_mainwinseekbar_config_style_apply(bool lucent_enable);
	void signal_mainwinseekbar_set_timepos(int);
	void signal_mainwinseekbar_option_timemode_change(unsigned int);

public Q_SLOTS:
	void mainwinseekbar_config_style_apply(bool);
	void mainwinseekbar_set_timepos(int);
	void mainwinseekbar_option_timemode_change(unsigned int);
	void mainwinseekbar_timelabel_change_timemode(void);

private:
	MainWindow *main_window;
	QHBoxLayout *layout_seekbar;
	DispQtMainwinSeekslider *seek_slider;
	QLabel *label_songnums, *label_times;
	//QPushButton *label_songnums, *label_times;
	int time_len_ms;
	unsigned int time_display_mode;
	QMutex mutex_seekbar;
};


#endif // MOC_SEEKBAR_H
