#ifndef QREMOTE_PLAYBACK_H
#define QREMOTE_PLAYBACK_H

#include <QWidget>
#include <QTimer>
#include "ui_qremote_playback.h"
#include "nss_toolkit.h"

class QRemotePlayback : public QWidget
{
    Q_OBJECT

public:
    QRemotePlayback(QWidget *parent);
    ~QRemotePlayback();

    void id(DEVICE_ID val);

    void show();

    void ClearSearchResult();

    void OnSearchResult(NsstMediaFileList* filelist);

    void OnSDKMessage( int event_type,NsstEventCommonParam* event_param );

    void OnGetJPEGProgress(int speed,int current_size,int total_size);

    void OnJPEGResult(int error_code);

    void closeEvent(QCloseEvent *);
public slots:
    void SlotOnSearchFiles();

    void SlotOnFileListDblClicked(QListWidgetItem *item);

    void OnClickPlay();
    void OnClickFast();
    void OnClickSlow();
    void OnClickStep();
    void OnClickAudio();
    void OnClickStop();

    void OnTimerGetProgress();

    void OnChangeProgress();

    void GoToPage();
private:
    Ui::formRemotePlayback ui_;

    NsstMediaFileList list_;

    NsstChannel vod_play_channel_;
    NsstChannel vod_download_channel_;

    NsstSearchFileCondition condition_;

    DrawParams params_;

    int current_play_index_;

    int file_type_;

    QTimer* timer_get_progress_;

    bool paused_;

    bool audio_;

    void DoSearch(int begin,int count);
};

#endif // QREMOTE_PLAYBACK_H
