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 06d9cd2

Browse files
committed
Align SDL2_Mixer enums with style guidelines
1 parent bb2cd32 commit 06d9cd2

File tree

1 file changed

+41
-33
lines changed

1 file changed

+41
-33
lines changed

‎units/sdl2_mixer.pas

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,29 @@ procedure MIX_VERSION(Out X: TSDL_Version);
8282
*}
8383
function Mix_Linked_Version: PSDL_Version cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_Linked_Version' {$ENDIF} {$ENDIF};
8484

85-
const
86-
MIX_INIT_FLAC = $00000001;
87-
MIX_INIT_MOD = $00000002;
88-
MIX_INIT_MP3 = $00000008;
89-
MIX_INIT_OGG = $00000010;
90-
MIX_INIT_MID = $00000020;
91-
MIX_INIT_OPUS = $00000040;
92-
MIX_INIT_WAVPACK = $00000080;
93-
94-
{ // Removed in SDL2_mixer 2.0.2
95-
MIX_INIT_MODPLUG = 00000004ドル;
96-
MIX_INIT_FLUIDSYNTH = 00000020ドル;
97-
}
9885
type
99-
PPMIX_InitFlags = ^PMIX_InitFlags;
100-
PMIX_InitFlags = ^TMIX_InitFlags;
101-
TMIX_InitFlags = cint;
86+
PPMix_InitFlags = ^PMix_InitFlags;
87+
PMix_InitFlags = ^TMix_InitFlags;
88+
TMix_InitFlags = type cint;
89+
90+
const
91+
MIX_INIT_FLAC = TMix_InitFlags($00000001);
92+
MIX_INIT_MOD = TMix_InitFlags($00000002);
93+
MIX_INIT_MP3 = TMix_InitFlags($00000008);
94+
MIX_INIT_OGG = TMix_InitFlags($00000010);
95+
MIX_INIT_MID = TMix_InitFlags($00000020);
96+
MIX_INIT_OPUS = TMix_InitFlags($00000040);
97+
MIX_INIT_WAVPACK = TMix_InitFlags($00000080);
98+
99+
// Removed in SDL2_mixer 2.0.2:
100+
// MIX_INIT_MODPLUG = TMix_InitFlags(00000004ドル);
101+
// MIX_INIT_FLUIDSYNTH = TMix_InitFlags(00000020ドル);
102102

103103
{* Loads dynamic libraries and prepares them for use. Flags should be
104104
one or more flags from MIX_InitFlags OR'd together.
105105
It returns the flags successfully initialized, or 0 on failure.
106106
*}
107-
function Mix_Init(flags: cint): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_Init' {$ENDIF} {$ENDIF};
107+
function Mix_Init(flags: TMix_InitFlags): cint cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_Init' {$ENDIF} {$ENDIF};
108108

109109
{* Unloads libraries loaded with Mix_Init *}
110110
procedure Mix_Quit() cdecl; external MIX_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_MIX_Quit' {$ENDIF} {$ENDIF};
@@ -142,26 +142,34 @@ TMix_Chunk = record
142142
type
143143
PPMix_Fading = ^PMix_Fading;
144144
PMix_Fading = ^TMix_Fading;
145-
TMix_Fading = (MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN);
145+
TMix_Fading = type cint;
146+
147+
const
148+
MIX_NO_FADING = TMix_Fading(0);
149+
MIX_FADING_OUT = TMix_Fading(1);
150+
MIX_FADING_IN = TMix_Fading(2);
146151

152+
type
147153
PPMix_MusicType = ^PMix_MusicType;
148154
PMix_MusicType = ^TMix_MusicType;
149-
TMix_MusicType = (
150-
MUS_NONE,
151-
MUS_CMD,
152-
MUS_WAV,
153-
MUS_MOD,
154-
MUS_MID,
155-
MUS_OGG,
156-
MUS_MP3,
157-
MUS_MP3_MAD_UNUSED,
158-
MUS_FLAC,
159-
MUS_MODPLUG_UNUSED,
160-
MUS_OPUS,
161-
MUS_WAVPACK,
162-
MUS_GME
163-
);
155+
TMix_MusicType = type cint;
156+
157+
const
158+
MUS_NONE = TMix_MusicType(0);
159+
MUS_CMD = TMix_MusicType(1);
160+
MUS_WAV = TMix_MusicType(2);
161+
MUS_MOD = TMix_MusicType(3);
162+
MUS_MID = TMix_MusicType(4);
163+
MUS_OGG = TMix_MusicType(5);
164+
MUS_MP3 = TMix_MusicType(6);
165+
MUS_MP3_MAD_UNUSED = TMix_MusicType(7);
166+
MUS_FLAC = TMix_MusicType(8);
167+
MUS_MODPLUG_UNUSED = TMix_MusicType(9);
168+
MUS_OPUS = TMix_MusicType(10);
169+
MUS_WAVPACK = TMix_MusicType(11);
170+
MUS_GM = TMix_MusicType(12);
164171

172+
type
165173
{* The internal format for a music chunk interpreted via mikmod *}
166174
PPMix_Music = ^PMix_Music;
167175
PMix_Music = type Pointer;

0 commit comments

Comments
(0)

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