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;
202 if (mag > 8 || mag < 1)
211 int_to_subpage_t::const_iterator subpageIter;
212 subpageIter = page->
subpages.begin();
213 while (subpageIter != page->
subpages.end())
225 str += QString(
"%1").arg(subpage->
subpagenum,2,16,QChar(
'0'));
240 spaces.fill(
' ', 27 - str.length());
241 str =
" <" + str + spaces +
" > ";
246 int startPos = selected - 5;
249 if (startPos + 9 >= count)
250 startPos = count - 10;
252 str =
" <" + str.mid(startPos * 3, 27) +
" > ";
259 if (page < 0x100 || page > 0x899)
275 QMutexLocker lock(mag.lock);
278 int_to_page_t::iterator iter;
279 iter = mag.pages.begin();
280 while (iter != mag.pages.end())
289 mag.current_page = 0;
290 mag.current_subpage = 0;
291 mag.loadingpage.active =
false;
305 int vbimode,
int lang,
int flags)
308 if (magazine < 1 || magazine > 8)
311 for(
int m = 1; m <= 8; m++)
328 if (!(isMagazineSerialMode) && m != magazine)
334 int lastSubPage =
m_magazines[m - 1].current_subpage;
336 LOG(VB_VBI, LOG_DEBUG,
337 QString(
"AddPageHeader(p %1, sp %2, lang %3, mag %4, lp %5, lsp %6"
339 .arg(page).arg(subpage).arg(lang).arg(m).arg(lastPage)
340 .arg(lastSubPage).arg(isMagazineSerialMode));
342 if ((page != lastPage || subpage != lastSubPage) &&
349 .pages[lastPage].subpages[lastSubPage]);
350 m_magazines[m - 1].pages[lastPage].pagenum = lastPage;
369 m_magazines[magazine - 1].current_subpage = subpage;
371 for (
auto & line : ttpage->
data)
378 ttpage->
flags = flags;
383 std::fill_n(ttpage->
data[0].data(), 8,
' ');
387 for (
uint j = 8; j < 40; j++)
403 const uint8_t* buf,
int vbimode)
413 if (magazine < 1 || magazine > 8)
416 int currentpage =
m_magazines[magazine - 1].current_page;
438 b1 =
hamm8(buf, &err);
439 b2 =
hamm8(buf + 37, &err);
446 b2 =
hamm84(buf + 37, &err);
453 if (b1 != 0 || !(b2 & 8))
456 for (ptrdiff_t i = 0; i < 6; ++i)
462 b1 =
hamm16(buf+1+6*i, &err);
463 b2 =
hamm16(buf+3+6*i, &err);
464 b3 =
hamm16(buf+5+6*i, &err);
470 b1 =
hamm84(buf+2+6*i, &err) * 16 +
472 b2 =
hamm84(buf+4+6*i, &err) * 16 +
474 b3 =
hamm84(buf+6+6*i, &err) * 16 +
483 int x = (b2 >> 7) | ((b3 >> 5) & 0x06);
484 int nTmp = (magazine ^ x);
485 ttpage->
floflink[i] = ( nTmp ? nTmp : 8) * 256 + b1;
495 if (( row >= 1 ) && ( row <= 24 ))
499 for (
uint j = 0; j < 40; j++)
522 [[maybe_unused]]
int page,
523 [[maybe_unused]]
int subpage,
525 [[maybe_unused]]
int lang)
534 int page,
int direction)
const
538 if (mag > 8 || mag < 1)
543 int_to_page_t::const_iterator pageIter;
554 int_to_page_t::const_reverse_iterator iter;
559 res = &pageIter->second;
568 res = &pageIter->second;
571 res = &pageIter->second;
578 int page,
int subpage,
int direction)
const
582 if (mag > 8 || mag < 1)
587 int_to_page_t::const_iterator pageIter;
593 auto subpageIter = ttpage->
subpages.cbegin();
597 subpageIter = ttpage->
subpages.find(subpage);
599 if (subpageIter == ttpage->
subpages.cend())
603 return &(subpageIter->second);
609 if (subpageIter == ttpage->
subpages.cend())
611 auto iter = ttpage->
subpages.crbegin();
612 res = &(iter->second);
616 res = &(subpageIter->second);
623 if (subpageIter == ttpage->
subpages.cend())
624 subpageIter = ttpage->
subpages.cbegin();
626 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