📄 gsmctrfr.pas
字号:
Kpos:= 0;
for I:= Succ(Low(TSoundMelodyPatternNote)) to High(TSoundMelodyPatternNote) do
begin
if I in [smgpnC, smgpnD, mginE, smgpnF, smgpnG, smgpnA, smgpnH] then
begin
Inc(N);
if aNote = I then
Keyis:= 0;
if I < aNote then
Inc(Kpos);
end
else if I in [smgpnCis, smgpnDis, smgpnEis, smgpnFis, smgpnGis, smgpnAis] then
begin
if aNote = I then
Keyis:= 1;
end
else
if aNote = I then
Keyis:= -1;
end;
Sc:= Integer(MelodyScaleHigh)-Integer(MelodyScaleLow)+1;
R.Top:= 0;
R.Bottom:= MelodyKeyboard.Height;
R.Left:= 0;
R.Right:= MelodyKeyboard.Width div (N * Sc);
if Keyis > 0 then
begin
R.Bottom:= R.Bottom div 2;
Dec(R.Left, R.Right div 3);
end;
Inc(R.Left, Kpos * R.Right);
Inc(R.Left, N * (Integer(aScale)-Integer(MelodyScaleLow)) * R.Right);
if Keyis > 0 then
R.Right:= 2*R.Right div 3 + R.Left
else if Keyis = 0 then
R.Right:= R.Right + R.Left;
end;
procedure TGSMCentralForm.MelodyKeyboardMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
I: TSoundMelodyPatternScale;
J: TSoundMelodyPatternNote;
fMelodyKeyRect: TRect;
F, Keyis: Integer;
begin
for F:= 1 downto 0 do
for I:= MelodyScaleLow to MelodyScaleHigh do
for J:= Succ(Low(TSoundMelodyPatternNote)) to High(TSoundMelodyPatternNote) do
begin
GetKeyRect(I, J, fMelodyKeyRect, Keyis);
if (Keyis = F) and (fMelodyKeyRect.Left<= X) and (fMelodyKeyRect.Right >X) and (fMelodyKeyRect.Top <= Y) and (fMelodyKeyRect.Bottom >Y) then
begin
fMelodyKeyPressed:= Integer(I) * 256 + Integer(J);
fMelodyKeyPressTick:= GetTickCount;
MelodyScale.ItemIndex:= Integer(I)+Integer(Low(MelodyScaleLow));
MelodyNote.ItemIndex:= Integer(J);
MelodyKeyboard.Repaint;
Exit;
end;
end;
end;
procedure TGSMCentralForm.MelodyKeyboardMouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
T: Integer;
I: Byte;
begin
fMelodyKeyPressed:= 0;
MelodyKeyboard.Repaint;
T:= Integer(GetTickCount) - fMelodyKeyPressTick;
if T < 50 then I:= 5
else if T < 100 then I:= 4
else if T < 200 then I:= 3
else if T < 300 then I:= 2
else if T < 500 then I:= 1
else I:= 0;
MelodyDuration.ItemIndex:= I;
Button5.Click;
end;
procedure TGSMCentralForm.MelodySetFromGrid;
var
I, J: Integer;
begin
if MelodyGrid.RowCount <= 2 then
J:= 0
else
J:= MelodyGrid.Row;
for I:= 0 to MelodyGrid.ColCount-1 do
begin
fMelodyArray[I].ItemIndex:= Integer(MelodyGrid.Objects[I, J]);
end;
end;
function TGSMCentralForm.GetMelodyFromGrid;
var
I: Integer;
begin
Result:= TSoundMelody.Create;
Result.Name:= MelodyName.Text;
SetLength(Result.Pattern, MelodyGrid.RowCount-1);
for I:= 0 to MelodyGrid.RowCount-2 do
begin
with Result.Pattern[I] do
begin
Scale:= TSoundMelodyPatternScale(MelodyGrid.Objects[0, I]);
Note:= TSoundMelodyPatternNote(MelodyGrid.Objects[1, I]);
Duration:= TSoundMelodyPatternDuration(MelodyGrid.Objects[2, I]);
DurationSpecifier:= TSoundMelodyPatternDurationSpecifier(MelodyGrid.Objects[3, I]);
Tempo:= Integer(MelodyGrid.Objects[4, I]);
Style:= TSoundMelodyPatternStyle(MelodyGrid.Objects[5, I]);
Volume:= Integer(MelodyGrid.Objects[6, I]);
end;
end;
end;
procedure TGSMCentralForm.SetMelodyToGrid(aMelody: TSoundMelody);
var
I, J: Integer;
begin
MelodyName.Text:= aMelody.Name;
MelodyGrid.RowCount:= Length(aMelody.Pattern)+1;
for I:= 0 to MelodyGrid.RowCount-1 do
begin
MelodyGrid.Objects[0, I]:= Pointer(aMelody.Pattern[I].Scale);
MelodyGrid.Objects[1, I]:= Pointer(aMelody.Pattern[I].Note);
MelodyGrid.Objects[2, I]:= Pointer(aMelody.Pattern[I].Duration);
MelodyGrid.Objects[3, I]:= Pointer(aMelody.Pattern[I].DurationSpecifier);
MelodyGrid.Objects[4, I]:= Pointer(aMelody.Pattern[I].Tempo);
MelodyGrid.Objects[5, I]:= Pointer(aMelody.Pattern[I].Style);
MelodyGrid.Objects[6, I]:= Pointer(aMelody.Pattern[I].Volume);
if I > 0 then
for J:= 0 to MelodyGrid.ColCount-1 do
begin
MelodyGrid.Cells[J, I]:= fMelodyArray[J].Items[Integer(MelodyGrid.Objects[J, I])];
end;
end;
for J:= 0 to MelodyGrid.ColCount-1 do
begin
MelodyGrid.Objects[J, MelodyGrid.RowCount-1]:= nil;
MelodyGrid.Cells[J, MelodyGrid.RowCount-1]:= '';
end;
MelodyGrid.Row:= 1;
end;
procedure TGSMCentralForm.Button5Click(Sender: TObject);
var
I, J: Integer;
begin
if MelodyInsert.Checked or (MelodyGrid.Row = MelodyGrid.RowCount-1) then
begin
MelodyGrid.RowCount:= MelodyGrid.RowCount+1;
for I:= MelodyGrid.RowCount-2 downto MelodyGrid.Row do
for J:= 0 to MelodyGrid.ColCount-1 do
begin
MelodyGrid.Cells[J, I+1]:= MelodyGrid.Cells[J, I];
MelodyGrid.Objects[J, I+1]:= MelodyGrid.Objects[J, I];
end;
end;
for I:= 0 to MelodyGrid.ColCount-1 do
begin
MelodyGrid.Objects[I, MelodyGrid.Row]:= Pointer(fMelodyArray[I].ItemIndex);
MelodyGrid.Cells[I, MelodyGrid.Row]:= fMelodyArray[I].Items[fMelodyArray[I].ItemIndex];
end;
MelodyGrid.Row:= MelodyGrid.Row+1;
if SMSKind.ItemIndex = 2 then
for I:= 1 to MelodyGrid.RowCount-2 do // there is global settings of tempo and style in EME melody
begin
MelodyGrid.Objects[4, I]:= Pointer(MelodyTempo.ItemIndex);
MelodyGrid.Cells[4, I]:= MelodyTempo.Items[MelodyTempo.ItemIndex];
MelodyGrid.Objects[5, I]:= Pointer(MelodyStyle.ItemIndex);
MelodyGrid.Cells[5, I]:= MelodyStyle.Items[MelodyStyle.ItemIndex];
end;
end;
procedure TGSMCentralForm.Button6Click(Sender: TObject);
var
I, J: Integer;
begin
if (MelodyGrid.RowCount > 2) and (MelodyGrid.Row < MelodyGrid.RowCount-1) then
begin
for I:= MelodyGrid.Row to MelodyGrid.RowCount-1 do
for J:= 0 to MelodyGrid.ColCount-1 do
begin
MelodyGrid.Cells[J, I]:= MelodyGrid.Cells[J, I+1];
MelodyGrid.Objects[J, I]:= MelodyGrid.Objects[J, I+1];
end;
MelodyGrid.RowCount:= MelodyGrid.RowCount-1;
if (MelodyGrid.Row = MelodyGrid.RowCount-1) and (MelodyGrid.RowCount > 2) then
MelodyGrid.Row:= MelodyGrid.Row-1;
end;
end;
procedure TGSMCentralForm.MelodyGridDblClick(Sender: TObject);
begin
MelodySetFromGrid;
end;
procedure TGSMCentralForm.Button1Click(Sender: TObject);
var
Sg: TStrings;
N: Integer;
SndM: TSoundMelody;
begin
if OpenMelodyDialog.Execute then
begin
SndM:= TSoundMelody.Create;
try
Sg:= TStringList.Create;
try
Sg.LoadFromFile(OpenMelodyDialog.FileName);
N:= StrToIntDef(Sg.Values['Count'], 0);
if (N = 0) and (Sg.Count = 1) then
begin // try as RTTTL
SndM.RTTTL:= Sg[0];
end
else
begin // plain text
SndM.AssignStrings(Sg);
end;
finally
Sg.Free;
end;
SetMelodyToGrid(SndM);
finally
SndM.Free;
end;
SaveMelodyDialog.FileName:= OpenMelodyDialog.FileName;
end;
end;
procedure TGSMCentralForm.Button4Click(Sender: TObject);
var
Sg: TStrings;
St: TFileStream;
S: string;
SndM: TSoundMelody;
begin
if SaveMelodyDialog.Execute then
begin
SndM:= GetMelodyFromGrid;
try
if Pos('RTT', UpperCase(ExtractFileExt(SaveMelodyDialog.FileName))) <> 0 then
begin
S:= SndM.RTTTL;
if S <> '' then
begin
St:= TFileStream.Create(SaveMelodyDialog.FileName, fmCreate);
try
St.WriteBuffer(S[1], Length(S));
finally
St.Free;
end;
end;
end
else
begin
Sg:= SndM.CreateStrings;
try
Sg.SaveToFile(SaveMelodyDialog.FileName);
finally
Sg.Free;
end;
end;
finally
SndM.Free;
end;
end;
end;
procedure TGSMCentralForm.Button7Click(Sender: TObject);
var
D: TOpenDialog;
begin
case SMSKind2.ItemIndex of
0:
begin
D:= OpenPictureDialog;
end;
1:
begin
D:= OpenSEOMidiDialog;
end;
else
D:= nil;
end;
D.FileName:= SEOFileName.Text;
if D.Execute then
SEOFileName.Text:= D.FileName;
AdjustSEO;
end;
procedure TGSMCentralForm.AdjustSEO;
begin
SEOName.Text:= ExtractFileName(SEOFileName.Text);
case SMSKind2.ItemIndex of
0:
begin
SEOMidi.Close;
fSEOPictureFileName:= SEOFileName.Text;
try
SEOPicture.Picture.Assign(nil);
if SEOFileName.Text <> '' then
SEOPicture.Picture.LoadFromFile(SEOFileName.Text);
except
end;
end;
1:
begin
SEOMidi.Close;
SEOMidi.FileName:= SEOFileName.Text;
try
if SEOMidi.FileName <> '' then
SEOMidi.Open;
except
end;
end;
end;
end;
procedure TGSMCentralForm.Button8Click(Sender: TObject);
var
W: TWapDocument;
St: TStream;
S, S2: string;
begin
// S:= Hex2Bin('02056A0045C60D0374726569626B72616674008503616262612E6D69640006010301');
S:= Hex2Bin('02056A0045C6110337363837393839000D0374726569626B72616674008503616262612E6D696400080103');
St:= TStringStream.Create(S);
// St:= TFileStream.Create('d:\Program Files\Nokia\Tools\Nokia_Mobile_Internet_Toolkit\a.coc', fmOpenRead);
try
W:= TWapDocument.Create;
W.ReadWBXMLFromStream(St);
St.Position:= 0;
SMSLog.Log(Bin2Hex(StreamToString(St)));
SMSLog.Log(W.XMLData);
S2:= W.WBXMLData;
SMSLog.Log(Bin2Hex(S2));
W.WBXMLData:= S2;
SMSLog.Log(W.XMLData);
SMSLog.Log('---------');
// W:= TWapDocument.CreateFrom(Hex2Bin('02056A0045C60C037761702E66696E636F6D2E637A2F6367692D62696E2F676574636F6E74656E743F69643D3279326E616E5A4E3342000103537461686E6F757420746963746163706F6C2E6D6964000101'));
try
// ShowMessage(S);
finally
W.Free;
end;
finally
St.Free;
end;
end;
end.
>3.10.2005 18:56:03, OA: +447797990998, PID: 00, UD: 0605040B8423F0600D04702A200135000A190E31600D1B386E6441130740060368492B164D583572421923072061016144090B66255B346400200830
DCS=00
0791447779070672 64 0C91447779999089 00 00 5001308165302D 3D 0605040B8423F0 E00601AE02056A0045C6110337363837393839000D0374726569626B72616674008503616262612E6D696400080103
working 0605040B8423F0 600D04702A200135000A190E31600D1B386E6441130740060368492B164D583572421923072061016144090B66255B346400200830
DCS=F6
18 0605040B8423F0 010601B001066A00850A03612E637A0001
WORK
E00601AE 02056A strtbl:00 45C6110337363837393839000D0374726569626B7261667400 8503616262612E6D696400 080103
MY
010601B001066A00850A03612E637A0001
010601AE 01056A strtbl:00 45C60C03612E622E63000103466972737420546573742D4D657373616765000101
00 41 00 0C91347636709814 PID:00 DCS:00 UDL:32 0605040B8423F0 010601 AE 02056A0045C60D0362697A7A736F66742E61742F616262612E6D69640006010361626261000101
0605040B8423F0 010601 AE 02056A0045C60D0374726569626B72616674008503616262612E6D69640006010301
DCS=F6
0605040B8423F0 010601 AE 02056A0045C60D0374726569626B72616674008503616262612E6D69640006010361626261000101
02056A0045C6 0D0374726569626B72616674008503616262612E6D69640006010361626261000101
<si>
<indication
href="http://www.
cscscsccscs
.com/abba.xxx"
action="signal-low">
abba
</indication>
</si>
LAST WORKING from WEB>
AC0601AE 02056A0045C6 110337363837393839000D0374726569626B72616674008503616262612E6D69640008010361626261000101
<si>
<indication
si-id=
"373638373938"
href="http://
dsfdjsfjskfcs
.com/
abba.ccc">
action="signal-high"
>
abba
> // indication
</si>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -