Skip to content

Commit 75d82c0

Browse files
committed
Added/updated NetBSD code and libraries.
1 parent 8c95e49 commit 75d82c0

File tree

10 files changed

+68
-24
lines changed

10 files changed

+68
-24
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Like:
1414
- Tag infos with images.
1515
- Many Layout and Styles.
1616

17-
There are compiled executable for Linux 32/64, Windows 32/64, FreeBSD 64, OpenBSD, DragonFlyBSD MacOS X
17+
There are compiled executable for Linux 32/64, Windows 32/64, FreeBSD 64, OpenBSD 64, DragonFlyBSD 64, NetBSD 64, MacOS X
1818
and arm-aarch64 Rpi 32/64. =\> https://github.com/fredvs/strumpract/releases/
1919

2020
StrumPract was compiled with: FPC 3.2.2: http://www.freepascal.org

src/drums.pas

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ procedure tdrumsfo.loadsoundlib(const Sender: TObject);
13151315
{$else}
13161316
ordir := msestring(IncludeTrailingBackslash(ExtractFilePath(ParamStr(0))));
13171317
{$ENDIF}
1318-
1318+
13191319
lib5 := '';
13201320

13211321
{$IFDEF Windows}
@@ -1349,6 +1349,13 @@ procedure tdrumsfo.loadsoundlib(const Sender: TObject);
13491349
lib3 := AnsiString(ordir + 'lib/OpenBSD/64bit/LibMpg123-64.so');
13501350
lib4 := AnsiString(ordir + 'lib/OpenBSD/64bit/LibSoundTouch-64.so');
13511351
{$ENDIF}
1352+
1353+
{$if defined(CPUAMD64) and defined(netbsd) }
1354+
lib1 := AnsiString(ordir + 'lib/NetBSD/64bit/LibPortaudio-64.so');
1355+
lib2 := AnsiString(ordir + 'lib/NetBSD/64bit/LibSndFile-64.so');
1356+
lib3 := AnsiString(ordir + 'lib/NetBSD/64bit/LibMpg123-64.so');
1357+
lib4 := AnsiString(ordir + 'lib/NetBSD/64bit/LibSoundTouch-64.so');
1358+
{$ENDIF}
13521359

13531360
{$if defined(CPUAMD64) and defined(dragonfly) }
13541361
lib1 := AnsiString(ordir + 'lib/DragonFlyBSD/64bit/LibPortaudio-64.so');

src/infosd.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ procedure tinfosdfo.onpaintimg(const Sender: twidget; const acanvas: tcanvas);
296296
var
297297
theMemBitmap: TBGRABitmap;
298298
begin
299-
299+
{$ifndef netbsd}
300300
theMemBitmap := aimage.MemBitmap.Resample(PimgPreview.Width, PimgPreview.Height, rmFineResample) as TBGRABitmap;
301301

302302
if mainfo.typecolor.Value = 2 then
@@ -306,6 +306,7 @@ procedure tinfosdfo.onpaintimg(const Sender: twidget; const acanvas: tcanvas);
306306

307307
theMemBitmap.draw(acanvas, 0, 0, True);
308308
theMemBitmap.Free;
309+
{$endif}
309310
end;
310311

311312
procedure tinfosdfo.oncre(const Sender: TObject);
349 KB
Binary file not shown.
102 KB
Binary file not shown.
585 KB
Binary file not shown.
103 KB
Binary file not shown.

src/piano.pas

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,22 @@ implementation
5353

5454
var
5555
boundchildpi: array of boundchild;
56+
{$ifndef netbsd}
5657
aimagepiano4oct : TBGRAAnimatedGif;
58+
{$endif}
5759

5860
procedure tpianofo.onpaintimg(const Sender: twidget; const acanvas: tcanvas);
61+
{$ifndef netbsd}
5962
var
6063
theMemBitmap: TBGRABitmap;
6164
begin
62-
6365
theMemBitmap := aimagepiano4oct.MemBitmap.Resample(keyb1pb.Width, keyb1pb.Height, rmFineResample) as TBGRABitmap;
6466
theMemBitmap.Rectangle(0, 0, keyb1pb.Width, keyb1pb.Height, BGRA(255, 192, 0), BGRA(180, 180, 180, 255), dmDrawWithTransparency, 8192);
6567
theMemBitmap.draw(acanvas, 0, 0, True);
6668
theMemBitmap.Free;
67-
69+
{$else}
70+
begin
71+
{$endif}
6872
end;
6973

7074
procedure tpianofo.resizepi(fontheight : integer );
@@ -104,6 +108,7 @@ procedure tpianofo.oncloseex(const sender: TObject);
104108

