Skip to content

Commit 43b47f4

Browse files
committed
fbdocs: wiki snapshot 2021.03.14
1 parent d2d16f6 commit 43b47f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2819
-273
lines changed

doc/manual/cache/CatPgDddefines.wakka

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ Preprocessor symbols defined by the compiler.
141141
{{anchor name="BASICMACROS"}}{{fbdoc item="section" value="Basic-macros"}}
142142
=={{fbdoc item="keyword" value="KeyPgDdfbargcount|__FB_ARG_COUNT__"}}==
143143
Counts the number of arguments in an argument list.
144+
=={{fbdoc item="keyword" value="KeyPgDdfbargextract|__FB_ARG_EXTRACT__"}}==
145+
Returns nth argument from an argument list.
144146
=={{fbdoc item="keyword" value="KeyPgDdfbargleftof|__FB_ARG_LEFTOF__"}}==
145147
Returns left token based on separator.
146148
=={{fbdoc item="keyword" value="KeyPgDdfbargrightof|__FB_ARG_RIGHTOF__"}}==

doc/manual/cache/CatPgFullIndex.wakka

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Alphabetical listing of keywords, macros and procedures.
1515
- {{fbdoc item="keyword" value="KeyPgDddateiso|__DATE_ISO__"}}
1616
- {{fbdoc item="keyword" value="KeyPgDdfb64bit|__FB_64BIT__"}}
1717
- {{fbdoc item="keyword" value="KeyPgDdfbargcount|__FB_ARG_COUNT__"}}
18+
- {{fbdoc item="keyword" value="KeyPgDdfbargextract|__FB_ARG_EXTRACT__"}}
1819
- {{fbdoc item="keyword" value="KeyPgDdfbargleftof|__FB_ARG_LEFTOF__"}}
1920
- {{fbdoc item="keyword" value="KeyPgDdfbargrightof|__FB_ARG_RIGHTOF__"}}
2021
- {{fbdoc item="keyword" value="KeyPgDdfbargc|__FB_ARGC__"}}

doc/manual/cache/CatPgFunctIndex.wakka

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ List of ""FreeBASIC"" keywords sorted by the function they perform.
409409
- {{fbdoc item="keyword" value="KeyPgDddateiso|__DATE_ISO__"}}
410410
- {{fbdoc item="keyword" value="KeyPgDdfb64bit|__FB_64BIT__"}}
411411
- {{fbdoc item="keyword" value="KeyPgDdfbargcount|__FB_ARG_COUNT__"}}
412+
- {{fbdoc item="keyword" value="KeyPgDdfbargextract|__FB_ARG_EXTRACT__"}}
412413
- {{fbdoc item="keyword" value="KeyPgDdfbargleftof|__FB_ARG_LEFTOF__"}}
413414
- {{fbdoc item="keyword" value="KeyPgDdfbargrightof|__FB_ARG_RIGHTOF__"}}
414415
- {{fbdoc item="keyword" value="KeyPgDdfbargc|__FB_ARGC__"}}

doc/manual/cache/CatPgOpIndexing.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The indexing operators return references to some memory based on the value of th
66
<<=={{fbdoc item="keyword" value="KeyPgOpArrayIndex|Operator () (Array index)"}}==
77
Returns a reference to an element in an array.
88
=={{fbdoc item="keyword" value="KeyPgOpStringIndex|Operator [] (String index)"}}==
9-
Returns a reference to a character in a string.
9+
Returns a reference to the numeric value of a character in a string.
1010
<<>>=={{fbdoc item="keyword" value="KeyPgOpPtrIndex|Operator [] (Pointer index)"}}==
1111
Returns a reference to memory offset from a base address.
1212
>>::c::

doc/manual/cache/ExtLibTOC.wakka

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ This is the list of external library bindings currently included in ""FreeBASIC"
4444
{{fbdoc item="keyword" value="ExtLibogg|Ogg"}} - Ogg multimedia container format creation/decoder library
4545
{{fbdoc item="keyword" value="ExtLibal|OpenAL"}} - Cross-platform 3D audio API.
4646
{{fbdoc item="keyword" value="ExtLibPortAudio|PortAudio"}} - Cross-platform audio I/O library
47+
{{fbdoc item="keyword" value="ExtLibsfx|sfx"}} - Freebasic sfx library is cross-platform and comes for Windows, Linux, Dos
4748
{{fbdoc item="keyword" value="ExtLibsndfile|sndfile"}} - Library to read/write/convert audio files in various formats
4849
{{fbdoc item="keyword" value="ExtLibVLC|VLC"}} - Audio/video playback
4950
{{fbdoc item="keyword" value="ExtLibvorbis|Vorbis"}} - Ogg Vorbis audio compression library

