MythTV  master
cc708reader.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2003-2005, Daniel Kristjansson
3 
4 #ifndef CC708READER_H
5 #define CC708READER_H
6 
7 #include <cstdint>
8 #include "format.h"
9 #include "compat.h"
10 #include "captions/cc708window.h"
11 
12 class MythPlayer;
13 
14 const uint k708MaxServices = 64;
15 
17 {
18  public:
19  explicit CC708Reader(MythPlayer *owner);
20  virtual ~CC708Reader();
21 
22  void SetCurrentService(int service) { m_currentService = service; }
24  void SetEnabled(bool enable) { m_enabled = enable; }
25  void ClearBuffers(void);
26 
28  { return &(m_cc708services[service_num]); }
29  CC708Window &GetCCWin(uint service_num, uint window_id)
30  { return m_cc708services[service_num].m_windows[window_id]; }
32  { return GetCCWin(svc_num, m_cc708services[svc_num].m_currentWindow); }
33 
34  // Window settings
35  virtual void SetCurrentWindow(uint service_num, int window_id);
36  virtual void DefineWindow(uint service_num, int window_id,
37  int priority, bool visible,
38  int anchor_point, int relative_pos,
39  int anchor_vertical, int anchor_horizontal,
40  int row_count, int column_count,
41  int row_lock, int column_lock,
42  int pen_style, int window_style);
43  virtual void DeleteWindows( uint service_num, int window_map);
44  virtual void DisplayWindows(uint service_num, int window_map);
45  virtual void HideWindows( uint service_num, int window_map);
46  virtual void ClearWindows( uint service_num, int window_map);
47  virtual void ToggleWindows( uint service_num, int window_map);
48  virtual void SetWindowAttributes(uint service_num,
49  int fill_color, int fill_opacity,
50  int border_color, int border_type,
51  int scroll_dir, int print_dir,
52  int effect_dir,
53  int display_effect, int effect_speed,
54  int justify, int word_wrap);
55 
56  // Pen settings
57  virtual void SetPenAttributes(uint service_num,
58  int pen_size, int offset,
59  int text_tag, int font_tag,
60  int edge_type,
61  int underline, int italics);
62  virtual void SetPenColor(uint service_num,
63  int fg_color, int fg_opacity,
64  int bg_color, int bg_opacity,
65  int edge_color);
66  virtual void SetPenLocation(uint service_num, int row, int column);
67 
68  // Display State
69  virtual void Delay(uint service_num, int tenths_of_seconds);
70  virtual void DelayCancel(uint service_num);
71  virtual void Reset(uint service_num);
72 
73  // Text
74  virtual void TextWrite(uint service_num,
75  int16_t* unicode_string, int16_t len);
76 
77  // Data
78  std::array<unsigned char *,k708MaxServices> m_buf {};
79  std::array<uint,k708MaxServices> m_bufAlloc {};
80  std::array<uint,k708MaxServices> m_bufSize {};
81  std::array<bool,k708MaxServices> m_delayed {};
82 
83  std::array<int16_t *,k708MaxServices> m_tempStr {};
84  std::array<int,k708MaxServices> m_tempStrAlloc {};
85  std::array<int,k708MaxServices> m_tempStrSize {};
86 
88  std::array<CC708Service,k708MaxServices> m_cc708services;
89  std::array<int,k708MaxServices> m_cc708DelayedDeletes {};
90 
91  MythPlayer *m_parent {nullptr};
92  bool m_enabled {false};
93 };
94 #endif // CC708READER_H
CC708Reader::SetWindowAttributes
virtual void SetWindowAttributes(uint service_num, int fill_color, int fill_opacity, int border_color, int border_type, int scroll_dir, int print_dir, int effect_dir, int display_effect, int effect_speed, int justify, int word_wrap)
Definition: cc708reader.cpp:187
CC708Reader::CC708Reader
CC708Reader(MythPlayer *owner)
Definition: cc708reader.cpp:14
CC708Reader::m_tempStrSize
std::array< int, k708MaxServices > m_tempStrSize
Definition: cc708reader.h:85
CC708Reader::m_enabled
bool m_enabled
Definition: cc708reader.h:92
CC708Reader::GetCCWin
CC708Window & GetCCWin(uint svc_num)
Definition: cc708reader.h:31
cc708window.h
CC708Reader::m_delayed
std::array< bool, k708MaxServices > m_delayed
Definition: cc708reader.h:81
CC708Reader::ClearBuffers
void ClearBuffers(void)
Definition: cc708reader.cpp:40
k708MaxServices
const uint k708MaxServices
Definition: cc708reader.h:14
CC708Window
Definition: cc708window.h:194
CC708Reader::Delay
virtual void Delay(uint service_num, int tenths_of_seconds)
Definition: cc708reader.cpp:262
CC708Reader::GetCurrentService
CC708Service * GetCurrentService(void)
Definition: cc708reader.h:23
CC708Reader::SetEnabled
void SetEnabled(bool enable)
Definition: cc708reader.h:24
format.h
CC708Reader::DelayCancel
virtual void DelayCancel(uint service_num)
Definition: cc708reader.cpp:269
CC708Reader::SetPenColor
virtual void SetPenColor(uint service_num, int fg_color, int fg_opacity, int bg_color, int bg_opacity, int edge_color)
Definition: cc708reader.cpp:233
CC708Reader::SetCurrentWindow
virtual void SetCurrentWindow(uint service_num, int window_id)
Definition: cc708reader.cpp:46
CC708Reader::DefineWindow
virtual void DefineWindow(uint service_num, int window_id, int priority, bool visible, int anchor_point, int relative_pos, int anchor_vertical, int anchor_horizontal, int row_count, int column_count, int row_lock, int column_lock, int pen_style, int window_style)
Definition: cc708reader.cpp:54
CC708Reader::~CC708Reader
virtual ~CC708Reader()
Definition: cc708reader.cpp:31
MythPlayer
Definition: mythplayer.h:100
CC708Reader::ClearWindows
virtual void ClearWindows(uint service_num, int window_map)
Definition: cc708reader.cpp:160
CC708Reader::TextWrite
virtual void TextWrite(uint service_num, int16_t *unicode_string, int16_t len)
Definition: cc708reader.cpp:283
CC708Reader::m_cc708services
std::array< CC708Service, k708MaxServices > m_cc708services
Definition: cc708reader.h:88
CC708Reader::ToggleWindows
virtual void ToggleWindows(uint service_num, int window_map)
Definition: cc708reader.cpp:171
CC708Reader::m_buf
std::array< unsigned char *, k708MaxServices > m_buf
Definition: cc708reader.h:78
CC708Reader::GetCCWin
CC708Window & GetCCWin(uint service_num, uint window_id)
Definition: cc708reader.h:29
compat.h
CC708Service
Definition: cc708window.h:313
CC708Reader::SetPenLocation
virtual void SetPenLocation(uint service_num, int row, int column)
Definition: cc708reader.cpp:254
uint
unsigned int uint
Definition: compat.h:140
CC708Reader::HideWindows
virtual void HideWindows(uint service_num, int window_map)
Definition: cc708reader.cpp:144
CC708Reader::SetCurrentService
void SetCurrentService(int service)
Definition: cc708reader.h:22
CC708Reader::m_parent
MythPlayer * m_parent
Definition: cc708reader.h:91
CC708Reader::GetService
CC708Service * GetService(uint service_num)
Definition: cc708reader.h:27
CC708Reader::SetPenAttributes
virtual void SetPenAttributes(uint service_num, int pen_size, int offset, int text_tag, int font_tag, int edge_type, int underline, int italics)
Definition: cc708reader.cpp:215
CC708Reader::Reset
virtual void Reset(uint service_num)
Definition: cc708reader.cpp:275
CC708Reader::m_bufSize
std::array< uint, k708MaxServices > m_bufSize
Definition: cc708reader.h:80
CC708Reader::m_tempStrAlloc
std::array< int, k708MaxServices > m_tempStrAlloc
Definition: cc708reader.h:84
CC708Reader::m_currentService
int m_currentService
Definition: cc708reader.h:87
CC708Reader::m_cc708DelayedDeletes
std::array< int, k708MaxServices > m_cc708DelayedDeletes
Definition: cc708reader.h:89
CC708Reader::m_bufAlloc
std::array< uint, k708MaxServices > m_bufAlloc
Definition: cc708reader.h:79
CC708Reader::DisplayWindows
virtual void DisplayWindows(uint service_num, int window_map)
Definition: cc708reader.cpp:109
CC708Reader::m_tempStr
std::array< int16_t *, k708MaxServices > m_tempStr
Definition: cc708reader.h:83
CC708Reader
Definition: cc708reader.h:17
CC708Reader::DeleteWindows
virtual void DeleteWindows(uint service_num, int window_map)
Definition: cc708reader.cpp:97