jvcllaz: Fix compilation of JvID3v2 demo with Laz 1.6.4

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6327 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-04-20 13:01:06 +00:00
parent c4109bd145
commit 0608517e55
9 changed files with 52 additions and 54 deletions

View File

@ -1,19 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="10"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<Title Value="JvID3v1Demo"/> <Title Value="JvID3v1Demo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<XPManifest> <XPManifest>
<DpiAware Value="True"/> <DpiAware Value="True"/>
</XPManifest> </XPManifest>
<Icon Value="0"/>
</General> </General>
<BuildModes Count="1"> <BuildModes Count="1">
<Item1 Name="Default" Default="True"/> <Item1 Name="Default" Default="True"/>
@ -22,8 +20,9 @@
<Version Value="2"/> <Version Value="2"/>
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<FormatVersion Value="2"/> <local>
<Modes Count="0"/> <FormatVersion Value="1"/>
</local>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>

View File

@ -18,8 +18,7 @@ object JvID3v1MainForm: TJvID3v1MainForm
OnDropFiles = FormDropFiles OnDropFiles = FormDropFiles
Position = poScreenCenter Position = poScreenCenter
ShowHint = True ShowHint = True
LCLVersion = '1.9.0.0' LCLVersion = '1.6.4.0'
Scaled = False
object lblArtist: TLabel object lblArtist: TLabel
AnchorSideTop.Control = edtArtist AnchorSideTop.Control = edtArtist
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
@ -283,7 +282,7 @@ object JvID3v1MainForm: TJvID3v1MainForm
ShowHint = True ShowHint = True
end end
object ToolButton2: TToolButton object ToolButton2: TToolButton
Left = 46 Left = 48
Hint = 'Save changes of the tag to the file' Hint = 'Save changes of the tag to the file'
Top = 0 Top = 0
Action = actSave Action = actSave
@ -291,7 +290,7 @@ object JvID3v1MainForm: TJvID3v1MainForm
ShowHint = True ShowHint = True
end end
object ToolButton3: TToolButton object ToolButton3: TToolButton
Left = 90 Left = 92
Hint = 'Erase the tag of the file' Hint = 'Erase the tag of the file'
Top = 0 Top = 0
Action = actErase Action = actErase
@ -299,7 +298,7 @@ object JvID3v1MainForm: TJvID3v1MainForm
ShowHint = True ShowHint = True
end end
object ToolButton4: TToolButton object ToolButton4: TToolButton
Left = 134 Left = 136
Hint = 'Toggle ''Always on Top''' Hint = 'Toggle ''Always on Top'''
Top = 0 Top = 0
Action = actOnTop Action = actOnTop
@ -307,7 +306,7 @@ object JvID3v1MainForm: TJvID3v1MainForm
ShowHint = True ShowHint = True
end end
object ToolButton5: TToolButton object ToolButton5: TToolButton
Left = 178 Left = 184
Hint = 'Show ''About'' dialog' Hint = 'Show ''About'' dialog'
Top = 0 Top = 0
Action = actAbout Action = actAbout
@ -315,7 +314,7 @@ object JvID3v1MainForm: TJvID3v1MainForm
ShowHint = True ShowHint = True
end end
object ToolButton6: TToolButton object ToolButton6: TToolButton
Left = 222 Left = 228
Hint = 'Close program' Hint = 'Close program'
Top = 0 Top = 0
Action = actExit Action = actExit

View File

@ -31,7 +31,6 @@ unit JvID3v1MainFormU;
interface interface
uses uses
//Windows, Messages,
SysUtils, Classes, Graphics, Controls, Forms, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, //JvComponent, Dialogs, //JvComponent,
StdCtrls, //Mask, //JvToolEdit, StdCtrls, //Mask, //JvToolEdit,

View File

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="10"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<Title Value="JvId3v2Demo"/> <Title Value="JvId3v2Demo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<XPManifest> <XPManifest>
@ -21,8 +20,9 @@
<Version Value="2"/> <Version Value="2"/>
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<FormatVersion Value="2"/> <local>
<Modes Count="0"/> <FormatVersion Value="1"/>
</local>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>

