Luxophia

Форк
0
/
LUX.Audio.SDIF.Frames.pas 
206 строк · 7.2 Кб
1
unit LUX.Audio.SDIF.Frames;
2

3
interface //#################################################################### ■
4

5
uses System.Classes,
6
     LUX.Audio.SDIF;
7

8
type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】
9

10
     TFrame1TYP = class;
11
     TFrameASTI = class;
12
     TFrame1ASO = class;
13

14
     //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】
15

16
     //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】
17

18
     //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TFrame1TYP
19

20
     TFrame1TYP = class( TFrameSDIF )
21
     private
22
     protected
23
       _Text :TArray<AnsiChar>;
24
     public
25
       ///// メソッド
26
       class function ReadCreate( const F_:TFileStream; const H_:TFrameHeaderSDIF; const P_:TFileSDIF ) :TFrameSDIF; override;
27
     end;
28

29
     //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TFrameASTI
30

31
     TFrameASTI = class( TFrameSDIF )
32
     private
33
     protected
34
     public
35
       ///// メソッド
36
       class function ReadCreate( const F_:TFileStream; const H_:TFrameHeaderSDIF; const P_:TFileSDIF ) :TFrameSDIF; override;
37
     end;
38

39
     //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TFrame1ASO
40

41
     TFrame1ASO = class( TFrameSDIF )
42
     private
43
     protected
44
       ///// アクセス
45
       function GetClss :String;
46
       function GetDura :Single;
47
       function GetTimeMax :Single;
48
     public
49
       ///// プロパティ
50
       property Clss    :String read GetClss   ;
51
       property Dura    :Single read GetDura   ;
52
       property TimeMax :Single read GetTimeMax;
53
       ///// メソッド
54
       class function Select( const Clss_:String ) :CFrameSDIF; reintroduce; virtual;
55
       class function ReadCreate( const F_:TFileStream; const H_:TFrameHeaderSDIF; const P_:TFileSDIF ) :TFrameSDIF; override;
56
     end;
57

58
//const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】
59

60
//var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】
61

62
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】
63

64
implementation //############################################################### ■
65

66
uses System.SysUtils,
67
     LUX.Audio.SDIF.Matrixs, LUX.Audio.SDIF.Frames.ASO1;
68

69
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】
70

71
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】
72

73
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TFrame1TYP
74

75
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
76

77
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
78

79
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
80

81
/////////////////////////////////////////////////////////////////////// メソッド
82

83
class function TFrame1TYP.ReadCreate( const F_:TFileStream; const H_:TFrameHeaderSDIF; const P_:TFileSDIF ) :TFrameSDIF;
84
begin
85
     Result := Create( P_ );
86

87
     with TFrame1TYP( Result ) do
88
     begin
89
          SetLength( _Text, H_.Size - 16 );
90

91
          F_.Read( _Text[0], H_.Size - 16 );
92
     end;
93
end;
94

95
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TFrameASTI
96

97
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
98

99
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
100

101
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
102

103
/////////////////////////////////////////////////////////////////////// メソッド
104

105
class function TFrameASTI.ReadCreate( const F_:TFileStream; const H_:TFrameHeaderSDIF; const P_:TFileSDIF ) :TFrameSDIF;
106
var
107
   P :TFrameSDIF;
108
   N :Integer;
109
begin
110
     P := TFrameSDIF.Create;
111

112
     for N := 1 to H_.MatrixCount do TMatrixSDIF.ReadCreate( F_, P );
113

114
     Result := Create( P_ );
115

116
     for N := 1 to P.ChildsN do P.Head.Paren := TMatrixSDIF( Result );
117

118
     P.Free;
119
end;
120

121
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TFrame1ASO
122

123
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
124

125
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected
126

127
/////////////////////////////////////////////////////////////////////// アクセス
128

129
function TFrame1ASO.GetClss :String;
130
begin
131
     Result := TMatrixChar( FindMatrix( 'clss' ) ).Lines[ 0 ];
132
end;
133

134
function TFrame1ASO.GetDura :Single;
135
begin
136
     Result := TMatrixFlo4( FindMatrix( 'dura' ) ).Values[ 0, 0 ];
137
end;
138

139
function TFrame1ASO.GetTimeMax :Single;
140
begin
141
     Result := Time + Dura;
142
end;
143

144
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
145

146
/////////////////////////////////////////////////////////////////////// メソッド
147

148
class function TFrame1ASO.Select( const Clss_:String ) :CFrameSDIF;
149
begin
150
     if SameText( Clss_, 'Tran' ) then Result := TFrameTran
151
                                  else
152
     if SameText( Clss_, 'TmSt' ) then Result := TFrameTmSt
153
                                  else
154
     if SameText( Clss_, 'Frmt' ) then Result := TFrameFrmt
155
                                  else
156
     if SameText( Clss_, 'BpGa' ) then Result := TFrameBpGa
157
                                  else
158
     if SameText( Clss_, 'Rflt' ) then Result := TFrameRflt
159
                                  else
160
     if SameText( Clss_, 'Clip' ) then Result := TFrameClip
161
                                  else
162
     if SameText( Clss_, 'Gsim' ) then Result := TFrameGsim
163
                                  else
164
     if SameText( Clss_, 'Frze' ) then Result := TFrameFrze
165
                                  else
166
     if SameText( Clss_, 'Revs' ) then Result := TFrameRevs
167
                                  else
168
     if SameText( Clss_, 'Imag' ) then Result := TFrameImag
169
                                  else
170
     if SameText( Clss_, 'Brkp' ) then Result := TFrameBrkp
171
                                  else
172
     if SameText( Clss_, 'Surf' ) then Result := TFrameSurf
173
                                  else
174
     if SameText( Clss_, 'Band' ) then Result := TFrameBand
175
                                  else
176
     if SameText( Clss_, 'Noiz' ) then Result := TFrameNoiz
177
                                  else Result := nil;
178

179
     Assert( Assigned( Result ), Clss_ + ':未対応のクラス型です。' );
180
end;
181

182
class function TFrame1ASO.ReadCreate( const F_:TFileStream; const H_:TFrameHeaderSDIF; const P_:TFileSDIF ) :TFrameSDIF;
183
var
184
   P :TFrame1ASO;
185
   N :Integer;
186
begin
187
     P := TFrame1ASO.Create;
188

189
     for N := 1 to H_.MatrixCount do TMatrixSDIF.ReadCreate( F_, P );
190

191
     Result := Select( P.Clss ).Create( P_ );
192

193
     for N := 1 to P.ChildsN do P.Head.Paren := TMatrixSDIF( Result );
194

195
     P.Free;
196
end;
197

198
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】
199

200
//############################################################################## □
201

202
initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化
203

204
finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化
205

206
end. //######################################################################### ■

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.