105109
procedure tpianofo.oncreated(const sender: TObject);
106110
begin
111+
107112
tsigkeyboard1.keywidth := tsigkeyboard1.Width div 32;
108113
tsigcontroller1.inputtype := 0; // from synth/piano
109114
Caption := 'Piano Synthesizer' ;
@@ -265,18 +270,22 @@ procedure tpianofo.crea(const sender: TObject);
265270
ordir := msestring(IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))) ;
266271
{$ENDIF}
267272

273+
{$ifndef netbsd}
268274
if fileexists(ordir +'images' + directoryseparator + 'piano4oct.png')
269275
then
270276
begin
271-
aimagepiano4oct := TBGRAAnimatedGif.Create(ordir + 'images' + directoryseparator + 'piano4oct.png');
272-
keyb1pb.invalidate;
277+
aimagepiano4oct := TBGRAAnimatedGif.Create(ordir + 'images' + directoryseparator + 'piano4oct.png');
278+
keyb1pb.invalidate;
273279
end;
280+
{$endif}
274281

275282
end;
276283

277284
procedure tpianofo.ondestro(const sender: TObject);
278285
begin
279-
aimagepiano4oct.Free;
286+
{$ifndef netbsd}
287+
aimagepiano4oct.Free;
288+
{$endif}
280289
end;
281290

282291
end.

src/randomnote.pas

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,30 +202,35 @@ implementation
202202
drums;
203203

204204
procedure trandomnotefo.onpaintimg(const Sender: twidget; const acanvas: tcanvas);
205+
{$ifndef netbsd}
205206
var
206207
theMemBitmap: TBGRABitmap;
207208
begin
208-
209209
theMemBitmap := aimagepiano.MemBitmap.Resample(keyb1pb.Width, keyb1pb.Height, rmFineResample) as TBGRABitmap;
210210
theMemBitmap.Rectangle(0, 0, keyb1pb.Width, keyb1pb.Height, BGRA(255, 192, 0), BGRA(180, 180, 180, 255), dmDrawWithTransparency, 8192);
211211
theMemBitmap.draw(acanvas, 0, 0, True);
212212
theMemBitmap.Free;
213-
214-
end;
213+
{$else}
214+
begin
215+
{$endif}
216+
end;
215217

216218
procedure trandomnotefo.onpaintguit(const Sender: twidget; const acanvas: tcanvas);
219+
{$ifndef netbsd}
217220
var
218221
theMemBitmap : TBGRABitmap;
219222
begin
220-
221223
theMemBitmap:= aimageguit.MemBitmap.Resample(guitpb1.Width, guitpb1.Height, rmFineResample) as TBGRABitmap;
222224
theMemBitmap.Rectangle(0, 0, guitpb1.Width, guitpb1.Height, BGRA(255, 192, 0), BGRA(180, 180, 180, 255), dmDrawWithTransparency, 8192);
223225
theMemBitmap.draw(acanvas, 0, 0, True);
224226
theMemBitmap.Free;
225-
227+
{$else}
228+
begin
229+
{$endif}
226230
end;
227231

228232
procedure trandomnotefo.onpaintbass(const Sender: twidget; const acanvas: tcanvas);
233+
{$ifndef netbsd}
229234
var
230235
theMemBitmap : TBGRABitmap;
231236
begin
@@ -234,7 +239,9 @@ procedure trandomnotefo.onpaintbass(const Sender: twidget; const acanvas: tcanva
234239
theMemBitmap.Rectangle(0, 0, basspb1.Width, basspb1.Height, BGRA(255, 192, 0), BGRA(180, 180, 180, 255), dmDrawWithTransparency, 8192);
235240
theMemBitmap.draw(acanvas, 0, 0, True);
236241
theMemBitmap.Free;
237-
242+
{$else}
243+
begin
244+
{$endif}
238245
end;
239246

240247
procedure trandomnotefo.guitarchord(num, ranchord, ismin, isseven: integer);
@@ -4008,6 +4015,7 @@ procedure trandomnotefo.oncreatedev(const Sender: TObject);
40084015
ordir := msestring(IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))) ;
40094016
{$ENDIF}
40104017

4018+
{$ifndef netbsd}
40114019
if fileexists(ordir + 'images' + directoryseparator + 'piano1oct.png')
40124020
then
40134021
begin
@@ -4028,7 +4036,8 @@ procedure trandomnotefo.oncreatedev(const Sender: TObject);
40284036
aimagebass := TBGRAAnimatedGif.Create(ordir + 'images' + directoryseparator + 'basstab.png');
40294037
basspb1.invalidate;
40304038
end;
4031-
4039+
{$ENDIF}
4040+
40324041
elipse1_2.bitmap := elipse1_1.bitmap;
40334042
elipse1_3.bitmap := elipse1_1.bitmap;
40344043
elipse2_1.bitmap := elipse1_1.bitmap;

