Skip to content

Commit

Permalink
Some cleanup in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredvs committed Nov 13, 2021
1 parent ed847ba commit f5aff6c
Show file tree
Hide file tree
Showing 14 changed files with 5,478 additions and 5,481 deletions.
463 changes: 246 additions & 217 deletions src/commander.pas

Large diffs are not rendered by default.

120 changes: 75 additions & 45 deletions src/equalizer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,37 @@
interface

uses
Classes,ctypes,SysUtils,msetypes,mseglob,mseguiglob,mseguiintf,mseapplication,
msestat,msemenus,msegui,msegraphics,msegraphutils,mseevent,mseclasses,mseforms,
msedock,msegraphedits,mseificomp,mseificompglob,mseifiglob,msescrollbar,
msesimplewidgets,msewidgets,msechart,msedispwidgets,mserichstring,
msefiledialogx,msestatfile,msebitmap,mseimage;
Classes,
ctypes,
SysUtils,
msetypes,
mseglob,
mseguiglob,
mseguiintf,
mseapplication,
msestat,
msemenus,
msegui,
msegraphics,
msegraphutils,
mseevent,
mseclasses,
mseforms,
msedock,
msegraphedits,
mseificomp,
mseificompglob,
mseifiglob,
msescrollbar,
msesimplewidgets,
msewidgets,
msechart,
msedispwidgets,
mserichstring,
msefiledialogx,
msestatfile,
msebitmap,
mseimage;

type
tasliders = array[1..20] of tslider;
Expand Down Expand Up @@ -83,10 +109,10 @@ tequalizerfo = class(tdockform)
fond: tstringdisp;
loadset: TButton;
saveset: TButton;
tstringdisp21: tstringdisp;
EQEN: tbooleanedit;
blight: tbutton;
bdark: tbutton;
tstringdisp21: tstringdisp;
EQEN: tbooleanedit;
blight: TButton;
bdark: TButton;
procedure oncrea(const Sender: TObject);
procedure onchangeslider(const Sender: TObject);
procedure onchangeall();
Expand Down Expand Up @@ -263,23 +289,23 @@ procedure tequalizerfo.onchangeslider(const Sender: TObject);

abutton.Caption := astring;

if tag = 0 then
if tagsender < 11 then
songplayerfo.changefrequency(1, tagsender, again, -1)
else
songplayerfo.changefrequency(1, tagsender - 10, -1, again);

if tag = 1 then
if tagsender < 11 then
songplayer2fo.changefrequency(2, tagsender, again, -1)
else
songplayer2fo.changefrequency(2, tagsender - 10, -1, again);

if Caption = 'Equalizer Recorder' then
if tagsender < 11 then
recorderfo.changefrequency(2, tagsender, again, -1)
else
recorderfo.changefrequency(2, tagsender - 10, -1, again);
if tag = 0 then
if tagsender < 11 then
songplayerfo.changefrequency(1, tagsender, again, -1)
else
songplayerfo.changefrequency(1, tagsender - 10, -1, again);

if tag = 1 then
if tagsender < 11 then
songplayer2fo.changefrequency(2, tagsender, again, -1)
else
songplayer2fo.changefrequency(2, tagsender - 10, -1, again);

if Caption = 'Equalizer Recorder' then
if tagsender < 11 then
recorderfo.changefrequency(2, tagsender, again, -1)
else
recorderfo.changefrequency(2, tagsender - 10, -1, again);

end;
end;
Expand Down Expand Up @@ -351,7 +377,7 @@ procedure tequalizerfo.onvisiblechange(const Sender: TObject);
mainfo.tmainmenu1.menu[4].submenu[16].Caption := ' Show Equalizer 2 '
else if Caption = 'Equalizer Recorder' then
mainfo.tmainmenu1.menu[4].submenu[17].Caption := ' Show Equalizer Rec ';

if norefresh = False then
begin
if Assigned(mainfo) then
Expand Down Expand Up @@ -380,26 +406,30 @@ procedure tequalizerfo.loadlist(const Sender: TObject);
ordir: msestring;
begin
ordir := msestring(ExtractFilePath(msestring(ParamStr(0))) + 'equ' + directoryseparator);
dialogfilesfo.tag := tag;
dialogfilesfo.tag := tag;
dialogfilesfo.Caption := 'Load a Equalizer Settings File';
dialogfilesfo.list_files.mask := '*.equ';
dialogfilesfo.list_files.path := ordir;
dialogfilesfo.list_files.mask := '*.equ';
dialogfilesfo.list_files.path := ordir;
dialogfilesfo.selected_file.Text := '';

if tag < 2 then dialogfilesfo.setother.visible := true
else dialogfilesfo.setother.visible := false;

if (mainfo.typecolor.Value = 0) then
begin
if caption = 'Equalizer Recorder' then
dialogfilesfo.list_files.frame.colorclient := cl_ltgray else
dialogfilesfo.list_files.frame.colorclient := $F9FFC2;
end else
if (mainfo.typecolor.Value = 1) then
dialogfilesfo.list_files.frame.colorclient := cl_ltgray else
dialogfilesfo.list_files.frame.colorclient := cl_gray;

application.processmessages;

if tag < 2 then
dialogfilesfo.setother.Visible := True
else
dialogfilesfo.setother.Visible := False;

if (mainfo.typecolor.Value = 0) then
begin
if Caption = 'Equalizer Recorder' then
dialogfilesfo.list_files.frame.colorclient := cl_ltgray
else
dialogfilesfo.list_files.frame.colorclient := $F9FFC2;
end
else if (mainfo.typecolor.Value = 1) then
dialogfilesfo.list_files.frame.colorclient := cl_ltgray
else
dialogfilesfo.list_files.frame.colorclient := cl_gray;