View File

@ -1,7 +1,7 @@
program JvId3v2Demo; program JvId3v2Demo;
uses uses
Interfaces, Interfaces, LCLVersion,
Forms, Forms,
JvId3v2MainFormU in 'JvId3v2MainFormU.pas' {JvId3v2MainForm}, JvId3v2MainFormU in 'JvId3v2MainFormU.pas' {JvId3v2MainForm},
JvId3v2EditFormU in 'JvId3v2EditFormU.pas' {JvId3v2EditForm}; JvId3v2EditFormU in 'JvId3v2EditFormU.pas' {JvId3v2EditForm};
@ -9,7 +9,9 @@ uses
{$R *.res} {$R *.res}
begin begin
{$IF LCL_FullVersion >= 1080000}
Application.Scaled:=True; Application.Scaled:=True;
{$ENDIF}
Application.Initialize; Application.Initialize;
Application.CreateForm(TJvId3v2MainForm, JvId3v2MainForm); Application.CreateForm(TJvId3v2MainForm, JvId3v2MainForm);
Application.Run; Application.Run;

View File

@ -12,7 +12,7 @@ object JvID3v2EditForm: TJvID3v2EditForm
OnCreate = FormCreate OnCreate = FormCreate
OnShow = FormShow OnShow = FormShow
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '1.9.0.0' LCLVersion = '1.6.4.0'
object lsbNavigator: TListBox object lsbNavigator: TListBox
Left = 4 Left = 4
Height = 483 Height = 483
@ -73,7 +73,7 @@ object JvID3v2EditForm: TJvID3v2EditForm
Height = 487 Height = 487
Top = 40 Top = 40
Width = 474 Width = 474
PageIndex = 0 PageIndex = 1
Align = alClient Align = alClient
TabOrder = 2 TabOrder = 2
object PgWinAmpTags: TPage object PgWinAmpTags: TPage
@ -451,6 +451,7 @@ object JvID3v2EditForm: TJvID3v2EditForm
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Right = 4 BorderSpacing.Right = 4
ScrollBars = ssAutoBoth
TabOrder = 1 TabOrder = 1
end end
object edtDescription: TEdit object edtDescription: TEdit

View File

