Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
alinvip22@gmail.com authored and alinvip22@gmail.com committed Jan 13, 2021
1 parent e3a2dc5 commit fb57b65
Show file tree
Hide file tree
Showing 12 changed files with 1,662 additions and 1,455 deletions.
1,993 changes: 996 additions & 997 deletions FMX/VKPlayer.Main.fmx

Large diffs are not rendered by default.

Binary file removed FMX/Win32/Release/VKPlayer.zip1
Binary file not shown.
2 changes: 2 additions & 0 deletions FMXWindows/VKAudio.dpr
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
program VKAudio;

{$R *.dres}

uses
System.StartUpCopy,
FMX.Forms,
Expand Down
12 changes: 11 additions & 1 deletion FMXWindows/VKAudio.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<FrameworkType>FMX</FrameworkType>
<MainSource>VKAudio.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>37983</TargetedPlatforms>
<AppType>Application</AppType>
Expand Down Expand Up @@ -408,6 +408,10 @@
<DCCReference Include="View\VKAudioWin.View.ListItemUser.pas"/>
<DCCReference Include="View\VKAudioWin.View.ListItemSheffle.pas"/>
<DCCReference Include="View\VKAudioWin.View.ListItemPlaylist.pas"/>
<RcItem Include="D:\Temp\Iconion\VK1\album.png">
<ResourceType>RCDATA</ResourceType>
<ResourceId>cover</ResourceId>
</RcItem>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
Expand Down Expand Up @@ -455,6 +459,12 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="D:\Temp\Iconion\VK1\album.png" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
Expand Down
79 changes: 59 additions & 20 deletions FMXWindows/VKAudioWin.Classes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@
interface

type
TCurrentListKind = (lkNone, lkMusic, lkFriend, lkPlaylist, lkCustom);
TCurrentPlaylist = class;

TCurrentPlaylist = record
private
FKind: TCurrentListKind;
FId: Integer;
procedure SetKind(const Value: TCurrentListKind);
procedure SetId(const Value: Integer);
public
procedure Friend(Id: Integer);
procedure Music;
procedure Playlist(Id: Integer);
procedure Custom;
function Compare(AKind: TCurrentListKind; const AId: Integer = 0): Boolean;
property Kind: TCurrentListKind read FKind write SetKind;
property Id: Integer read FId write SetId;
end;
TCurrentListKind = (lkNone, lkMusic, lkFriend, lkPlaylist, lkCustom);

TAudioInfo = record
Id: Integer;
OwnerId: Integer;
AccessKey: string;
Title: string;
Artist: string;
Duration: string;
CoverUrl: string;
end;

TFriendInfo = record
Id: Integer;
FullName: string;
FirstName: string;
end;

TPlaylistInfo = record
Expand All @@ -37,6 +33,32 @@ TPlaylistInfo = record
CoverUrl: string;
end;

TOnCurrentPlaylistChange = procedure(const Sender: TCurrentPlaylist) of object;

TCurrentPlaylist = class
private
FKind: TCurrentListKind;
FPlaylistInfo: TPlaylistInfo;
FFriendInfo: TFriendInfo;
FId: Integer;
FOnChange: TOnCurrentPlaylistChange;
procedure SetKind(const Value: TCurrentListKind);
procedure SetId(const Value: Integer);
procedure SetOnChange(const Value: TOnCurrentPlaylistChange);
procedure DoChange;
public
procedure Friend(Info: TFriendInfo);
procedure Music;
procedure Playlist(Info: TPlaylistInfo);
procedure Custom;
function Compare(AKind: TCurrentListKind; const AId: Integer = 0): Boolean;
property Kind: TCurrentListKind read FKind write SetKind;
property Id: Integer read FId write SetId;
property OnChange: TOnCurrentPlaylistChange read FOnChange write SetOnChange;
property FriendInfo: TFriendInfo read FFriendInfo;
property PlaylistInfo: TPlaylistInfo read FPlaylistInfo;
end;

implementation

{ TCurrentPlaylist }
Expand All @@ -50,24 +72,36 @@ procedure TCurrentPlaylist.Custom;
begin
FKind := lkCustom;
FId := 0;
DoChange;
end;

procedure TCurrentPlaylist.Friend(Id: Integer);
procedure TCurrentPlaylist.DoChange;
begin
if Assigned(FOnChange) then
FOnChange(Self);
end;

procedure TCurrentPlaylist.Friend(Info: TFriendInfo);
begin
FKind := lkFriend;
FId := Id;
FFriendInfo := Info;
FId := Info.Id;
DoChange;
end;

procedure TCurrentPlaylist.Music;
begin
FKind := lkMusic;
FId := 0;
DoChange;
end;

procedure TCurrentPlaylist.Playlist(Id: Integer);
procedure TCurrentPlaylist.Playlist(Info: TPlaylistInfo);
begin
FKind := lkPlaylist;
FId := Id;
FId := Info.Id;
FPlaylistInfo := Info;
DoChange;
end;

procedure TCurrentPlaylist.SetId(const Value: Integer);
Expand All @@ -80,5 +114,10 @@ procedure TCurrentPlaylist.SetKind(const Value: TCurrentListKind);
FKind := Value;
end;

procedure TCurrentPlaylist.SetOnChange(const Value: TOnCurrentPlaylistChange);
begin
FOnChange := Value;
end;

end.

Loading

0 comments on commit fb57b65

Please sign in to comment.