1 | {This unit is part of United Openlibraries of Sound (uos)}
|
---|
2 |
|
---|
3 | { This is the dynamical loader for mpg123 library with reference counting.
|
---|
4 | Load the library with mp_load() and release with mp_unload().
|
---|
5 | License : modified LGPL.
|
---|
6 | Fred van Stappen fiens@hotmail.com }
|
---|
7 |
|
---|
8 | unit uos_mpg123;
|
---|
9 |
|
---|
10 | interface
|
---|
11 |
|
---|
12 | {$DEFINE newversion} // uncomment for mpg123 new version
|
---|
13 | {$mode objfpc}{$H+}
|
---|
14 |
|
---|
15 | uses
|
---|
16 | ctypes,
|
---|
17 | classes, dynlibs;
|
---|
18 |
|
---|
19 | const
|
---|
20 | libmp=
|
---|
21 | {$IFDEF unix}
|
---|
22 | {$IFDEF darwin}
|
---|
23 | 'libmpg123.0.dylib';
|
---|
24 | {$ELSE}
|
---|
25 | 'libmpg123.so.0';
|
---|
26 | {$ENDIF}
|
---|
27 | {$ELSE}
|
---|
28 | 'mpg123.dll';
|
---|
29 | {$ENDIF}
|
---|
30 |
|
---|
31 | const
|
---|
32 | SEEK_SET = 0; //* seek relative to beginning of file */
|
---|
33 | SEEK_CUR = 1; //* seek relative to current file position */
|
---|
34 | SEEK_END = 2; //* seek relative to end of file */
|
---|
35 | SEEK_DATA = 3; //* seek to the next data */
|
---|
36 | SEEK_HOLE = 4; //* seek to the next hole */
|
---|
37 | SEEK_MAX = SEEK_HOLE;
|
---|
38 |
|
---|
39 |
|
---|
40 | type
|
---|
41 | {$IF Defined(MSWINDOWS)}
|
---|
42 | off_t = int64;
|
---|
43 | {$ELSE}
|
---|
44 | off_t = clonglong;
|
---|
45 | {$ENDIF}
|
---|
46 |
|
---|
47 | Puos_count_t = ^Tuos_count_t;
|
---|
48 | Tuos_count_t = off_t;
|
---|
49 |
|
---|
50 | PMemoryStream = ^TMemoryStream;
|
---|
51 |
|
---|
52 | Tmpg123_handle = Pointer;
|
---|
53 | Tmpg123_init = function(): integer; cdecl;
|
---|
54 | Tmpg123_exit = procedure; cdecl;
|
---|
55 | Tmpg123_new = function(const decoder: PChar;
|
---|
56 | var error: integer): Tmpg123_handle; cdecl;
|
---|
57 | Tmpg123_delete = procedure(mh: Tmpg123_handle); cdecl;
|
---|
58 |
|
---|
59 | const
|
---|
60 | MPG123_VERBOSE = 0; // set verbosity value for enabling messages
|
---|
61 | // to stderr, >= 0 makes sense (integer)
|
---|
62 | MPG123_FLAGS = 1;
|
---|
63 | // set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer)
|
---|
64 | MPG123_ADD_FLAGS = 2; // add some flags (integer)
|
---|
65 | MPG123_FORCE_RATE = 3;
|
---|
66 | // when value > 0, force output rate to that value (integer)
|
---|
67 | MPG123_DOWN_SAMPLE = 4; // 0=native rate, 1=half rate, 2=quarter rate (integer)
|
---|
68 | MPG123_RVA = 5; // one of the RVA choices above (integer)
|
---|
69 | MPG123_DOWNSPEED = 6; // play a frame N times (integer)
|
---|
70 | MPG123_UPSPEED = 7; // play every Nth frame (integer)
|
---|
71 | MPG123_START_FRAME = 8; // start with this frame (skip frames before that, integer)
|
---|
72 | MPG123_DECODE_FRAMES = 9; // decode only this number of frames (integer)
|
---|
73 | MPG123_ICY_INTERVAL = 10;
|
---|
74 | // stream contains ICY metadata with this interval (integer)
|
---|
75 | MPG123_OUTSCALE = 11; // the scale for output samples (amplitude - integer
|
---|
76 | // or float according to mpg123 output format, normally integer)
|
---|
77 | MPG123_TIMEOUT = 12; // timeout for reading from a stream (not supported
|
---|
78 | // on win32, integer)
|
---|
79 | MPG123_REMOVE_FLAGS = 13; // remove some flags (inverse of MPG123_ADD_FLAGS, integer)
|
---|
80 | MPG123_RESYNC_LIMIT = 14; // Try resync on frame parsing for that many bytes
|
---|
81 | // or until end of stream (<0 ... integer).
|
---|
82 | MPG123_INDEX_SIZE = 15; // Set the frame index size (if supported).
|
---|
83 | // Values <0 mean that the index is allowed to grow
|
---|
84 | // dynamically in these steps (in positive direction,
|
---|
85 | // of course) -- Use this when you really want a
|
---|
86 | // full index with every individual frame.
|
---|
87 | MPG123_PREFRAMES = 16;
|
---|
88 |
|
---|
89 | {** mpg123_param_flags - Flag bits for MPG123_FLAGS, use the usual binary or to combine. **}
|
---|
90 | MPG123_FORCE_MONO = $7; // 0111 Force some mono mode: This is a test bitmask
|
---|
91 | // for seeing if any mono forcing is active.
|
---|
92 | MPG123_MONO_LEFT = $1; // 0001 Force playback of left channel only.
|
---|
93 | MPG123_MONO_RIGHT = $2; // 0010 Force playback of right channel only.
|
---|
94 | MPG123_MONO_MIX = $4; // 0100 Force playback of mixed mono.
|
---|
95 | MPG123_FORCE_STEREO = $8; // 1000 Force stereo output.
|
---|
96 | MPG123_FORCE_8BIT = $10; // 00010000 Force 8bit formats.
|
---|
97 | MPG123_QUIET = $20;
|
---|
98 | // 00100000 Suppress any printouts (overrules verbose). *)
|
---|
99 | MPG123_GAPLESS = $40; // 01000000 Enable gapless decoding (default on
|
---|
100 | // if libmpg123 has support).
|
---|
101 | MPG123_NO_RESYNC = $80;
|
---|
102 | // 10000000 Disable resync stream after error. *)
|
---|
103 | MPG123_SEEKBUFFER = $100; // 000100000000 Enable small buffer on non-seekable
|
---|
104 | // streams to allow some peek-ahead (for better MPEG sync).
|
---|
105 | MPG123_FUZZY = $200; // 001000000000 Enable fuzzy seeks (guessing byte
|
---|
106 | // offsets or using approximate seek points from Xing TOC)
|
---|
107 | (* 1.72 *)
|
---|
108 | MPG123_FORCE_FLOAT = $400; // 010000000000 Force floating point output
|
---|
109 | // (32 or 64 bits depends on mpg123 internal precision).
|
---|
110 | MPG123_PLAIN_ID3TEXT = $800;
|
---|
111 | MPG123_IGNORE_STREAMLENGTH = $1000;
|
---|
112 |
|
---|
113 | {$IF DEFINED(newversion)}
|
---|
114 | MPG123_IGNORE_INFOFRAME = $4000;
|
---|
115 | MPG123_AUTO_RESAMPLE = $8000;
|
---|
116 | MPG123_PICTURE = $10000;
|
---|
117 | MPG123_NO_PEEK_END = $20000;
|
---|
118 | MPG123_SKIP_ID3V2 = $2000;
|
---|
119 | MPG123_FORCE_SEEKABLE = $40000;
|
---|
120 | {$endif}
|
---|
121 |
|
---|
122 | {** mpg123_param_rva - Choices for MPG123_RVA **}
|
---|
123 | MPG123_RVA_OFF = 0; // RVA disabled (default).
|
---|
124 | MPG123_RVA_MIX = 1; // Use mix/track/radio gain.
|
---|
125 | MPG123_RVA_ALBUM = 2; // Use album/audiophile gain
|
---|
126 | MPG123_RVA_MAX = MPG123_RVA_ALBUM; // The maximum RVA code, may increase in future.
|
---|
127 |
|
---|
128 | type
|
---|
129 | Tmpg123_param = function(mh: Tmpg123_handle; mpg123_parms_type: integer;
|
---|
130 | Value: longint; fvalue: double): integer; cdecl;
|
---|
131 | Tmpg123_getparam = function(mh: Tmpg123_handle; mpg123_parms_type: integer;
|
---|
132 | var val: longint; var fval: double): integer; cdecl;
|
---|
133 |
|
---|
134 | {** mpg123_feature_set - ??? **}
|
---|
135 | const
|
---|
136 | MPG123_FEATURE_ABI_UTF8OPEN = 0;
|
---|
137 | MPG123_FEATURE_OUTPUT_8BIT = 1;
|
---|
138 | MPG123_FEATURE_OUTPUT_16BIT = 2;
|
---|
139 | MPG123_FEATURE_OUTPUT_32BIT = 3;
|
---|
140 | MPG123_FEATURE_INDEX = 4;
|
---|
141 | MPG123_FEATURE_PARSE_ID3V2 = 5;
|
---|
142 | MPG123_FEATURE_DECODE_LAYER1 = 6;
|
---|
143 | MPG123_FEATURE_DECODE_LAYER2 = 7;
|
---|
144 | MPG123_FEATURE_DECODE_LAYER3 = 8;
|
---|
145 | MPG123_FEATURE_DECODE_ACCURATE = 9;
|
---|
146 | MPG123_FEATURE_DECODE_DOWNSAMPLE = 10;
|
---|
147 | MPG123_FEATURE_DECODE_NTOM = 11;
|
---|
148 | MPG123_FEATURE_PARSE_ICY = 12;
|
---|
149 | MPG123_FEATURE_TIMEOUT_READ = 13;
|
---|
150 |
|
---|
151 | type
|
---|
152 | Tmpg123_feature = function(const feature_key: shortint): cardinal; cdecl;
|
---|
153 |
|
---|
154 | const
|
---|
155 | MPG123_DONE = -12; // Message: Track ended.
|
---|
156 | MPG123_NEW_FORMAT = -11;
|
---|
157 | // Message: Output format will be different on next call.
|
---|
158 | MPG123_NEED_MORE = -10; // Message: For feed reader: "Feed me more!"
|
---|
159 | MPG123_ERR = -1; // <Generic Error>
|
---|
160 | MPG123_OK = 0; // <Success>
|
---|
161 | MPG123_BAD_OUTFORMAT = 1; // Unable to set up output format!
|
---|
162 | MPG123_BAD_CHANNEL = 2; // Invalid channel number specified.
|
---|
163 | MPG123_BAD_RATE = 3; // Invalid sample rate specified.
|
---|
164 | MPG123_ERR_16TO8TABLE = 4;
|
---|
165 | // Unable to allocate memory for 16 to 8 converter table!
|
---|
166 | MPG123_BAD_PARAM = 5; // Bad parameter id!
|
---|
167 | MPG123_BAD_BUFFER = 6;
|
---|
168 | // Bad buffer given -- invalid pointer or too small size.
|
---|
169 | MPG123_OUT_OF_MEM = 7; // Out of memory -- some malloc() failed.
|
---|
170 | MPG123_NOT_INITIALIZED = 8; // You didn't initialize the library!
|
---|
171 | MPG123_BAD_DECODER = 9; // Invalid decoder choice.
|
---|
172 | MPG123_BAD_HANDLE = 10; // Invalid mpg123 handle.
|
---|
173 | MPG123_NO_BUFFERS = 11; // Unable to initialize frame buffers (out of memory?).
|
---|
174 | MPG123_BAD_RVA = 12; // Invalid RVA mode.
|
---|
175 | MPG123_NO_GAPLESS = 13; // This build doesn't support gapless decoding.
|
---|
176 | MPG123_NO_SPACE = 14; // Not enough buffer space.
|
---|
177 | MPG123_BAD_TYPES = 15; // Incompatible numeric data types.
|
---|
178 | MPG123_BAD_BAND = 16; // Bad equalizer band.
|
---|
179 | MPG123_ERR_NULL = 17;
|
---|
180 | // Null pointer given where valid storage address needed.
|
---|
181 | MPG123_ERR_READER = 18; // Error reading the stream.
|
---|
182 | MPG123_NO_SEEK_FROM_END = 19; // Cannot seek from end (end is not known).
|
---|
183 | MPG123_BAD_WHENCE = 20; // Invalid 'whence' for seek function.
|
---|
184 | MPG123_NO_TIMEOUT = 21; // Build does not support stream timeouts.
|
---|
185 | MPG123_BAD_FILE = 22; // File access error.
|
---|
186 | MPG123_NO_SEEK = 23; // Seek not supported by stream.
|
---|
187 | MPG123_NO_READER = 24; // No stream opened.
|
---|
188 | MPG123_BAD_PARS = 25; // Bad parameter handle.
|
---|
189 | MPG123_BAD_INDEX_PAR = 26; // Bad parameters to mpg123_index()
|
---|
190 | MPG123_OUT_OF_SYNC = 27; // Lost track in bytestream and did not try to resync.
|
---|
191 | MPG123_RESYNC_FAIL = 28; // Resync failed to find valid MPEG data.
|
---|
192 | MPG123_NO_8BIT = 29; // No 8bit encoding possible.
|
---|
193 | MPG123_BAD_ALIGN = 30; // Stack aligmnent error
|
---|
194 | MPG123_NULL_BUFFER = 31; // NULL input buffer with non-zero size...
|
---|
195 | MPG123_NO_RELSEEK = 32; // Relative seek not possible (screwed up file offset)
|
---|
196 | MPG123_NULL_POINTER = 33;
|
---|
197 | // You gave a null pointer somewhere where you shouldn't have.
|
---|
198 | MPG123_BAD_KEY = 34; // Bad key value given.
|
---|
199 | MPG123_NO_INDEX = 35; // No frame index in this build.
|
---|
200 | MPG123_INDEX_FAIL = 36; // Something with frame index went wrong.
|
---|
201 | (* 1.72 *)
|
---|
202 | MPG123_BAD_DECODER_SETUP = 37; // Something prevents a proper decoder setup
|
---|
203 | MPG123_MISSING_FEATURE = 38; // This feature has not been built into libmpg123.
|
---|
204 | MPG123_BAD_VALUE = 39;
|
---|
205 | MPG123_LSEEK_FAILED = 40;
|
---|
206 | MPG123_BAD_CUSTOM_IO = 41;
|
---|
207 | MPG123_LFS_OVERFLOW = 42;
|
---|
208 |
|
---|
209 | type
|
---|
210 | Tmpg123_plain_strerror = function(errcode: integer): PChar; cdecl;
|
---|
211 | Tmpg123_strerror = function(mh: Tmpg123_handle): PChar; cdecl;
|
---|
212 | Tmpg123_errcode = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
213 | Tmpg123_decoders = function(): PPChar; cdecl;
|
---|
214 | Tmpg123_supported_decoders = function(): PPchar; cdecl;
|
---|
215 | Tmpg123_decoder = function(mh: Tmpg123_handle;
|
---|
216 | var decoder_name: PChar): integer; cdecl;
|
---|
217 | Tmpg123_current_decoder = function(mh: Tmpg123_handle): PChar; cdecl;
|
---|
218 |
|
---|
219 | const // mpg123_enc_enum
|
---|
220 | MPG123_ENC_8 = $00f; (**< 0000 0000 1111 Some 8 bit integer encoding. *)
|
---|
221 | MPG123_ENC_16 = $040; (**< 0000 0100 0000 Some 16 bit integer encoding. *)
|
---|
222 | MPG123_ENC_32 = $100; (**< 0001 0000 0000 Some 32 bit integer encoding. *)
|
---|
223 | MPG123_ENC_SIGNED = $080; (**< 0000 1000 0000 Some signed integer encoding. *)
|
---|
224 | MPG123_ENC_FLOAT = $800; (**< 1110 0000 0000 Some float encoding. *)
|
---|
225 | MPG123_ENC_SIGNED_16 = (MPG123_ENC_16 or MPG123_ENC_SIGNED or $10);
|
---|
226 | (**< 0000 1101 0000 signed 16 bit *)
|
---|
227 | MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16 or $20);
|
---|
228 | (**< 0000 0110 0000 unsigned 16 bit*)
|
---|
229 | MPG123_ENC_UNSIGNED_8 = $01;
|
---|
230 | (**< 0000 0000 0001 unsigned 8 bit*)
|
---|
231 | MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED or $02);
|
---|
232 | (**< 0000 1000 0010 signed 8 bit*)
|
---|
233 | MPG123_ENC_ULAW_8 = $04;
|
---|
234 | (**< 0000 0000 0100 ulaw 8 bit*)
|
---|
235 | MPG123_ENC_ALAW_8 = $08;
|
---|
236 | (**< 0000 0000 1000 alaw 8 bit *)
|
---|
237 | MPG123_ENC_SIGNED_32 = MPG123_ENC_32 or MPG123_ENC_SIGNED or $1000;
|
---|
238 | (**< 0001 1001 0000 signed 32 bit *)
|
---|
239 | MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32 or $2000;
|
---|
240 | (**< 0001 0010 0000 unsigned 32 bit *)
|
---|
241 | MPG123_ENC_FLOAT_32 = $200;
|
---|
242 | (**< 0010 0000 0000 32bit float *)
|
---|
243 | MPG123_ENC_FLOAT_64 = $400;
|
---|
244 | (**< 0100 0000 0000 64bit float *)
|
---|
245 | MPG123_ENC_ANY = MPG123_ENC_SIGNED_16 or MPG123_ENC_UNSIGNED_16 or
|
---|
246 | MPG123_ENC_UNSIGNED_8 or MPG123_ENC_SIGNED_8 or
|
---|
247 | MPG123_ENC_ULAW_8 or MPG123_ENC_ALAW_8 or
|
---|
248 | MPG123_ENC_SIGNED_32 or MPG123_ENC_UNSIGNED_32 or
|
---|
249 | MPG123_ENC_FLOAT_32 or MPG123_ENC_FLOAT_64; (**< any encoding *)
|
---|
250 |
|
---|
251 | MPG123_LEFT = $1;
|
---|
252 | MPG123_RIGHT = $2;
|
---|
253 | MPG123_LR = $3;
|
---|
254 |
|
---|
255 | type
|
---|
256 | {$if defined(cpu64)}
|
---|
257 | cuint64 = qword;
|
---|
258 | size_t = cuint64;
|
---|
259 | {$else}
|
---|
260 | cuint32 = longword;
|
---|
261 | size_t = cuint32;
|
---|
262 | {$endif}
|
---|
263 |
|
---|
264 | psize_t = ^size_t;
|
---|
265 | coff_t = size_t; //Int64;
|
---|
266 | PLong = Pointer;
|
---|
267 | pplong = array of PLong;
|
---|
268 | PInteger = Pointer;
|
---|
269 | PPInteger = array of PInteger;
|
---|
270 |
|
---|
271 | Tmpg123_rates = procedure(var list: pplong; var number: size_t); cdecl;
|
---|
272 | Tmpg123_encodings = procedure(var list: ppinteger; var number: size_t); cdecl;
|
---|
273 | Tmpg123_encsize = function(encoding: integer): integer; cdecl;
|
---|
274 | Tmpg123_format_none = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
275 | Tmpg123_format_all = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
276 | Tmpg123_format = function(mh: Tmpg123_handle; rate: cardinal;
|
---|
277 | channels: integer; encodings: integer): integer; cdecl;
|
---|
278 | Tmpg123_format_support = function(mh: Tmpg123_handle; rate: cardinal;
|
---|
279 | encoding: integer): integer; cdecl;
|
---|
280 | Tmpg123_getformat = function(mh: Tmpg123_handle; var rate: cardinal;
|
---|
281 | var channels, encoding: integer): integer; cdecl;
|
---|
282 | Tmpg123_open = function(mh: Tmpg123_handle; path: PChar): integer; cdecl;
|
---|
283 | Tmpg123_open_fd = function(mh: Tmpg123_handle; fd: integer): integer; cdecl;
|
---|
284 |
|
---|
285 | {$IF DEFINED(newversion)}
|
---|
286 | Tmpg123_open_handle = function(mh: Tmpg123_handle; pha: pointer): integer; cdecl;
|
---|
287 | {* Use an opaque handle as bitstream input. This works only with the
|
---|
288 | * replaced I/O from mpg123_replace_reader_handle()!
|
---|
289 | * mpg123_close() will call the cleanup callback for your handle (if you gave one).
|
---|
290 | * \return MPG123_OK on success
|
---|
291 | }
|
---|
292 | Tmpg123_replace_reader_handle = function(mh : Tmpg123_handle; r_read : pointer;
|
---|
293 | r_lseek : pointer ; cleanup : pointer): integer; cdecl;
|
---|
294 | {* Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors.
|
---|
295 | * The handle is a void pointer, so you can pass any data you want...
|
---|
296 | * mpg123_open_handle() is the call you make to use the I/O defined here.
|
---|
297 | * There is no fallback to internal read/seek here.
|
---|
298 | * Note: As it would be troublesome to mess with this while having a file open,
|
---|
299 | * this mpg123_close() is implied here.
|
---|
300 | * \param r_read The callback for reading (behaviour like posix read).
|
---|
301 | * \param r_lseek The callback for seeking (like posix lseek).
|
---|
302 | * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). }
|
---|
303 |
|
---|
304 | Tmpg123_replace_reader = function(mh : Tmpg123_handle; r_read : pointer;
|
---|
305 | r_lseek : pointer): integer; cdecl;
|
---|
306 | Tmpg123_getformat2 = function(mh: Tmpg123_handle; var rate: cardinal;
|
---|
307 | var channels, encoding: integer; var clear_flag: integer): integer; cdecl;
|
---|
308 | Tmpg123_framelength = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
309 | Tmpg123_framepos = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
310 | Tmpg123_spf = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
311 | Tmpg123_meta_free = procedure(mh: Tmpg123_handle); cdecl;
|
---|
312 | Tmpg123_set_index = function(mh: Tmpg123_handle; var offsets: PPInteger;
|
---|
313 | step: coff_t; fill: size_t): integer;
|
---|
314 |
|
---|
315 | {$if not(defined(cpu64) and defined(unix))}
|
---|
316 | Tmpg123_open_32 = function(mh: Tmpg123_handle; path: PChar): integer; cdecl;
|
---|
317 | Tmpg123_open_fd_32 = function(mh: Tmpg123_handle; fd: integer): integer; cdecl;
|
---|
318 | Tmpg123_open_handle_32 = function(mh: Tmpg123_handle; pha: pointer): integer; cdecl;
|
---|
319 | Tmpg123_decode_frame_32 = function(mh: Tmpg123_handle; var num: coff_t;
|
---|
320 | audio: PPChar; var bytes: size_t): integer; cdecl;
|
---|
321 | Tmpg123_framebyframe_decode_32 = function(mh: Tmpg123_handle; var num: coff_t;
|
---|
322 | audio: PPChar; var bytes: size_t): integer; cdecl;
|
---|
323 | Tmpg123_framepos_32 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
324 | Tmpg123_tell_32 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
325 | Tmpg123_tellframe_32 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
326 | Tmpg123_seek_32 = function(mh: Tmpg123_handle; sampleoff: coff_t;
|
---|
327 | whence: integer): integer; cdecl;
|
---|
328 | Tmpg123_feedseek_32 = function(mh: Tmpg123_handle; sampleoff: coff_t;
|
---|
329 | whence: integer; var input_offset: coff_t): coff_t; cdecl;
|
---|
330 | Tmpg123_seek_frame_32 = function(mh: Tmpg123_handle; frameoff: coff_t;
|
---|
331 | whence: integer): coff_t; cdecl;
|
---|
332 | Tmpg123_timeframe_32 = function(mh: Tmpg123_handle; sec: double): coff_t; cdecl;
|
---|
333 | Tmpg123_index_32 = function(mh: Tmpg123_handle; var offsets: PPInteger;
|
---|
334 | var step: coff_t; var fill: size_t): integer;
|
---|
335 | Tmpg123_set_index_32 = function(mh: Tmpg123_handle; var offsets: PPInteger;
|
---|
336 | step: coff_t; fill: size_t): integer;
|
---|
337 | Tmpg123_position_32 = function(mh: Tmpg123_handle; frame_offset: coff_t;
|
---|
338 | buffered_bytes: coff_t;
|
---|
339 | var current_frame: coff_t; var frames_left: coff_t;
|
---|
340 | var current_seconds: double;
|
---|
341 | var seconds_left: double): integer; cdecl;
|
---|
342 | Tmpg123_framelength_32 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
343 | Tmpg123_length_32 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
344 | Tmpg123_set_filesize_32 = function(mh: Tmpg123_handle; size: coff_t): integer; cdecl;
|
---|
345 | Tmpg123_replace_reader_32 = function(mh : Tmpg123_handle; r_read : pointer;
|
---|
346 | r_lseek : pointer): integer; cdecl;
|
---|
347 | Tmpg123_replace_reader_handle_32 = function(mh : Tmpg123_handle; r_read : pointer;
|
---|
348 | r_lseek : pointer ; cleanup : pointer): integer; cdecl;
|
---|
349 | {$endif}
|
---|
350 |
|
---|
351 |
|
---|
352 | Tmpg123_open_64 = function(mh: Tmpg123_handle; path: PChar): integer; cdecl;
|
---|
353 | Tmpg123_open_fd_64 = function(mh: Tmpg123_handle; fd: integer): integer; cdecl;
|
---|
354 | Tmpg123_open_handle_64 = function(mh: Tmpg123_handle; pha: pointer): integer; cdecl;
|
---|
355 | Tmpg123_decode_frame_64 = function(mh: Tmpg123_handle; var num: coff_t;
|
---|
356 | audio: PPChar; var bytes: size_t): integer; cdecl;
|
---|
357 | Tmpg123_framebyframe_decode_64 = function(mh: Tmpg123_handle; var num: coff_t;
|
---|
358 | audio: PPChar; var bytes: size_t): integer; cdecl;
|
---|
359 | Tmpg123_framepos_64 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
360 | Tmpg123_tell_64 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
361 | Tmpg123_tellframe_64 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
362 | Tmpg123_seek_64 = function(mh: Tmpg123_handle; sampleoff: coff_t;
|
---|
363 | whence: integer): integer; cdecl;
|
---|
364 | Tmpg123_feedseek_64 = function(mh: Tmpg123_handle; sampleoff: coff_t;
|
---|
365 | whence: integer; var input_offset: coff_t): coff_t; cdecl;
|
---|
366 | Tmpg123_seek_frame_64 = function(mh: Tmpg123_handle; frameoff: coff_t;
|
---|
367 | whence: integer): coff_t; cdecl;
|
---|
368 | Tmpg123_timeframe_64 = function(mh: Tmpg123_handle; sec: double): coff_t; cdecl;
|
---|
369 | Tmpg123_index_64 = function(mh: Tmpg123_handle; var offsets: PPInteger;
|
---|
370 | var step: coff_t; var fill: size_t): integer;
|
---|
371 | Tmpg123_set_index_64 = function(mh: Tmpg123_handle; var offsets: PPInteger;
|
---|
372 | step: coff_t; fill: size_t): integer;
|
---|
373 | Tmpg123_position_64 = function(mh: Tmpg123_handle; frame_offset: coff_t;
|
---|
374 | buffered_bytes: coff_t;
|
---|
375 | var current_frame: coff_t; var frames_left: coff_t;
|
---|
376 | var current_seconds: double;
|
---|
377 | var seconds_left: double): integer; cdecl;
|
---|
378 | Tmpg123_framelength_64 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
379 | Tmpg123_length_64 = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
380 | Tmpg123_set_filesize_64 = function(mh: Tmpg123_handle; size: coff_t): integer; cdecl;
|
---|
381 | Tmpg123_replace_reader_64 = function(mh : Tmpg123_handle; r_read : pointer;
|
---|
382 | r_lseek : pointer): integer; cdecl;
|
---|
383 | Tmpg123_replace_reader_handle_64 = function(mh : Tmpg123_handle; r_read : pointer;
|
---|
384 | r_lseek : pointer ; cleanup : pointer): integer; cdecl;
|
---|
385 | {$endif}
|
---|
386 |
|
---|
387 | Tmpg123_open_feed = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
388 | Tmpg123_close = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
389 | Tmpg123_read = function(mh: Tmpg123_handle; outmemory: pcfloat;
|
---|
390 | outmemsize: size_t; var done: size_t): integer; cdecl;
|
---|
391 | Tmpg123_feed = function(mh: Tmpg123_handle; inbuf: Pointer;
|
---|
392 | size: size_t): integer; cdecl;
|
---|
393 | Tmpg123_decode = function(mh: Tmpg123_handle; inmemory: Pointer;
|
---|
394 | inmemsize: size_t; outmemory: Pointer;
|
---|
395 | outmemsize: size_t; var done: size_t): integer; cdecl;
|
---|
396 | Tmpg123_decode_frame = function(mh: Tmpg123_handle; var num: coff_t;
|
---|
397 | audio: PPChar; var bytes: size_t): integer; cdecl;
|
---|
398 |
|
---|
399 | {$IF DEFINED(newversion)}
|
---|
400 | Tmpg123_framebyframe_decode = function(mh: Tmpg123_handle; var num: coff_t;
|
---|
401 | audio: PPChar; var bytes: size_t): integer; cdecl;
|
---|
402 | Tmpg123_framebyframe_next = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
403 | Tmpg123_framedata = function(mh: Tmpg123_handle; var header: longint;
|
---|
404 | bodydata: PPChar; var bodybytes: size_t): integer; cdecl;
|
---|
405 | {$endif}
|
---|
406 |
|
---|
407 | Tmpg123_tell = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
408 | Tmpg123_tellframe = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
409 | Tmpg123_tell_stream = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
410 | Tmpg123_seek = function(mh: Tmpg123_handle; sampleoff: coff_t;
|
---|
411 | whence: integer): integer; cdecl;
|
---|
412 | Tmpg123_feedseek = function(mh: Tmpg123_handle; sampleoff: coff_t;
|
---|
413 | whence: integer; var input_offset: coff_t): coff_t;
|
---|
414 | cdecl;
|
---|
415 | Tmpg123_seek_frame = function(mh: Tmpg123_handle; frameoff: coff_t;
|
---|
416 | whence: integer): coff_t; cdecl;
|
---|
417 | Tmpg123_timeframe = function(mh: Tmpg123_handle; sec: double): coff_t; cdecl;
|
---|
418 | Tmpg123_index = function(mh: Tmpg123_handle; var offsets: PPInteger;
|
---|
419 | var step: coff_t; var fill: size_t): integer;
|
---|
420 | Tmpg123_position = function(mh: Tmpg123_handle; frame_offset: coff_t;
|
---|
421 | buffered_bytes: coff_t;
|
---|
422 | var current_frame: coff_t; var frames_left: coff_t;
|
---|
423 | var current_seconds: double;
|
---|
424 | var seconds_left: double): integer; cdecl;
|
---|
425 | Tmpg123_eq = function(mh: Tmpg123_handle; mpg123_channels_channel: integer;
|
---|
426 | band: integer; val: double): integer; cdecl;
|
---|
427 | Tmpg123_geteq = function(mh: Tmpg123_handle; mpg123_channels_channel: integer;
|
---|
428 | band: integer): double; cdecl;
|
---|
429 | Tmpg123_reset_eq = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
430 | Tmpg123_volume = function(mh: Tmpg123_handle; vol: double): integer; cdecl;
|
---|
431 | Tmpg123_volume_change = function(mh: Tmpg123_handle; change: double): integer; cdecl;
|
---|
432 | Tmpg123_getvolume = function(mh: Tmpg123_handle; var base: double;
|
---|
433 | var really: double; var rva_db: double): integer;
|
---|
434 | cdecl;
|
---|
435 |
|
---|
436 | const
|
---|
437 | MPG123_CBR = 0; (**< Constant Bitrate Mode (default) *)
|
---|
438 | MPG123_VBR = 1; (**< Variable Bitrate Mode *)
|
---|
439 | MPG123_ABR = 2; (**< Average Bitrate Mode *)
|
---|
440 |
|
---|
441 | (** enum mpg123_version - Enumeration of the MPEG Versions *)
|
---|
442 | MPG123_1_0 = 0; (**< MPEG Version 1.0 *)
|
---|
443 | MPG123_2_0 = 1; (**< MPEG Version 2.0 *)
|
---|
444 | MPG123_2_5 = 2; (**< MPEG Version 2.5 *)
|
---|
445 |
|
---|
446 | (** enum mpg123_mode - Enumeration of the MPEG Audio mode.
|
---|
447 | * Only the mono mode has 1 channel, the others have 2 channels. *)
|
---|
448 | MPG123_M_STEREO = 0; (**< Standard Stereo. *)
|
---|
449 | MPG123_M_JOINT = 1; (**< Joint Stereo. *)
|
---|
450 | MPG123_M_DUAL = 2; (**< Dual Channel. *)
|
---|
451 | MPG123_M_MONO = 3; (**< Single Channel. *)
|
---|
452 |
|
---|
453 | (** enum mpg123_flags - Enumeration of the MPEG Audio flag bits *)
|
---|
454 | MPG123_CRC = $1; (**< The bitstream is error protected using 16-bit CRC. *)
|
---|
455 | MPG123_COPYRIGHT = $2; (**< The bitstream is copyrighted. *)
|
---|
456 | MPG123_PRIVATE = $4; (**< The private bit has been set. *)
|
---|
457 | MPG123_ORIGINAL = $8; (**< The bitstream is an original, not a copy. *)
|
---|
458 |
|
---|
459 | (** Data structure for storing information about a frame of MPEG Audio *)
|
---|
460 | type
|
---|
461 | pmpg123_frameinfo = ^Tmpg123_frameinfo;
|
---|
462 | Tmpg123_frameinfo = record
|
---|
463 | mpg123_version_version: longword; (**< The MPEG version (1.0/2.0/2.5). *)
|
---|
464 | layer: integer; (**< The MPEG Audio Layer (MP1/MP2/MP3). *)
|
---|
465 | rate: longword; (**< The sampling rate in Hz. *)
|
---|
466 | mpg123_mode_mode: longint;
|
---|
467 | (**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). *)
|
---|
468 | mode_ext: integer; (**< The mode extension bit flag. *)
|
---|
469 | framesize: integer; (**< The size of the frame (in bytes). *)
|
---|
470 | mpg123_flags_flags: longword; (**< MPEG Audio flag bits. *)
|
---|
471 | emphasis: integer; (**< The emphasis type. *)
|
---|
472 | bitrate: integer; (**< Bitrate of the frame (kbps). *)
|
---|
473 | abr_rate: integer; (**< The target average bitrate. *)
|
---|
474 | mpg123_vbr_vbr: longword; (**< The VBR mode. *)
|
---|
475 | end;
|
---|
476 |
|
---|
477 | Tmpg123_info = function(mh: Tmpg123_handle;
|
---|
478 | var mi: Tmpg123_frameinfo): integer; cdecl;
|
---|
479 | Tmpg123_safe_buffer = function(): size_t; cdecl;
|
---|
480 | Tmpg123_scan = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
481 | Tmpg123_length = function(mh: Tmpg123_handle): coff_t; cdecl;
|
---|
482 | Tmpg123_set_filesize = function(mh: Tmpg123_handle; size: coff_t): integer; cdecl;
|
---|
483 | Tmpg123_tpf = function(mh: Tmpg123_handle): double; cdecl;
|
---|
484 | Tmpg123_clip = function(mh: Tmpg123_handle): longint; cdecl;
|
---|
485 |
|
---|
486 | const
|
---|
487 | MPG123_ACCURATE = 1;
|
---|
488 | (**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) *)
|
---|
489 |
|
---|
490 | type
|
---|
491 | Tmpg123_getstate = function(mh: Tmpg123_handle; mpg123_state_key: integer;
|
---|
492 | var val: longint; var fval: double): integer; cdecl;
|
---|
493 | Pmpg123_string = ^Tmpg123_string;
|
---|
494 |
|
---|
495 | Tmpg123_string = record
|
---|
496 | p: PChar; (**< pointer to the string data *)
|
---|
497 | size: size_t; (**< raw number of bytes allocated *)
|
---|
498 | fill: size_t;
|
---|
499 | (**< number of used bytes (including closing zero byte) *)
|
---|
500 | end;
|
---|
501 |
|
---|
502 | Tmpg123_init_string = procedure(psb: Pmpg123_string); cdecl;
|
---|
503 | Tmpg123_free_string = procedure(psb: Pmpg123_string); cdecl;
|
---|
504 | Tmpg123_resize_string = function(psb: Pmpg123_string; news: size_t): integer; cdecl;
|
---|
505 | Tmpg123_grow_string = function(psb: Pmpg123_string; news: size_t): integer; cdecl;
|
---|
506 | Tmpg123_copy_string = function(strfrom, strto: Pmpg123_string): integer; cdecl;
|
---|
507 | Tmpg123_add_string = function(psb: Pmpg123_string; stuff: PChar): integer; cdecl;
|
---|
508 | Tmpg123_add_substring = function(psb: Pmpg123_string; stuff: PChar;
|
---|
509 | strfrom, Count: size_t): integer; cdecl;
|
---|
510 | Tmpg123_set_string = function(psb: Pmpg123_string; stuff: PChar): integer; cdecl;
|
---|
511 | Tmpg123_set_substring = function(psb: Pmpg123_string; stuff: PChar;
|
---|
512 | strfrom, Count: size_t): integer; cdecl;
|
---|
513 | Tmpg123_strlen = function(psb: Pmpg123_string; utf8: integer): size_t;
|
---|
514 |
|
---|
515 | {$IF DEFINED(newversion)}
|
---|
516 | Tmpg123_chomp_string = function(psb: Pmpg123_string): integer;
|
---|
517 | {$endif}
|
---|
518 |
|
---|
519 | const
|
---|
520 | mpg123_text_unknown = 0;
|
---|
521 | mpg123_text_utf8 = 1;
|
---|
522 | mpg123_text_latin1 = 2;
|
---|
523 | mpg123_text_icy = 3;
|
---|
524 | mpg123_text_cp1252 = 4;
|
---|
525 | mpg123_text_utf16 = 5;
|
---|
526 | mpg123_text_utf16bom = 6;
|
---|
527 | mpg123_text_utf16be = 7;
|
---|
528 | mpg123_text_max = 7;
|
---|
529 | mpg123_id3_latin1 = 0;
|
---|
530 | mpg123_id3_utf16bom = 1;
|
---|
531 | mpg123_id3_utf16be = 2;
|
---|
532 | mpg123_id3_utf8 = 3;
|
---|
533 | mpg123_id3_enc_max = 3;
|
---|
534 |
|
---|
535 | type
|
---|
536 | Tmpg123_enc_from_id3 = function(id3_enc_byte: byte): integer; cdecl;
|
---|
537 | Tmpg123_store_utf8 = function(psb: Pmpg123_string; mpg123_text_encoding: integer;
|
---|
538 | var Source: byte;
|
---|
539 | source_size: size_t): integer; cdecl;
|
---|
540 | Pmpg123_text = ^Tmpg123_text;
|
---|
541 |
|
---|
542 | Tmpg123_text = record
|
---|
543 | lang: array[0..2] of char;
|
---|
544 | (**< Three-letter language code (not terminated). *)
|
---|
545 | id: array[0..3] of char;
|
---|
546 | (**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). *)
|
---|
547 | description: Tmpg123_string; (**< Empty for the generic comment... *)
|
---|
548 | Text: Tmpg123_string; (**< ... *)
|
---|
549 | end;
|
---|
550 |
|
---|
551 | {$IF DEFINED(newversion)}
|
---|
552 | {* The picture type values from ID3v2. }
|
---|
553 | mpg123_id3_pic_type = Longint;
|
---|
554 | const
|
---|
555 | mpg123_id3_pic_other = 0;
|
---|
556 | mpg123_id3_pic_icon = 1;
|
---|
557 | mpg123_id3_pic_other_icon = 2;
|
---|
558 | mpg123_id3_pic_front_cover = 3;
|
---|
559 | mpg123_id3_pic_back_cover = 4;
|
---|
560 | mpg123_id3_pic_leaflet = 5;
|
---|
561 | mpg123_id3_pic_media = 6;
|
---|
562 | mpg123_id3_pic_lead = 7;
|
---|
563 | mpg123_id3_pic_artist = 8;
|
---|
564 | mpg123_id3_pic_conductor = 9;
|
---|
565 | mpg123_id3_pic_orchestra = 10;
|
---|
566 | mpg123_id3_pic_composer = 11;
|
---|
567 | mpg123_id3_pic_lyricist = 12;
|
---|
568 | mpg123_id3_pic_location = 13;
|
---|
569 | mpg123_id3_pic_recording = 14;
|
---|
570 | mpg123_id3_pic_performance = 15;
|
---|
571 | mpg123_id3_pic_video = 16;
|
---|
572 | mpg123_id3_pic_fish = 17;
|
---|
573 | mpg123_id3_pic_illustration = 18;
|
---|
574 | mpg123_id3_pic_artist_logo = 19;
|
---|
575 | mpg123_id3_pic_publisher_logo = 20;
|
---|
576 |
|
---|
577 | {* Sub data structure for ID3v2, for storing picture data including comment.
|
---|
578 | * This is for the ID3v2 APIC field. You should consult the ID3v2 specification
|
---|
579 | * for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields"
|
---|
580 | * here to separate from MPEG frames). }
|
---|
581 |
|
---|
582 | type
|
---|
583 | PPmpg123_picture = ^Pmpg123_picture;
|
---|
584 | Pmpg123_picture = ^Tmpg123_picture;
|
---|
585 |
|
---|
586 | Tmpg123_picture = record
|
---|
587 | pictype : char;
|
---|
588 | description : Tmpg123_string;
|
---|
589 | mime_type : Tmpg123_string;
|
---|
590 | size : size_t;
|
---|
591 | data : Pbyte;
|
---|
592 | end;
|
---|
593 |
|
---|
594 | {$endif}
|
---|
595 |
|
---|
596 | type
|
---|
597 | PPmpg123_id3v2 = ^Pmpg123_id3v2;
|
---|
598 | Pmpg123_id3v2 = ^Tmpg123_id3v2;
|
---|
599 |
|
---|
600 | Tmpg123_id3v2 = record
|
---|
601 | Version: byte; (**< 3 or 4 for ID3v2.3 or ID3v2.4. *)
|
---|
602 | Title: Pmpg123_string;
|
---|
603 | (**< Title string (pointer into text_list). *)
|
---|
604 | Artist: Pmpg123_string;
|
---|
605 | (**< Artist string (pointer into text_list). *)
|
---|
606 | Album: Pmpg123_string;
|
---|
607 | (**< Album string (pointer into text_list). *)
|
---|
608 | Year: Pmpg123_string;
|
---|
609 | (**< The year as a string (pointer into text_list). *)
|
---|
610 | Genre: Pmpg123_string; (**< Genre String (pointer into text_list). The genre string(s)
|
---|
611 | may very well need postprocessing, esp. for ID3v2.3. *)
|
---|
612 | Comment: Pmpg123_string;
|
---|
613 | (**< Pointer to last encountered comment text with empty description. *)
|
---|
614 | (* Encountered ID3v2 fields are appended to these lists.
|
---|
615 | There can be multiple occurences, the pointers above always point
|
---|
616 | to the last encountered data. *)
|
---|
617 | Comment_list: Pmpg123_text; (**< Array of comments. *)
|
---|
618 | NumComments: size_t; (**< Number of comments. *)
|
---|
619 | Text: Pmpg123_text; (**< Array of ID3v2 text fields *)
|
---|
620 | NumTexts: size_t; (**< Numer of text fields. *)
|
---|
621 | Extra: Pmpg123_text;
|
---|
622 | (**< The array of extra (TXXX) fields. *)
|
---|
623 | NumExtras: size_t;
|
---|
624 | (**< Number of extra text (TXXX) fields. *)
|
---|
625 |
|
---|
626 | {$IF DEFINED(newversion)}
|
---|
627 | picture : Pmpg123_picture;
|
---|
628 | pictures : size_t;
|
---|
629 | {$endif}
|
---|
630 | end;
|
---|
631 |
|
---|
632 | PPmpg123_id3v1 = ^Pmpg123_id3v1;
|
---|
633 | Pmpg123_id3v1 = ^Tmpg123_id3v1;
|
---|
634 | Tmpg123_id3v1 = record
|
---|
635 | tag: array[0..2] of char;
|
---|
636 | (**< Always the string "TAG", the classic intro. *)
|
---|
637 | title: array[0..29] of char; (**< Title string. *)
|
---|
638 | artist: array[0..29] of char; (**< Artist string. *)
|
---|
639 | album: array[0..29] of char; (**< Album string. *)
|
---|
640 | year: array[0..3] of char; (**< Year string. *)
|
---|
641 | comment: array[0..29] of char; (**< Comment string. *)
|
---|
642 | genre: byte; (**< Genre index. *)
|
---|
643 | end;
|
---|
644 |
|
---|
645 | const
|
---|
646 | MPG123_ID3_ = $03;
|
---|
647 | (**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. *)
|
---|
648 | MPG123_NEW_ID3_ = $01;
|
---|
649 | (**< 0001 There is ID3 info that changed since last call to mpg123_id3. *)
|
---|
650 | MPG123_ICY_ = $0C;
|
---|
651 | (**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*)
|
---|
652 | MPG123_NEW_ICY_ = $04;
|
---|
653 | (**< 0100 There is ICY info that changed since last call to mpg123_icy. *)
|
---|
654 |
|
---|
655 | type
|
---|
656 | Tmpg123_meta_check = function(mh: Tmpg123_handle): integer; cdecl;
|
---|
657 | Tmpg123_id3 = function(mh: Tmpg123_handle; v1: PPmpg123_id3v1;
|
---|
658 | v2: PPmpg123_id3v2): integer; cdecl;
|
---|
659 | Tmpg123_icy = function(mh: Tmpg123_handle; var icy_meta: PChar): integer; cdecl;
|
---|
660 | // Tmpg123_icy = function(mh: Tmpg123_handle; icy_meta: PPChar): integer; cdecl;
|
---|
661 | Tmpg123_icy2utf8 = function(icy_text: PChar): PChar; cdecl;
|
---|
662 |
|
---|
663 | const
|
---|
664 | _NUM_CHANNELS = 2;
|
---|
665 | _MPG123_RATES = 9;
|
---|
666 | _MPG123_ENCODINGS = 10;
|
---|
667 |
|
---|
668 | type
|
---|
669 | Pmpg123_pars = ^Tmpg123_pars;
|
---|
670 |
|
---|
671 | Tmpg123_pars = record
|
---|
672 | verbose: integer; (* verbose level *)
|
---|
673 | flags: longword; (* combination of above *)
|
---|
674 | force_rate: longword;
|
---|
675 | down_sample: integer;
|
---|
676 | rva: integer; (* (which) rva to do:
|
---|
677 | 0: nothing,
|
---|
678 | 1: radio/mix/track
|
---|
679 | 2: album/audiophile *)
|
---|
680 | halfspeed: longword;
|
---|
681 | doublespeed: longword;
|
---|
682 | {$IFNDEF WINDOWS}
|
---|
683 | timeout: longword;
|
---|
684 | {$ENDIF}
|
---|
685 | audio_caps: array[0.._NUM_CHANNELS - 1, 0.._MPG123_RATES,
|
---|
686 | 0.._MPG123_ENCODINGS - 1] of char;
|
---|
687 | (* long start_frame; *)(* frame offset to begin with *)
|
---|
688 | (* long frame_number;*)(* number of frames to decode *)
|
---|
689 | icy_interval: longword;
|
---|
690 | outscale: double; // longword ?
|
---|
691 | resync_limit: longword;
|
---|
692 | index_size: longint;
|
---|
693 | (* Long, because: negative values have a meaning. *)
|
---|
694 | dummy: array[0..64] of byte; // dummy
|
---|
695 | end;
|
---|
696 |
|
---|
697 | Tmpg123_parnew = function(mp: Pmpg123_pars; decoder: PChar;
|
---|
698 | var error: integer): Tmpg123_handle; cdecl;
|
---|
699 | Tmpg123_new_pars = function(var error: integer): Pmpg123_pars; cdecl;
|
---|
700 | Tmpg123_delete_pars = procedure(mp: Pmpg123_pars); cdecl;
|
---|
701 | Tmpg123_fmt_none = function(mp: Pmpg123_pars): integer; cdecl;
|
---|
702 | Tmpg123_fmt_all = function(mp: Pmpg123_pars): integer; cdecl;
|
---|
703 | Tmpg123_fmt = function(mh: Pmpg123_pars; rate: longword;
|
---|
704 | channels, encodings: integer): integer; cdecl;
|
---|
705 | Tmpg123_fmt_support = function(mh: Pmpg123_pars; rate: longword;
|
---|
706 | encoding: integer): integer; cdecl;
|
---|
707 | Tmpg123_par = function(mp: Pmpg123_pars; mpg123_parms_type: integer;
|
---|
708 | Value: longword; fvalue: double): integer;
|
---|
709 | cdecl;
|
---|
710 | Tmpg123_getpar = function(mp: Pmpg123_pars; mpg123_parms_type: integer;
|
---|
711 | var val: longword; var fval: double)
|
---|
712 | : integer; cdecl;
|
---|
713 | Tmpg123_replace_buffer = function(mh: Tmpg123_handle; Data: Pointer;
|
---|
714 | size: size_t): integer; cdecl;
|
---|
715 |
|
---|
716 | Tmpg123_outblock = function(mh: Tmpg123_handle): size_t; cdecl;
|
---|
717 |
|
---|
718 | { *** the mpg123 library functions : ***************************************** }
|
---|
719 | var
|
---|
720 | mpg123_init: Tmpg123_init;
|
---|
721 | mpg123_exit: Tmpg123_exit;
|
---|
722 | mpg123_new: Tmpg123_new;
|
---|
723 | mpg123_delete: Tmpg123_delete;
|
---|
724 |
|
---|
725 | mpg123_param: Tmpg123_param;
|
---|
726 | mpg123_getparam: Tmpg123_getparam;
|
---|
727 | mpg123_feature: Tmpg123_feature;
|
---|
728 |
|
---|
729 | mpg123_plain_strerror: Tmpg123_plain_strerror;
|
---|
730 | mpg123_strerror: Tmpg123_strerror;
|
---|
731 | mpg123_errcode: Tmpg123_errcode;
|
---|
732 | mpg123_decoders: Tmpg123_decoders;
|
---|
733 | mpg123_supported_decoders: Tmpg123_supported_decoders;
|
---|
734 | mpg123_decoder: Tmpg123_decoder;
|
---|
735 | mpg123_current_decoder: Tmpg123_current_decoder;
|
---|
736 |
|
---|
737 | mpg123_rates: Tmpg123_rates;
|
---|
738 | mpg123_encodings: Tmpg123_encodings;
|
---|
739 | mpg123_encsize: Tmpg123_encsize;
|
---|
740 | mpg123_format_none: Tmpg123_format_none;
|
---|
741 | mpg123_format_all: Tmpg123_format_all;
|
---|
742 | mpg123_format: Tmpg123_format;
|
---|
743 | mpg123_format_support: Tmpg123_format_support;
|
---|
744 | mpg123_getformat: Tmpg123_getformat;
|
---|
745 | mpg123_getformat2: Tmpg123_getformat2;
|
---|
746 |
|
---|
747 | (** \defgroup mpg123_input mpg123 file input and decoding
|
---|
748 | * Functions for input bitstream and decoding operations. *)
|
---|
749 |
|
---|
750 | mpg123_open: Tmpg123_open;
|
---|
751 | mpg123_open_fd: Tmpg123_open_fd;
|
---|
752 |
|
---|
753 | {$IF DEFINED(newversion)}
|
---|
754 | {$if not(defined(cpu64) and defined(unix))}
|
---|
755 | mpg123_open_32: Tmpg123_open_32;
|
---|
756 | mpg123_open_fd_32: Tmpg123_open_fd_32;
|
---|
757 | mpg123_open_handle_32 : Tmpg123_open_handle_32;
|
---|
758 | {$ifend}
|
---|
759 | mpg123_open_64: Tmpg123_open_64;
|
---|
760 | mpg123_open_fd_64: Tmpg123_open_fd_64;
|
---|
761 | mpg123_open_handle: Tmpg123_open_handle;
|
---|
762 | mpg123_open_handle_64: Tmpg123_open_handle_64;
|
---|
763 | mpg123_replace_reader: Tmpg123_replace_reader;
|
---|
764 | mpg123_replace_reader_handle: Tmpg123_replace_reader_handle;
|
---|
765 | mpg123_set_index: Tmpg123_set_index;
|
---|
766 | {$endif}
|
---|
767 |
|
---|
768 | mpg123_open_feed: Tmpg123_open_feed;
|
---|
769 | mpg123_close: Tmpg123_close;
|
---|
770 | mpg123_read: Tmpg123_read;
|
---|
771 | mpg123_feed: Tmpg123_feed;
|
---|
772 | mpg123_decode: Tmpg123_decode;
|
---|
773 | mpg123_decode_frame: Tmpg123_decode_frame;
|
---|
774 | mpg123_framepos: Tmpg123_framepos;
|
---|
775 |
|
---|
776 | {$IF DEFINED(newversion)}
|
---|
777 | {$if not(defined(cpu64) and defined(unix))}
|
---|
778 | mpg123_decode_frame_32: Tmpg123_decode_frame_32;
|
---|
779 | mpg123_framebyframe_decode_32: Tmpg123_framebyframe_decode_32;
|
---|
780 | mpg123_tell_32: Tmpg123_tell_32;
|
---|
781 | mpg123_framepos_32: Tmpg123_framepos_32;
|
---|
782 | mpg123_tellframe_32: Tmpg123_tellframe_32;
|
---|
783 | mpg123_seek_32: Tmpg123_seek_32;
|
---|
784 | mpg123_seek_frame_32: Tmpg123_seek_frame_32;
|
---|
785 | mpg123_timeframe_32: Tmpg123_timeframe_32;
|
---|
786 | mpg123_index_32: Tmpg123_index_32;
|
---|
787 | mpg123_set_index_32: Tmpg123_set_index_32;
|
---|
788 | mpg123_position_32: Tmpg123_position_32;
|
---|
789 | mpg123_framelength_32: Tmpg123_framelength_32;
|
---|
790 | mpg123_length_32: Tmpg123_length_32;
|
---|
791 | mpg123_set_filesize_32: Tmpg123_set_filesize_32;
|
---|
792 | mpg123_replace_reader_32: Tmpg123_replace_reader_32;
|
---|
793 | mpg123_replace_reader_handle_32: Tmpg123_replace_reader_handle_32;
|
---|
794 | {$ifend}
|
---|
795 | mpg123_framebyframe_decode: Tmpg123_framebyframe_decode;
|
---|
796 | mpg123_framebyframe_next: Tmpg123_framebyframe_next;
|
---|
797 | mpg123_framedata: Tmpg123_framedata;
|
---|
798 | mpg123_decode_frame_64: Tmpg123_decode_frame_64;
|
---|
799 | mpg123_framebyframe_decode_64: Tmpg123_framebyframe_decode_64;
|
---|
800 | mpg123_tell_64: Tmpg123_tell_64;
|
---|
801 | mpg123_framepos_64: Tmpg123_framepos_64;
|
---|
802 | mpg123_tellframe_64: Tmpg123_tellframe_64;
|
---|
803 | mpg123_seek_64: Tmpg123_seek_64;
|
---|
804 | mpg123_seek_frame_64: Tmpg123_seek_frame_64;
|
---|
805 | mpg123_timeframe_64: Tmpg123_timeframe_64;
|
---|
806 | mpg123_index_64: Tmpg123_index_64;
|
---|
807 | mpg123_set_index_64: Tmpg123_set_index_64;
|
---|
808 | mpg123_position_64: Tmpg123_position_64;
|
---|
809 | mpg123_framelength_64: Tmpg123_framelength_64;
|
---|
810 | mpg123_length_64: Tmpg123_length_64;
|
---|
811 | mpg123_set_filesize_64: Tmpg123_set_filesize_64;
|
---|
812 | mpg123_replace_reader_64: Tmpg123_replace_reader_64;
|
---|
813 | mpg123_replace_reader_handle_64: Tmpg123_replace_reader_handle_64;
|
---|
814 | {$endif}
|
---|
815 |
|
---|
816 | mpg123_tell: Tmpg123_tell;
|
---|
817 | mpg123_tellframe: Tmpg123_tellframe;
|
---|
818 | mpg123_tell_stream: Tmpg123_tell_stream;
|
---|
819 | mpg123_seek: Tmpg123_seek;
|
---|
820 | mpg123_feedseek: Tmpg123_feedseek;
|
---|
821 | mpg123_seek_frame: Tmpg123_seek_frame;
|
---|
822 | mpg123_timeframe: Tmpg123_timeframe;
|
---|
823 | mpg123_index: Tmpg123_index;
|
---|
824 | mpg123_position: Tmpg123_position;
|
---|
825 |
|
---|
826 | (** \defgroup mpg123_voleq mpg123 volume and equalizer **)
|
---|
827 | mpg123_eq: Tmpg123_eq;
|
---|
828 | mpg123_geteq: Tmpg123_geteq;
|
---|
829 | mpg123_reset_eq: Tmpg123_reset_eq;
|
---|
830 | mpg123_volume: Tmpg123_volume;
|
---|
831 | mpg123_volume_change: Tmpg123_volume_change;
|
---|
832 | mpg123_getvolume: Tmpg123_getvolume;
|
---|
833 |
|
---|
834 | (** \defgroup mpg123_status mpg123 status and information **)
|
---|
835 | mpg123_info: Tmpg123_info;
|
---|
836 | mpg123_safe_buffer: Tmpg123_safe_buffer;
|
---|
837 | mpg123_scan: Tmpg123_scan;
|
---|
838 | mpg123_length: Tmpg123_length;
|
---|
839 | mpg123_framelength: Tmpg123_framelength;
|
---|
840 | mpg123_set_filesize: Tmpg123_set_filesize;
|
---|
841 | mpg123_tpf: Tmpg123_tpf;
|
---|
842 | mpg123_spf: Tmpg123_spf;
|
---|
843 | mpg123_clip: Tmpg123_clip;
|
---|
844 | mpg123_getstate: Tmpg123_getstate;
|
---|
845 |
|
---|
846 | (** \defgroup mpg123_metadata mpg123 metadata handling *)
|
---|
847 | mpg123_init_string: Tmpg123_init_string;
|
---|
848 | mpg123_free_string: Tmpg123_free_string;
|
---|
849 | mpg123_resize_string: Tmpg123_resize_string;
|
---|
850 | mpg123_grow_string: Tmpg123_grow_string;
|
---|
851 | mpg123_copy_string: Tmpg123_copy_string;
|
---|
852 | mpg123_add_string: Tmpg123_add_string;
|
---|
853 | mpg123_add_substring: Tmpg123_add_substring;
|
---|
854 | mpg123_set_string: Tmpg123_set_string;
|
---|
855 | mpg123_set_substring: Tmpg123_set_substring;
|
---|
856 | mpg123_strlen: Tmpg123_strlen;
|
---|
857 | mpg123_chomp_string :Tmpg123_chomp_string;
|
---|
858 |
|
---|
859 | mpg123_enc_from_id3: Tmpg123_enc_from_id3;
|
---|
860 | mpg123_store_utf8: Tmpg123_store_utf8;
|
---|
861 |
|
---|
862 | mpg123_meta_check: Tmpg123_meta_check;
|
---|
863 | mpg123_meta_free: Tmpg123_meta_free;
|
---|
864 | mpg123_id3: Tmpg123_id3;
|
---|
865 | mpg123_icy: Tmpg123_icy;
|
---|
866 | mpg123_icy2utf8: Tmpg123_icy2utf8;
|
---|
867 |
|
---|
868 | (** \defgroup mpg123_advpar mpg123 advanced parameter API *)
|
---|
869 | mpg123_parnew: Tmpg123_parnew;
|
---|
870 | mpg123_new_pars: Tmpg123_new_pars;
|
---|
871 | mpg123_delete_pars: Tmpg123_delete_pars;
|
---|
872 | mpg123_fmt_none: Tmpg123_fmt_none;
|
---|
873 | mpg123_fmt_all: Tmpg123_fmt_all;
|
---|
874 | mpg123_fmt: Tmpg123_fmt;
|
---|
875 | mpg123_fmt_support: Tmpg123_fmt_support;
|
---|
876 | mpg123_par: Tmpg123_par;
|
---|
877 | mpg123_getpar: Tmpg123_getpar;
|
---|
878 | mpg123_replace_buffer: Tmpg123_replace_buffer;
|
---|
879 | mpg123_outblock: Tmpg123_outblock;
|
---|
880 |
|
---|
881 | {Special function for dynamic loading of lib ...}
|
---|
882 |
|
---|
883 | var
|
---|
884 | Mp_Handle: TLibHandle;
|
---|
885 | // this will hold our handle for the lib; it functions nicely as a mutli-lib prevention unit as well...
|
---|
886 | ReferenceCounter: cardinal = 0; // Reference counter
|
---|
887 |
|
---|
888 | function mp_IsLoaded: boolean; inline;
|
---|
889 | function mp_load(const libfilename: string): boolean; // load the lib
|
---|
890 |
|
---|
891 | function mp_unload(): boolean;
|
---|
892 | // unload and frees the lib from memory : do not forget to call it before close application.
|
---|
893 |
|
---|
894 | implementation
|
---|
895 |
|
---|
896 | function mp_IsLoaded: boolean;
|
---|
897 | begin
|
---|
898 | Result := (Mp_Handle <> dynlibs.NilHandle);
|
---|
899 | end;
|
---|
900 |
|
---|
901 | function mp_unload(): boolean;
|
---|
902 | begin
|
---|
903 | result := false;
|
---|
904 | // < Reference counting
|
---|
905 | if ReferenceCounter > 0 then
|
---|
906 | Dec(ReferenceCounter);
|
---|
907 | if ReferenceCounter > 0 then
|
---|
908 | exit;
|
---|
909 | // >
|
---|
910 | if mp_IsLoaded then
|
---|
911 | begin
|
---|
912 | mpg123_exit ;
|
---|
913 | DynLibs.UnloadLibrary(mp_Handle);
|
---|
914 | mp_Handle := DynLibs.NilHandle;
|
---|
915 | result := true;
|
---|
916 | end;
|
---|
917 | end;
|
---|
918 |
|
---|
919 | function Mp_Load(const libfilename: string): boolean;
|
---|
920 | var
|
---|
921 | thelib: string;
|
---|
922 | begin
|
---|
923 | Result := False;
|
---|
924 | if Mp_Handle <> 0 then
|
---|
925 | begin
|
---|
926 | Result := True; {is it already there ?}
|
---|
927 | Inc(ReferenceCounter);
|
---|
928 | end
|
---|
929 | else
|
---|
930 | begin {go & load the library}
|
---|
931 | if Length(libfilename) = 0 then thelib := libmp else thelib := libfilename;
|
---|
932 | Mp_Handle := DynLibs.SafeLoadLibrary(thelib); // obtain the handle we want
|
---|
933 | if Mp_Handle <> DynLibs.NilHandle then
|
---|
934 |
|
---|
935 | begin
|
---|
936 | mpg123_init := Tmpg123_init(GetProcAddress(Mp_Handle, 'mpg123_init'));
|
---|
937 | mpg123_exit := Tmpg123_exit(GetProcAddress(Mp_Handle, 'mpg123_exit'));
|
---|
938 | mpg123_new := Tmpg123_new(GetProcAddress(Mp_Handle, 'mpg123_new'));
|
---|
939 | mpg123_delete := Tmpg123_delete(GetProcAddress(Mp_Handle, 'mpg123_delete'));
|
---|
940 | mpg123_param := Tmpg123_param(GetProcAddress(Mp_Handle, 'mpg123_param'));
|
---|
941 | mpg123_getparam := Tmpg123_getparam(
|
---|
942 | GetProcAddress(Mp_Handle, 'mpg123_getparam'));
|
---|
943 | mpg123_plain_strerror := Tmpg123_plain_strerror(
|
---|
944 | GetProcAddress(Mp_Handle, 'mpg123_plain_strerror'));
|
---|
945 | mpg123_strerror := Tmpg123_strerror(
|
---|
946 | GetProcAddress(Mp_Handle, 'mpg123_strerror'));
|
---|
947 | mpg123_errcode := Tmpg123_errcode(GetProcAddress(Mp_Handle, 'mpg123_errcode'));
|
---|
948 | mpg123_decoders := Tmpg123_decoders(
|
---|
949 | GetProcAddress(Mp_Handle, 'mpg123_decoders'));
|
---|
950 | mpg123_supported_decoders :=
|
---|
951 | Tmpg123_supported_decoders(GetProcAddress(Mp_Handle, 'mpg123_supported_decoders'));
|
---|
952 | mpg123_decoder := Tmpg123_decoder(GetProcAddress(Mp_Handle, 'mpg123_decoder'));
|
---|
953 | mpg123_rates := Tmpg123_rates(GetProcAddress(Mp_Handle, 'mpg123_rates'));
|
---|
954 | mpg123_encodings := Tmpg123_encodings(
|
---|
955 | GetProcAddress(Mp_Handle, 'mpg123_encodings'));
|
---|
956 | mpg123_format_none := Tmpg123_format_none(
|
---|
957 | GetProcAddress(Mp_Handle, 'mpg123_format_none'));
|
---|
958 | mpg123_format_all := Tmpg123_format_all(
|
---|
959 | GetProcAddress(Mp_Handle, 'mpg123_format_all'));
|
---|
960 | mpg123_format := Tmpg123_format(GetProcAddress(Mp_Handle, 'mpg123_format'));
|
---|
961 | mpg123_format_support := Tmpg123_format_support(
|
---|
962 | GetProcAddress(Mp_Handle, 'mpg123_format_support'));
|
---|
963 | mpg123_getformat := Tmpg123_getformat(
|
---|
964 | GetProcAddress(Mp_Handle, 'mpg123_getformat'));
|
---|
965 | mpg123_open := Tmpg123_open(GetProcAddress(Mp_Handle, 'mpg123_open'));
|
---|
966 | mpg123_open_fd := Tmpg123_open_fd(GetProcAddress(Mp_Handle, 'mpg123_open_fd'));
|
---|
967 |
|
---|
968 | {$IF DEFINED(newversion)}
|
---|
969 | mpg123_open_handle := Tmpg123_open_handle(GetProcAddress(Mp_Handle, 'mpg123_open_handle'));
|
---|
970 | mpg123_replace_reader := Tmpg123_replace_reader(GetProcAddress(Mp_Handle,
|
---|
971 | 'mpg123_replace_reader'));
|
---|
972 | mpg123_replace_reader_handle := Tmpg123_replace_reader_handle(GetProcAddress(Mp_Handle,
|
---|
973 | 'mpg123_replace_reader_handle'));
|
---|
974 | mpg123_framebyframe_decode := Tmpg123_framebyframe_decode(
|
---|
975 | GetProcAddress(Mp_Handle, 'mpg123_framebyframe_decode'));
|
---|
976 | mpg123_framebyframe_next := Tmpg123_framebyframe_next(
|
---|
977 | GetProcAddress(Mp_Handle, 'mpg123_framebyframe_next'));
|
---|
978 | mpg123_framedata := Tmpg123_framedata(
|
---|
979 | GetProcAddress(Mp_Handle, 'mpg123_framedata'));
|
---|
980 | mpg123_meta_free := Tmpg123_meta_free(
|
---|
981 | GetProcAddress(Mp_Handle, 'mpg123_meta_free'));
|
---|
982 | mpg123_strlen := Tmpg123_strlen(
|
---|
983 | GetProcAddress(Mp_Handle, 'mpg123_strlen'));
|
---|
984 | mpg123_chomp_string := Tmpg123_chomp_string(
|
---|
985 | GetProcAddress(Mp_Handle, 'mpg123_chomp_string'));
|
---|
986 | mpg123_getformat2 := Tmpg123_getformat2(
|
---|
987 | GetProcAddress(Mp_Handle, 'mpg123_getformat2'));
|
---|
988 | mpg123_framepos := Tmpg123_framepos(GetProcAddress(Mp_Handle, 'mpg123_framepos'));
|
---|
989 | mpg123_framelength := Tmpg123_framelength(GetProcAddress(Mp_Handle, 'mpg123_framelength'));
|
---|
990 | mpg123_encsize := Tmpg123_encsize(GetProcAddress(Mp_Handle, 'mpg123_encsize'));
|
---|
991 | mpg123_set_index := Tmpg123_set_index(GetProcAddress(Mp_Handle, 'mpg123_set_index'));
|
---|
992 |
|
---|
993 | {$if not(defined(cpu64) and defined(unix))}
|
---|
994 | mpg123_open_32 := Tmpg123_open_32(GetProcAddress(Mp_Handle, 'mpg123_open_32'));
|
---|
995 | mpg123_open_fd_32 := Tmpg123_open_fd_32(GetProcAddress(Mp_Handle, 'mpg123_open_fd_32'));
|
---|
996 | mpg123_open_handle_32 := Tmpg123_open_handle_32(GetProcAddress(Mp_Handle, 'mpg123_open_handle_32'));
|
---|
997 | mpg123_decode_frame_32 := Tmpg123_decode_frame_32(GetProcAddress(Mp_Handle, 'mpg123_decode_frame_32'));
|
---|
998 | mpg123_framebyframe_decode_32 := Tmpg123_framebyframe_decode_32(GetProcAddress(Mp_Handle, 'mpg123_framebyframe_decode_32'));
|
---|
999 | mpg123_tell_32 := Tmpg123_tell_32(GetProcAddress(Mp_Handle, 'mpg123_tell_32'));
|
---|
1000 | mpg123_framepos_32 := Tmpg123_framepos_32(GetProcAddress(Mp_Handle, 'mpg123_framepos_32'));
|
---|
1001 | mpg123_tellframe_32 := Tmpg123_tellframe_32(GetProcAddress(Mp_Handle, 'mpg123_tellframe_32'));
|
---|
1002 | mpg123_seek_32 := Tmpg123_seek_32(GetProcAddress(Mp_Handle, 'mpg123_seek_32'));
|
---|
1003 | mpg123_seek_frame_32 := Tmpg123_seek_frame_32(GetProcAddress(Mp_Handle, 'mpg123_seek_frame_32'));
|
---|
1004 | mpg123_timeframe_32 := Tmpg123_timeframe_32(GetProcAddress(Mp_Handle, 'mpg123_timeframe_32'));
|
---|
1005 | mpg123_index_32 := Tmpg123_index_32(GetProcAddress(Mp_Handle, 'mpg123_index_32'));
|
---|
1006 | mpg123_set_index_32 := Tmpg123_set_index_32(GetProcAddress(Mp_Handle, 'mpg123_set_index_32'));
|
---|
1007 | mpg123_position_32 := Tmpg123_position_32(GetProcAddress(Mp_Handle, 'mpg123_position_32'));
|
---|
1008 | mpg123_framelength_32 := Tmpg123_framelength_32(GetProcAddress(Mp_Handle, 'mpg123_framelength_32'));
|
---|
1009 | mpg123_length_32 := Tmpg123_length_32(GetProcAddress(Mp_Handle, 'mpg123_length_32'));
|
---|
1010 | mpg123_set_filesize_32 := Tmpg123_set_filesize_32(GetProcAddress(Mp_Handle, 'mpg123_set_filesize_32'));
|
---|
1011 | mpg123_replace_reader_32 := Tmpg123_replace_reader_32(GetProcAddress(Mp_Handle, 'mpg123_replace_reader_32'));
|
---|
1012 | mpg123_replace_reader_handle_32 := Tmpg123_replace_reader_handle_32(GetProcAddress(Mp_Handle, 'mpg123_replace_reader_handle_32'));
|
---|
1013 | {$endif}
|
---|
1014 |
|
---|
1015 | mpg123_open_64 := Tmpg123_open_64(GetProcAddress(Mp_Handle, 'mpg123_open_64'));
|
---|
1016 | mpg123_open_fd_64 := Tmpg123_open_fd_64(GetProcAddress(Mp_Handle, 'mpg123_open_fd_64'));
|
---|
1017 | mpg123_open_handle_64 := Tmpg123_open_handle_64(GetProcAddress(Mp_Handle, 'mpg123_open_handle_64'));
|
---|
1018 | mpg123_decode_frame_64 := Tmpg123_decode_frame_64(GetProcAddress(Mp_Handle, 'mpg123_decode_frame_64'));
|
---|
1019 | mpg123_framebyframe_decode_64 := Tmpg123_framebyframe_decode_64(GetProcAddress(Mp_Handle, 'mpg123_framebyframe_decode_64'));
|
---|
1020 | mpg123_tell_64 := Tmpg123_tell_64(GetProcAddress(Mp_Handle, 'mpg123_tell_64'));
|
---|
1021 | mpg123_framepos_64 := Tmpg123_framepos_64(GetProcAddress(Mp_Handle, 'mpg123_framepos_64'));
|
---|
1022 | mpg123_tellframe_64 := Tmpg123_tellframe_64(GetProcAddress(Mp_Handle, 'mpg123_tellframe_64'));
|
---|
1023 | mpg123_seek_64 := Tmpg123_seek_64(GetProcAddress(Mp_Handle, 'mpg123_seek_64'));
|
---|
1024 | mpg123_seek_frame_64 := Tmpg123_seek_frame_64(GetProcAddress(Mp_Handle, 'mpg123_seek_frame_64'));
|
---|
1025 | mpg123_timeframe_64 := Tmpg123_timeframe_64(GetProcAddress(Mp_Handle, 'mpg123_timeframe_64'));
|
---|
1026 | mpg123_index_64 := Tmpg123_index_64(GetProcAddress(Mp_Handle, 'mpg123_index_64'));
|
---|
1027 | mpg123_set_index_64 := Tmpg123_set_index_64(GetProcAddress(Mp_Handle, 'mpg123_set_index_64'));
|
---|
1028 | mpg123_position_64 := Tmpg123_position_64(GetProcAddress(Mp_Handle, 'mpg123_position_64'));
|
---|
1029 | mpg123_framelength_64 := Tmpg123_framelength_64(GetProcAddress(Mp_Handle, 'mpg123_framelength_64'));
|
---|
1030 | mpg123_length_64 := Tmpg123_length_64(GetProcAddress(Mp_Handle, 'mpg123_length_64'));
|
---|
1031 | mpg123_set_filesize_64 := Tmpg123_set_filesize_64(GetProcAddress(Mp_Handle, 'mpg123_set_filesize_64'));
|
---|
1032 | mpg123_replace_reader_64 := Tmpg123_replace_reader_64(GetProcAddress(Mp_Handle, 'mpg123_replace_reader_64'));
|
---|
1033 | mpg123_replace_reader_handle_64 := Tmpg123_replace_reader_handle_64(GetProcAddress(Mp_Handle, 'mpg123_replace_reader_handle_64'));
|
---|
1034 |
|
---|
1035 | {$endif}
|
---|
1036 |
|
---|
1037 | mpg123_open_feed := Tmpg123_open_feed(
|
---|
1038 | GetProcAddress(Mp_Handle, 'mpg123_open_feed'));
|
---|
1039 | mpg123_close := Tmpg123_close(GetProcAddress(Mp_Handle, 'mpg123_close'));
|
---|
1040 | mpg123_read := Tmpg123_read(GetProcAddress(Mp_Handle, 'mpg123_read'));
|
---|
1041 | mpg123_decode := Tmpg123_decode(GetProcAddress(Mp_Handle, 'mpg123_decode'));
|
---|
1042 | mpg123_decode_frame := Tmpg123_decode_frame(
|
---|
1043 | GetProcAddress(Mp_Handle, 'mpg123_decode_frame'));
|
---|
1044 | mpg123_tell := Tmpg123_tell(GetProcAddress(Mp_Handle, 'mpg123_tell'));
|
---|
1045 | mpg123_tellframe := Tmpg123_tellframe(
|
---|
1046 | GetProcAddress(Mp_Handle, 'mpg123_tellframe'));
|
---|
1047 | mpg123_seek := Tmpg123_seek(GetProcAddress(Mp_Handle, 'mpg123_seek'));
|
---|
1048 | mpg123_feedseek := Tmpg123_feedseek(
|
---|
1049 | GetProcAddress(Mp_Handle, 'mpg123_feedseek'));
|
---|
1050 | mpg123_seek_frame := Tmpg123_seek_frame(
|
---|
1051 | GetProcAddress(Mp_Handle, 'mpg123_seek_frame'));
|
---|
1052 | mpg123_timeframe := Tmpg123_timeframe(
|
---|
1053 | GetProcAddress(Mp_Handle, 'mpg123_timeframe'));
|
---|
1054 | mpg123_index := Tmpg123_index(GetProcAddress(Mp_Handle, 'mpg123_index'));
|
---|
1055 | mpg123_position := Tmpg123_position(
|
---|
1056 | GetProcAddress(Mp_Handle, 'mpg123_position'));
|
---|
1057 | mpg123_eq := Tmpg123_eq(GetProcAddress(Mp_Handle, 'mpg123_eq'));
|
---|
1058 | mpg123_reset_eq := Tmpg123_reset_eq(
|
---|
1059 | GetProcAddress(Mp_Handle, 'mpg123_reset_eq'));
|
---|
1060 | mpg123_volume := Tmpg123_volume(GetProcAddress(Mp_Handle, 'mpg123_volume'));
|
---|
1061 | mpg123_volume_change := Tmpg123_volume_change(
|
---|
1062 | GetProcAddress(Mp_Handle, 'mpg123_volume_change'));
|
---|
1063 | mpg123_getvolume := Tmpg123_getvolume(
|
---|
1064 | GetProcAddress(Mp_Handle, 'mpg123_getvolume'));
|
---|
1065 | mpg123_info := Tmpg123_info(GetProcAddress(Mp_Handle, 'mpg123_info'));
|
---|
1066 | mpg123_safe_buffer := Tmpg123_safe_buffer(
|
---|
1067 | GetProcAddress(Mp_Handle, 'mpg123_safe_buffer'));
|
---|
1068 | mpg123_scan := Tmpg123_scan(GetProcAddress(Mp_Handle, 'mpg123_scan'));
|
---|
1069 | mpg123_length := Tmpg123_length(GetProcAddress(Mp_Handle, 'mpg123_length'));
|
---|
1070 | mpg123_tpf := Tmpg123_tpf(GetProcAddress(Mp_Handle, 'mpg123_tpf'));
|
---|
1071 | mpg123_spf := Tmpg123_spf(GetProcAddress(Mp_Handle, 'mpg123_spf'));
|
---|
1072 | mpg123_clip := Tmpg123_clip(GetProcAddress(Mp_Handle, 'mpg123_clip'));
|
---|
1073 | mpg123_init_string := Tmpg123_init_string(
|
---|
1074 | GetProcAddress(Mp_Handle, 'mpg123_init_string'));
|
---|
1075 | mpg123_free_string := Tmpg123_free_string(
|
---|
1076 | GetProcAddress(Mp_Handle, 'mpg123_free_string'));
|
---|
1077 | mpg123_resize_string := Tmpg123_resize_string(
|
---|
1078 | GetProcAddress(Mp_Handle, 'mpg123_resize_string'));
|
---|
1079 | mpg123_copy_string := Tmpg123_copy_string(
|
---|
1080 | GetProcAddress(Mp_Handle, 'mpg123_copy_string'));
|
---|
1081 | mpg123_add_string := Tmpg123_add_string(
|
---|
1082 | GetProcAddress(Mp_Handle, 'mpg123_add_string'));
|
---|
1083 | mpg123_add_substring := Tmpg123_add_substring(
|
---|
1084 | GetProcAddress(Mp_Handle, 'mpg123_add_substring'));
|
---|
1085 | mpg123_set_string := Tmpg123_set_string(
|
---|
1086 | GetProcAddress(Mp_Handle, 'mpg123_set_string'));
|
---|
1087 | mpg123_set_substring := Tmpg123_set_substring(
|
---|
1088 | GetProcAddress(Mp_Handle, 'mpg123_set_substring'));
|
---|
1089 | mpg123_meta_check := Tmpg123_meta_check(
|
---|
1090 | GetProcAddress(Mp_Handle, 'mpg123_meta_check'));
|
---|
1091 | mpg123_id3 := Tmpg123_id3(GetProcAddress(Mp_Handle, 'mpg123_id3'));
|
---|
1092 | mpg123_icy := Tmpg123_icy(GetProcAddress(Mp_Handle, 'mpg123_icy'));
|
---|
1093 | mpg123_parnew := Tmpg123_parnew(GetProcAddress(Mp_Handle, 'mpg123_parnew'));
|
---|
1094 | mpg123_new_pars := Tmpg123_new_pars(
|
---|
1095 | GetProcAddress(Mp_Handle, 'mpg123_new_pars'));
|
---|
1096 | mpg123_delete_pars := Tmpg123_delete_pars(
|
---|
1097 | GetProcAddress(Mp_Handle, 'mpg123_delete_pars'));
|
---|
1098 | mpg123_fmt_none := Tmpg123_fmt_none(
|
---|
1099 | GetProcAddress(Mp_Handle, 'mpg123_fmt_none'));
|
---|
1100 | mpg123_fmt_all := Tmpg123_fmt_all(GetProcAddress(Mp_Handle, 'mpg123_fmt_all'));
|
---|
1101 | mpg123_fmt := Tmpg123_fmt(GetProcAddress(Mp_Handle, 'mpg123_fmt'));
|
---|
1102 | mpg123_fmt_support := Tmpg123_fmt_support(
|
---|
1103 | GetProcAddress(Mp_Handle, 'mpg123_fmt_support'));
|
---|
1104 | mpg123_par := Tmpg123_par(GetProcAddress(Mp_Handle, 'mpg123_par'));
|
---|
1105 | mpg123_getpar := Tmpg123_getpar(GetProcAddress(Mp_Handle, 'mpg123_getpar'));
|
---|
1106 | mpg123_replace_buffer := Tmpg123_replace_buffer(
|
---|
1107 | GetProcAddress(Mp_Handle, 'mpg123_replace_buffer'));
|
---|
1108 | mpg123_outblock := Tmpg123_outblock(
|
---|
1109 | GetProcAddress(Mp_Handle, 'mpg123_outblock'));
|
---|
1110 | end;
|
---|
1111 | Result := mp_IsLoaded;
|
---|
1112 | ReferenceCounter := 1;
|
---|
1113 |
|
---|
1114 | end;
|
---|
1115 | end;
|
---|
1116 |
|
---|
1117 | end.
|
---|