Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a5fea4e

Browse files
committed
Add missing SDL2_mixer symbols (2.8.1)
This commit adds some symbols that were missing from SDL2_mixer.pas, bringing it up to date with v2.8.1 of the library.
1 parent 0db34c2 commit a5fea4e

File tree

1 file changed

+142
-1
lines changed

1 file changed

+142
-1
lines changed

‎units/sdl2_mixer.pas

Lines changed: 142 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function Mix_Linked_Version: PSDL_Version cdecl; external MIX_LibName {$IFDEF DE
8989
MIX_INIT_OGG = $00000010;
9090
MIX_INIT_MID = $00000020;
9191
MIX_INIT_OPUS = $00000040;
92+
MIX_INIT_WAVPACK = $00000080;
9293

9394
{ // Removed in SDL2_mixer 2.0.2
9495
MIX_INIT_MODPLUG = 00000004ドル;
@@ -161,7 +162,9 @@ TMix_Chunk = record
161162
MUS_MP3_MAD_UNUSED,
162163
MUS_FLAC,
163164
MUS_MODPLUG_UNUSED,
164-
MUS_OPUS
165+
MUS_OPUS,
166+
MUS_WAVPACK,
167+
MUS_GME
165168
);
166169

167170
{* The internal format for a music chunk interpreted via mikmod *}
@@ -171,6 +174,14 @@ TMix_Chunk = record
171174
{* Open the mixer with a certain audio format *}
172175
function Mix_OpenAudio(frequency: cint; format: cuint16; channels: cint; chunksize: cint): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_OpenAudio' {$ENDIF} {$ENDIF};
173176

177+
{ * Open a specific audio device for playback. *}
178+
function Mix_OpenAudioDevice(frequency: cint; format: cuint16; channels: cint; chunksize: cint; device: PAnsiChar; allowed_changes: cint): cint; cdecl;
179+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_OpenAudioDevice' {$ENDIF} {$ENDIF};
180+
181+
{* Pause (1) or resume (0) the whole audio output. *}
182+
procedure Mix_PauseAudio(pause_on: cint); cdecl;
183+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_PauseAudio' {$ENDIF} {$ENDIF};
184+
174185
{* Dynamically change the number of channels managed by the mixer.
175186
If decreasing the number of channels, the upper channels are
176187
stopped.
@@ -242,6 +253,58 @@ function Mix_HasMusicDecoder(const name: PAnsiChar): TSDL_Bool cdecl;
242253
*}
243254
function Mix_GetMusicType(music: PMix_Music): TMix_MusicType cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicType' {$ENDIF} {$ENDIF};
244255

256+
{* Get the title for a music object, or its filename.
257+
This returns format-specific metadata. Not all formats support this!
258+
259+
If `music` is NULL, this will query the currently-playing music.
260+
261+
If the music's title tag is missing or empty, the filename will be returned instead.
262+
263+
This function never returns NIL! If no data is available, it will return an empty string.
264+
*}
265+
function Mix_GetMusicTitle(music: PMix_Music): PAnsiChar; cdecl;
266+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicTitle' {$ENDIF} {$ENDIF};
267+
268+
{* Get the title for a music object.
269+
This returns format-specific metadata. Not all formats support this!
270+
271+
If `music` is NULL, this will query the currently-playing music.
272+
273+
This function never returns NIL! If no data is available, it will return an empty string.
274+
*}
275+
function Mix_GetMusicTitleTag(music: PMix_Music): PAnsiChar; cdecl;
276+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicTitleTag' {$ENDIF} {$ENDIF};
277+
278+
{* Get the artist name for a music object.
279+
This returns format-specific metadata. Not all formats support this!
280+
281+
If `music` is NULL, this will query the currently-playing music.
282+
283+
This function never returns NIL! If no data is available, it will return an empty string.
284+
*}
285+
function Mix_GetMusicArtistTag(music: PMix_Music): PAnsiChar; cdecl;
286+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicArtistTag' {$ENDIF} {$ENDIF};
287+
288+
{* Get the album name for a music object.
289+
This returns format-specific metadata. Not all formats support this!
290+
291+
If `music` is NULL, this will query the currently-playing music.
292+
293+
This function never returns NIL! If no data is available, it will return an empty string.
294+
*}
295+
function Mix_GetMusicAlbumTag(music: PMix_Music): PAnsiChar; cdecl;
296+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicAlbumTag' {$ENDIF} {$ENDIF};
297+
298+
{* Get the copyright text for a music object.
299+
This returns format-specific metadata. Not all formats support this!
300+
301+
If `music` is NULL, this will query the currently-playing music.
302+
303+
This function never returns NIL! If no data is available, it will return an empty string.
304+
*}
305+
function Mix_GetMusicCopyrightTag(music: PMix_Music): PAnsiChar; cdecl;
306+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicCopyrightTag' {$ENDIF} {$ENDIF};
307+
245308
{* Set a function that is called after all mixing is performed.
246309
This can be used to provide real-time visual display of the audio stream
247310
or add a custom mixer filter for the stream data.
@@ -608,6 +671,23 @@ function Mix_Volume(channel: cint; volume: cint): cint cdecl; external MIX_LibNa
608671
function Mix_VolumeChunk(chunk: PMix_Chunk; volume: cint): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_VolumeChunk' {$ENDIF} {$ENDIF};
609672
function Mix_VolumeMusic(volume: cint): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_VolumeMusic' {$ENDIF} {$ENDIF};
610673

674+
{* Query the current volume for a music object. *}
675+
function Mix_GetMusicVolume(music: PMix_Music): cint; cdecl;
676+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicVolume' {$ENDIF} {$ENDIF};
677+
678+
{* Set the master volume for all channels.
679+
680+
SDL_Mixer keeps a per-channel volume, a per-chunk volume, and a master volume.
681+
All three are considered when mixing audio.
682+
683+
Note that the master volume does not affect any playing music;
684+
it is only applied when mixing chunks. Use Mix_VolumeMusic() for that.
685+
686+
If the specified volume is -1, this returns the current volume.
687+
*}
688+
function Mix_MasterVolume(volume: cint): cint; cdecl;
689+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_MasterVolume' {$ENDIF} {$ENDIF};
690+
611691
{* Halt playing of a particular channel *}
612692
function Mix_HaltChannel(channel: cint): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_HaltChannel' {$ENDIF} {$ENDIF};
613693
function Mix_HaltGroup(tag: cint): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_HaltGroup' {$ENDIF} {$ENDIF};
@@ -642,6 +722,18 @@ procedure Mix_ResumeMusic cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MA
642722
procedure Mix_RewindMusic cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_RewindMusic' {$ENDIF} {$ENDIF};
643723
function Mix_PausedMusic: cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_PausedMusic' {$ENDIF} {$ENDIF};
644724

725+
{* Jump to a given order in MOD music. *}
726+
function Mix_ModMusicJumpToOrder(order: cint): cint; cdecl;
727+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_ModMusicJumpToOrder' {$ENDIF} {$ENDIF};
728+
729+
{* Set a track in a GME music object. *}
730+
function Mix_StartTrack(music: PMix_Music; track: cint): cint; cdecl;
731+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_StartTrack' {$ENDIF} {$ENDIF};
732+
733+
{* Get number of tracks in a GME music object. *}
734+
function Mix_GetNumTracks(music: PMix_Music): cint; cdecl;
735+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetNumTracks' {$ENDIF} {$ENDIF};
736+
645737
{* Set the current position in the music stream.
646738
This returns 0 if successful, or -1 if it failed or isn't implemented.
647739
This function is only implemented for MOD music formats (set pattern
@@ -650,6 +742,40 @@ function Mix_PausedMusic: cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFD
650742
*}
651743
function Mix_SetMusicPosition(position: Double): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_SetMusicPosition' {$ENDIF} {$ENDIF};
652744

745+
{* Get the current position of a music stream, in seconds.
746+
Returns -1.0 if this feature is not supported for some codec.
747+
*}
748+
function Mix_GetMusicPosition(music: PMix_Music): cdouble; cdecl;
749+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicPosition' {$ENDIF} {$ENDIF};
750+
751+
{* Get a music object's duration, in seconds.
752+
If NIL is passed, returns duration of currently playing music.
753+
Returns -1.0 on error.
754+
*}
755+
function Mix_MusicDuration(music: PMix_Music): cdouble; cdecl;
756+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_MusicDuration' {$ENDIF} {$ENDIF};
757+
758+
{* Get the loop start time position of a music stream, in seconds.
759+
Returns -1.0 if this feature is not used by this music
760+
or unsupported by the codec.
761+
*}
762+
function Mix_GetMusicLoopStartTime(music: PMix_Music): cdouble; cdecl;
763+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicLoopStartTime' {$ENDIF} {$ENDIF};
764+
765+
{* Get the loop end time position of a music stream, in seconds.
766+
Returns -1.0 if this feature is not used by this music
767+
or unsupported by the codec.
768+
*}
769+
function Mix_GetMusicLoopEndTime(music: PMix_Music): cdouble; cdecl;
770+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicLoopEndTime' {$ENDIF} {$ENDIF};
771+
772+
{* Get the loop time length of a music stream, in seconds.
773+
Returns -1.0 if this feature is not used by this music
774+
or unsupported by the codec.
775+
*}
776+
function Mix_GetMusicLoopLengthTime(music: PMix_Music): cdouble; cdecl;
777+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetMusicLoopLengthTime' {$ENDIF} {$ENDIF};
778+
653779
{* Check the status of a specific channel.
654780
If the specified channel is -1, check all channels.
655781
*}
@@ -674,6 +800,21 @@ function Mix_GetSoundFonts: PAnsiChar cdecl; external MIX_LibName {$IFDEF DELPHI
674800

675801
function Mix_EachSoundFont(func: TMix_SoundFunc; data: Pointer): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_EachSoundFont' {$ENDIF} {$ENDIF};
676802

803+
{* Set full path of the Timidity config file.
804+
This is only useful if SDL_Mixer is using Timidity to play MIDI files.
805+
*}
806+
function Mix_SetTimidityCfg(path: PAnsiChar): cint; cdecl;
807+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_SetTimidityCfg' {$ENDIF} {$ENDIF};
808+
809+
{* Get full path of previously specified Timidity config file.
810+
If a path has never been specified, this returns NIL.
811+
812+
This returns a pointer to internal memory;
813+
it must not be modified nor freed by the caller.
814+
*}
815+
function Mix_GetTimidityCfg(): PAnsiChar; cdecl;
816+
external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_GetTimidityCfg' {$ENDIF} {$ENDIF};
817+
677818
{* Get the Mix_Chunk currently associated with a mixer channel
678819
Returns NULL if it's an invalid channel, or there's no chunk associated.
679820
*}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /