-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmain_mi.pas
More file actions
653 lines (561 loc) · 19.8 KB
/
main_mi.pas
File metadata and controls
653 lines (561 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
/////////////////// Demo how to use Multi-Input with uos ////////////////////
unit main_mi;
{$mode objfpc}{$H+}
interface
uses
uos_flat,
Forms,
Dialogs,
SysUtils,
fileutil,
Graphics,
ctypes,
StdCtrls,
ComCtrls,
ExtCtrls,
Classes,
Controls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button10: TButton;
Button11: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button7: TButton;
Button8: TButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
CheckBox8: TCheckBox;
Label12: TLabel;
mp3input: TCheckBox;
Edit1: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Label1: TLabel;
Label10: TLabel;
Label11: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
OpenDialog1: TOpenDialog;
PaintBox1: TPaintBox;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
Shape8: TShape;
Shape9: TShape;
TrackBar1: TTrackBar;
TrackBar2: TTrackBar;
TrackBar3: TTrackBar;
TrackBar4: TTrackBar;
TrackBar5: TTrackBar;
TrackBar6: TTrackBar;
TrackBar7: TTrackBar;
TrackBar8: TTrackBar;
procedure Button11Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure CheckBox1Change(Sender: TObject);
procedure CheckBox2Change(Sender: TObject);
procedure CheckBox3Change(Sender: TObject);
procedure CheckBox4Change(Sender: TObject);
procedure CheckBox5Change(Sender: TObject);
procedure CheckBox6Change(Sender: TObject);
procedure CheckBox7Change(Sender: TObject);
procedure CheckBox8Change(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure PaintBox1Paint(Sender: TObject);
procedure ClosePlayer0;
procedure TrackBar1Change(Sender: TObject);
procedure TrackBar2Change(Sender: TObject);
procedure TrackBar3Change(Sender: TObject);
procedure TrackBar4Change(Sender: TObject);
procedure TrackBar5Change(Sender: TObject);
procedure TrackBar6Change(Sender: TObject);
procedure TrackBar7Change(Sender: TObject);
procedure TrackBar8Change(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
procedure uos_logo();
var
Form1: TForm1;
BufferBMP: TBitmap;
PlayerIndex0, inindex1, inindex2, inindex3, inindex4, mut, inindex5, inindex6, inindex7, inindex8, channels: cardinal;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.ClosePlayer0;
begin
button16.Enabled := False;
button15.Enabled := False;
button3.Enabled := False;
button14.Enabled := False;
button2.Enabled := True;
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex1, TrackBar1.position / 100,
TrackBar1.position / 100, True);
end;
procedure TForm1.TrackBar2Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex2, TrackBar2.position / 100,
TrackBar2.position / 100, True);
end;
procedure TForm1.TrackBar3Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex3, TrackBar3.position / 100,
TrackBar3.position / 100, True);
end;
procedure TForm1.TrackBar4Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex4, TrackBar4.position / 100,
TrackBar4.position / 100, True);
end;
procedure TForm1.TrackBar5Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex8, TrackBar5.position / 100,
TrackBar5.position / 100, True);
end;
procedure TForm1.TrackBar6Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex5, TrackBar6.position / 100,
TrackBar6.position / 100, True);
end;
procedure TForm1.TrackBar7Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex6, TrackBar7.position / 100,
TrackBar7.position / 100, True);
end;
procedure TForm1.TrackBar8Change(Sender: TObject);
begin
if (button14.Enabled = False) then
uos_InputSetDSPVolume(PlayerIndex0, InIndex7, TrackBar8.position / 100,
TrackBar8.position / 100, True);
end;
procedure TForm1.FormActivate(Sender: TObject);
var
ordir: string;
{$IFDEF Darwin}
opath: string;
{$ENDIF}
begin
uos_logo();
ordir := application.Location;
{$IFDEF Windows}
{$if defined(cpu64)}
Edit1.Text := ordir + 'lib\Windows\64bit\LibPortaudio-64.dll';
Edit2.Text := ordir + 'lib\Windows\64bit\LibSndFile-64.dll';
Edit3.Text := ordir + 'lib\Windows\64bit\LibMpg123-64.dll';
{$else}
Edit1.Text := ordir + 'lib\Windows\32bit\LibPortaudio-32.dll';
Edit2.Text := ordir + 'lib\Windows\32bit\LibSndFile-32.dll';
Edit3.Text := ordir + 'lib\Windows\32bit\LibMpg123-32.dll';
{$endif}
{$ENDIF}
{$IFDEF Darwin}
{$IFDEF CPU32}
opath := ordir;
opath := copy(opath, 1, Pos('/uos', opath) - 1);
Edit1.Text := opath + '/lib/Mac/32bit/LibPortaudio-32.dylib';
Edit2.Text := opath + '/lib/Mac/32bit/LibSndFile-32.dylib';
Edit3.Text := opath + '/lib/Mac/32bit/LibMpg123-32.dylib';
{$ENDIF}
{$IFDEF CPU64}
opath := ordir;
opath := copy(opath, 1, Pos('/uos', opath) - 1);
Edit1.Text := opath + '/lib/Mac/64bit/LibPortaudio-64.dylib';
Edit2.Text := opath + '/lib/Mac/64bit/LibSndFile-64.dylib';
Edit3.Text := opath + '/lib/Mac/64bit/LibMpg123-64.dylib';
{$ENDIF}
{$ENDIF}
{$if defined(cpu64) and defined(linux) }
Edit1.Text := ordir + 'lib/Linux/64bit/LibPortaudio-64.so';
Edit2.Text := ordir + 'lib/Linux/64bit/LibSndFile-64.so';
Edit3.Text := ordir + 'lib/Linux/64bit/LibMpg123-64.so';
{$ENDIF}
{$if defined(CPUAMD64) and defined(openbsd) }
Edit1.Text := ordir + 'lib/OpenBSD/64bit/LibPortaudio-64.so';
Edit2.Text := ordir + 'lib/OpenBSD/64bit/LibSndFile-64.so';
Edit3.Text := ordir + 'lib/OpenBSD/64bit/LibMpg123-64.so';
{$ENDIF}
{$if defined(cpu86) and defined(linux)}
Edit1.Text := ordir + 'lib/Linux/32bit/LibPortaudio-32.so';
Edit2.Text := ordir + 'lib/Linux/32bit/LibSndFile-32.so';
Edit3.Text := ordir + 'lib/Linux/32bit/LibMpg123-32.so';
{$ENDIF}
{$if defined(linux) and defined(cpuarm)}
Edit1.Text := ordir + 'lib/Linux/arm_raspberrypi/libportaudio-arm.so';
Edit2.Text := ordir + 'lib/Linux/arm_raspberrypi/libsndfile-arm.so';
Edit3.Text := ordir + 'lib/Linux/arm_raspberrypi/libmpg123-arm.so';
{$ENDIF}
{$IFDEF freebsd}
{$if defined(cpu64)}
Edit1.Text := ordir + 'lib/FreeBSD/64bit/libportaudio-64.so';
Edit2.Text := ordir + 'lib/FreeBSD/64bit/libsndfile-64.so';
Edit3.Text := ordir + 'lib/FreeBSD/64bit/libmpg123-64.so';
{$else}
Edit1.Text := ordir + 'lib/FreeBSD/32bit/libportaudio-32.so';
Edit2.Text := ordir + 'lib/FreeBSD/32bit/libsndfile-32.so';
Edit3.Text := ordir + 'lib/FreeBSD/32bit/libmpg123-32.so';
{$endif}
{$ENDIF}
opendialog1.Initialdir := application.Location + 'sound';
Edit4.Text := application.Location + 'sound' + directoryseparator + 'test.wav';
Edit5.Text := application.Location + 'sound' + directoryseparator + 'test.ogg';
Edit6.Text := application.Location + 'sound' + directoryseparator + 'test.wav';
Edit7.Text := application.Location + 'sound' + directoryseparator + 'test.flac';
Edit8.Text := application.Location + 'sound' + directoryseparator + 'test.ogg';
Edit9.Text := application.Location + 'sound' + directoryseparator + 'test.flac';
Edit10.Text := application.Location + 'sound' + directoryseparator + 'test.wav';
Edit11.Text := application.Location + 'sound' + directoryseparator + 'test.ogg';
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
PaintBox1.Canvas.Draw(0, 0, BufferBMP);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// Load the libraries
// function uos_loadlib(PortAudioFileName, SndFileFileName, Mpg123FileName, Mp4ffFileName, FaadFileName, opusfilefilename, libxmpfilename: PChar) : LongInt;
{$if defined(CPUAMD64) and defined(linux) }
// For Linux amd64, check libsndfile.so
if (Edit2.Text <> 'system') and (Edit2.Text <> '') then
if uos_TestLoadLibrary(PChar(edit2.Text)) = false then
edit2.Text := edit2.Text + '.2';
if (Edit1.Text <> 'system') and (Edit1.Text <> '') then
if uos_TestLoadLibrary(PChar(edit1.Text)) = false then
edit1.Text := edit1.Text + '.2';
{$endif}
if uos_LoadLib(PChar(edit1.Text), PChar(edit2.Text), PChar(edit3.Text), nil, nil, nil, nil) = 0 then
begin
form1.hide;
form1.Position := podefault;
button1.Caption := 'Libraries are loaded...';
button1.Enabled := False;
edit1.ReadOnly := True;
edit2.ReadOnly := True;
edit3.ReadOnly := True;
form1.Height := 478;
form1.Position := poScreenCenter;
button2.click;
form1.Show;
end
else
begin
if uosLoadResult.PAloaderror = 1 then
MessageDlg(edit1.Text + ' do not exist...', mtWarning, [mbYes], 0);
if uosLoadResult.PAloaderror = 2 then
MessageDlg(edit1.Text + ' do not load...', mtWarning, [mbYes], 0);
if uosLoadResult.SFloaderror = 1 then
MessageDlg(edit2.Text + ' do not exist...', mtWarning, [mbYes], 0);
if uosLoadResult.SFloaderror = 2 then
MessageDlg(edit2.Text + ' do not load...', mtWarning, [mbYes], 0);
end;
end;
procedure TForm1.Button11Click(Sender: TObject);
begin
if opendialog1.Execute then
edit10.Text := opendialog1.FileName;
end;
procedure TForm1.Button17Click(Sender: TObject);
begin
if opendialog1.Execute then
edit11.Text := opendialog1.FileName;
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
if opendialog1.Execute then
edit6.Text := opendialog1.FileName;
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
if opendialog1.Execute then
edit7.Text := opendialog1.FileName;
end;
procedure TForm1.Button14Click(Sender: TObject);
begin
button15.Enabled := True;
button3.Enabled := True;
button14.Enabled := False;
button16.Enabled := False;
button2.Enabled := False;
// set the volume from the sliders.
TrackBar1Change(self);
TrackBar2Change(self);
TrackBar3Change(self);
TrackBar4Change(self);
TrackBar5Change(self);
TrackBar6Change(self);
TrackBar7Change(self);
TrackBar8Change(self);
// Ok let start it
uos_Play(PlayerIndex0);
end;
procedure TForm1.Button15Click(Sender: TObject);
begin
uos_Pause(PlayerIndex0);
button15.Enabled := False;
button16.Enabled := True;
end;
procedure TForm1.Button16Click(Sender: TObject);
begin
uos_RePlay(PlayerIndex0);
button16.Enabled := False;
button15.Enabled := True;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
ratioendlessloop: shortint;
begin
PlayerIndex0 := 0;
channels := 2; // (stereo output)
uos_Stop(PlayerIndex0);
sleep(100);
application.ProcessMessages;
uos_CreatePlayer(PlayerIndex0);
if mp3input.Checked then
ratioendlessloop := 4
else
ratioendlessloop := 1;
//// add input from audio file with custom parameters
//////////// PlayerIndex : Index of a existing Player
////////// FileName : filename of audio file
////////// OutputIndex : OutputIndex of existing Output // -1 : all output, -2: no output, other integer : existing output)
////////// SampleFormat : -1 default : Int16 : (0: Float32, 1:Int32, 2:Int16) SampleFormat of Input can be <= SampleFormat float of Output
//////////// FramesCount : default : -1 (65536)
// result : -1 nothing created, otherwise Input Index in array
inindex1 := uos_AddFromFile(PlayerIndex0, PChar(Edit4.Text), -1, 0, 1024);
inindex2 := uos_AddFromFile(PlayerIndex0, PChar(Edit5.Text), -1, 0, 1024);
inindex3 := uos_AddFromFile(PlayerIndex0, PChar(Edit6.Text), -1, 0, 1024);
inindex4 := uos_AddFromFile(PlayerIndex0, PChar(Edit7.Text), -1, 0, 1024);
inindex5 := uos_AddFromFile(PlayerIndex0, PChar(Edit8.Text), -1, 0, 1024);
inindex6 := uos_AddFromFile(PlayerIndex0, PChar(Edit9.Text), -1, 0, 1024);
inindex7 := uos_AddFromFile(PlayerIndex0, PChar(Edit10.Text), -1, 0, 1024);
inindex8 := uos_AddFromFile(PlayerIndex0, PChar(Edit11.Text), -1, 0, 1024);
// This for a dummy endless input, set enable to true, must be last input
// Needed to make all input reach the end.
mut := uos_AddFromEndlessMuted(PlayerIndex0, 2, 1024 div ratioendlessloop);
uos_inputsetenable(PlayerIndex0, mut, True);
///// DSP Volume changer
////////// PlayerIndex1 : Index of a existing Player
////////// In1Index : InputIndex of a existing input
////////// VolLeft : Left volume ( from 0 to 1 => gain > 1 )
////////// VolRight : Right volume
uos_InputAddDSPVolume(PlayerIndex0, InIndex1, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex2, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex3, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex4, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex5, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex6, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex7, 1, 1);
uos_InputAddDSPVolume(PlayerIndex0, InIndex8, 1, 1);
//// add a Output into device with custom parameters
//////////// PlayerIndex : Index of a existing Player
//////////// Device ( -1 is default Output device )
//////////// Latency ( -1 is latency suggested ) )
//////////// SampleRate : delault : -1 (44100)
//////////// Channels : delault : -1 (2:stereo) (0: no channels, 1:mono, 2:stereo, ...)
//////////// SampleFormat : -1 default : Int16 : (0: Float32, 1:Int32, 2:Int16)
//////////// FramesCount : default : -1 (65536)
// ChunkCount : default : -1 (= 512)
// result : -1 nothing created, otherwise Output Index in array
{$if defined(cpuarm) or defined(cpuaarch64)} // need a lower latency
uos_AddIntoDevOut(PlayerIndex0, -1, 0.3, -1, -1, 0, 1024, -1);
{$else}
uos_AddIntoDevOut(PlayerIndex0, -1, 0.3, -1, -1, 0, 1024, -1);
{$endif}
CheckBox1Change(Sender);
CheckBox2Change(Sender);
CheckBox3Change(Sender);
CheckBox4Change(Sender);
CheckBox5Change(Sender);
CheckBox6Change(Sender);
CheckBox7Change(Sender);
CheckBox8Change(Sender);
/////// procedure to execute when stream is terminated
uos_EndProc(PlayerIndex0, @ClosePlayer0);
///// Assign the procedure of object to execute at end
//////////// PlayerIndex : Index of a existing Player
//////////// ClosePlayer1 : procedure of object to execute inside the loop
application.ProcessMessages;
button14.Enabled := True;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
uos_Stop(PlayerIndex0);
sleep(100);
button2.Enabled := True;
button3.Enabled := False;
ClosePlayer0;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if opendialog1.Execute then
edit4.Text := opendialog1.FileName;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if opendialog1.Execute then
edit8.Text := opendialog1.FileName;
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
if opendialog1.Execute then
edit5.Text := opendialog1.FileName;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
if opendialog1.Execute then
edit9.Text := opendialog1.FileName;
end;
procedure TForm1.CheckBox1Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex1, checkbox1.Checked);
end;
procedure TForm1.CheckBox2Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex2, checkbox2.Checked);
end;
procedure TForm1.CheckBox3Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex5, checkbox3.Checked);
end;
procedure TForm1.CheckBox4Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex6, checkbox4.Checked);
end;
procedure TForm1.CheckBox5Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex3, checkbox5.Checked);
end;
procedure TForm1.CheckBox6Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex4, checkbox6.Checked);
end;
procedure TForm1.CheckBox7Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex7, checkbox7.Checked);
end;
procedure TForm1.CheckBox8Change(Sender: TObject);
begin
uos_InputSetEnable(PlayerIndex0, InIndex8, checkbox8.Checked);
end;
procedure uos_logo();
var
xpos, ypos: integer;
ratio: double;
begin
xpos := 0;
ypos := 0;
ratio := 1;
BufferBMP := TBitmap.Create;
with form1 do
begin
form1.PaintBox1.Parent.DoubleBuffered := True;
PaintBox1.Height := round(ratio * 116);
PaintBox1.Width := round(ratio * 100);
BufferBMP.Height := PaintBox1.Height;
BufferBMP.Width := PaintBox1.Width;
BufferBMP.Canvas.AntialiasingMode := amOn;
BufferBMP.Canvas.Pen.Width := round(ratio * 6);
BufferBMP.Canvas.brush.Color := clmoneygreen;
BufferBMP.Canvas.FillRect(0, 0, PaintBox1.Width, PaintBox1.Height);
BufferBMP.Canvas.Pen.Color := clblack;
BufferBMP.Canvas.brush.Color := $70FF70;
BufferBMP.Canvas.Ellipse(round(ratio * (22) + xpos),
round(ratio * (30) + ypos), round(ratio * (72) + xpos),
round(ratio * (80) + ypos));
BufferBMP.Canvas.brush.Color := clmoneygreen;
BufferBMP.Canvas.Arc(round(ratio * (34) + xpos), round(ratio * (8) + ypos),
round(ratio * (58) + xpos), round(ratio * (32) + ypos), round(ratio * (58) + xpos),
round(ratio * (20) + ypos), round(ratio * (46) + xpos),
round(ratio * (32) + xpos));
BufferBMP.Canvas.Arc(round(ratio * (34) + xpos), round(ratio * (32) + ypos),
round(ratio * (58) + xpos), round(ratio * (60) + ypos), round(ratio * (34) + xpos),
round(ratio * (48) + ypos), round(ratio * (46) + xpos),
round(ratio * (32) + ypos));
BufferBMP.Canvas.Arc(round(ratio * (-28) + xpos), round(ratio * (18) + ypos),
round(ratio * (23) + xpos), round(ratio * (80) + ypos), round(ratio * (20) + xpos),
round(ratio * (50) + ypos), round(ratio * (3) + xpos), round(ratio * (38) + ypos));
BufferBMP.Canvas.Arc(round(ratio * (70) + xpos), round(ratio * (18) + ypos),
round(ratio * (122) + xpos), round(ratio * (80) + ypos),
round(ratio * (90 - xpos)),
round(ratio * (38) + ypos), round(ratio * (72) + xpos),
round(ratio * (50) + ypos));
BufferBMP.Canvas.Font.Name := 'Arial';
BufferBMP.Canvas.Font.Size := round(ratio * 10);
BufferBMP.Canvas.TextOut(round(ratio * (4) + xpos),
round(ratio * (83) + ypos), 'United Openlib');
BufferBMP.Canvas.Font.Size := round(ratio * 7);
BufferBMP.Canvas.TextOut(round(ratio * (20) + xpos),
round(ratio * (101) + ypos), 'of');
BufferBMP.Canvas.Font.Size := round(ratio * 10);
BufferBMP.Canvas.TextOut(round(ratio * (32) + xpos),
round(ratio * (98) + ypos), 'Sound');
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
form1.Height := 148;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
uos_free;
BufferBMP.free;
end;
end.