Skip to content

Commit

Permalink
Upgrade, fix vk app
Browse files Browse the repository at this point in the history
  • Loading branch information
HemulGM committed Jan 31, 2023
1 parent abaa72b commit 9c6e83c
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 53 deletions.
2 changes: 2 additions & 0 deletions BassPlayer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ procedure TBASSPlayer.ResetAudioChannel;
function TBASSPlayer.Play: Boolean;
begin
Result := False;
if not IsInit then
Exit;
if FOpenning then
Exit;

Expand Down
13 changes: 9 additions & 4 deletions VKAP.Main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ object FormMain: TFormMain
Margins.Left = 0
Align = alClient
BevelOuter = bvNone
ParentBackground = False
ParentColor = True
TabOrder = 4
object PanelTrackSinger: TPanel
AlignWithMargins = True
Expand All @@ -268,8 +270,8 @@ object FormMain: TFormMain
Margins.Bottom = 0
Align = alClient
BevelOuter = bvNone
Ctl3D = False
ParentCtl3D = False
ParentBackground = False
ParentColor = True
TabOrder = 0
object LabelTitle: TLabel
AlignWithMargins = True
Expand Down Expand Up @@ -328,6 +330,8 @@ object FormMain: TFormMain
Height = 36
Align = alRight
BevelOuter = bvNone
ParentBackground = False
ParentColor = True
TabOrder = 1
object LabelTime: TLabel
AlignWithMargins = True
Expand Down Expand Up @@ -463,6 +467,8 @@ object FormMain: TFormMain
Height = 56
Align = alRight
BevelOuter = bvNone
ParentBackground = False
ParentColor = True
TabOrder = 7
object ImageAvatar: TImage
AlignWithMargins = True
Expand Down Expand Up @@ -615,6 +621,7 @@ object FormMain: TFormMain
Height = 56
Align = alRight
BevelOuter = bvNone
ParentBackground = False
ParentColor = True
TabOrder = 8
object TrackbarVolume: ThTrackbar
Expand Down Expand Up @@ -1543,8 +1550,6 @@ object FormMain: TFormMain
end
end
object VK: TVK
AppID = '6121396'
AppKey = 'AlVXZFMUqyrnABp8ncuU'
BaseURL = 'https://api.vk.com/method'
EndPoint = 'https://oauth.vk.com/authorize'
OnAuth = VKAuth
Expand Down
19 changes: 14 additions & 5 deletions VKAP.Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ interface
Vcl.Imaging.pngimage, System.Generics.Collections, Vcl.Imaging.jpeg,
VK.Entity.Playlist, VK.Entity.Profile, BassPlayer.LoadHandle, VK.Entity.Audio,
VKAP.Player, HGM.SQLite, HGM.SQLang, Vcl.Menus, Vcl.WinXCtrls,
HGM.Controls.TrackBar, System.Win.TaskbarCore, Vcl.Taskbar, HGM.Tools.Hint,
Vcl.Styles.Utils.SysStyleHook;
HGM.Controls.TrackBar, System.Win.TaskbarCore, Vcl.Taskbar, HGM.Tools.Hint
{,
Vcl.Styles.Utils.SysStyleHook};

type
TAudio = record
Expand Down Expand Up @@ -333,7 +334,8 @@ implementation

uses
VK.Audio, Vk.Types, System.IOUtils, HGM.Common.Workspace, HGM.Common.Utils,
Direct2D, D2D1, Math, VK.Vcl.OAuth2, VK.Friends, Vcl.Themes, Vcl.Styles;
Direct2D, D2D1, Math, VK.Vcl.OAuth2, VK.Friends, Vcl.Themes, Vcl.Styles,
HGM.Common.PngUtils, VK.Clients;

{$R *.dfm}

Expand Down Expand Up @@ -1498,7 +1500,7 @@ procedure TFormMain.CreateLoaders;
FFriends.Clear;
Result := False;
try
if VK.Friends.Get(Users, [TVkProfileField.NickName, TVkProfileField.Sex, TVkProfileField.Photo50, TVkProfileField.Status, TVkProfileField.CanSeeAudio], TVkFriendsOrder.Name) then
if VK.Friends.Get(Users, [TVkExtendedField.NickName, TVkExtendedField.Sex, TVkExtendedField.Photo50, TVkExtendedField.Status, TVkExtendedField.CanSeeAudio], TVkFriendsOrder.Name) then
begin
try
for i := Low(Users.Items) to High(Users.Items) do
Expand Down Expand Up @@ -1946,6 +1948,7 @@ procedure TFormMain.SetColors(IsDark: Boolean);
FAvatarDef.LoadFromResourceName(HInstance, 'def_avatar_dark');
ButtonColorHot := $00757575;
ButtonColorNormal := $00A2A2A2;

