|
@@ -189,6 +189,7 @@ type
|
|
Examples : TStringList;
|
|
Examples : TStringList;
|
|
procedure initMidi;
|
|
procedure initMidi;
|
|
procedure playNote(note: byte);
|
|
procedure playNote(note: byte);
|
|
|
|
+ procedure loadFromList(lines : TStringlist; filename : String);
|
|
function readString(var line: string): boolean;
|
|
function readString(var line: string): boolean;
|
|
procedure saveSection(filename: string; key: string);
|
|
procedure saveSection(filename: string; key: string);
|
|
procedure loadSection(filename: string; key: string);
|
|
procedure loadSection(filename: string; key: string);
|
|
@@ -299,6 +300,53 @@ begin
|
|
lastNote := note;
|
|
lastNote := note;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TForm1.loadFromList(lines: TStringlist; filename : String);
|
|
|
|
+var
|
|
|
|
+ i,x: integer;
|
|
|
|
+ line: string;
|
|
|
|
+ list: TStringList;
|
|
|
|
+begin
|
|
|
|
+ acNew.Execute;
|
|
|
|
+ list := TStringList.Create;
|
|
|
|
+ i := 1;
|
|
|
|
+ for x := 0 to lines.count-1 do begin
|
|
|
|
+ if (i + 1 > StringGrid1.RowCount) then
|
|
|
|
+ begin
|
|
|
|
+ StringGrid1.RowCount := StringGrid1.RowCount + 1;
|
|
|
|
+ end;
|
|
|
|
+ line := lines[x];
|
|
|
|
+ if (Pos('#', line) = 1) then
|
|
|
|
+ begin
|
|
|
|
+ line := RightstrPos(line, 2);
|
|
|
|
+ if (Pos('TPS:', line) = 1) then
|
|
|
|
+ begin
|
|
|
|
+ line := RightstrPos(line, 5);
|
|
|
|
+ cbTPSVersion.Text := line;
|
|
|
|
+ cbTPSVersionChange(nil);
|
|
|
|
+ end;
|
|
|
|
+ end else
|
|
|
|
+ begin
|
|
|
|
+ MCSStrings.DelimSepTextToStringlist(line, '"', ',', list);
|
|
|
|
+ if list.Count > 0 then
|
|
|
|
+ Stringgrid1.Cells[0, i] := list[0];
|
|
|
|
+ if list.Count > 1 then
|
|
|
|
+ Stringgrid1.Cells[1, i] := list[1];
|
|
|
|
+ if list.Count > 2 then
|
|
|
|
+ Stringgrid1.Cells[2, i] := list[2];
|
|
|
|
+ if list.Count > 3 then
|
|
|
|
+ Stringgrid1.Cells[4, i] := list[3];
|
|
|
|
+ list.Clear;
|
|
|
|
+ inc(i);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+ list.Free;
|
|
|
|
+ activeFile := filename;
|
|
|
|
+ renumberGrid();
|
|
|
|
+ addHeaderText;
|
|
|
|
+ setCaption();
|
|
|
|
+ setDirty(False);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of string);
|
|
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of string);
|
|
var
|
|
var
|
|
line: string;
|
|
line: string;
|
|
@@ -317,10 +365,20 @@ end;
|
|
|
|
|
|
procedure TForm1.MenuItem1Click(Sender: TObject);
|
|
procedure TForm1.MenuItem1Click(Sender: TObject);
|
|
var i : integer;
|
|
var i : integer;
|
|
|
|
+ fileName, data : String;
|
|
|
|
+ lines : TStringList;
|
|
begin
|
|
begin
|
|
// todo
|
|
// todo
|
|
if (Sender is TMenuItem) then begin
|
|
if (Sender is TMenuItem) then begin
|
|
- i := TMenuItem(Sender).Tag;
|
|
|
|
|
|
+ if (checkDirty()) then begin
|
|
|
|
+ i := TMenuItem(Sender).Tag;
|
|
|
|
+ filename := examples[i-1];
|
|
|
|
+ data := DownloadFile('http://wkla.no-ip.biz/down/' + filename);
|
|
|
|
+ lines := TStringList.Create;
|
|
|
|
+ lines.Text:= data;
|
|
|
|
+ loadFromList(lines, filename);
|
|
|
|
+ lines.Free;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|