Transcode.h 2.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*****************************************************************************
 * Transcode.h : File Transcoder
 *****************************************************************************
 * copyright (c) 2008-2009 the vlmc team
 *
 * authors: clement chavance <chavance.c@gmail.com>
 *
 * this program is free software; you can redistribute it and/or
 * modify it under the terms of the gnu general public license
 * as published by the free software foundation; either version 2
 * of the license, or (at your option) any later version.
 *
 * this program is distributed in the hope that it will be useful,
 * but without any warranty; without even the implied warranty of
 * merchantability or fitness for a particular purpose.  see the
 * gnu general public license for more details.
 *
 * you should have received a copy of the gnu general public license
 * along with this program; if not, write to the free software
 * foundation, inc., 51 franklin street, fifth floor, boston ma 02110-1301, usa.
 *****************************************************************************/

#ifndef TRANSCODE_H
#define TRANSCODE_H

#include <QDialog>
#include <QString>
28
#include <QEvent>
29
30
#include <QProgressDialog>
#include <QTimer>
31
#include "vlc/vlc.h"
32
33
34
35
36
37
38
39
40
41

#include "ui_transcode.h"

class Transcode : public QDialog
{
    Q_OBJECT
    Q_DISABLE_COPY( Transcode )
    public:
        static Transcode *instance( QWidget* parent = 0 );

42
43
44
    protected:
        virtual void changeEvent( QEvent *e );

45
46
    private:
        explicit Transcode( QWidget *parent = 0 );
47
48
49
50
        bool m_doTranscode( const QString &transStr );
        void m_initProgressDialog();
        void m_releaseVLCRessources();

51
52
53
        Ui::Transcode m_ui;
        QString m_origVidPath;

54
55
56
57
        libvlc_exception_t m_vlcEx;
        libvlc_instance_t *m_libvlc;
        libvlc_media_t *m_vlcMedia;
        libvlc_media_player_t *m_vlcMp;
58
59
60
61
62
63
64
65
        libvlc_event_manager_t *m_vlcEM;

        qint64 m_origMediaLength;

        QProgressDialog *m_progress;
        QTimer          *m_timer;

        bool m_running;
66

67
        static Transcode *m_instance;
68
        static void m_callback(const libvlc_event_t *event, void *ptr);
69

70
    private slots:
71
72
73
74
75
76
77
78
        void on_browseFileButton_clicked();

        void on_dialogButtonBox_accepted();
        void on_dialogButtonBox_rejected();

        void on_addProfile_clicked();
        void on_editProfile_clicked();
        void on_deleteProfile_clicked();
79
80
81

        void calcTranscodePercentage();
        void cancelTranscode();
82
83
84
};

#endif