PanelPlayer.Color := $00151515;

ButtonFlatSearchBG.ColorNormal := AColor;
Expand Down Expand Up @@ -1992,6 +1995,11 @@ procedure TFormMain.SetColors(IsDark: Boolean);
ShapeHotButton.Pen.Color := $00DBD2CA;
end;

PanelTrackSinger.Color := PanelPlayer.Color;
PanelTrackTime.Color := PanelPlayer.Color;
PanelVolume.Color := PanelPlayer.Color;
PanelUser.Color := PanelPlayer.Color;

FStyleColor := AColor;
FFontColor := AFont;
FIsDark := IsDark;
Expand Down Expand Up @@ -2067,6 +2075,7 @@ procedure TFormMain.FormCreate(Sender: TObject);
var
i: Integer;
begin
VK.Application := TVkApplicationData.Marusia;
//{ $IFDEF NEEDFMX}
//TFormFMXCaptcha.Execute(CaptchaImg, Answer);
//{$ELSE}
Expand Down Expand Up @@ -2336,7 +2345,7 @@ procedure TFormMain.VKLogin(Sender: TObject);
FToken := VK.Token;
FSettings.SetStr('General', 'Token', FToken);

if VK.Users.Get(User, 0, [TVkProfileField.Photo50]) then
if VK.Users.Get(User, 0, [TVkExtendedField.Photo50]) then
begin
FVkId := User.id;
FVkIdCurrent := FVkId;
Expand Down
1 change: 1 addition & 0 deletions VKAP.Player.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ object FormPlayer: TFormPlayer
ClientHeight = 200
ClientWidth = 350
Color = 16579578
CustomTitleBar.Height = 42
DoubleBuffered = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Expand Down
2 changes: 1 addition & 1 deletion VKAP.Player.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TFormPlayer = class(TForm)
implementation

uses
VKAP.Main, HGM.Common.Utils;
VKAP.Main, HGM.Common.Utils, HGM.Common.PngUtils;

{$R *.dfm}

Expand Down
2 changes: 1 addition & 1 deletion VKAudioPlayer.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ program VKAudioPlayer;
{$R *.dres}

