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(AVSubtitle& subtitle, bool fix_position,
44  bool allow_forced);
45  void ClearAVSubtitles(void);
46  static void FreeAVSubtitle(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
textsubtitleparser.h
SubtitleReader::GetRawTextSubtitles
QStringList GetRawTextSubtitles(uint64_t &duration)
Definition: subtitlereader.cpp:101
SubtitleReader::m_textSubtitles
TextSubtitles m_textSubtitles
Definition: subtitlereader.h:59
SubtitleReader
Definition: subtitlereader.h:33
SubtitleReader::AddAVSubtitle
bool AddAVSubtitle(AVSubtitle &subtitle, bool fix_position, bool allow_forced)
Definition: subtitlereader.cpp:26
SubtitleReader::~SubtitleReader
~SubtitleReader()
Definition: subtitlereader.cpp:4
SubtitleReader::EnableAVSubtitles
void EnableAVSubtitles(bool enable)
Definition: subtitlereader.cpp:11
mythdeque.h
SubtitleReader::ClearAVSubtitles
void ClearAVSubtitles(void)
Definition: subtitlereader.cpp:71
SubtitleReader::LoadExternalSubtitles
void LoadExternalSubtitles(const QString &subtitleFileName, bool isInProgress)
Definition: subtitlereader.cpp:87
SubtitleReader::EnableTextSubtitles
void EnableTextSubtitles(bool enable)
Definition: subtitlereader.cpp:16
AVSubtitles
Definition: subtitlereader.h:14
SubtitleReader::ClearRawTextSubtitles
void ClearRawTextSubtitles(void)
Definition: subtitlereader.cpp:124
TextSubtitles
Definition: textsubtitleparser.h:35
SubtitleReader::FreeAVSubtitle
static void FreeAVSubtitle(AVSubtitle &sub)
Definition: subtitlereader.cpp:82
RawTextSubs::m_lock
QMutex m_lock
Definition: subtitlereader.h:29
SubtitleReader::m_rawTextSubtitles
RawTextSubs m_rawTextSubtitles
Definition: subtitlereader.h:61
SubtitleReader::GetTextSubtitles
TextSubtitles * GetTextSubtitles(void)
Definition: subtitlereader.h:48
SubtitleReader::EnableRawTextSubtitles
void EnableRawTextSubtitles(bool enable)
Definition: subtitlereader.cpp:21
SubtitleReader::AddRawTextSubtitle
void AddRawTextSubtitle(const QStringList &list, uint64_t duration)
Definition: subtitlereader.cpp:113
SubtitleReader::GetAVSubtitles
AVSubtitles * GetAVSubtitles(void)
Definition: subtitlereader.h:42
SubtitleReader::SubtitleReader
SubtitleReader()=default
RawTextSubs::RawTextSubs
RawTextSubs(void)=default
SubtitleReader::m_rawTextSubtitlesEnabled
bool m_rawTextSubtitlesEnabled
Definition: subtitlereader.h:62
SubtitleReader::m_avSubtitlesEnabled
bool m_avSubtitlesEnabled
Definition: subtitlereader.h:58
AVSubtitles::m_buffers
MythDeque< AVSubtitle > m_buffers
Definition: subtitlereader.h:17
RawTextSubs::m_duration
uint64_t m_duration
Definition: subtitlereader.h:28
AVSubtitles::AVSubtitles
AVSubtitles()=default
SubtitleReader::m_textSubtitlesEnabled
bool m_textSubtitlesEnabled
Definition: subtitlereader.h:60
RawTextSubs::m_buffers
QStringList m_buffers
Definition: subtitlereader.h:27
MythDeque< AVSubtitle >
AVSubtitles::m_fixPosition
bool m_fixPosition
Definition: subtitlereader.h:19
RawTextSubs
Definition: subtitlereader.h:23
AVSubtitles::m_lock
QMutex m_lock
Definition: subtitlereader.h:18
SubtitleReader::HasTextSubtitles
bool HasTextSubtitles(void)
Definition: subtitlereader.cpp:96
SubtitleReader::m_avSubtitles
AVSubtitles m_avSubtitles
Definition: subtitlereader.h:57