src/songplayer.pas

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,6 +1910,7 @@ procedure tsongplayerfo.doplayerstart(const Sender: TObject);
19101910
// lposition.face.template := mainfo.tfaceplayerlight;
19111911

19121912
hascue2 := True;
1913+
19131914
oninfowav(Sender);
19141915

19151916
infosdfo2.infolength.Caption := copy(llength.Value, 1, 8);
@@ -2648,18 +2649,19 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
26482649

26492650
tagClass := IdentifyKind(FileName);
26502651
TagReader := tagClass.Create;
2651-
2652+
26522653
TagReader.LoadFromFile(FileName);
26532654

26542655
if TagReader.Tags.ImageCount > 0 then
26552656
begin
26562657
Result := 0;
26572658
TagReader.Tags.Images[0].Image.Position := 0;
26582659
end;
2659-
2660+
26602661
end;
26612662

26622663
begin
2664+
26632665
fileex := fileext(PChar(ansistring(historyfn.Value)));
26642666

26652667
if (lowercase(fileex) = 'wav') or (lowercase(fileex) = 'ogg') or
@@ -2688,9 +2690,15 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
26882690
infosdfo.infofile.Caption := copy(trim(extractfilename(historyfn.Value)), 1, 60);
26892691
infosdfo.infofile.hint := ' ' + trim(extractfilename(historyfn.Value)) + ' ';
26902692

2693+
{$ifndef netbsd}
26912694
if (lowercase(fileex) <> 'mp3') then
2695+
{$else}
2696+
if true then
2697+
{$endif}
26922698
begin
2699+
{$ifndef netbsd}
26932700
infosdfo.loadimagetag(nil);
2701+
{$endif}
26942702

26952703
infosdfo.infoname.Caption :=
26962704
uos_InputGetTagTitle(theplayer, Inputindex1);
@@ -2712,11 +2720,13 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
27122720
end
27132721
else
27142722
begin
2723+
27152724
if readtag(ansistring(historyfn.Value)) = 0 then
27162725
infosdfo.loadimagetag(TagReader.Tags.Images[0].Image)
27172726
else
27182727
infosdfo.loadimagetag(nil);
2719-
2728+
2729+
27202730
CommonTags := TagReader.GetCommonTags;
27212731

27222732
infosdfo.infoname.Caption := copy(trim(CommonTags.Title), 1, 60) + ' ';
@@ -2743,7 +2753,7 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
27432753
infosdfo.infochan.Caption := 'Stereo '
27442754
else
27452755
infosdfo.infochan.Caption := trim(TagReader.MediaProperty.ChannelMode) + ' ';
2746-
2756+
27472757
end;
27482758
// BPM
27492759

@@ -2781,9 +2791,15 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
27812791

27822792
infosdfo2.infofile.Caption := copy(trim(extractfilename(historyfn.Value)), 1, 60);
27832793

2794+
{$ifndef netbsd}
27842795
if (lowercase(fileex) <> 'mp3') then
2796+
{$else}
2797+
if true then
2798+
{$endif}
27852799
begin
2800+
{$ifndef netbsd}
27862801
infosdfo2.loadimagetag(nil);
2802+
{$endif}
27872803
infosdfo2.infoname.Caption :=
27882804
uos_InputGetTagTitle(theplayer2, Inputindex1);
27892805
infosdfo2.infoartist.Caption :=
@@ -2800,16 +2816,15 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
28002816
uos_InputGetTagTrack(theplayer2, Inputindex1);
28012817
infosdfo2.infochan.Caption :=
28022818
uos_InputGetTagGenre(theplayer2, Inputindex1);
2803-
28042819
end
28052820
else
28062821
begin
2807-
2822+
28082823
if readtag(ansistring(historyfn.Value)) = 0 then
28092824
infosdfo2.loadimagetag(TagReader.Tags.Images[0].Image)
28102825
else
28112826
infosdfo2.loadimagetag(nil);
2812-
2827+
28132828
CommonTags := TagReader.GetCommonTags;
28142829

28152830
infosdfo2.infoname.Caption := copy(trim(CommonTags.Title), 1, 60) + ' ';
@@ -2865,8 +2880,11 @@ procedure tsongplayerfo.oninfowav(const Sender: TObject);
28652880
ttimerwavdata.Enabled := True;
28662881
end;
28672882
end;
2868-
if (lowercase(fileex) = 'mp3') then
2869-
TagReader.Free;
2883+
{$ifndef netbsd}
2884+
if (lowercase(fileex) = 'mp3') then
2885+
TagReader.Free;
2886+
{$endif}
2887+
28702888
end
28712889
else
28722890
ShowMessage(historyfn.Value + ' does not exist or not mounted...');

0 commit comments

Comments
 (0)