Go to the documentation of this file.
11 static inline int MAGAZINE(
int page) {
return page / 256; };
16 for (
int i = 0; i < 256; i++)
18 for (
int bit = 0; bit < 8; bit++)
29 bool numeric_input =
false;
198 if (mag > 8 || mag < 1)
207 int_to_subpage_t::const_iterator subpageIter;
208 subpageIter = page->
subpages.begin();
209 while (subpageIter != page->
subpages.end())
221 str += QString(
"%1").arg(subpage->
subpagenum,2,16,QChar(
'0'));
236 spaces.fill(
' ', 27 - str.length());
237 str =
" <" + str + spaces +
" > ";
242 int startPos = selected - 5;
245 if (startPos + 9 >= count)
246 startPos = count - 10;
248 str =
" <" + str.mid(startPos * 3, 27) +
" > ";
255 if (page < 0x100 || page > 0x899)
271 QMutexLocker lock(mag.lock);
274 int_to_page_t::iterator iter;
275 iter = mag.pages.begin();
276 while (iter != mag.pages.end())
285 mag.current_page = 0;
286 mag.current_subpage = 0;
287 mag.loadingpage.active =
false;
301 int vbimode,
int lang,
int flags)
304 if (magazine < 1 || magazine > 8)
307 for(
int m = 1; m <= 8; m++)
324 if (!(isMagazineSerialMode) && m != magazine)
330 int lastSubPage =
m_magazines[m - 1].current_subpage;
332 LOG(VB_VBI, LOG_DEBUG,
333 QString(
"AddPageHeader(p %1, sp %2, lang %3, mag %4, lp %5, lsp %6"
335 .arg(page).arg(subpage).arg(lang).arg(m).arg(lastPage)
336 .arg(lastSubPage).arg(isMagazineSerialMode));
338 if ((page != lastPage || subpage != lastSubPage) &&
345 .pages[lastPage].subpages[lastSubPage]);
346 m_magazines[m - 1].pages[lastPage].pagenum = lastPage;
365 m_magazines[magazine - 1].current_subpage = subpage;
367 for (
auto & line : ttpage->
data)
374 ttpage->
flags = flags;
379 std::fill_n(ttpage->
data[0].data(), 8,
' ');
383 for (
uint j = 8; j < 40; j++)
399 const uint8_t* buf,
int vbimode)
409 if (magazine < 1 || magazine > 8)
412 int currentpage =
m_magazines[magazine - 1].current_page;
434 b1 =
hamm8(buf, &err);
435 b2 =
hamm8(buf + 37, &err);
442 b2 =
hamm84(buf + 37, &err);
449 if (b1 != 0 || !(b2 & 8))
452 for (ptrdiff_t i = 0; i < 6; ++i)
458 b1 =
hamm16(buf+1+6*i, &err);
459 b2 =
hamm16(buf+3+6*i, &err);
460 b3 =
hamm16(buf+5+6*i, &err);
466 b1 =
hamm84(buf+2+6*i, &err) * 16 +
468 b2 =
hamm84(buf+4+6*i, &err) * 16 +
470 b3 =
hamm84(buf+6+6*i, &err) * 16 +
479 int x = (b2 >> 7) | ((b3 >> 5) & 0x06);
480 int nTmp = (magazine ^ x);
481 ttpage->
floflink[i] = ( nTmp ? nTmp : 8) * 256 + b1;
491 if (( row >= 1 ) && ( row <= 24 ))
495 for (
uint j = 0; j < 40; j++)
518 [[maybe_unused]]
int page,
519 [[maybe_unused]]
int subpage,
521 [[maybe_unused]]
int lang)
530 int page,
int direction)
const
534 if (mag > 8 || mag < 1)
539 int_to_page_t::const_iterator pageIter;
550 int_to_page_t::const_reverse_iterator iter;
555 res = &pageIter->second;
564 res = &pageIter->second;
567 res = &pageIter->second;
574 int page,
int subpage,
int direction)
const
578 if (mag > 8 || mag < 1)
583 int_to_page_t::const_iterator pageIter;
589 auto subpageIter = ttpage->
subpages.cbegin();
593 subpageIter = ttpage->
subpages.find(subpage);
595 if (subpageIter == ttpage->
subpages.cend())
599 return &(subpageIter->second);
605 if (subpageIter == ttpage->
subpages.cend())
607 auto iter = ttpage->
subpages.crbegin();
608 res = &(iter->second);
612 res = &(subpageIter->second);
619 if (subpageIter == ttpage->
subpages.cend())
620 subpageIter = ttpage->
subpages.cbegin();
622 res = &(subpageIter->second);
int flof
page has FastText links
int_to_subpage_t subpages
static constexpr uint8_t TP_INTERRUPTED_SEQ
std::array< int, 6 > floflink
FastText links (FLOF)
std::array< uint8_t, 256 > m_bitswap
int hamm84(const uint8_t *p, int *err)
static constexpr const char * ACTION_0
bool subtitle
page is subtitle page
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
#define ACTION_MENUYELLOW
virtual void PageUpdated(int page, int subpage)
const TeletextPage * FindPageInternal(int page, int direction) const
static constexpr const char * ACTION_9
std::array< TeletextMagazine, 8 > m_magazines
@ VBI_DVB_SUBTITLE
< DVB packet
static constexpr const char * ACTION_1
MBASE_PUBLIC long long copy(QFile &dst, QFile &src, uint block_size=0)
Copies src file to dst file.
#define ACTION_PREVSUBPAGE
virtual void HeaderUpdated(int page, int subpage, tt_line_array &page_ptr, int lang)
std::array< uint8_t, 40 > tt_line_array
void SetPage(int page, int subpage)
static constexpr const char * ACTION_8
static int MAGAZINE(int page)
static constexpr const char * ACTION_7
int hamm8(const uint8_t *p, int *err)
void AddTeletextData(int magazine, int row, const uint8_t *buf, int vbimode)
static constexpr const char * ACTION_4
bool KeyPress(const QString &Key, bool &Exit)
static constexpr const char * ACTION_3
static constexpr const char * ACTION_5
std::array< int, 3 > m_pageinput
TeletextSubPage * FindSubPage(void)
bool active
data has arrived since page last cleared
int subpagenum
the wanted subpage
static constexpr const char * ACTION_2
void AddPageHeader(int page, int subpage, const uint8_t *buf, int vbimode, int lang, int flags)
#define ACTION_NEXTSUBPAGE
static constexpr uint8_t TP_MAGAZINE_SERIAL
const TeletextSubPage * FindSubPageInternal(int page, int subpage, int direction) const
const TeletextPage * FindPage(int page, int dir=0) const
static constexpr const char * ACTION_6
#define ACTION_TOGGLEBACKGROUND
int hamm16(const uint8_t *p, int *err)
std::array< tt_line_array, 25 > data
page data