@ -105,22 +105,21 @@ type
ToolButton5: TToolButton; ToolButton5: TToolButton;
actCopyTov1: TAction; actCopyTov1: TAction;
actCopyFromv1: TAction; actCopyFromv1: TAction;
procedure actOKExecute(Sender: TObject);
procedure actCancelExecute(Sender: TObject);
procedure actRemoveExecute(Sender: TObject);
procedure actAddPictureExecute(Sender: TObject); procedure actAddPictureExecute(Sender: TObject);
procedure actDeletePictureExecute(Sender: TObject); procedure actCancelExecute(Sender: TObject);
procedure actSavePictureExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure lsvPicturesClick(Sender: TObject);
procedure lsbNavigatorClick(Sender: TObject);
procedure actChangePictureExecute(Sender: TObject); procedure actChangePictureExecute(Sender: TObject);
procedure ItemSelected(Sender: TObject);
procedure actCopyTov1Execute(Sender: TObject);
procedure actCopyFromv1Execute(Sender: TObject); procedure actCopyFromv1Execute(Sender: TObject);
procedure actCopyTov1Execute(Sender: TObject);
procedure actDeletePictureExecute(Sender: TObject);
procedure actOKExecute(Sender: TObject);
procedure actRemoveExecute(Sender: TObject);
procedure actSavePictureExecute(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure lsvAllFramesInfoTip(Sender: TObject; Item: TListItem; procedure FormShow(Sender: TObject);
var InfoTip: String); procedure ItemSelected(Sender: TObject);
procedure lsbNavigatorClick(Sender: TObject);
procedure lsvAllFramesInfoTip(Sender: TObject; Item: TListItem; var InfoTip: String);
procedure lsvPicturesClick(Sender: TObject);
private private
FTagDeleted: Boolean; FTagDeleted: Boolean;
protected protected
@ -273,16 +272,13 @@ var
procedure SetPictureListItemTo(ListItem: TListItem; Frame: TJvID3PictureFrame); procedure SetPictureListItemTo(ListItem: TListItem; Frame: TJvID3PictureFrame);
begin begin
with ListItem, Frame do ListItem.Caption := Frame.Description;
begin while ListItem.SubItems.Count < 3 do
Caption := Description; ListItem.SubItems.Add('');
while SubItems.Count < 3 do ListItem.SubItems[0] := CPictureTypeStr[Frame.PictureType]; //Type
SubItems.Add(''); ListItem.SubItems[1] := Frame.MIMEType; //Format
SubItems[0] := CPictureTypeStr[PictureType]; //Type ListItem.SubItems[2] := IntToStr(Frame.DataSize); //Size
SubItems[1] := string(MIMEType); //Format ListItem.Data := Frame;
SubItems[2] := IntToStr(DataSize); //Size
Data := Frame;
end;
end; end;
procedure TJvID3v2EditForm.FormCreate(Sender: TObject); procedure TJvID3v2EditForm.FormCreate(Sender: TObject);
@ -307,9 +303,9 @@ begin
HasTag := True; HasTag := True;
if JvID3v21.FrameCount = 0 then if JvID3v21.FrameCount = 0 then
GetID3v2Version(JvID3v21.FileName, HasTag, Version); GetID3v2Version(JvID3v21.FileName, HasTag, Version);
if HasTag then if HasTag then
JvID3v21.Commit; JvID3v21.Commit;
ModalResult := mrOk; ModalResult := mrOk;
finally finally
Screen.Cursor := lCursor; Screen.Cursor := lCursor;
@ -362,7 +358,6 @@ begin
TagToCtrls; TagToCtrls;
imgPicture.Picture.Assign(nil); imgPicture.Picture.Assign(nil);
lsbNavigator.ItemIndex := 0; lsbNavigator.ItemIndex := 0;
Notebook1.PageIndex := lsbNavigator.ItemIndex;
end; end;
function ChangeYear(const ADateTime: TDateTime; const NewYear: Word): TDateTime; function ChangeYear(const ADateTime: TDateTime; const NewYear: Word): TDateTime;
@ -560,6 +555,7 @@ begin
P := Point(0, EdtEncodedBy.Top + EdtEncodedby.Height + EdtEncodedBy.BorderSpacing.Bottom); P := Point(0, EdtEncodedBy.Top + EdtEncodedby.Height + EdtEncodedBy.BorderSpacing.Bottom);
P := ScreenToClient(EdtEncodedBy.Parent.ClientToScreen(P)); P := ScreenToClient(EdtEncodedBy.Parent.ClientToScreen(P));
Height := P.Y; Height := P.Y;
Notebook1.PageIndex := lsbNavigator.ItemIndex;
end; end;
procedure TJvID3v2EditForm.lsvPicturesClick(Sender: TObject); procedure TJvID3v2EditForm.lsvPicturesClick(Sender: TObject);

View File

@ -258,6 +258,8 @@ type
property DefaultColWidth: Integer read GetDefaultColWidth write SetDefaultColWidth default 16; property DefaultColWidth: Integer read GetDefaultColWidth write SetDefaultColWidth default 16;
property DefaultRowHeight default 18; //: Integer read GetDefaultRowHeight write SetDefaultRowHeihgt default 18; property DefaultRowHeight default 18; //: Integer read GetDefaultRowHeight write SetDefaultRowHeihgt default 18;
property Align;
property Anchors;
property BorderSpacing; property BorderSpacing;
property BorderStyle; property BorderStyle;
property Flat read GetFlat write SetFlat default true; property Flat read GetFlat write SetFlat default true;

View File

@ -1225,7 +1225,7 @@ procedure ID3ErrorFmt(const Msg: string; const Args: array of const;
function CreateUniqueName(AController: TJvID3Controller; const FrameName: AnsiString; function CreateUniqueName(AController: TJvID3Controller; const FrameName: AnsiString;
FrameClass: TJvID3FrameClass; Component: TComponent): string; FrameClass: TJvID3FrameClass; Component: TComponent): string;
procedure GetID3v2Version(const AFileName: string; var HasTag: Boolean; procedure GetID3v2Version(const AFileName: string; var HasTag: Boolean;
var Version: TJvID3Version); out Version: TJvID3Version);
function ExtToMIMEType(const Ext: string): string; function ExtToMIMEType(const Ext: string): string;
function MIMETypeToExt(const MIMEType: string): string; function MIMETypeToExt(const MIMEType: string): string;
function GenreToNiceGenre(const AGenre: string): string; function GenreToNiceGenre(const AGenre: string): string;
@ -1235,7 +1235,7 @@ function NiceGenreToGenre(const ANiceGenre: string): string;
implementation implementation
uses uses
Graphics, Math, LazUTF8, LConvEncoding, LazFileUtils, DateUtils, Graphics, Math, LazUTF8, LConvEncoding, LazFileUtils, DateUtils, StrUtils,
(* (*
{$IFDEF HAS_UNIT_ANSISTRINGS} {$IFDEF HAS_UNIT_ANSISTRINGS}
AnsiStrings, AnsiStrings,
@ -2336,7 +2336,7 @@ begin
end; end;
procedure GetID3v2Version(const AFileName: string; var HasTag: Boolean; procedure GetID3v2Version(const AFileName: string; var HasTag: Boolean;
var Version: TJvID3Version); out Version: TJvID3Version);
var var
Header: TID3v2HeaderRec; Header: TID3v2HeaderRec;
begin begin
@ -2996,7 +2996,7 @@ begin
if Result then if Result then
Result := Result :=
AnsiSameStr(TJvID3ContentFrame(Frame).Language, Self.Language) and AnsiSameStr(TJvID3ContentFrame(Frame).Language, Self.Language) and
SameStr(TJvID3ContentFrame(Frame).Description, Self.Description) (TJvID3ContentFrame(Frame).Description = Self.Description)
else else
Result := inherited SameUniqueIDAs(Frame); Result := inherited SameUniqueIDAs(Frame);
end; end;
@ -6073,8 +6073,8 @@ begin
Exit; Exit;
while (Frame is TJvID3GeneralObjFrame) and while (Frame is TJvID3GeneralObjFrame) and
not SameStr(TJvID3GeneralObjFrame(Frame).ContentDescription, AContentDescription) do (TJvID3GeneralObjFrame(Frame).ContentDescription <> AContentDescription)
do
AController.FindNextFrame(fiGeneralObject, Frame); AController.FindNextFrame(fiGeneralObject, Frame);
if Frame is TJvID3GeneralObjFrame then if Frame is TJvID3GeneralObjFrame then
@ -6174,7 +6174,7 @@ begin
(Frame.FrameID = FrameID) and (FrameID = fiGeneralObject); (Frame.FrameID = FrameID) and (FrameID = fiGeneralObject);
if Result then if Result then
Result := SameStr(TJvID3GeneralObjFrame(Frame).ContentDescription, ContentDescription) Result := (TJvID3GeneralObjFrame(Frame).ContentDescription = ContentDescription)
else else
Result := inherited SameUniqueIDAs(Frame); Result := inherited SameUniqueIDAs(Frame);
end; end;
@ -6933,7 +6933,7 @@ begin
Result := Result :=
(TJvID3PictureFrame(Frame).PictureType = PictureType) and (TJvID3PictureFrame(Frame).PictureType = PictureType) and
((PictureType in [ptFileIcon, ptOtherFileIcon]) or ((PictureType in [ptFileIcon, ptOtherFileIcon]) or
SameStr(Description, TJvID3PictureFrame(Frame).Description)) (Description = TJvID3PictureFrame(Frame).Description))
else else
Result := inherited SameUniqueIDAs(Frame); Result := inherited SameUniqueIDAs(Frame);
end; end;