Welcome to mirror list, hosted at ThFree Co, Russian Federation.

File_Teletext.h « Text « MediaInfo « MediaInfo « thirdparty « src - github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0c4da03560fb95b0aac58b5e42a138ce0b72fc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*  Copyright (c) MediaArea.net SARL. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license that can
 *  be found in the License.html file in the root of the source tree.
 */

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Information about Teletext streams
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//---------------------------------------------------------------------------
#ifndef MediaInfo_File_TeletextH
#define MediaInfo_File_TeletextH
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include "MediaInfo/File__Analyze.h"
#include <bitset>
#include <string>
//---------------------------------------------------------------------------

namespace MediaInfoLib
{

//***************************************************************************
// Class File_Teletext
//***************************************************************************

class File_Teletext : public File__Analyze
{
public :
    File_Teletext();
    ~File_Teletext();

    //In
    #if defined(MEDIAINFO_MPEGPS_YES)
        bool FromMpegPs;
    #endif
    bool IsSubtitle;

private :
    //Streams management
    void Streams_Fill();
    void Streams_Finish();

    //Buffer - Synchro
    bool Synchronize();
    bool Synched_Test();
    void Synched_Init();

    //Buffer - Global
    void Read_Buffer_Unsynched();
    void Read_Buffer_Continue();

    //Buffer - Per element
    void Header_Parse();
    void Data_Parse();

    //Elements
    void Character_Fill(wchar_t Character);
    void HasChanged();

    //Streams
    struct stream
    {
        vector<std::wstring> CC_Displayed_Values;

        stream()
        {
            CC_Displayed_Values.resize(26);
            for (size_t PosY=0; PosY<26; ++PosY)
                CC_Displayed_Values[PosY].resize(40, L' ');
        }

        void Clear()
        {
            for (size_t PosY=0; PosY<26; ++PosY)
                for (size_t PosX=0; PosX<40; ++PosX)
                    CC_Displayed_Values[PosY][PosX]=L' ';
        }

    };
    typedef map<int16u, stream> streams; //Key is Magazine+PageNumber
    streams Streams;
    int16u Stream_HasChanged;

    //Temp
    int8u   X;
    int8u   Y;
    std::bitset<16> C;
    int8u   PageNumber;
    int16u  SubCode;
    int64u  End;

    //Ancillary
    #if defined(MEDIAINFO_MPEGPS_YES)
        File_Teletext* Parser;
    #endif
};

} //NameSpace

#endif