You've already forked lazarus-ccr
jvcllaz: Fix JvMM demos for Linux. Less hints and warnings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6881 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -110,7 +110,6 @@ type
|
||||
protected
|
||||
function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;
|
||||
function GetPalette: HPALETTE; override;
|
||||
procedure AdjustSize; override;
|
||||
procedure BufferedPaint; override;
|
||||
procedure DefineProperties(Filer: TFiler); override;
|
||||
procedure DoPaintImage; override;
|
||||
@ -121,6 +120,7 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure AdjustSize; override;
|
||||
published
|
||||
property Align;
|
||||
property Anchors;
|
||||
@ -306,9 +306,11 @@ begin
|
||||
end;
|
||||
|
||||
function TJvImageControl.DoPaletteChange: Boolean;
|
||||
{
|
||||
var
|
||||
ParentForm: TCustomForm;
|
||||
Tmp: TGraphic;
|
||||
}
|
||||
begin
|
||||
Result := False;
|
||||
(*************** NOT CONVERTED ***
|
||||
|
@ -192,8 +192,7 @@ implementation
|
||||
uses
|
||||
TypInfo,
|
||||
Math, // JclMath, // for EnsureRange
|
||||
JvResources,
|
||||
JvJCLUtils; // for TryStrToInt
|
||||
JvResources;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
|
@ -79,7 +79,7 @@ type
|
||||
procedure SetWantDrawBuffer(Value: Boolean);
|
||||
protected
|
||||
procedure Paint; override;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure KeyDown(var Key: Word; {%H-}Shift: TShiftState); override;
|
||||
procedure DoEnter; override;
|
||||
procedure DoExit; override;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
|
||||
@ -88,12 +88,12 @@ type
|
||||
procedure DrawFocus;
|
||||
procedure DrawFrame(X, Y: Integer);
|
||||
procedure SetFullColor(const Value: TJvFullColor); virtual;
|
||||
procedure MouseColor(Shift: TShiftState; X, Y: Integer); virtual;
|
||||
procedure MouseColor({%H-}Shift: TShiftState; X, Y: Integer); virtual;
|
||||
procedure AxisConfigChange; virtual;
|
||||
procedure DrawBuffer; virtual;
|
||||
procedure ColorSpaceChange; virtual;
|
||||
procedure CalcSize; virtual;
|
||||
procedure KeyMove(KeyCode: TJvKeyCode; MoveCount: Integer); virtual;
|
||||
procedure KeyMove({%H-}KeyCode: TJvKeyCode; {%H-}MoveCount: Integer); virtual;
|
||||
procedure InvalidateCursor; virtual; abstract;
|
||||
property WantDrawBuffer: Boolean read FWantDrawBuffer write SetWantDrawBuffer;
|
||||
property MouseDragging: Boolean read FMouseDragging;
|
||||
@ -241,7 +241,7 @@ type
|
||||
X, Y: Integer); override;
|
||||
procedure MouseColor(Shift: TShiftState;
|
||||
X, Y: Integer); override;
|
||||
procedure KeyMove(KeyCode: TJvKeyCode; MoveCount: Integer); override;
|
||||
procedure KeyMove({%H-}KeyCode: TJvKeyCode; {%H-}MoveCount: Integer); override;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
procedure TrackBarColorChange(Sender: TObject); override;
|
||||
public
|
||||
@ -669,7 +669,7 @@ type
|
||||
procedure SetSelected(const Value: TJvFullColor);
|
||||
procedure SetSelectedIndex(const Value: Integer);
|
||||
procedure SetBrush(const Value: TBrush);
|
||||
procedure MouseLeave(var Msg: TLMMouse); message LM_MOUSELEAVE;
|
||||
// procedure MouseLeave(var Msg: TLMMouse); message LM_MOUSELEAVE;
|
||||
procedure CMHintShow(var Msg: TLMessage); message CM_HINTSHOW;
|
||||
protected
|
||||
procedure Paint; override;
|
||||
@ -765,7 +765,7 @@ function AxisConfigToString(AxisConfig: TJvFullColorAxisConfig;
|
||||
ItemFormat: TJvFullColorAxisConfigFormat; AColorSpace: TJvColorSpace): string;
|
||||
var
|
||||
Str: string;
|
||||
AxisConfigs: TJvFullColorAxisConfigs;
|
||||
//AxisConfigs: TJvFullColorAxisConfigs;
|
||||
begin
|
||||
Str := GetEnumName(TypeInfo(TJvFullColorAxisConfig), Ord(AxisConfig));
|
||||
case ItemFormat of
|
||||
@ -774,7 +774,7 @@ begin
|
||||
afIndent:
|
||||
Result := Str;
|
||||
else
|
||||
AxisConfigs := TabAxisConfigs[AxisConfig];
|
||||
//AxisConfigs := TabAxisConfigs[AxisConfig];
|
||||
Result := Format('[%s] = %s ; [%s] = %s ; [%s] = %s',
|
||||
[Str[3], AColorSpace.AxisName[axIndex0], Str[4],
|
||||
AColorSpace.AxisName[axIndex1], Str[5], AColorSpace.AxisName[axIndex2]]);
|
||||
@ -1175,6 +1175,7 @@ begin
|
||||
// Delphi TColor is (MSB) 00BBGGRR (LSB)
|
||||
// Line^[IndexX] := RGBToBGR(ConvertToColor(TempColor));
|
||||
P^ := RGBToBGR(ConvertToColor(TempColor));
|
||||
PColorRGBA(P)^.a := 255;
|
||||
inc(P);
|
||||
end;
|
||||
end;
|
||||
@ -1592,7 +1593,7 @@ begin
|
||||
end;
|
||||
// (outchy) don't remove, Bitmap colors are stocked as (MSB) 00RRGGBB (LSB)
|
||||
// Delphi TColor is (MSB) 00BBGGRR (LSB)
|
||||
Line^[X] := RGBToBGR(ConvertToColor(Magic1 or (Magic2 shl 8) or (Magic3 shl 16)));
|
||||
Line^[X] := RGBToBGR(ConvertToColor(Magic1 or (Magic2 shl 8) or (Magic3 shl 16))) + $FF000000;
|
||||
// P^ := RGBToBGR(ConvertToColor(Magic1 or (Magic2 shl 8) or (Magic3 shl 16)));
|
||||
// inc(P);
|
||||
end
|
||||
@ -2843,6 +2844,7 @@ begin
|
||||
spLeft:
|
||||
begin
|
||||
ShapeTop := (h - FShapeHeight) div 2;
|
||||
ShapeLeft := 0;
|
||||
TextLeft := FShapeWidth + FSpacing;
|
||||
TextTop := (h - TextHeight(FCaption)) div 2;
|
||||
end;
|
||||
@ -3495,13 +3497,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{
|
||||
procedure TJvFullColorGroup.MouseLeave(var Msg: TLMMouse);
|
||||
begin
|
||||
FMouseIndex := -1;
|
||||
Msg.Result := 1;
|
||||
Refresh;
|
||||
end;
|
||||
|
||||
}
|
||||
{$IFDEF RTL200_UP}
|
||||
// for D2009 "Use Controls.PHintInfo" warning
|
||||
type
|
||||
@ -3518,7 +3521,7 @@ var
|
||||
AColorID: TJvFullColorSpaceID;
|
||||
AColorSpace: TJvColorSpace;
|
||||
begin
|
||||
AHintInfo := PHintInfo(Msg.LParam);
|
||||
AHintInfo := {%H-}PHintInfo(PtrInt(Msg.LParam));
|
||||
ColorIndex := -1;
|
||||
|
||||
CalcRects(XPos, YPos, XInc, YInc);
|
||||
@ -3691,7 +3694,7 @@ var
|
||||
XOffset, YOffset, XInc, YInc: Integer;
|
||||
X, Y: Integer;
|
||||
lEdge: TJvFullColorEdge;
|
||||
ClipRect: TRect;
|
||||
lClipRect: TRect;
|
||||
|
||||
procedure BevelRect(const R: TRect; Style: TJvFullColorEdge;
|
||||
FillStyle: TBrushStyle; FillColor: TColor);
|
||||
@ -3738,7 +3741,7 @@ begin
|
||||
|
||||
Y := YOffset;
|
||||
X := XOffset;
|
||||
ClipRect := Canvas.ClipRect;
|
||||
lClipRect := Canvas.ClipRect;
|
||||
|
||||
Index := 0;
|
||||
while Index < Items.Count do
|
||||
@ -3772,9 +3775,9 @@ begin
|
||||
for IndexY := 0 to RowCount do
|
||||
begin
|
||||
Rectangle(
|
||||
Max(ClipRect.Left, 1),
|
||||
Max(lClipRect.Left, 1),
|
||||
Max(Y - YInc + 1, 1),
|
||||
Min(ClipRect.Right, Self.Width - 2),
|
||||
Min(lClipRect.Right, Self.Width - 2),
|
||||
Min(Y, Self.Height - 2)
|
||||
);
|
||||
X := XOffset;
|
||||
|
@ -164,7 +164,6 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
JvResources,
|
||||
Controls, SysUtils, JvFullColorForm, JvFullColorCircleForm;
|
||||
|
||||
//=== { TJvFullColorDialog } =================================================
|
||||
|
@ -1,31 +1,32 @@
|
||||
object JvFullColorFrm: TJvFullColorFrm
|
||||
Left = 373
|
||||
Height = 388
|
||||
Height = 454
|
||||
Top = 274
|
||||
Width = 712
|
||||
Width = 922
|
||||
ActiveControl = ColorBox
|
||||
AutoSize = True
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Color Spaces Editor, Choose your color'
|
||||
ClientHeight = 388
|
||||
ClientWidth = 712
|
||||
ClientHeight = 454
|
||||
ClientWidth = 922
|
||||
Color = clBtnFace
|
||||
DesignTimePPI = 120
|
||||
Font.Color = clWindowText
|
||||
KeyPreview = True
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
LCLVersion = '2.1.0.0'
|
||||
object LabelColorSpace: TLabel
|
||||
AnchorSideLeft.Control = JvColorSpaceCombo
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 112
|
||||
BorderSpacing.Top = 8
|
||||
Left = 15
|
||||
Height = 20
|
||||
Top = 10
|
||||
Width = 150
|
||||
BorderSpacing.Top = 10
|
||||
Caption = '&Current Color Space :'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object LabelDrawOld: TLabel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
@ -33,15 +34,17 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideRight.Control = LabelDrawNew
|
||||
AnchorSideBottom.Control = JvColorSpaceCombo
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 270
|
||||
Height = 23
|
||||
Top = 27
|
||||
Width = 61
|
||||
Left = 338
|
||||
Height = 36
|
||||
Top = 35
|
||||
Width = 76
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = False
|
||||
BorderSpacing.Left = 16
|
||||
BorderSpacing.Left = 20
|
||||
Color = clBlack
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
OnClick = LabelDrawOldClick
|
||||
end
|
||||
@ -53,115 +56,131 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = JvColorSpaceCombo
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 331
|
||||
Height = 23
|
||||
Top = 27
|
||||
Width = 61
|
||||
Left = 414
|
||||
Height = 36
|
||||
Top = 35
|
||||
Width = 76
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = False
|
||||
Color = clWhite
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object LabelOld: TLabel
|
||||
AnchorSideLeft.Control = LabelDrawOld
|
||||
AnchorSideTop.Control = LabelColorSpace
|
||||
Left = 270
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 22
|
||||
Left = 338
|
||||
Height = 20
|
||||
Top = 10
|
||||
Width = 29
|
||||
Caption = 'Old:'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object LabelNew: TLabel
|
||||
AnchorSideLeft.Control = LabelDrawNew
|
||||
AnchorSideTop.Control = LabelColorSpace
|
||||
Left = 331
|
||||
Height = 15
|
||||
Top = 8
|
||||
Width = 27
|
||||
Left = 414
|
||||
Height = 20
|
||||
Top = 10
|
||||
Width = 36
|
||||
Caption = 'New:'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object GroupBoxSettings: TGroupBox
|
||||
AnchorSideLeft.Control = JvColorSpaceCombo
|
||||
AnchorSideTop.Control = JvColorSpaceCombo
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 246
|
||||
Top = 62
|
||||
Width = 380
|
||||
BorderSpacing.Top = 12
|
||||
BorderSpacing.Right = 16
|
||||
Left = 15
|
||||
Height = 308
|
||||
Top = 86
|
||||
Width = 475
|
||||
BorderSpacing.Top = 15
|
||||
BorderSpacing.Right = 20
|
||||
Caption = ' Settings ... '
|
||||
ClientHeight = 226
|
||||
ClientWidth = 376
|
||||
ClientHeight = 290
|
||||
ClientWidth = 467
|
||||
Font.Color = clWindowText
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
object LabelAxis0: TLabel
|
||||
AnchorSideLeft.Control = GroupBoxSettings
|
||||
AnchorSideTop.Control = GroupBoxSettings
|
||||
Left = 16
|
||||
Height = 15
|
||||
Top = 4
|
||||
Width = 55
|
||||
Left = 20
|
||||
Height = 20
|
||||
Top = 5
|
||||
Width = 75
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Left = 16
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Left = 20
|
||||
BorderSpacing.Top = 5
|
||||
Caption = 'LabelAxis0'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object LabelAxis1: TLabel
|
||||
AnchorSideLeft.Control = LabelAxis0
|
||||
AnchorSideTop.Control = ScrollBarAxis0
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 16
|
||||
Height = 15
|
||||
Top = 59
|
||||
Width = 55
|
||||
Left = 20
|
||||
Height = 20
|
||||
Top = 75
|
||||
Width = 75
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Top = 16
|
||||
BorderSpacing.Top = 20
|
||||
Caption = 'LabelAxis1'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object LabelAxis2: TLabel
|
||||
AnchorSideLeft.Control = LabelAxis0
|
||||
AnchorSideTop.Control = ScrollBarAxis1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 16
|
||||
Height = 15
|
||||
Top = 114
|
||||
Width = 55
|
||||
Left = 20
|
||||
Height = 20
|
||||
Top = 145
|
||||
Width = 75
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Top = 16
|
||||
BorderSpacing.Top = 20
|
||||
Caption = 'LabelAxis2'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object LabelPredefined: TLabel
|
||||
AnchorSideLeft.Control = ColorBox
|
||||
AnchorSideTop.Control = ScrollBarAxis2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 88
|
||||
Height = 15
|
||||
Top = 169
|
||||
Width = 95
|
||||
Left = 108
|
||||
Height = 20
|
||||
Top = 215
|
||||
Width = 128
|
||||
Alignment = taRightJustify
|
||||
Caption = '&Predefined colors:'
|
||||
FocusControl = ColorBox
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object ScrollBarAxis0: TScrollBar
|
||||
AnchorSideLeft.Control = LabelAxis0
|
||||
AnchorSideTop.Control = LabelAxis0
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = SpinEditAxis0
|
||||
Left = 16
|
||||
Height = 20
|
||||
Top = 23
|
||||
Width = 268
|
||||
Left = 20
|
||||
Height = 25
|
||||
Top = 30
|
||||
Width = 332
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Right = 16
|
||||
BorderSpacing.Top = 5
|
||||
BorderSpacing.Right = 20
|
||||
LargeChange = 16
|
||||
Max = 255
|
||||
PageSize = 0
|
||||
@ -175,12 +194,12 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ScrollBarAxis0
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 16
|
||||
Height = 20
|
||||
Top = 78
|
||||
Width = 268
|
||||
Left = 20
|
||||
Height = 25
|
||||
Top = 100
|
||||
Width = 332
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Top = 5
|
||||
LargeChange = 16
|
||||
Max = 255
|
||||
PageSize = 0
|
||||
@ -194,13 +213,13 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ScrollBarAxis1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 16
|
||||
Height = 20
|
||||
Top = 133
|
||||
Width = 268
|
||||
Left = 20
|
||||
Height = 25
|
||||
Top = 170
|
||||
Width = 332
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Bottom = 16
|
||||
BorderSpacing.Top = 5
|
||||
BorderSpacing.Bottom = 20
|
||||
LargeChange = 16
|
||||
Max = 255
|
||||
PageSize = 0
|
||||
@ -212,14 +231,16 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = GroupBoxSettings
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 300
|
||||
Height = 23
|
||||
Top = 22
|
||||
Width = 60
|
||||
Left = 372
|
||||
Height = 30
|
||||
Top = 27
|
||||
Width = 75
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Right = 16
|
||||
BorderSpacing.Right = 20
|
||||
Font.Color = clWindowText
|
||||
MaxValue = 255
|
||||
OnChange = SpinEditChange
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
end
|
||||
object SpinEditAxis1: TSpinEdit
|
||||
@ -229,13 +250,15 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = SpinEditAxis0
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 300
|
||||
Height = 23
|
||||
Top = 77
|
||||
Width = 60
|
||||
Left = 372
|
||||
Height = 30
|
||||
Top = 97
|
||||
Width = 75
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Font.Color = clWindowText
|
||||
MaxValue = 255
|
||||
OnChange = SpinEditChange
|
||||
ParentFont = False
|
||||
TabOrder = 3
|
||||
end
|
||||
object SpinEditAxis2: TSpinEdit
|
||||
@ -245,13 +268,15 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = SpinEditAxis0
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 300
|
||||
Height = 23
|
||||
Top = 132
|
||||
Width = 60
|
||||
Left = 372
|
||||
Height = 30
|
||||
Top = 167
|
||||
Width = 75
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Font.Color = clWindowText
|
||||
MaxValue = 255
|
||||
OnChange = SpinEditChange
|
||||
ParentFont = False
|
||||
TabOrder = 5
|
||||
end
|
||||
object ColorBox: TColorBox
|
||||
@ -259,15 +284,17 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = LabelPredefined
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 88
|
||||
Height = 22
|
||||
Top = 188
|
||||
Width = 201
|
||||
Left = 108
|
||||
Height = 36
|
||||
Top = 240
|
||||
Width = 251
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Bottom = 16
|
||||
ItemHeight = 16
|
||||
BorderSpacing.Top = 5
|
||||
BorderSpacing.Bottom = 20
|
||||
Font.Color = clWindowText
|
||||
ItemHeight = 20
|
||||
OnSelect = ComboBoxPredefinedSelect
|
||||
ParentFont = False
|
||||
TabOrder = 6
|
||||
end
|
||||
end
|
||||
@ -279,16 +306,16 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ButtonOK
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 408
|
||||
Height = 341
|
||||
Top = 8
|
||||
Width = 296
|
||||
Left = 510
|
||||
Height = 434
|
||||
Top = 10
|
||||
Width = 402
|
||||
ColCount = 8
|
||||
SquareSize = 30
|
||||
OnChange = JvFullColorGroupChange
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Right = 8
|
||||
Constraints.MinWidth = 288
|
||||
BorderSpacing.Right = 10
|
||||
Constraints.MinWidth = 360
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
end
|
||||
@ -300,29 +327,33 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ButtonOK
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 408
|
||||
Height = 341
|
||||
Top = 8
|
||||
Width = 296
|
||||
Left = 510
|
||||
Height = 434
|
||||
Top = 10
|
||||
Width = 402
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Right = 10
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
ClientHeight = 341
|
||||
ClientWidth = 296
|
||||
ClientHeight = 434
|
||||
ClientWidth = 402
|
||||
Font.Color = clWindowText
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object LabelAxis: TLabel
|
||||
AnchorSideLeft.Control = PanelGraphic
|
||||
AnchorSideTop.Control = JvColorAxisConfigCombo
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 10
|
||||
Height = 15
|
||||
Top = 14
|
||||
Width = 24
|
||||
BorderSpacing.Left = 8
|
||||
Left = 12
|
||||
Height = 20
|
||||
Top = 20
|
||||
Width = 33
|
||||
BorderSpacing.Left = 10
|
||||
Caption = '&Axis:'
|
||||
Font.Color = clWindowText
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object JvColorPanel: TJvFullColorPanel
|
||||
AnchorSideLeft.Control = PanelGraphic
|
||||
@ -331,15 +362,15 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideRight.Control = PanelGraphic
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = JvFullColorTrackBar
|
||||
Left = 10
|
||||
Height = 263
|
||||
Top = 37
|
||||
Width = 268
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Right = 8
|
||||
BorderSpacing.Bottom = 4
|
||||
Left = 12
|
||||
Height = 326
|
||||
Top = 53
|
||||
Width = 378
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 10
|
||||
BorderSpacing.Top = 5
|
||||
BorderSpacing.Right = 10
|
||||
BorderSpacing.Bottom = 5
|
||||
FullColor = 83886079
|
||||
TabOrder = 1
|
||||
OnColorChange = JvColorPanelColorChange
|
||||
@ -354,11 +385,12 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = PanelGraphic
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 10
|
||||
Height = 27
|
||||
Top = 304
|
||||
Width = 268
|
||||
BorderSpacing.Bottom = 8
|
||||
Left = 12
|
||||
Height = 38
|
||||
Top = 384
|
||||
Width = 378
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Bottom = 10
|
||||
FullColor = 83886079
|
||||
TabOrder = 2
|
||||
ArrowWidth = 8
|
||||
@ -367,18 +399,19 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideLeft.Control = LabelAxis
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = PanelGraphic
|
||||
AnchorSideRight.Control = PanelGraphic
|
||||
AnchorSideRight.Control = JvColorPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 42
|
||||
Height = 23
|
||||
Top = 10
|
||||
Width = 244
|
||||
Left = 55
|
||||
Height = 36
|
||||
Top = 12
|
||||
Width = 335
|
||||
Selected = acXYZ
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Right = 8
|
||||
ItemHeight = 15
|
||||
BorderSpacing.Left = 10
|
||||
BorderSpacing.Top = 10
|
||||
Font.Color = clWindowText
|
||||
ItemHeight = 22
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
OnChange = ComboBoxAxisChange
|
||||
end
|
||||
@ -388,61 +421,70 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Control = ButtonOK
|
||||
AnchorSideRight.Control = GroupBoxSettings
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 284
|
||||
Height = 25
|
||||
Top = 324
|
||||
Width = 108
|
||||
Left = 366
|
||||
Height = 30
|
||||
Top = 414
|
||||
Width = 124
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'ButtonGraphics'
|
||||
Constraints.MinWidth = 75
|
||||
Constraints.MinWidth = 94
|
||||
Font.Color = clWindowText
|
||||
OnClick = ButtonGraphicsClick
|
||||
ParentFont = False
|
||||
TabOrder = 6
|
||||
end
|
||||
object ButtonOK: TButton
|
||||
AnchorSideLeft.Control = GroupBoxSettings
|
||||
AnchorSideTop.Control = GroupBoxSettings
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 25
|
||||
Top = 324
|
||||
Width = 75
|
||||
Left = 15
|
||||
Height = 30
|
||||
Top = 414
|
||||
Width = 94
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 16
|
||||
BorderSpacing.Bottom = 8
|
||||
BorderSpacing.Top = 20
|
||||
BorderSpacing.Bottom = 10
|
||||
Caption = '&OK'
|
||||
Constraints.MinWidth = 75
|
||||
Constraints.MinWidth = 94
|
||||
Default = True
|
||||
Font.Color = clWindowText
|
||||
ModalResult = 1
|
||||
ParentFont = False
|
||||
TabOrder = 3
|
||||
end
|
||||
object ButtonCancel: TButton
|
||||
AnchorSideLeft.Control = ButtonOK
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ButtonOK
|
||||
Left = 95
|
||||
Height = 25
|
||||
Top = 324
|
||||
Width = 75
|
||||
BorderSpacing.Left = 8
|
||||
Left = 119
|
||||
Height = 30
|
||||
Top = 414
|
||||
Width = 72
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 10
|
||||
Cancel = True
|
||||
Caption = 'Ca&ncel'
|
||||
Font.Color = clWindowText
|
||||
ModalResult = 2
|
||||
ParentFont = False
|
||||
TabOrder = 4
|
||||
end
|
||||
object ButtonApply: TButton
|
||||
AnchorSideLeft.Control = ButtonCancel
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ButtonOK
|
||||
Left = 178
|
||||
Height = 25
|
||||
Top = 324
|
||||
Width = 75
|
||||
Left = 201
|
||||
Height = 30
|
||||
Top = 414
|
||||
Width = 94
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Left = 10
|
||||
Caption = '&Apply'
|
||||
Constraints.MinWidth = 75
|
||||
Constraints.MinWidth = 94
|
||||
Font.Color = clWindowText
|
||||
OnClick = ButtonApplyClick
|
||||
ParentFont = False
|
||||
TabOrder = 5
|
||||
end
|
||||
object JvColorSpaceCombo: TJvFullColorSpaceCombo
|
||||
@ -450,14 +492,16 @@ object JvFullColorFrm: TJvFullColorFrm
|
||||
AnchorSideTop.Control = LabelColorSpace
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 23
|
||||
Top = 27
|
||||
Width = 244
|
||||
BorderSpacing.Left = 12
|
||||
BorderSpacing.Top = 4
|
||||
Constraints.MinWidth = 210
|
||||
ItemHeight = 15
|
||||
Left = 15
|
||||
Height = 36
|
||||
Top = 35
|
||||
Width = 305
|
||||
BorderSpacing.Left = 15
|
||||
BorderSpacing.Top = 5
|
||||
Constraints.MinWidth = 262
|
||||
Font.Color = clWindowText
|
||||
ItemHeight = 22
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
OnSelect = JvComboBoxColorSpaceSelect
|
||||
end
|
||||
|
@ -120,7 +120,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
JvResources;
|
||||
Math, JvResources;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
@ -155,8 +155,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TJvFullColorFrm.FormShow(Sender: TObject);
|
||||
var
|
||||
i, w: Integer;
|
||||
begin
|
||||
Position := poScreenCenter;
|
||||
w := 0;
|
||||
for i := 0 to JvColorAxisConfigCombo.Items.Count-1 do
|
||||
w := Max(w, JvColorAxisConfigCombo.Canvas.TextWidth(JvColorAxisConfigCombo.Items[i]));
|
||||
JvColorAxisConfigCombo.Constraints.MinWidth := w + 40;;
|
||||
AutoSize := true;
|
||||
end;
|
||||
|
||||
procedure TJvFullColorFrm.Loaded;
|
||||
|
@ -89,8 +89,6 @@ procedure RotateBitmap(SourceBitmap, DestBitmap: TBitmap; AColorDelta: TJvColorD
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
JvTypes;
|
||||
|
||||
function RotateColor(AColor: TJvFullColor; AColorDelta: TJvColorDelta): TJvFullColor;
|
||||
var
|
||||
@ -175,7 +173,7 @@ end;
|
||||
procedure RotateBitmap(SourceBitmap, DestBitmap: TBitmap; AColorDelta: TJvColorDelta);
|
||||
type
|
||||
TFullColorValue = array [TJvAxisIndex] of SmallInt;
|
||||
PFullColorValue = ^TFullColorValue;
|
||||
// PFullColorValue = ^TFullColorValue;
|
||||
var
|
||||
OriginalPixelFormat: TPixelFormat;
|
||||
Colors: array [TJvAxisIndex,Byte] of TFullColorValue;
|
||||
@ -275,7 +273,7 @@ begin
|
||||
if ColorFusion[axIndex2] < 0 then
|
||||
ColorFusion[axIndex2] := 0;
|
||||
DestLine^ := // Bitmap Color Format is (MSB)0RGB(LSB)
|
||||
(ColorFusion[axIndex0] shl 16) or (ColorFusion[axIndex1] shl 8) or (ColorFusion[axIndex2]);
|
||||
(ColorFusion[axIndex0] shl 16) or (ColorFusion[axIndex1] shl 8) or (ColorFusion[axIndex2]); // or $FF000000;
|
||||
Inc(SourceLine);
|
||||
Inc(DestLine);
|
||||
end;
|
||||
|
@ -102,10 +102,10 @@ type
|
||||
private
|
||||
FID: TJvFullColorSpaceID;
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; virtual;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; virtual;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; virtual;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; virtual;
|
||||
function GetAxisName({%H-}Index: TJvAxisIndex): string; virtual;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; virtual;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; virtual;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; virtual;
|
||||
function GetName: string; virtual;
|
||||
function GetShortName: string; virtual;
|
||||
function GetNumberOfColors: Cardinal; virtual;
|
||||
@ -148,11 +148,11 @@ type
|
||||
TJvRGBColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -161,11 +161,11 @@ type
|
||||
TJvHLSColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -174,11 +174,11 @@ type
|
||||
TJvCMYColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -187,11 +187,11 @@ type
|
||||
TJvYUVColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -200,7 +200,7 @@ type
|
||||
TJvHSVColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
@ -213,11 +213,11 @@ type
|
||||
TJvYIQColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -226,11 +226,11 @@ type
|
||||
TJvYCCColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -239,11 +239,11 @@ type
|
||||
TJvXYZColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -252,11 +252,11 @@ type
|
||||
TJvLABColorSpace = class(TJvColorSpace)
|
||||
protected
|
||||
function GetAxisName(Index: TJvAxisIndex): string; override;
|
||||
function GetAxisMin(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMin({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisMax({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
function GetName: string; override;
|
||||
function GetShortName: string; override;
|
||||
function GetAxisDefault(Index: TJvAxisIndex): Byte; override;
|
||||
function GetAxisDefault({%H-}Index: TJvAxisIndex): Byte; override;
|
||||
public
|
||||
function ConvertFromColor(AColor: TColor): TJvFullColor; override;
|
||||
function ConvertToColor(AColor: TJvFullColor): TColor; override;
|
||||
@ -314,7 +314,7 @@ function ColorSpaceManager: TJvColorSpaceManager;
|
||||
function GetAxisValue(AColor: TJvFullColor; AAxis: TJvAxisIndex): Byte;
|
||||
function SetAxisValue(AColor: TJvFullColor; AAxis: TJvAxisIndex; NewValue: Byte): TJvFullColor;
|
||||
|
||||
procedure SplitColorParts(AColor: TJvFullColor; var Part1, Part2, Part3: Integer);
|
||||
procedure SplitColorParts(AColor: TJvFullColor; out Part1, Part2, Part3: Integer);
|
||||
function JoinColorParts(const Part1, Part2, Part3: Integer): TJvFullColor;
|
||||
|
||||
function ColorToPrettyName(Value: TColor): String;
|
||||
@ -385,7 +385,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure SplitColorParts(AColor: TJvFullColor; var Part1, Part2, Part3: Integer);
|
||||
procedure SplitColorParts(AColor: TJvFullColor; out Part1, Part2, Part3: Integer);
|
||||
begin
|
||||
Part1 := AColor and $000000FF;
|
||||
Part2 := (AColor shr 8) and $000000FF;
|
||||
@ -460,7 +460,7 @@ end;
|
||||
|
||||
function TJvColorSpace.ConvertFromColor(AColor: TColor): TJvFullColor;
|
||||
begin
|
||||
Result := (AColor and $00FFFFFF) or (ID shl 24);
|
||||
Result := (Cardinal(AColor) and $00FFFFFF) or (ID shl 24);
|
||||
end;
|
||||
|
||||
function TJvColorSpace.ConvertToColor(AColor: TJvFullColor): TColor;
|
||||
|
@ -30,7 +30,7 @@ unit JvGradientHeaderPanel;
|
||||
interface
|
||||
|
||||
uses
|
||||
LMessages, Types,
|
||||
LMessages,
|
||||
SysUtils, Classes, Graphics, Controls, StdCtrls,
|
||||
JvGradient, JvTypes, JvComponent;
|
||||
|
||||
|
@ -125,7 +125,7 @@ begin
|
||||
Exit;
|
||||
|
||||
Seek(-CTagSize, soFromEnd);
|
||||
Result := (Read(TagID, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag);
|
||||
Result := (Read(TagID{%H-}, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag);
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
@ -157,7 +157,7 @@ begin
|
||||
try
|
||||
Seek(-CTagSize, soFromEnd);
|
||||
|
||||
if (Read(TagID, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag) then
|
||||
if (Read(TagID{%H-}, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag) then
|
||||
Size := Size - CTagSize;
|
||||
finally
|
||||
Free;
|
||||
@ -179,7 +179,7 @@ begin
|
||||
if Size >= CTagSize then
|
||||
begin
|
||||
Seek(-CTagSize, soFromEnd);
|
||||
if (Read(TagID, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag) then
|
||||
if (Read(TagID{%H-}, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag) then
|
||||
Seek(-CTagIDSize, soFromCurrent)
|
||||
else
|
||||
Seek(0, soFromEnd);
|
||||
@ -248,7 +248,7 @@ begin
|
||||
|
||||
FNeedUpdateHasTag := True;
|
||||
|
||||
FillChar(lTag, CTagSize, #0);
|
||||
FillChar(lTag{%H-}, CTagSize, #0);
|
||||
|
||||
// Set new Tag
|
||||
Move(CID3v1Tag[0], lTag.Identifier[0], 3);
|
||||
@ -318,7 +318,7 @@ var
|
||||
begin
|
||||
CheckActive;
|
||||
|
||||
Result := ReadID3v1Tag(FileName, lTag);
|
||||
Result := ReadID3v1Tag(FileName, lTag{%H-});
|
||||
|
||||
FNeedUpdateHasTag := False;
|
||||
FHasTag := Result;
|
||||
|
@ -296,7 +296,7 @@ type
|
||||
procedure WriteFrameHeader(const AFrameSize: Cardinal);
|
||||
procedure WriteID;
|
||||
|
||||
procedure ChangeToVersion(const ANewVersion: TJvID3Version); virtual;
|
||||
procedure ChangeToVersion(const {%H-}ANewVersion: TJvID3Version); virtual;
|
||||
function SupportsVersion(const AVersion: TJvID3Version): Boolean; virtual;
|
||||
|
||||
{ Checks whether this frame is empty, thus can be removed }
|
||||
@ -310,7 +310,7 @@ type
|
||||
procedure CheckFrameIDStr(const S: AnsiString);
|
||||
|
||||
{ Checks whether Frame has the same unique identifier as this frame }
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; virtual;
|
||||
function SameUniqueIDAs(const {%H-}Frame: TJvID3Frame): Boolean; virtual;
|
||||
|
||||
function MustWriteAsUTF: Boolean; virtual;
|
||||
|
||||
@ -329,8 +329,8 @@ type
|
||||
const AFrameIDStr: AnsiString = ''); reintroduce; virtual;
|
||||
destructor Destroy; override;
|
||||
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; virtual;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; virtual;
|
||||
class function CanAddFrame({%H-}AController: TJvID3Controller; {%H-}AFrameID: TJvID3FrameID): Boolean; virtual;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; virtual;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; virtual;
|
||||
@ -402,13 +402,13 @@ type
|
||||
procedure ReadFrame; override;
|
||||
procedure WriteFrame; override;
|
||||
|
||||
function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetFrameSize(const {%H-}ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetIsEmpty: Boolean; override;
|
||||
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -468,7 +468,7 @@ type
|
||||
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -562,7 +562,7 @@ type
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -599,13 +599,13 @@ type
|
||||
procedure ReadFrame; override;
|
||||
procedure WriteFrame; override;
|
||||
|
||||
function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetFrameSize(const {%H-}ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetIsEmpty: Boolean; override;
|
||||
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -633,14 +633,14 @@ type
|
||||
procedure ReadFrame; override;
|
||||
procedure WriteFrame; override;
|
||||
|
||||
function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetFrameSize(const {%H-}ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetIsEmpty: Boolean; override;
|
||||
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller;
|
||||
AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -667,7 +667,7 @@ type
|
||||
procedure ReadFrame; override;
|
||||
procedure WriteFrame; override;
|
||||
|
||||
function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetFrameSize(const {%H-}ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetIsEmpty: Boolean; override;
|
||||
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
@ -747,7 +747,7 @@ type
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -914,7 +914,7 @@ type
|
||||
//procedure SetText(const ANewText: WideString); override;
|
||||
procedure ChangeToVersion(const ANewVersion: TJvID3Version); override;
|
||||
public
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
class function Find(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3TimestampFrame;
|
||||
class function FindOrCreate(AController: TJvID3Controller; const AFrameID: TJvID3FrameID): TJvID3TimestampFrame;
|
||||
published
|
||||
@ -947,7 +947,7 @@ type
|
||||
procedure ReadFrame; override;
|
||||
procedure WriteFrame; override;
|
||||
|
||||
function GetFrameSize(const ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetFrameSize(const {%H-}ToEncoding: TJvID3Encoding): Cardinal; override;
|
||||
function GetIsEmpty: Boolean; override;
|
||||
|
||||
function SameUniqueIDAs(const Frame: TJvID3Frame): Boolean; override;
|
||||
@ -984,7 +984,7 @@ type
|
||||
function MustWriteAsUTF: Boolean; override;
|
||||
public
|
||||
class function CanAddFrame(AController: TJvID3Controller; AFrameID: TJvID3FrameID): Boolean; override;
|
||||
function CheckFrame(const HandleError: TJvID3HandleError): Boolean; override;
|
||||
function CheckFrame(const {%H-}HandleError: TJvID3HandleError): Boolean; override;
|
||||
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear; override;
|
||||
@ -1084,7 +1084,7 @@ type
|
||||
constructor Create(Controller: TJvID3Controller);
|
||||
destructor Destroy; override;
|
||||
procedure BeginDesign;
|
||||
procedure ID3Event(Event: TJvID3Event; Info: Longint); virtual;
|
||||
procedure ID3Event({%H-}Event: TJvID3Event; {%H-}Info: Longint); virtual;
|
||||
procedure EndDesign;
|
||||
property Controller: TJvID3Controller read FController;
|
||||
end;
|
||||
@ -1235,7 +1235,7 @@ function NiceGenreToGenre(const ANiceGenre: string): string;
|
||||
implementation
|
||||
|
||||
uses
|
||||
Graphics, Math, LazUTF8, LConvEncoding, LazFileUtils, DateUtils, StrUtils,
|
||||
Graphics, Math, LazUTF8, LConvEncoding, LazFileUtils, DateUtils,
|
||||
(*
|
||||
{$IFDEF HAS_UNIT_ANSISTRINGS}
|
||||
AnsiStrings,
|
||||
@ -1454,7 +1454,8 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function CheckIsURL(Frame: TJvID3Frame; var S: AnsiString; const HandleError: TJvID3HandleError): Boolean;
|
||||
function CheckIsURL({%H-}Frame: TJvID3Frame; var {%H-}S: AnsiString;
|
||||
const {%H-}HandleError: TJvID3HandleError): Boolean;
|
||||
begin
|
||||
{ Not implemented }
|
||||
Result := True;
|
||||
@ -1541,7 +1542,7 @@ function CheckMaxCharCount(Frame: TJvID3Frame; var S: String;
|
||||
const HandleError: TJvID3HandleError): Boolean;
|
||||
begin
|
||||
//Result := CharCount(S) <= MaxCharCount;
|
||||
Result := UTF8Length(S) <= MaxCharCount;
|
||||
Result := Cardinal(UTF8Length(S)) <= MaxCharCount;
|
||||
if not Result then
|
||||
case HandleError of
|
||||
heAutoCorrect:
|
||||
@ -1553,7 +1554,7 @@ end;
|
||||
|
||||
{function GetID3Date(const S: WideString; const Encoding: TJvID3Encoding;
|
||||
const Year: Word = 0): TDateTime; }
|
||||
function GetID3Date(const S: String; const Encoding: TJvID3Encoding;
|
||||
function GetID3Date(const S: String; const {%H-}Encoding: TJvID3Encoding;
|
||||
const Year: Word = 0): TDateTime;
|
||||
var
|
||||
Day, Month: Word;
|
||||
@ -1582,10 +1583,6 @@ begin
|
||||
}
|
||||
end;
|
||||
|
||||
{
|
||||
function CheckIsLanguageList(Frame: TJvID3Frame;
|
||||
Strings: {$IFDEF COMPILER12_UP}TStrings{$ELSE}JclUnicode.TWideStrings{$ENDIF COMPILER12_UP};
|
||||
const HandleError: TJvID3HandleError): Boolean; }
|
||||
function CheckIsLanguageList(Frame: TJvID3Frame; Strings: TStrings;
|
||||
const HandleError: TJvID3HandleError): Boolean;
|
||||
var
|
||||
@ -1607,11 +1604,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{
|
||||
function CheckList(Frame: TJvID3Frame;
|
||||
Strings: {$IFDEF COMPILER12_UP}TStrings{$ELSE}JclUnicode.TWideStrings{$ENDIF COMPILER12_UP};
|
||||
const ASeparator: WideChar;
|
||||
const HandleError: TJvID3HandleError): Boolean; }
|
||||
function CheckList(Frame: TJvID3Frame; Strings: TStrings;
|
||||
const ASeparator: WideChar; const HandleError: TJvID3HandleError): Boolean;
|
||||
var
|
||||
@ -1649,7 +1641,7 @@ end;
|
||||
|
||||
{function GetID3Time(const S: WideString; const Encoding: TJvID3Encoding;
|
||||
const Sec: Word = 0; MSec: Word = 0): TDateTime; }
|
||||
function GetID3Time(const S: String; const Encoding: TJvID3Encoding;
|
||||
function GetID3Time(const S: String; const {%H-}Encoding: TJvID3Encoding;
|
||||
const Sec: Word = 0; MSec: Word = 0): TDateTime;
|
||||
var
|
||||
Hour, Min: Word;
|
||||
@ -1802,11 +1794,11 @@ begin
|
||||
for I := 0 to SourceSize - 1 do
|
||||
begin
|
||||
Dest := Dest shl 7;
|
||||
Dest := Dest or (TBytes(Source)[I] and $7F); // $7F = %01111111
|
||||
Dest := Dest or Cardinal(TBytes(Source)[I] and $7F); // $7F = %01111111
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure UnSyncSafe(var Source; const SourceSize: Integer; var Dest: Int64); overload;
|
||||
procedure UnSyncSafe(var Source; const SourceSize: Integer; out Dest: Int64); overload;
|
||||
type
|
||||
TBytes = array [0..MaxInt - 1] of Byte;
|
||||
var
|
||||
@ -1824,8 +1816,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{procedure ExtractFixedStrings(const Content: WideString; const ALength: Integer;
|
||||
Strings: {$IFDEF COMPILER12_UP}TStrings{$ELSE}JclUnicode.TWideStrings{$ENDIF COMPILER12_UP}); }
|
||||
procedure ExtractFixedStrings(const Content: String; const ALength: Integer;
|
||||
Strings: TStrings);
|
||||
var
|
||||
@ -1874,8 +1864,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{ procedure ExtractStrings(Separator: WideChar; const Content: WideString;
|
||||
Strings: {$IFDEF COMPILER12_UP}TStrings{$ELSE}JclUnicode.TWideStrings{$ENDIF COMPILER12_UP}); }
|
||||
procedure ExtractStrings(Separator: WideChar; const Content: String;
|
||||
Strings: TStrings);
|
||||
var
|
||||
@ -1923,14 +1911,13 @@ function GetTagSizeInclHeader(AStream: TStream): Cardinal;
|
||||
var
|
||||
Header: TID3v2HeaderRec;
|
||||
begin
|
||||
if (AStream.Read(Header, SizeOf(Header)) = SizeOf(Header)) and
|
||||
Result := 0;
|
||||
if (AStream.Read(Header{%H-}, SizeOf(Header)) = SizeOf(Header)) and
|
||||
(Header.Identifier = cID3HeaderId) then
|
||||
begin
|
||||
UnSyncSafe(Header.Size, 4, Result);
|
||||
Inc(Result, 10);
|
||||
end
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ChangeTagSize(const SourceFileName: string;
|
||||
@ -1994,7 +1981,7 @@ begin
|
||||
|
||||
while True do
|
||||
begin
|
||||
BytesRead := AStream.Read(LBuffer, CBufferSize);
|
||||
BytesRead := AStream.Read(LBuffer{%H-}, CBufferSize);
|
||||
if BytesRead = 0 then
|
||||
begin
|
||||
Result := -1;
|
||||
@ -2005,7 +1992,7 @@ begin
|
||||
begin
|
||||
if LastWasFF and (LBuffer[I] and $E0 = $E0) then
|
||||
begin
|
||||
Inc(Result, I - 1);
|
||||
Inc(Result, Int64(I) - 1);
|
||||
if (I + BufferSize - 1 >= BytesRead) or (I = 0) then
|
||||
begin
|
||||
AStream.Seek(Result, soBeginning);
|
||||
@ -2069,7 +2056,7 @@ begin
|
||||
while BytesToRead > 0 do
|
||||
begin
|
||||
{ Read at max CBufferSize bytes from the stream }
|
||||
BytesRead := Source.Read(SourceBuf[0], Min(MaxBufSize, BytesToRead));
|
||||
BytesRead := Source.Read({%H-}SourceBuf[0], Min(MaxBufSize, BytesToRead));
|
||||
if BytesRead = 0 then
|
||||
ID3Error(RsECouldNotReadData);
|
||||
|
||||
@ -2342,7 +2329,7 @@ var
|
||||
begin
|
||||
with TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite) do
|
||||
try
|
||||
HasTag := (Read(Header, SizeOf(Header)) = SizeOf(Header)) and
|
||||
HasTag := (Read(Header{%H-}, SizeOf(Header)) = SizeOf(Header)) and
|
||||
(Header.Identifier = cID3HeaderId);
|
||||
if not HasTag then
|
||||
Exit;
|
||||
@ -2499,7 +2486,7 @@ end;
|
||||
class function TJvID3AudioEncryptionFrame.Find(AController: TJvID3Controller;
|
||||
const AOwnerID: AnsiString): TJvID3AudioEncryptionFrame;
|
||||
var
|
||||
Frame: TJvID3Frame;
|
||||
Frame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := nil;
|
||||
if not Assigned(AController) or not AController.Active then
|
||||
@ -3768,7 +3755,7 @@ begin
|
||||
|
||||
if Header.HasTag then
|
||||
FFileInfo.Read(AStream, 10 + Header.Size)
|
||||
else
|
||||
{%H-}else
|
||||
FFileInfo.Read(AStream, 0);
|
||||
finally
|
||||
EndReading;
|
||||
@ -3841,7 +3828,7 @@ var
|
||||
|
||||
NewTagSizeInclHeader := ANewTagSizeInclHeaderExclPadding + Result;
|
||||
{ Round to multiple of CChunk }
|
||||
NewTagSizeInclHeader := ((NewTagSizeInclHeader + CChunk - 1) div CChunk) * CChunk;
|
||||
NewTagSizeInclHeader := ((NewTagSizeInclHeader + CChunk {%H-}- 1) div CChunk) * CChunk;
|
||||
Result := NewTagSizeInclHeader - ANewTagSizeInclHeaderExclPadding;
|
||||
end;
|
||||
|
||||
@ -4140,7 +4127,7 @@ end;
|
||||
procedure TJvID3CustomTextFrame.ReadFrame;
|
||||
var
|
||||
//S: WideString;
|
||||
S: String;
|
||||
S: String = '';
|
||||
begin
|
||||
with Stream do
|
||||
begin
|
||||
@ -4380,7 +4367,8 @@ const
|
||||
CMinBytes: array [TJvID3Encoding] of Byte = (2, 4, 4, 2);
|
||||
var
|
||||
//S1, S2: WideString;
|
||||
S1, S2: String;
|
||||
S1: String = '';
|
||||
S2: String = '';
|
||||
begin
|
||||
with Stream do
|
||||
begin
|
||||
@ -4510,9 +4498,9 @@ end;
|
||||
|
||||
procedure TJvID3ExtendedHeader.Read;
|
||||
var
|
||||
LSize: Cardinal;
|
||||
LFlag: Byte;
|
||||
FlagDataLength: Byte;
|
||||
LSize: Cardinal = 0;
|
||||
LFlag: Byte = 0;
|
||||
FlagDataLength: Byte = 0;
|
||||
begin
|
||||
Reset;
|
||||
|
||||
@ -4967,7 +4955,7 @@ const
|
||||
VBRTag_Info: array [0..3] of AnsiChar = AnsiString('Info'); { Do not change case }
|
||||
FRAMES_FLAG = $0001;
|
||||
BYTES_FLAG = $0002;
|
||||
TOC_FLAG = $0004;
|
||||
//TOC_FLAG = $0004;
|
||||
var
|
||||
HeadFlags: Integer;
|
||||
begin
|
||||
@ -5022,7 +5010,7 @@ var
|
||||
begin
|
||||
Reset;
|
||||
|
||||
FHeaderFoundAt := SearchSync(AStream, Offset, MPEGTag, CMPEGTagSize);
|
||||
FHeaderFoundAt := SearchSync(AStream, Offset, MPEGTag{%H-}, CMPEGTagSize);
|
||||
if FHeaderFoundAt < 0 then
|
||||
Exit;
|
||||
|
||||
@ -5036,7 +5024,7 @@ begin
|
||||
begin
|
||||
{ Need to determine if the file has an ID3v1 tag }
|
||||
AStream.Seek(-CTagSize, soFromEnd);
|
||||
FHasID3v1Tag := (AStream.Read(TagID, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag);
|
||||
FHasID3v1Tag := (AStream.Read(TagID{%H-}, CTagIDSize) = CTagIDSize) and (TagID = CID3v1Tag);
|
||||
end;
|
||||
|
||||
{ We now know enough to calculate the rest }
|
||||
@ -5291,7 +5279,8 @@ end;
|
||||
|
||||
procedure TJvID3Frame.ReadFrameHeader;
|
||||
var
|
||||
Flag0, Flag1: Byte;
|
||||
Flag0: Byte = 0;
|
||||
Flag1: Byte = 0;
|
||||
begin
|
||||
case Controller.Version of
|
||||
ive2_2:
|
||||
@ -5811,7 +5800,7 @@ end;
|
||||
|
||||
function TJvID3Frames.CheckIsUnique(Frame: TJvID3Frame): Boolean;
|
||||
var
|
||||
FoundFrame: TJvID3Frame;
|
||||
FoundFrame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := True;
|
||||
if not Assigned(Frame) then
|
||||
@ -5900,7 +5889,7 @@ begin
|
||||
Result := TJvID3Frame(FList[Index]);
|
||||
end;
|
||||
|
||||
function TJvID3Frames.GetFrameIDs: TJvID3FrameIDs;
|
||||
function TJvID3Frames.{%H-}GetFrameIDs: TJvID3FrameIDs;
|
||||
begin
|
||||
end;
|
||||
|
||||
@ -6063,7 +6052,7 @@ end;
|
||||
class function TJvID3GeneralObjFrame.Find(AController: TJvID3Controller;
|
||||
const AContentDescription: String): TJvID3GeneralObjFrame;
|
||||
var
|
||||
Frame: TJvID3Frame;
|
||||
Frame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := nil;
|
||||
if not Assigned(AController) or not AController.Active then
|
||||
@ -6282,7 +6271,7 @@ begin
|
||||
begin
|
||||
BeginReadFrame(10);
|
||||
try
|
||||
if Read(Header, 10) <> 10 then
|
||||
if Read(Header{%H-}, 10) <> 10 then
|
||||
Exit;
|
||||
|
||||
FHasTag := Header.Identifier = cID3HeaderId;
|
||||
@ -6359,7 +6348,7 @@ begin
|
||||
if Self.FSize > $0FFFFFFF then // 28 bits = 256 MB
|
||||
ID3Error(RsETagTooBig, Controller);
|
||||
|
||||
FillChar(Header, SizeOf(Header), #0);
|
||||
FillChar(Header{%H-}, SizeOf(Header), #0);
|
||||
|
||||
with Stream do
|
||||
begin
|
||||
@ -6817,7 +6806,7 @@ end;
|
||||
class function TJvID3PictureFrame.Find(AController: TJvID3Controller;
|
||||
const AType: TJvID3PictureType): TJvID3PictureFrame;
|
||||
var
|
||||
Frame: TJvID3Frame;
|
||||
Frame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := nil;
|
||||
if not Assigned(AController) or not AController.Active then
|
||||
@ -6886,7 +6875,7 @@ end;
|
||||
|
||||
procedure TJvID3PictureFrame.ReadFrame;
|
||||
var
|
||||
LPictureType: Byte;
|
||||
LPictureType: Byte = 0;
|
||||
begin
|
||||
{ Text encoding $xx
|
||||
MIME type <text string> $00
|
||||
@ -7138,7 +7127,7 @@ end;
|
||||
class function TJvID3PopularimeterFrame.Find(AController: TJvID3Controller;
|
||||
const AEmailAddress: AnsiString): TJvID3PopularimeterFrame;
|
||||
var
|
||||
Frame: TJvID3Frame;
|
||||
Frame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := nil;
|
||||
if not Assigned(AController) or not AController.Active then
|
||||
@ -7465,7 +7454,7 @@ const
|
||||
cMinBytes: array [TJvID3Encoding] of Byte = (2, 4, 4, 2);
|
||||
var
|
||||
//S: WideString;
|
||||
S: String;
|
||||
S: String = '';
|
||||
begin
|
||||
if IsNullSeparator then
|
||||
begin
|
||||
@ -7597,7 +7586,7 @@ end;
|
||||
|
||||
function TJvID3Stream.GetBytesTillEndOfFrame: Longint;
|
||||
begin
|
||||
Result := FStartPosition + FCurrentFrameSize - Position;
|
||||
Result := Int64(FStartPosition) + FCurrentFrameSize - Position;
|
||||
end;
|
||||
|
||||
function TJvID3Stream.GetBytesTillEndOfTag: Longint;
|
||||
@ -7697,7 +7686,7 @@ end;
|
||||
|
||||
function TJvID3Stream.ReadEnc(var AEncoding: TJvID3Encoding): Longint;
|
||||
var
|
||||
B: Byte;
|
||||
B: Byte = 0;
|
||||
begin
|
||||
Result := Read(B, 1);
|
||||
if B <= Integer(High(TJvID3Encoding)) then
|
||||
@ -7796,8 +7785,8 @@ end;
|
||||
//function TJvID3Stream.ReadStringEnc(var S: WideString): Longint;
|
||||
function TJvID3Stream.ReadStringEnc(var S: String): LongInt;
|
||||
var
|
||||
SA: AnsiString;
|
||||
SW: WideString;
|
||||
SA: AnsiString = '';
|
||||
SW: WideString = '';
|
||||
begin
|
||||
case SourceEncoding of
|
||||
ienISO_8859_1:
|
||||
@ -7836,7 +7825,7 @@ end;
|
||||
|
||||
function TJvID3Stream.ReadStringW(var SW: WideString): Longint;
|
||||
var
|
||||
Order: WideChar;
|
||||
Order: WideChar = #0;
|
||||
P: PWideChar;
|
||||
StartPos: PAnsiChar;
|
||||
TerminatorFound: Boolean;
|
||||
@ -7919,7 +7908,7 @@ end;
|
||||
|
||||
function TJvID3Stream.ReadSyncSafeInteger(var AInt: Cardinal): Longint;
|
||||
var
|
||||
Value: Cardinal;
|
||||
Value: Cardinal = 0;
|
||||
begin
|
||||
Result := Read(Value, 4);
|
||||
UnSyncSafe(Value, 4, AInt);
|
||||
@ -7928,8 +7917,10 @@ end;
|
||||
//function TJvID3Stream.ReadUserString(var S1, S2: WideString): Longint;
|
||||
function TJvID3Stream.ReadUserString(var S1, S2: String): LongInt;
|
||||
var
|
||||
SA1, SA2: AnsiString;
|
||||
SW1, SW2: WideString;
|
||||
SA1: AnsiString = '';
|
||||
SA2: AnsiString = '';
|
||||
SW1: WideString = '';
|
||||
SW2: WideString = '';
|
||||
begin
|
||||
case SourceEncoding of
|
||||
ienISO_8859_1:
|
||||
@ -8183,7 +8174,7 @@ end;
|
||||
|
||||
function TJvID3Stream.WriteSyncSafeInteger(const AInt: Cardinal): Longint;
|
||||
var
|
||||
Value: Cardinal;
|
||||
Value: Cardinal = 0;
|
||||
begin
|
||||
SyncSafe(AInt, Value, 4);
|
||||
Result := Write(Value, 4);
|
||||
@ -8724,7 +8715,7 @@ begin
|
||||
// S := UTF16ToAnsiString(Copy(ANewText, 1, 19));
|
||||
S := Copy(ANewText, 1, 19);
|
||||
|
||||
FillChar(TimeArray, SizeOf(TimeArray), #0);
|
||||
FillChar(TimeArray{%H-}, SizeOf(TimeArray), #0);
|
||||
TimeArray[tkMonth] := 1;
|
||||
TimeArray[tkDay] := 1;
|
||||
|
||||
@ -8939,7 +8930,7 @@ class function TJvID3URLUserFrame.Find(AController: TJvID3Controller;
|
||||
const AIndex: Integer): TJvID3URLUserFrame;
|
||||
var
|
||||
FoundIndex: Integer;
|
||||
Frame: TJvID3Frame;
|
||||
Frame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := nil;
|
||||
if not Assigned(AController) or not AController.Active then
|
||||
@ -9071,7 +9062,7 @@ class function TJvID3UserFrame.Find(AController: TJvID3Controller;
|
||||
const AIndex: Integer): TJvID3UserFrame;
|
||||
var
|
||||
FoundIndex: Integer;
|
||||
Frame: TJvID3Frame;
|
||||
Frame: TJvID3Frame = nil;
|
||||
begin
|
||||
Result := nil;
|
||||
|
||||
|
@ -231,7 +231,7 @@ function ID3_StringToFrameID(const S: AnsiString): TJvID3FrameID;
|
||||
function ID3_FrameIDToString(const ID: TJvID3FrameID; const Size: Integer = 4): AnsiString;
|
||||
|
||||
{ Genre procedures }
|
||||
function ID3_GenreToID(const AGenre: string; const InclWinampGenres: Boolean = True): Integer;
|
||||
function ID3_GenreToID(const AGenre: string; const {%H-}InclWinampGenres: Boolean = True): Integer;
|
||||
{ searches for a genre that is a prefix for AGenreLong }
|
||||
function ID3_LongGenreToID(const ALongGenre: string; const InclWinampGenres: Boolean = True): Integer;
|
||||
function ID3_IDToGenre(const ID: Integer; const InclWinampGenres: Boolean = True): string;
|
||||
@ -258,7 +258,6 @@ uses
|
||||
AnsiStrings,
|
||||
{$ENDIF HAS_UNIT_ANSISTRINGS}
|
||||
*)
|
||||
JvJCLUtils,
|
||||
JvConsts, JvResources, JvTypes;
|
||||
|
||||
type
|
||||
|
@ -232,14 +232,14 @@ end;
|
||||
|
||||
procedure TJvPicClip.CheckIndex(Index: Integer);
|
||||
begin
|
||||
if (Index >= Cols * Rows) or (Index < 0) then
|
||||
if (Index >= Integer(Cols) * Rows) or (Index < 0) then
|
||||
raise EListError.CreateResFmt(@SListIndexError, [Index]);
|
||||
end;
|
||||
|
||||
function TJvPicClip.GetIndex(Col, Row: Cardinal): Integer;
|
||||
begin
|
||||
Result := Col + (Row * Cols);
|
||||
if (Result >= Cols * Rows) or IsEmpty then
|
||||
if (Result >= Integer(Cols) * Rows) or IsEmpty then
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
|
@ -661,7 +661,7 @@ begin
|
||||
PaintText;
|
||||
PaintRectangle;
|
||||
|
||||
Repaint;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TJvSpecialProgress.UpdateBlock;
|
||||
|
Reference in New Issue
Block a user