doc/manual/cache/ExtLibsfx.wakka

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{{fbdoc item="title" value="sfx"}}----
2+
Freebasic sfx library is cross-platform and comes for Windows, Linux, Dos
3+
Author: angros47
4+
Download link: https://sourceforge.net/projects/freebasic-sfx-library/files/
5+
Forum link: https://freebasic.net/forum/viewtopic.php?f=17&t=26256
6+
7+
Compile Library: all the necessary scripts are in the archive, you just need to substitute the correct path to the compiler in them
8+
9+
A brief description of the main (not all) functions:
10+
11+
1) ""SoundmidiSet"" - setting mode midi (needed for function PLAY)
12+
2) ""SoundSet"" - setting mode PCM sound (needed for functions SOUND , ""PlayWave"")
13+
1) PLAY - command is for playing musical notes, octave *.
14+
2) SOUND - command produces sound of a specific frequency for a specific duration
15+
3) ""LoadMidi"" - load midi from file, returns a pointer ""MidiSequence"" ptr
16+
4) ""PlayMidi"" - play midi, in parameters you need to pass pointer ""MidiSequence"" ptr
17+
5) ""CreateMidi"" - creates ""MidiSequence"" ptr, then you can use the pointer using PLAY to write data , and then save in the file
18+
6) ""SaveMidi"" - save data ""MidiSequence"" ptr in file, in format .mid
19+
7) ""LoadWave"" - loads a file into memory WAV (supported only WAVE_FORMAT_PCM), returns a pointer ""WaveHeaderType"" ptr
20+
8) ""PlayWave"" - play wav , in parameters you need to pass pointer ""WaveHeaderType"" ptr
21+
22+
* The command PLAY can play more than one note at time: it supports chords, by grouping notes inside curly brackets, and it allows to play up to 16 channels at the same time. For more information see also command QBASICs play.
23+
24+
Description of all functions is in the file readme.txt (in archive)
25+
26+
{{fbdoc item="ex"}}
27+
28+
Example Play%%(freebasic)
29+
#include "sfx.bi"
30+
#inclib "fbsfx"
31+
32+
SoundmidiSet ()
33+
PLAY "a4e4g4a4g4e4c2f4f4f2d4d4d2"
34+
%%
35+
Example Play wih thread%%(freebasic)
36+
#include "sfx.bi"
37+
#inclib "fbsfx"
38+
39+
dim shared as any ptr mutex
40+
mutex = MutexCreate
41+
42+
dim shared as Long iMusicExit
43+
dim as Double dTimer
44+
45+
sub procThread(p as any ptr)
46+
SoundmidiSet ()
47+
PLAY "a4e4g4a4g4e4c2f4f4f2d4d4d2"
48+
MutexLock(mutex)
49+
iMusicExit = 1
50+
MutexUnLock(mutex)
51+
End Sub
52+
53+
dTimer = timer
54+
threadcreate(@procThread)
55+
56+
do
57+
? timer - dTimer
58+
MutexLock(mutex)
59+
if iMusicExit then
60+
exit do
61+
EndIf
62+
MutexUnLock(mutex)
63+
Loop
64+
%%
65+
Example ""CreateMidi"", ""SaveMidi""
66+
%%(freebasic)
67+
#include "sfx.bi"
68+
#inclib "fbsfx"
69+
70+
SoundmidiSet ()
71+
dim as any ptr Midi=CreateMidi()
72+
PLAY Midi,"a4e4g4a4g4e4c2f4f4f2d4d4d2"
73+
SaveMidi "music.mid", Midi
74+
%%
75+
Example ""LoadMidi"", ""PlayMidi""
76+
%%(freebasic)
77+
#include "sfx.bi"
78+
#inclib "fbsfx"
79+
80+
SoundmidiSet ()
81+
dim as any ptr Midi=LoadMidi("music.mid")
82+
PlayMidi(Midi, 1)
83+
sleep
84+
%%
85+
Example Sound
86+
%%(freebasic)
87+
#include "sfx.bi"
88+
#inclib "fbsfx"
89+
90+
SoundSet (44100,1,16)
91+
sound SineWave(2000), 1 ' sine 2 kHz
92+
sound NoiseWave(), 1 ' noise
93+
sleep
94+
%%
95+
Example ""LoadWave"", ""PlayWave""
96+
%%(freebasic)
97+
#include "sfx.bi"
98+
#inclib "fbsfx"
99+
100+
dim as WaveHeaderType ptr pWave
101+
SoundSet (44100,2,16)
102+
pWave = LoadWave("1.wav")
103+
if pWave = 0 then
104+
print "pWave = 0" : end
105+
end if
106+
PlayWave(pWave)
107+
sleep
108+
%%
109+
110+
{{fbdoc item="back" value="ExtLibTOC|External Library Table of Contents"}}

doc/manual/cache/FaqPggetputstructure.wakka

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ using FB
1414

1515

1616
'' function to show info on an image
17-
sub show_image_info( byval image as any ptr )
18-
dim as PUT_HEADER ptr header
17+
sub show_image_info( byval img as any ptr )
18+
dim as PUT_HEADER ptr header ' IMAGE can also be use instead of PUT_HEADER
1919
dim as integer w, h, bpp, pitch
2020