uses
VCLFlickerReduce in '..\#Fork\VCLFlickerReduce\VCLFlickerReduce.pas',
//VCLFlickerReduce in '..\#Fork\VCLFlickerReduce\VCLFlickerReduce.pas',
Vcl.Forms,
VKAP.Main in 'VKAP.Main.pas' {FormMain},
BassPlayer.Lib in 'BassPlayer.Lib.pas',
Expand Down
25 changes: 10 additions & 15 deletions VKAudioPlayer.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\#Fork\VCLFlickerReduce\VCLFlickerReduce.pas"/>
<DCCReference Include="VKAP.Main.pas">
<Form>FormMain</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="BassPlayer.Lib.pas"/>
<DCCReference Include="BassPlayer.pas"/>
Expand All @@ -119,7 +117,6 @@
<DCCReference Include="BassPlayer.LoadHandle.pas"/>
<DCCReference Include="VKAP.Player.pas">
<Form>FormPlayer</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="..\SQLite\HGM.SQLang.pas"/>
<DCCReference Include="..\SQLite\HGM.SQLite.pas"/>
Expand Down Expand Up @@ -189,12 +186,10 @@
<Source Name="MainSource">VKAudioPlayer.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k260.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp260.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\FastReport 6 VCL Enterprise\LibD26\dclfrxTee26.bpl">FastReport 6.0 Tee Components</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\FastReport 6 VCL Enterprise\LibD26\dclfsTee26.bpl">FastScript 1.9 Tee Components</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\FastReport 6 VCL Enterprise\LibD26\dclfrxIBX26.bpl">FastReport 6.0 IBX Components</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\FastReport 6 VCL Enterprise\LibD26\dclfsIBX26.bpl">FastScript 1.9 IBX Components</Excluded_Packages>
<Excluded_Packages Name="C:\Users\alinv\Documents\GitHub\FMXTrayIcon\FmxTrayIcon.bpl">(untitled)</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\htmlreports_XE104.bpl">File C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\htmlreports_XE104.bpl not found</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
Expand All @@ -204,9 +199,9 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="avatarmask.png" Configuration="Release" Class="ProjectFile">
<DeployFile LocalName="Win32\Release\VKAudioPlayer.exe" Configuration="Release" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<RemoteName>VKAudioPlayer.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
Expand Down Expand Up @@ -270,7 +265,7 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="pause.png" Configuration="Release" Class="ProjectFile">
<DeployFile LocalName="Media\Material Icons_e034(3).ico" Configuration="Debug" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
Expand Down Expand Up @@ -330,13 +325,13 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win32\Release\VKAudioPlayer.exe" Configuration="Release" Class="ProjectOutput">
<DeployFile LocalName="avatarmask.png" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32">
<RemoteName>VKAudioPlayer.exe</RemoteName>
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Media\Material Icons_e034(3).ico" Configuration="Debug" Class="ProjectFile">
<DeployFile LocalName="pause.png" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
Expand Down
30 changes: 3 additions & 27 deletions VKAudioProject.groupproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<Projects Include="VKAudioPlayer.dproj">
<Dependencies/>
</Projects>
<Projects Include="..\#Little\Audio\Audio.dproj">
<Dependencies/>
</Projects>
<Projects Include="..\VK_API\VKComponents.dproj">
<Dependencies/>
</Projects>
Expand All @@ -18,9 +15,6 @@
<Projects Include="FMX\VKPlayer.dproj">
<Dependencies/>
</Projects>
<Projects Include="..\KnigaVuhe\Knigavuhe.dproj">
<Dependencies/>
</Projects>
<Projects Include="..\FMXAudio\FMXAudioHGM.dproj">
<Dependencies/>
</Projects>
Expand All @@ -47,15 +41,6 @@
<Target Name="VKAudioPlayer:Make">
<MSBuild Projects="VKAudioPlayer.dproj" Targets="Make"/>
</Target>
<Target Name="Audio">
<MSBuild Projects="..\#Little\Audio\Audio.dproj"/>
</Target>
<Target Name="Audio:Clean">
<MSBuild Projects="..\#Little\Audio\Audio.dproj" Targets="Clean"/>
</Target>
<Target Name="Audio:Make">
<MSBuild Projects="..\#Little\Audio\Audio.dproj" Targets="Make"/>
</Target>
<Target Name="VKComponents">
<MSBuild Projects="..\VK_API\VKComponents.dproj"/>
</Target>
Expand Down Expand Up @@ -83,15 +68,6 @@
<Target Name="VKPlayer:Make">
<MSBuild Projects="FMX\VKPlayer.dproj" Targets="Make"/>
</Target>
<Target Name="Knigavuhe">
<MSBuild Projects="..\KnigaVuhe\Knigavuhe.dproj"/>
</Target>
<Target Name="Knigavuhe:Clean">
<MSBuild Projects="..\KnigaVuhe\Knigavuhe.dproj" Targets="Clean"/>
</Target>
<Target Name="Knigavuhe:Make">
<MSBuild Projects="..\KnigaVuhe\Knigavuhe.dproj" Targets="Make"/>
</Target>
<Target Name="FMXAudioHGM">
<MSBuild Projects="..\FMXAudio\FMXAudioHGM.dproj"/>
</Target>
Expand Down Expand Up @@ -120,13 +96,13 @@
<MSBuild Projects="..\VK_API\Samples\Auth\VKAuth.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="VKAudioPlayer;Audio;VKComponents;HGMComponents;VKPlayer;Knigavuhe;FMXAudioHGM;VKAudio;VKAuth"/>
<CallTarget Targets="VKAudioPlayer;VKComponents;HGMComponents;VKPlayer;FMXAudioHGM;VKAudio;VKAuth"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="VKAudioPlayer:Clean;Audio:Clean;VKComponents:Clean;HGMComponents:Clean;VKPlayer:Clean;Knigavuhe:Clean;FMXAudioHGM:Clean;VKAudio:Clean;VKAuth:Clean"/>
<CallTarget Targets="VKAudioPlayer:Clean;VKComponents:Clean;HGMComponents:Clean;VKPlayer:Clean;FMXAudioHGM:Clean;VKAudio:Clean;VKAuth:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="VKAudioPlayer:Make;Audio:Make;VKComponents:Make;HGMComponents:Make;VKPlayer:Make;Knigavuhe:Make;FMXAudioHGM:Make;VKAudio:Make;VKAuth:Make"/>
<CallTarget Targets="VKAudioPlayer:Make;VKComponents:Make;HGMComponents:Make;VKPlayer:Make;FMXAudioHGM:Make;VKAudio:Make;VKAuth:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>

0 comments on commit 9c6e83c

Please sign in to comment.