application.ProcessMessages;
dialogfilesfo.Show;
end;

Expand Down
70 changes: 36 additions & 34 deletions src/filelistform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ tfilelistfo = class(tdockform)
procedure opendir(const Sender: TObject);
procedure onexecfind(const Sender: TObject);

procedure onactiv(const sender: TObject);
procedure onmouse(const sender: twidget; var ainfo: mouseeventinfoty);
procedure onactiv(const Sender: TObject);
procedure onmouse(const Sender: twidget; var ainfo: mouseeventinfoty);
end;

var
Expand Down Expand Up @@ -135,7 +135,7 @@ procedure tfilelistfo.formcreated(const Sender: TObject);
Timercount.Enabled := False;
Timercount.options := [to_single];
Timercount.ontimer := @ontimercount;

randomize;

list_files.hint := ' To move a row: click+hold into the fixed column ' + lineend +
Expand All @@ -158,8 +158,7 @@ procedure tfilelistfo.formcreated(const Sender: TObject);

for x := 0 to list_files.rowCount - 1 do
list_files.fixcols[-1].captions[x] := msestring(IntToStr(x + 1));



end;

procedure tfilelistfo.ontimersent(const Sender: TObject);
Expand All @@ -182,7 +181,7 @@ procedure tfilelistfo.onsent(const Sender: TObject);
var
theplaysender, thecaution, therandom: integer;
mustmix: Boolean = False;
begin
begin

if directoryexists(historyfn.Value) then
begin
Expand Down Expand Up @@ -252,7 +251,7 @@ procedure tfilelistfo.onsent(const Sender: TObject);
if commanderfo.Brandommix.tag = 1 then
begin
therandom := random(list_files.rowcount - 1);
application.processmessages;
application.ProcessMessages;
if (list_files[3][therandom] = '1') then
begin
mustmix := True;
Expand Down Expand Up @@ -509,8 +508,9 @@ procedure tfilelistfo.onchangpath(const Sender: TObject; findex: integer);

edfilescount.Value := list_files.rowcount;
if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');

finally
datalist_files.Free;
Expand Down Expand Up @@ -717,9 +717,10 @@ procedure tfilelistfo.onaftdrop(const Sender: TObject);

procedure tfilelistfo.onchangecount(const Sender: TObject);
begin
if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');
if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');
end;

procedure tfilelistfo.ondestr(const Sender: TObject);
Expand All @@ -742,9 +743,9 @@ procedure tfilelistfo.loadlist(const Sender: TObject);
ordir := msestring(ExtractFilePath(msestring(ParamStr(0))) + 'list' + directoryseparator);
tfiledialog1.controller.captionopen := 'Open List File';
tfiledialog1.controller.options := [fdo_savelastdir, fdo_sysfilename];
tfiledialog1.controller.nopanel := true;
tfiledialog1.controller.compact := true;

tfiledialog1.controller.nopanel := True;
tfiledialog1.controller.compact := True;

tfiledialog1.controller.fontcolor := cl_black;
if mainfo.typecolor.Value = 2 then
Expand All @@ -771,10 +772,11 @@ procedure tfilelistfo.loadlist(const Sender: TObject);
Caption := removefileext(tfiledialog1.controller.filename);

list_files.fixcols[-1].captions.Count := filelistfo.list_files.rowCount;

if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');

if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');

list_files.defocuscell;
list_files.datacols.clearselection;
Expand Down Expand Up @@ -891,10 +893,11 @@ procedure tfilelistfo.addfile(const Sender: TObject);
list_files[3][x] := msestring(IntToStr(1));
list_files[4][x] := tfiledialog1.controller.filename;
edfilescount.Value := list_files.rowcount;

if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');

if edfilescount.Value > 1 then
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' files')
else
filescount.Value := msestring(IntToStr(edfilescount.Value) + ' file');

list_files.fixcols[-1].captions.Count := list_files.rowCount;

Expand Down Expand Up @@ -943,8 +946,8 @@ procedure tfilelistfo.opendir(const Sender: TObject);
ara, arb: msestringarty;
begin
tfiledialog1.controller.captiondir := 'Open Audio Directory';
tfiledialog1.controller.nopanel := false;
tfiledialog1.controller.compact := false;
tfiledialog1.controller.nopanel := False;
tfiledialog1.controller.compact := False;


if mainfo.typecolor.Value = 2 then
Expand Down Expand Up @@ -1001,22 +1004,21 @@ procedure tfilelistfo.onexecfind(const Sender: TObject);
findmessagefo.Show(True);
end;

procedure tfilelistfo.onactiv(const sender: TObject);
procedure tfilelistfo.onactiv(const Sender: TObject);
begin
if historyfn.value <> '' then
caption := historyfn.Value;
if historyfn.Value <> '' then
Caption := historyfn.Value;
bounds_cxmax := 442;
bounds_cxmin := 442;
Width := 442;
end;

procedure tfilelistfo.onmouse(const sender: twidget;
var ainfo: mouseeventinfoty);
procedure tfilelistfo.onmouse(const Sender: twidget; var ainfo: mouseeventinfoty);
begin
if mainfo.ttimer2.Enabled then
mainfo.ttimer2.restart // to reset
else
mainfo.ttimer2.Enabled := True;
if mainfo.ttimer2.Enabled then
mainfo.ttimer2.restart // to reset
else
mainfo.ttimer2.Enabled := True;
end;


Expand Down
Loading

0 comments on commit f5aff6c

Please sign in to comment.