21-
header = image
21+
header = img
2222
if( header->type = PUT_HEADER_NEW ) then
2323

2424
print "New style header"

doc/manual/cache/GfxInternalFormats.wakka

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,38 @@ Information on the internal formats used by ""FreeBASIC"" to represent graphics.
2121

2222
In ""FreeBASIC"", images can be used as arrays (as in QB) or as pointers. Either way, the image data is contained in one continuous chunk. The chunk consists of an header followed by the image data. The header can be of two types (old-style and new-style) and determines the format of the following image data.
2323

24-
**Old-style** chunk header consists of 4 bytes (32 bits, or 4 bytes). The first 3 bits contain the image color depth in bytes per pixel (8-bit color depth -> 1; 16-bit color depth -> 2; 32-bit color depth -> 4). The next 13 bits contain the image width. The last 16 bits contain the image's height. Please note the intrinsic nature of the header allows only for sizes up to ##8191 * 65535## pixels. The actual pixel data follows the header, and is compacted one row of pixels after another; no data alignment is assumed. The final size of the chunk can then be computed using the formula:
24+
**Old-style** chunk header consists of 4 bytes (32 bits, or 4 bytes). The first 3 bits contain the image color depth in bytes per pixel (8-bit color depth -> 1; 16-bit color depth -> 2; 32-bit color depth -> 4). The next 13 bits contain the image width. The last 16 bits contain the image's height. Please note the intrinsic nature of the header allows only for sizes up to ##8191 * 65535## pixels:
25+
%%(freebasic)
26+
' inside FB namespace (extracted from fbgfx.bi)
27+
28+
type _OLD_HEADER field = 1
29+
bpp : 3 as ushort
30+
width : 13 as ushort
31+
height as ushort
32+
end type
33+
%%
34+
The actual pixel data follows the header, and is compacted one row of pixels after another; no data alignment is assumed.
35+
The final size of the chunk can then be computed using the formula:
2536

2637
##size = 4 + ( width * height * bytes_per_pixel )##
2738

28-
**New-style** chunk header consists of 32 bytes. The first dword (32 bits) must be equal to the value 7, allowing ""GfxLib"" to identify the new type of chunk. The second dword contains the image color depth in bytes per pixel. The third and fourth dwords contain the image width and height respectively, effectively removing the image size limit enforced by the old-style image chunks. The fifth dword contains the pixel row pitch in bytes; this tells how many bytes a row of pixels in the image takes up. The pitch in new-style chunks is always padded to a multiple of 16, to allow pixels' row data to be aligned on the paragraph boundary. The remaining 3 dwords (total 12 bytes) of the header are currently unused and reserved for future use. The final size of the image is:
39+
**New-style** chunk header consists of 32 bytes. The first dword (32 bits) must be equal to the value 7, allowing ""GfxLib"" to identify the new type of chunk. The second dword contains the image color depth in bytes per pixel. The third and fourth dwords contain the image width and height respectively, effectively removing the image size limit enforced by the old-style image chunks. The fifth dword contains the pixel row pitch in bytes; this tells how many bytes a row of pixels in the image takes up. The pitch in new-style chunks is always padded to a multiple of 16, to allow pixels' row data to be aligned on the paragraph boundary. The remaining 3 dwords (total 12 bytes) of the header are currently unused and reserved for future use:
40+
%%(freebasic)
41+
' inside FB namespace (extracted from fbgfx.bi)
42+
43+
type IMAGE field = 1 '' in FB namespace
44+
union
45+
old as _OLD_HEADER
46+
type as ulong
47+
end union
48+
bpp as long
49+
width as ulong
50+
height as ulong
51+
pitch as ulong
52+
_reserved(1 to 12) as ubyte
53+
end type
54+
%%
55+
The final size of the image is:
2956

3057
##size = 32 + ( ( ( ( width * bytes_per_pixel ) + &hF ) and not &hF ) * height )##
3158

doc/manual/cache/JasonFirth.wakka

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
Jason K. Firth, SJ Zero
2-
http://www.qbxl.net
1+
Jason K. Firth
32

43
**Who I Am**
5-
I am a hobbyist software developer whose tool of choice is FreeBASIC. I have Quest for a King, Nietzsche, Star Phalanx, and Rambo vs. Kitty Cat under my belt.
4+
I am a hobbyist software developer whose tool of choice is FreeBASIC.
65

76
**What I Do**
87
I'm an instrumentation engineering technologist, not a programmer.

doc/manual/cache/KeyPgChain.wakka

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end if
3737
- Exit code is limited to 8 bits in DOS.
3838

3939
{{fbdoc item="diff"}}
40-
- None
40+
- ##[[KeyPgCommon|Common]]## does not allow to keep the values of certain variables when chaining programs with ##**Chain**##.
4141

4242
{{fbdoc item="see"}}
4343
- ##[[KeyPgExec|Exec]]## transfer temporarily, with arguments

0 commit comments

Comments
 (0)