MythTV  master
subtitlereader.h
Go to the documentation of this file.
1 #ifndef SUBTITLEREADER_H
2 #define SUBTITLEREADER_H
3 
4 #include <QMutex>
5 
6 extern "C" {
7 #include "libavcodec/avcodec.h"
8 }
9 
10 #include "mythdeque.h"
11 #include "textsubtitleparser.h"
12 
14 {
15  public:
16  AVSubtitles() = default;
18  QMutex m_lock;
19  bool m_fixPosition {false};
20 };
21 
23 {
24  public:
25  RawTextSubs(void) = default;
26 
27  QStringList m_buffers;
28  uint64_t m_duration {0};
29  QMutex m_lock;
30 };
31 
33 {
34  public:
35  SubtitleReader() = default;
37 
38  void EnableAVSubtitles(bool enable);
39  void EnableTextSubtitles(bool enable);
40  void EnableRawTextSubtitles(bool enable);
41 
43  bool AddAVSubtitle(const AVSubtitle& subtitle, bool fix_position,
44  bool allow_forced);
45  void ClearAVSubtitles(void);
46  void FreeAVSubtitle(const AVSubtitle &sub);
47 
49  bool HasTextSubtitles(void);
50  void LoadExternalSubtitles(const QString &subtitleFileName, bool isInProgress);
51 
52  QStringList GetRawTextSubtitles(uint64_t &duration);
53  void AddRawTextSubtitle(const QStringList& list, uint64_t duration);
54  void ClearRawTextSubtitles(void);
55 
56  private:
58  bool m_AVSubtitlesEnabled {false};
60  bool m_TextSubtitlesEnabled {false};
63 };
64 
65 #endif // SUBTITLEREADER_H
TextSubtitles * GetTextSubtitles(void)
AVSubtitles m_AVSubtitles
bool AddAVSubtitle(const AVSubtitle &subtitle, bool fix_position, bool allow_forced)
bool m_RawTextSubtitlesEnabled
void ClearRawTextSubtitles(void)
SubtitleReader()=default
void EnableAVSubtitles(bool enable)
void EnableTextSubtitles(bool enable)
RawTextSubs m_RawTextSubtitles
QStringList GetRawTextSubtitles(uint64_t &duration)
bool m_TextSubtitlesEnabled
QStringList m_buffers
RawTextSubs(void)=default
bool m_AVSubtitlesEnabled
bool HasTextSubtitles(void)
void LoadExternalSubtitles(const QString &subtitleFileName, bool isInProgress)
MythDeque< AVSubtitle > m_buffers
uint64_t m_duration
AVSubtitles()=default
void ClearAVSubtitles(void)
bool m_fixPosition
TextSubtitles m_TextSubtitles
void AddRawTextSubtitle(const QStringList &list, uint64_t duration)
AVSubtitles * GetAVSubtitles(void)
void EnableRawTextSubtitles(bool enable)
void FreeAVSubtitle(const AVSubtitle &sub)