1 /*  Copyright (c) MediaArea.net SARL. All Rights Reserved.
2  *
3  *  Use of this source code is governed by a BSD-style license that can
4  *  be found in the License.html file in the root of the source tree.
5  */
6 
7 //---------------------------------------------------------------------------
8 // Pre-compilation
9 #include "MediaInfo/PreComp.h"
10 #ifdef __BORLANDC__
11     #pragma hdrstop
12 #endif
13 //---------------------------------------------------------------------------
14 
15 //---------------------------------------------------------------------------
16 #include "MediaInfo/Setup.h"
17 //---------------------------------------------------------------------------
18 
19 //---------------------------------------------------------------------------
20 #if defined(MEDIAINFO_LYRICS3_YES)
21 //---------------------------------------------------------------------------
22 
23 //---------------------------------------------------------------------------
24 #include "MediaInfo/Tag/File_Lyrics3.h"
25 //---------------------------------------------------------------------------
26 
27 namespace MediaInfoLib
28 {
29 
30 //***************************************************************************
31 // Constructor/Destructor
32 //***************************************************************************
33 
34 //---------------------------------------------------------------------------
File_Lyrics3()35 File_Lyrics3::File_Lyrics3()
36 :File__Analyze()
37 {
38     //Configuration
39     TotalSize=(int64u)-1;
40 }
41 
42 //***************************************************************************
43 // Format
44 //***************************************************************************
45 
46 //---------------------------------------------------------------------------
Read_Buffer_Continue()47 void File_Lyrics3::Read_Buffer_Continue()
48 {
49     if (TotalSize==(int64u)-1)
50         TotalSize=Buffer_Size;
51 
52     //Coherency
53     if (TotalSize<20)
54     {
55         Reject("Lyrics3");
56         return;
57     }
58 
59     //Buffer size
60     if (Buffer_Size<TotalSize)
61         return;
62 
63     //Parsing
64     Element_Offset=0;
65     Element_Size=TotalSize;
66     Skip_Local(11,                                              "Signature");
67     Skip_Local(TotalSize-20,                                    "Lyrics");
68     Skip_Local(9,                                               "Signature");
69 
70     //Filling
71     Accept("Lyric3");
72 
73     Stream_Prepare(Stream_Text);
74     Fill(Stream_Text, 0, Text_Codec, "Lyrics3");
75 
76     Finish("Lyrics3");
77 }
78 
79 //***************************************************************************
80 // C++
81 //***************************************************************************
82 
83 } //NameSpace
84 
85 #endif //MEDIAINFO_LYRICS3_YES
86 
87