aboutsummaryrefslogblamecommitdiffstats
path: root/Game/Code/lib/midi/MidiFile.dcu
blob: 39038e820431bc92aa91bcb31f259af98e83c467 (plain) (tree)















































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
#�Lk�%7�^�MidiFile�<plib\midi\MidiFile.PAS@9o*dSystemfByte��f
AnsiString�+{�fInteger	�f�fstring�+{�fTObject|��fBoolean��eg.TObject_��>gTObject.SafeCallException�
ĄgTObject.AfterConstruction�
ĄgTObject.BeforeDestruction�
ĄgTObject.Dispatch�
ĄgTObject.DefaultHandler�
ĄgTObject.NewInstance�
ĄgTObject.FreeInstance�
ĄfDouble���gSizeOffPointer���gTObject.Create�
Ąg@ClassCreate�V�g@AfterConstruction��KgDisposeg@Dispose9Y:gTObject.Free�
ĄgTObject.Destroy�
Ąg@BeforeDestruction�S�g
@ClassDestroy����gDecg@LStrAsg�ԜgAssignedgIncgTruevɚ�gFalsesɚ�gFreeMemg@FreeMem��+�g@LStrAddRef�`Eg@LStrClr\��>g@HandleFinally�`p�gRoundg@ROUND�`p�g	BlockReadg
@BlockReadX�>�g@_IOTest�`p�gGetMemg@GetMem��+�gNewg@New����fPChar�u�RgChrfChar#���g@LStrFromPChar7�og
AssignFileg@AssignA#��gFileMode���5gResetg
@ResetFile)�ÈgEofg@EofFileS�g	CloseFileg@Close���g	@LStrLAsg�Ԝg	@LStrCat3�`p�g
@LStrArrayClr���gLengthg@LStrLenr�Xg	@LStrCatN�`p�fExtendedE�g@HandleAnyException�`p�g@DoneExcept�`p�cdSysInitcdWindowscdMessagesfTMessage�=5gWM_USER-��1cdSysUtilsgIntToStr�F�cdClassesfTListv	r�f
TComponent�AffTNotifyEvent��g.TComponentf��gTComponent.DefineProperties�a0�gTComponent.Loaded�a0�gTComponent.Notification�a0�gTComponent.ReadState�a0�gTComponent.SetName�a0�gTComponent.UpdateRegistry�a0�gTComponent.ValidateRename�a0�gTComponent.WriteState�a0�gTComponent.QueryInterface�a0�gTComponent.BeforeDestruction�a0�gTComponent.SafeCallException�a0�gTPersistent.AssignTo�!FqgTPersistent.Assign�!Fqg.TListY�O�g	TList.Get�)�Eg	TList.Add�)�EgTComponent.Create�a0�gTComponent.Destroy�a0�gRegisterComponentsw�}cdGraphicscdControlscdFormsgAllocateHWnd�o/�gDeallocateHWnd�B�jgApplication�_�fTApplicationٲE�gTApplication.HandleExceptiont�Z2cdDialogscdStdCtrlscdExtCtrlscdWinProcsfDWORDI��KfHWNDI��KgPostMessage�U�gGetPriorityClass�gSetPriorityClass0���gGetTickCount���gREALTIME_PRIORITY_CLASS-��1g
DefWindowProc��EYceMMSystemf	TTimeCaps�lVIgtimeGetDevCaps@�O�gtimeBeginPeriod�gtimeSetEventm�iSg
TIME_PERIODIC�}�1g
timeEndPeriod�g
timeKillEvent�c5MidiFile�_���c5Systemc5SysInit�c5Windows�c5Messages�c5SysUtils�c5Classes�c5Graphics�c5Controls�c5Forms�c5Dialogs�c5stdctrls�c5ExtCtrls�c5WinProcs�c%illegal����(%header����(%track����(*
TChunkType�(%single��En|*%multi_synch��En|*%multi_asynch��En|**TFileFormat�}�p�**PByte�����,*
TMidiEvent�����.*
PMidiEvent��tl0*TOnMidiEvent����2*TEvent����L4&.TMidiTrack��H1�6*
TMidiTrack��tS�8&
.TMidiFile�DeC:*	TMidiFile�a�e�<7.3F>5mmsystem�c*
TTimerProc@%TIMER_RESOLUTION
B%WM_MULTIMEDIA_TIMER
D� MIDIFileHandlef$� 	TimerProcd@� MIDITimerIDf� TimerPeriodf�(TimerCallBackProc2F�!uTimerID&!uMsg&!dwUser&" !dwParam1&"(!dwParam2&"0c(SetMIDITimer�F TimeCapsf&c(
KillMIDITimer.Fc(TMidiTrack.Create��h�1F8!Self8!.Hc��8(TMidiTrack.Destroy��h�1F8!Self8!.H i
c��8(TMidiTrack.putEvent��h�F8!Self8
!event0 commandf i pevent0c��8(TMidiTrack.getName��h&�8!Self8#Resultc�8(TMidiTrack.getInstrument��h&�8!Self8#Resultc�
8(TMidiTrack.getEventCount��h�8!Self8 Resultc�8(TMidiTrack.getEvent��h.�08!Self8!index Result0c�%8(TMidiTrack.getCurrentTime��h�8!Self8 Resultc�58(TMidiTrack.Rewind�
�hv�F8!Self8!pos
c�A8(TMidiTrack.PlayUntil��h��F8!Self8!posfc�M8(TMidiTrack.GoUntil��hh�F8!Self8!posc�Y8(TMidiTrack.checkReady��hN�F8!Self8c�e8(TMidiTrack.getTrackLength��h0�8!Self8 Resultc�m8(TMidiTrack.isReady��h
�8!Self8 Resultc�y8(TMidiFile.Create���zWF<!Self<!.H!AOwnerc��<(TMidiFile.Destroy���zWQ1F<!Self<!.H i
c��<(TMidiFile.GetTrack���zW,�8<!Self<!index Result8c��<(TMidiFile.setFilename���zW��F<!Self<!valf�c��<(TMidiFile.SetOnMidiEvent���zW��F<!Self<
!handler$2 ic��<(TMidiFile.MidiTimer���zWt�F<!Self<!sender
c��<(TMidiFile.StartPlaying���zWޘF<!Self< i
c��<(TMidiFile.ContinuePlaying���zWd�F<!Self<c��<(TMidiFile.StopPlaying���zWF�F<!Self<c��<(TMidiFile.GetCurrentTime���zW�<!Self< Resultc��<(TMidiFile.PlayToTime���zW��F<!Self<!timef i
 track8 pos 	deltaTimec�<(TMidiFile.GoToTime���zWʈF<!Self<!time i track8 posc�!<(TMidiFile.SetBpm���zW|�F<!Self<!val us_per_quarterc�9<(TMidiFile.ReadChunkHeader���zWY�F<!Self< theBytefJc�I<(TMidiFile.ReadChunkContent���zWĘF<!Self<c�U<(TMidiFile.ReadChunk���zWh�F<!Self<c�]<(TMidiFile.ProcessHeaderChunk���zW��F<!Self<c�e<(TMidiFile.ProcessTrackChunk���zW��F<!Self< dTimef� event
 lenf� strF 	midiEvent0 i us_per_quarterf�c�m<(TMidiFile.ReadVarLength���zWT�<!Self< Result i bc��<(TMidiFile.ReadString���zW��<!Self<!l
#Resultf s ic��<(TMidiFile.ReadFile���zW��F<!Self< i
c��<(KeyToStr�r���!key#Result n strf�c(IntToLenStr!val!len#Result
 strf�c(MyTimeToStr�r��1!val#Resultf� hour
 min sec msecf�c(TMidiFile.GetFusPerTick���zW8�<!Self< Resultfc�
<(TMidiFile.GetTrackLength���zW�<!Self<
 Result i length timefc�<(TMidiFile.Ready���zWx�<!Self<
 Result ic�1<(TMidiFile.OnTrackReady���zWP�F<!Self<c�A<(TMidiFile.WndProc���zW�F<!Selff<�"Msgc�I<(Register��`p�XFc(Finalization��`p�\!�Fc�(MidiFile�!Fc��CvMA(�C]Q*�EaM@0e,event�].,data1�a.,data2�e.,str�i.,dticks�m.,time�q.,mtime �u.,len(�y.cEi.HVm Fj!event0cHq0FcG8�FJy
`u�,events��8,name��8,
instrument��8,currentTime ��8,
currentPos(��8,ready0��8,trackLenght8��8.
checkReady�e���8,OnMidiEvent2@��8,OnTrackReady4P��8/Create��1��80Destroy���1��8.Rewind�A���8.	PlayUntil�M���8.GoUntil�Y���8.putEvent�����8.getEvent�%���8.getName����8.
getInstrument�
���8.
getEventCount����8.getCurrentTime�5���8.getTrackLength�m���8.isReady�y���8cG<aF���}�&.	MidiTimer�����<.WndProc�I���<,midiFileL`��<,	chunkType(���<,chunkLength��<,	chunkData,��<,
chunkIndex,!��<,chunkEnd,1��<,	FPriority"A��<,FFileFormat*Q�<,numberTracksa�<,
deltaTicksq�	<,FBpm��
<,FBeatsPerMeasure��<,
FusPerTick��<,	FFilename��<,Tracks��<,currentTrack8��!<,FOnMidiEvent2�%<,FOnUpdateEvent!�)<,playingA�-<,
PlayStartTimeQ�1<,currentTimea�5<,
currentPos��9<.OnTrackReady�A��=<.setFilename���A<.ReadChunkHeader�I��E<.ReadChunkContent�U��I<.	ReadChunk�]��M<.ProcessHeaderChunk�e��Q<.ProcessTrackChunk�m��U<.
ReadVarLength���Y<.
ReadString���]<.SetOnMidiEvent����a<.SetBpm�9��e</Create���i<0Destroy���1�m<.ReadFile���q<.GetTrack���u<.StartPlaying����y<.StopPlaying����}<.ContinuePlaying�����<.
PlayToTime����<.GoToTime�!���<.GetCurrentTime�����<.
GetFusPerTick�
���<.GetTrackLength����<.Ready�1���<1Filename
�����<1NumberOfTracks
����<1TicksPerQuarter
�	���<1
FileFormat
*
����<1Bpm
�
9���<1OnMidiEvent
2�%����<1
OnUpdateEvent
�))���<cD>�����H�F�j!uTimerID!uMsg!dwUser"!dwParam1"!dwParam2"cD>��D>���@AH�LNO1D>�l�R
TChunkTypeillegalheadertrackMidiFileTFileFormatsinglemulti_synchmulti_asynchMidiFile
TMidiEventTOnMidiEventevent
PMidiEventTEventLLf0
TMidiTrack
TMidiTrackLMidiFileL|���	TMidiFile	TMidiFileL	MidiFile����Filename����NumberOfTracks����TicksPerQuarter����
FileFormat����Bpm����OnMidiEvent������
OnUpdateEventU��jjh�EP�]����j�D$P��$��
v���D$��
s��
�
�P�j�P�P�P�P���=u�P�YZáP��P��SV��t�����ڋ�3ҋ������F3��F3��F�Ƅ�t�d�����^[�SVWU��ڋ��F�hM��|E3��F�����GMu�F��Ӏ�������~���]_^[�SVWUQ�ڋ��;�u"�{u�G�S��{u�G�S��CG�G�C3��C�G����$����$�<$�t�<$�uR�{uL�����$�G�h����|4�G������;$u�F:Cu�G+F�F3��C����M��}�Z]_^[�SV��؋ƋS�^[�SV��؋ƋS�^[Ë@�@ËH;Q}��|����3�Ë@�SVW���؋C�@;Cu�K��K�s��~�֋C�;x|���_^[�SVWQ�$��f�{"t6��S�C��ЋC$�S �C�s�F�{;�~�׋���@;$|̋��Z_^[�SVWU�����C�s�F�{;�~�׋��;h���]_^[�S�P�R;P�@f�x*t�؋C,�S([��@[�SV�؋s�VJ����@^[��@�SV��t�����ڋ�3ҋ��Vh��3����Ɔ|��������P�����Ƅ�t�d�����^[�SVWU��ڋ苅���t�����pN��|F3��������GNuꋅ�����P�P��=t����Ӏ�������~���]_^[�SV��؋֋���^[�U��QS�U��؋E��3�UhDd�0d� ����U��3�ZYYd�hK�E������[Y]�U��SVW���E����E�������XK��| C3��������U�P �U�P$FKu�_^[]�S�؀��t,���+�����f���t�Ӌ�����[�SVW�؋���pN��|F3��׋���3��GNu�����ƃ�h�P��3�������3����_^[�S���+�����ƃ�h�P��[�S��ƃ�����P�P�[Ë���SVWU����$�؋$+��i���D$�D$ܳ�܃�ݛ��݃���苃��pN��|F3��׋������GNu�$���YZ]_^[�SVWUQ�ڋ�i���$�$ܶ���苆��xO��|/G3ۋӋ���3���Ӌ������COu�Z]_^[�SQ�ڋ�;��t-�������ظ���������$�$ہ���ݙ��Z[�S�����j�T$��C0���<$Mu>�|$Tu7�|$hu�|$du	ƃ|�'�|$ru�|$ku	ƃ|�ƃ|�ƃ|�D$�T$����T$����T$��‰��YZ[�SV�؋����t������
������j�֋���C0�������������H���^[�S�؋�������|��t��t����[Ë��[Ë����������|��������rt��t�ƀ��ƀ��ƀ��������������������������������������������U����SVW3҉U���3�Uh�d�0d� ������3���|��������������F ����F$�֋����Q����E�����8�r����8��������������������F�E��F�������E��M��U�����U��F��֋����F,Q���F����V�R��‹V�R‰E������}􉃠�E�ۃ���ݛ���u������Lj�E��F�ǃ����@r
�� r+��s8�����F��������F���������F����֋������;�������3�ZYYd�h��E������_^[��]�S��3��������ڀ���������wߋ�[�SVWQ�$���؍G����>��H��|@3ҋ���	����BHu�$���Z_^[�SVW�؋���pN��|F3��׋����GNuꋃ���Rƃ|����C0�����C0�������C0����t�C0������@���_^[�U��jjSV���3�Uh\d�0d� �ù����ƒ����$�7gy���������E��t���E������E������E�����v�E�����g�E�����X�E�����I�E�����:�E�����+�E������E�����
�E�����ù����U���M��ƋU��3�ZYYd�hc�E�������^[YY]�����C����C#����D����D#����E����F����F#����G����G#����A����A#����BU��jSVW���ڋ�3�Uhdd�0d� �U������E��M��|��E��;��NjU��3�ZYYd�hk�E������_^[Y]�����0U��3�QQQQQQSVW�U���3�Uh�d�0d� ��������U�����������ƹ<����ع<�ƙ���֋ù<������<�Ù���ӍU����u�h��M�����u�h��M�����u�h�M��E���u�E���3�ZYYd�h��E������_^[��]�����:����.�������$����T$�$YZ�SVWU�����3틇��pN��|1F3ۋ������;�}���������CNu҉l$�D$܏��<$��,$�5|�<$��,$���]_^[�zDSVWU�������hM��|E3����������u3�FMu��]_^[�S�؋����tf���t�Ӌ�����[�U��QSVW�ډE��3��-u>3�Uh:d�0d� �U��E��3�ZYYd��2����U�����CP�CPV�P��C_^[Y]�Q��$��3ɸ$�Z�����SynthU��3�Uh%d�0d� �3�ZYYd�h,����]Ã-�m�MM2MD]]4]Zee0mmVqquuu(u �&yy u"}}}� }��� �������������$��}�"�6
R
T]J
9,m�<�P�"���� ���������
�����
�
�*(�
(0,&�
68�e
0248�6<"<6Ċ�h<
<%�5AN�eM2�B�eY>�eeNm�y
�*�I
�
�,�
(��
��",&�
6&H<�
22����
�
��8���J�(<�LN�h�6��<�>�A�.��
�<��:��
������zR@�M0!8R@�A�Y9|I*V
X�UH\4V
XL]IU0eme�m(mPu
�N��^e`H� �<��e`��>mLN�T�\`h�>�
2Hl
n r
X]v
Xz
X.�"�D��������������
|�
|�
|�
|�
|�
|�
|�
|�
|�
|�
|�
|$�~��N}�$� ��
~�<�LN6�.�������� � ���NL
8J�
m"�
mBR&1D�
y*A1DI6I"��
��
� ��U}U
�2YY�YN�
����$H$


4�, 


0"�

�,
&�<
�
6
"$ $"
4"�&$ @
B$"�4(0

"�* 
" 

$
B"(�2"((�

*
0R
,.&",$$<($$-$0B($($
(
$��-$H�
�



"�&(�"6�$$$>
�8� dB��&
",�*$",�04
,.,����.�8�6<M�Qi �y!�M�A�E�I�]�Q�U�Y�a�e�e�e�e�e�e
�e�e�e�i�m�q�y�y�y�y�y�y
�y�y�e��%y�y�y�	9=��	1y
2�m�	Qy	A�y��M�yIY!�y��%!yy !�5%)%]y"%-)!y$)
1-5y&-51Iy(1595}y*5m=9Uy,9	
yA=iy.=9�I�YUI�UI]Ya�Y�e�i�
m�q�u�y�}������������� ��"��$��&��(��*��,��.��0�A��I�2�����4�QI����6�U��!	�8�]��I	�:�e��y	�<�m���	�>����Q�@������B�����D�e9���F�a�n�
��
	}�H	�p���
��J
���L�!��N�%!m�P!�)%��R%�1)��T)51�V1!95]�X5�=9��Z9
A=�
�\=EA�
�^A1IE%�`E�bQ�dU�fY�h]�ja�le�ni�u
�y�
U}������������������������������������
��Y�i�����y���������
	%�9D�!M)-]1a9T�=�E�I�QU�]UIna�i	qAVFuY}W6�K�m�x3s.�}�PAV���J'������{���84���!�ipTi�I��u���h�b�	w0

%��)]-e1i5m=����A�E�M Q�Y�aVi��q�`p�u�	y�	}�	��	��	��	��	��U�Y�]�s`���������S��������
�
�!
�%
�u
�u
�u
�y
�}
��
��
��
�
�
	�
��
!�
%�
)�
-�
5�9)=)E�(M��Qa����Y��q� (� � �@0�$�$�`����6
�h������
�	�I�����������������P0	 �
P0 �P�!%p)-)(�-(�1,5P99�=A`pEI
I`�En�M@pQQ��Y`�]aaP�]^�e@iiJ�mP0qq*�u*yP}}���`0�$�$�$�6��`����Z
����p0���&��&��&�@2�@�\��`p�
�V�������@��p��`p�
�,
�\�����@��6��@��B��P�����	*l���
����	��!��%)5D)D�-f-��%��5��9�=AE0A0�=v�Ev�I@MMI�U@0YY��]@aad�e@ii��m� pq<yX
y�y=
������}�	�qQ�yQ������
��
�"�L��L��P��P��p��
�*�F�F��r��r�����`p�
�,
�X��q��p0�6�6�N������pp�8�8�8
�P������0p�Bt�t����
)�)��)�
@,�� �
)%8)d�)�%����)��!�1��5
9=29^�9d=j�5j�A@EEL�I`pBQQ.�Q�Q��U Y  a