• R/O
  • SSH
  • HTTPS

id3v2editorplus: コミット


コミットメタ情報

リビジョン44 (tree)
日時2019-12-07 04:21:43
作者derekwildstar

ログメッセージ

Corrigida a forma de carregamento de textos planos dos frames SYLT e USLT. Agora os caracteres NULL ao final do texto não são mais gerados
Corrigido o método TSYLT.ExibirVerso de forma que ao se usar APosicao = 0 o algoritmo entenda que trata-se de obter o primeiro "verso" independentemente do seu tempo
O texto plano importado e exportado a partir do form de edição de SYLT agora usa formato Unicode (2 Bytes por caractere) sempre
Tela de about concluída!

変更サマリ

差分

--- trunk/V2/src/UClassesETipos.pas (revision 43)
+++ trunk/V2/src/UClassesETipos.pas (revision 44)
@@ -486,12 +486,12 @@
486486 Exit;
487487
488488 with TFileStream.Create(AArquivo,fmCreate or fmShareDenyWrite) do
489- try
490- Write(PWideChar(Trim(Items[FIndice].Texto))^, (Length(Trim(Items[FIndice].Texto)) + 1) * 2);
491- Result := True;
492- finally
493- Free;
494- end;
489+ try
490+ Write(PWideChar(Trim(Items[FIndice].Texto))^, Length(Trim(Items[FIndice].Texto)) * 2);
491+ Result := True;
492+ finally
493+ Free;
494+ end;
495495 end;
496496
497497 function TUSLT.HTMLDoBrowser: String;
@@ -857,22 +857,35 @@
857857 if (FIndice = -1) or (Items[FIndice].Versos.Count = 0) then
858858 Exit;
859859
860- for var i: Word := 0 to Pred(Items[FIndice].Versos.Count) do
861- if Items[FIndice].Versos[i].Tempo = APosicao then
862- begin
863- FSaidaAnterior.Caption := '####### INÍCIO #######';
860+ if APosicao = 0 then
861+ begin
862+ FSaidaAnterior.Caption := '####### INÍCIO #######';
863+
864+ FSaidaCentral.Caption := Items[FIndice].Versos[0].Texto;
865+
866+ if Pred(Items[FIndice].Versos.Count) > 0 then
867+ FSaidaPosterior.Caption := Items[FIndice].Versos[1].Texto
868+ else
864869 FSaidaPosterior.Caption := '######## FIM ########';
870+ end
871+ else
872+ for var i: Word := 0 to Pred(Items[FIndice].Versos.Count) do
873+ if Items[FIndice].Versos[i].Tempo = APosicao then
874+ begin
875+ if i > 0 then
876+ FSaidaAnterior.Caption := Items[FIndice].Versos[i - 1].Texto
877+ else
878+ FSaidaAnterior.Caption := '####### INÍCIO #######';
865879
866- FSaidaCentral.Caption := Items[FIndice].Versos[i].Texto;
880+ FSaidaCentral.Caption := Items[FIndice].Versos[i].Texto;
867881
868- if i > 0 then
869- FSaidaAnterior.Caption := Items[FIndice].Versos[i - 1].Texto;
882+ if i < Pred(Items[FIndice].Versos.Count) then
883+ FSaidaPosterior.Caption := Items[FIndice].Versos[i + 1].Texto
884+ else
885+ FSaidaPosterior.Caption := '######## FIM ########';
870886
871- if i < Pred(Items[FIndice].Versos.Count) then
872- FSaidaPosterior.Caption := Items[FIndice].Versos[i + 1].Texto;
873-
874- Break;
875- end;
887+ Break;
888+ end;
876889 end;
877890
878891 function TSYLT.ExportarTexto(AArquivo: TFileName): Boolean;
@@ -889,7 +902,7 @@
889902 for var Verso: TSYLTVerso in Items[FIndice].Versos do
890903 Texto := Texto + Verso.Tempo.ToString + '=' + Verso.Texto + ^M^J;
891904
892- Write(PWideChar(Trim(Texto))^, (Length(Trim(Texto)) + 1) * 2);
905+ Write(PWideChar(Trim(Texto))^, Length(Trim(Texto)) * 2);
893906
894907 Result := True;
895908 finally
--- trunk/V2/src/UFORMEditarSYLT.pas (revision 43)
+++ trunk/V2/src/UFORMEditarSYLT.pas (revision 44)
@@ -37,7 +37,8 @@
3737
3838 {$R *.dfm}
3939
40-uses UDAMOPrincipal, UBassUtils;
40+uses
41+ UDAMOPrincipal, UBassUtils;
4142
4243 { TForm1 }
4344
@@ -92,7 +93,7 @@
9293 procedure TFORMEditarSYLT.PNSBCarregarTextoSYLTClick(Sender: TObject);
9394 begin
9495 if TDAMOPrincipal(Owner).OPDITXT.Execute then
95- VLEDVersos.Strings.LoadFromFile(TDAMOPrincipal(Owner).OPDITXT.FileName);
96+ VLEDVersos.Strings.LoadFromFile(TDAMOPrincipal(Owner).OPDITXT.FileName,TEncoding.Unicode);
9697 end;
9798
9899 procedure TFORMEditarSYLT.PNSBSalvarClick(Sender: TObject);
@@ -106,7 +107,7 @@
106107 procedure TFORMEditarSYLT.PNSBSalvarTextoSYLTClick(Sender: TObject);
107108 begin
108109 if TDAMOPrincipal(Owner).SADITXT.Execute then
109- VLEDVersos.Strings.SaveToFile(TDAMOPrincipal(Owner).OPDITXT.FileName);
110+ VLEDVersos.Strings.SaveToFile(TDAMOPrincipal(Owner).SADITXT.FileName,TEncoding.Unicode);
110111 end;
111112
112113 end.
--- trunk/V2/src/UFORMSobre.pas (revision 43)
+++ trunk/V2/src/UFORMSobre.pas (revision 44)
@@ -18,6 +18,9 @@
1818 LABEPoweredBy: TLabel;
1919 BEVELinha2: TBevel;
2020 procedure FormClose(Sender: TObject; var Action: TCloseAction);
21+ procedure IMAGID3v2Click(Sender: TObject);
22+ procedure IMAGBassClick(Sender: TObject);
23+ procedure IMAGDelphiClick(Sender: TObject);
2124 private
2225 { Private declarations }
2326 public
@@ -27,6 +30,9 @@
2730
2831 implementation
2932
33+uses
34+ ShellApi;
35+
3036 {$R *.dfm}
3137
3238 { TFORMSobre }
@@ -36,6 +42,21 @@
3642 Action := caFree;
3743 end;
3844
45+procedure TFORMSobre.IMAGBassClick(Sender: TObject);
46+begin
47+ ShellExecute(0, 'open', 'http://www.un4seen.com', nil, nil, SW_SHOWNORMAL);
48+end;
49+
50+procedure TFORMSobre.IMAGDelphiClick(Sender: TObject);
51+begin
52+ ShellExecute(0, 'open', 'https://www.embarcadero.com/br/products/delphi/starter', nil, nil, SW_SHOWNORMAL);
53+end;
54+
55+procedure TFORMSobre.IMAGID3v2Click(Sender: TObject);
56+begin
57+ ShellExecute(0, 'open', 'http://id3.org/Home', nil, nil, SW_SHOWNORMAL);
58+end;
59+
3960 class procedure TFORMSobre.ShowMe(AOwner: TComponent);
4061 begin
4162 TFORMSobre.Create(AOwner).ShowModal;
旧リポジトリブラウザで表示