Miam-Player  0.8.0
A nice music player
SubtitleFilter.h
Go to the documentation of this file.
1 /******************************************************************************
2  QtAV: Multimedia framework based on Qt and FFmpeg
3  Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
4 
5 * This file is part of QtAV (from 2014)
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ******************************************************************************/
21 
22 #ifndef QTAV_SUBTITLEFILTER_H
23 #define QTAV_SUBTITLEFILTER_H
24 
25 #include <QtAV/Filter.h>
26 #include <QtAV/Subtitle.h>
27 //final class
28 
29 namespace QtAV {
30 
31 class AVPlayer;
32 class SubtitleFilterPrivate;
39 {
40  Q_OBJECT
42  Q_PROPERTY(QByteArray codec READ codec WRITE setCodec NOTIFY codecChanged)
43  Q_PROPERTY(QStringList engines READ engines WRITE setEngines NOTIFY enginesChanged)
44  Q_PROPERTY(QString engine READ engine NOTIFY engineChanged)
45  Q_PROPERTY(bool fuzzyMatch READ fuzzyMatch WRITE setFuzzyMatch NOTIFY fuzzyMatchChanged)
46  //Q_PROPERTY(QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged)
47  Q_PROPERTY(QStringList dirs READ dirs WRITE setDirs NOTIFY dirsChanged)
48  Q_PROPERTY(QStringList suffixes READ suffixes WRITE setSuffixes NOTIFY suffixesChanged)
49  Q_PROPERTY(QStringList supportedSuffixes READ supportedSuffixes NOTIFY supportedSuffixesChanged)
50  Q_PROPERTY(bool canRender READ canRender NOTIFY canRenderChanged)
51  Q_PROPERTY(qreal delay READ delay WRITE setDelay NOTIFY delayChanged)
52 
53  Q_PROPERTY(bool autoLoad READ autoLoad WRITE setAutoLoad NOTIFY autoLoadChanged)
54  Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged)
55  Q_PROPERTY(QRectF rect READ rect WRITE setRect NOTIFY rectChanged)
56  Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
57  Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
58  // font properties for libass engine
59  Q_PROPERTY(QString fontFile READ fontFile WRITE setFontFile NOTIFY fontFileChanged)
60  Q_PROPERTY(QString fontsDir READ fontsDir WRITE setFontsDir NOTIFY fontsDirChanged)
61  Q_PROPERTY(bool fontFileForced READ isFontFileForced WRITE setFontFileForced NOTIFY fontFileForcedChanged)
62 public:
63  explicit SubtitleFilter(QObject *parent = 0);
64  void setPlayer(AVPlayer* player);
65  bool isSupported(VideoFilterContext::Type ct) const Q_DECL_OVERRIDE {
67  }
72  void setFile(const QString& file);
73  QString file() const;
78  bool autoLoad() const;
79  // <1 means normalized. not valid means the whole target rect. default is (0, 0, 1, 0.9) and align bottom
80  void setRect(const QRectF& r);
81  QRectF rect() const;
82  void setFont(const QFont& f);
83  QFont font() const;
84  void setColor(const QColor& c);
85  QColor color() const;
86 public slots:
87  // TODO: enable changed & autoload=> load
88  void setAutoLoad(bool value);
89 signals:
90  void rectChanged();
91  void fontChanged();
92  void colorChanged();
93  void autoLoadChanged(bool value);
94 signals:
95  void fileChanged();
96  void canRenderChanged();
97  void loaded(const QString& path);
98 
99  void codecChanged();
100  void enginesChanged();
101  void fuzzyMatchChanged();
102  void contentChanged();
103  //void fileNameChanged();
104  void dirsChanged();
105  void suffixesChanged();
106  void supportedSuffixesChanged();
107  void engineChanged();
108  void delayChanged();
109  void fontFileChanged();
110  void fontsDirChanged();
111  void fontFileForcedChanged();
112 
113 protected:
114  void process(Statistics* statistics, VideoFrame* frame) Q_DECL_OVERRIDE;
115 };
116 
117 } //namespace QtAV
118 #endif // QTAV_SUBTITLEFILTER_H
Definition: Filter.h:77
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
Definition: FilterContext.h:41
Definition: VideoFrame.h:32
The SubtitleFilter class draw text and image subtitles Subtitle load priority: user specified file (s...
Definition: SubtitleFilter.h:38
Definition: FilterContext.h:45
The AVPlayer class Preload:
Definition: AVPlayer.h:62
Definition: Statistics.h:35
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Definition: FilterContext.h:49
#define Q_DECL_OVERRIDE
Definition: QtAV_Global.h:177
Definition: Subtitle.h:220