forked from mltframework/shotcut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
126 lines (113 loc) · 3.52 KB
/
player.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
* Copyright (c) 2012 Meltytech, LLC
* Author: Dan Dennedy <dan@dennedy.org>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLAYER_H
#define PLAYER_H
#include <QWidget>
#include <QtGui/QIcon>
#include <QtCore/QSettings>
#include "mltcontroller.h"
class ScrubBar;
class QSpinBox;
class QLabel;
class TimeSpinBox;
class AudioSignal;
class QSlider;
namespace Ui {
class Player;
}
class Player : public QWidget
{
Q_OBJECT
public:
explicit Player(QWidget *parent = 0);
void setIn(unsigned);
void setOut(unsigned);
void setMarkers(const QList<int>&);
unsigned position() const {
return m_position;
}
signals:
void endOfStream();
void seeked();
void showStatusMessage(QString);
void audioSamplesSignal(const QVector<int16_t>&, const int&, const int&, const int&);
void inChanged(int);
void outChanged(int);
public slots:
void play(double speed = 1.0);
void pause();
void stop();
void togglePlayPaused();
void seek(int position);
void onProducerOpened();
void onShowFrame(Mlt::QFrame frame);
void onVolumeChanged(int);
void onCaptureStateChanged(bool);
void resetProfile();
void rewind();
void fastForward();
protected:
void resizeEvent(QResizeEvent* event);
private:
void readSettings();
void changeDeinterlacer(bool checked, const char* method);
void changeInterpolation(bool checked, const char* method);
void showAudio(Mlt::Frame* frame);
Ui::Player* ui;
QSettings m_settings;
ScrubBar* m_scrubber;
TimeSpinBox* m_positionSpinner;
QLabel* m_durationLabel;
QLabel* m_inPointLabel;
QLabel* m_selectedLabel;
unsigned m_position;
QIcon m_playIcon;
QIcon m_pauseIcon;
QSlider* m_volumeSlider;
AudioSignal* m_audioSignal;
int m_seekPosition;
int m_previousIn;
int m_previousOut;
double m_savedVolume;
private slots:
void updateSelection();
void onInChanged(int in);
void onOutChanged(int out);
void on_actionSkipNext_triggered();
void on_actionSkipPrevious_triggered();
void onVideoWidgetContextMenu(const QPoint& pos);
#ifdef Q_WS_X11
void on_actionOpenGL_triggered(bool checked);
#endif
void on_actionRealtime_triggered(bool checked);
void on_actionProgressive_triggered(bool checked);
void on_actionOneField_triggered(bool checked);
void on_actionLinearBlend_triggered(bool checked);
void on_actionYadifTemporal_triggered(bool checked);
void on_actionYadifSpatial_triggered(bool checked);
void on_actionNearest_triggered(bool checked);
void on_actionBilinear_triggered(bool checked);
void on_actionBicubic_triggered(bool checked);
void on_actionHyper_triggered(bool checked);
void on_actionJack_triggered(bool checked);
void onExternalTriggered(QAction*);
void onProfileTriggered(QAction*);
void onVolumeButtonToggled(bool checked);
void onMuteButtonToggled(bool checked);
};
#endif // PLAYER_H