Documentation ¶
Index ¶
- Constants
- func AllocateChannels(numchans m.Int) m.Int
- func BytePtrFromStringP(s string) (cpS *byte)
- func ChannelFinished(channel_finished mm.ChannelFinished)
- func CloseAudio()
- func EachSoundFont(function mm.Function, data *m.Void) m.Int
- func ExpireChannel(channel m.Int, ticks m.Int) m.Int
- func FadeInChannel(channel m.Int, chunk *mm.Chunk, loops m.Int, ms m.Int) m.Int
- func FadeInChannelTimed(channel m.Int, chunk *mm.Chunk, loops m.Int, ms m.Int, ticks m.Int) m.Int
- func FadeInMusic(music *mm.Music, loops m.Int, ms m.Int) m.Int
- func FadeInMusicPos(music *mm.Music, loops m.Int, ms m.Int, position m.Double) m.Int
- func FadeOutChannel(which m.Int, ms m.Int) m.Int
- func FadeOutGroup(tag m.Int, ms m.Int) m.Int
- func FadeOutMusic(ms m.Int) m.Int
- func FadingChannel(which m.Int) mm.Fading
- func FadingMusic() mm.Fading
- func FreeChunk(chunk *mm.Chunk)
- func FreeMusic(music *mm.Music)
- func GetChunk(channel m.Int) *mm.Chunk
- func GetChunkDecoder(index m.Int) string
- func GetError() (err error)
- func GetMusicAlbumTag(music *mm.Music) string
- func GetMusicArtistTag(music *mm.Music) string
- func GetMusicCopyrightTag(music *mm.Music) string
- func GetMusicDecoder(index m.Int) string
- func GetMusicHookData() *m.Void
- func GetMusicLoopEndTime(music *mm.Music) m.Double
- func GetMusicLoopLengthTime(music *mm.Music) m.Double
- func GetMusicLoopStartTime(music *mm.Music) m.Double
- func GetMusicPosition(music *mm.Music) m.Double
- func GetMusicTitle(music *mm.Music) string
- func GetMusicTitleTag(music *mm.Music) string
- func GetMusicType(music *mm.Music) mm.MusicType
- func GetMusicVolume(music *mm.Music) m.Int
- func GetNumChunkDecoders() m.Int
- func GetNumMusicDecoders() m.Int
- func GetSoundFonts() string
- func GetSynchroValue() m.Int
- func GetTimidityCfg() string
- func GroupAvailable(tag m.Int) m.Int
- func GroupChannel(which m.Int, tag m.Int) m.Int
- func GroupChannels(from m.Int, to m.Int, tag m.Int) m.Int
- func GroupCount(tag m.Int) m.Int
- func GroupNewer(tag m.Int) m.Int
- func GroupOldest(tag m.Int) m.Int
- func HaltChannel(channel m.Int) m.Int
- func HaltGroup(tag m.Int) m.Int
- func HaltMusic() m.Int
- func HasChunkDecoder(name string) m.Bool
- func HasMusicDecoder(name string) m.Bool
- func HookMusic(mix_func mm.MixFunc, arg *m.Void)
- func HookMusicFinished(music_finished mm.MusicFinished)
- func Init(flags m.Int) m.Int
- func Linked_Version() *m.Version
- func LoadLibrary(dllFile string, extFuncs *ExternalFunctions) (err error)
- func LoadMUS(file string) *mm.Music
- func LoadMUSType_RW(src *m.RWops, musicType mm.MusicType, freesrc m.Int) *mm.Music
- func LoadMUS_RW(src *m.RWops, freesrc m.Int) *mm.Music
- func LoadWAV(file string) *mm.Chunk
- func LoadWAV_RW(src *m.RWops, freesrc m.Int) *mm.Chunk
- func MasterVolume(volume m.Int) m.Int
- func ModMusicJumpToOrder(order m.Int) m.Int
- func MusicDuration(music *mm.Music) m.Double
- func OpenAudio(frequency m.Int, format m.Uint16, channels m.Int, chunksize m.Int) m.Int
- func OpenAudioDevice(frequency m.Int, format m.Uint16, channels m.Int, chunksize m.Int, ...) m.Int
- func Pause(channel m.Int)
- func PauseMusic()
- func Paused(channel m.Int) m.Int
- func PausedMusic() m.Int
- func PlayChannel(channel m.Int, chunk *mm.Chunk, loops m.Int) m.Int
- func PlayChannelTimed(channel m.Int, chunk *mm.Chunk, loops m.Int, ticks m.Int) m.Int
- func PlayMusic(music *mm.Music, loops m.Int) m.Int
- func Playing(channel m.Int) m.Int
- func PlayingMusic() m.Int
- func QuerySpec(frequency *m.Int, format *m.Uint16, channels *m.Int) m.Int
- func QuickLoad_RAW(mem *m.Uint8, len m.Uint32) *mm.Chunk
- func QuickLoad_WAV(mem *m.Uint8) *mm.Chunk
- func Quit()
- func RegisterEffect(channel m.Int, f mm.EffectFunc, d mm.EffectDone, arg *m.Void) m.Int
- func ReserveChannels(num m.Int) m.Int
- func Resume(channel m.Int)
- func ResumeMusic()
- func RewindMusic()
- func SetDistance(channel m.Int, distance m.Uint8) m.Int
- func SetMusicCMD(command string) m.Int
- func SetMusicPosition(position m.Double) m.Int
- func SetPanning(channel m.Int, left m.Uint8, right m.Uint8) m.Int
- func SetPosition(channel m.Int, angle m.Int16, distance m.Uint8) m.Int
- func SetPostMix(mix_func mm.MixFunc, arg *m.Void)
- func SetReverseStereo(channel m.Int, flip m.Int) m.Int
- func SetSoundFonts(paths string) m.Int
- func SetSynchroValue(value m.Int) m.Int
- func SetTimidityCfg(path string) m.Int
- func Test(filePath string)
- func UnregisterAllEffects(channel m.Int) m.Int
- func UnregisterEffect(channel m.Int, f mm.EffectFunc) m.Int
- func Volume(channel m.Int, volume m.Int) m.Int
- func VolumeChunk(chunk *mm.Chunk, volume m.Int) m.Int
- func VolumeMusic(volume m.Int) m.Int
- type ExternalFunctions
Constants ¶
const ( CHANNELS = 8 DEFAULT_FREQUENCY = 44100 DEFAULT_CHANNELS = 2 )
const ( SdlMixDll = "SDL2_mixer.dll" DllFuncNamePrefix = "Mix_" )
const (
ErrExternalFunctionsNotSet = "external functions are not set"
)
Variables ¶
This section is empty.
Functions ¶
func BytePtrFromStringP ¶
BytePtrFromStringP converts a Go string into a C string. If something goes wrong, it panics.
func ChannelFinished ¶
func ChannelFinished(channel_finished mm.ChannelFinished)
extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel));
func CloseAudio ¶
func CloseAudio()
func EachSoundFont ¶
extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data);
func FadeInChannel ¶
func FadeInChannelTimed ¶
func FadeInMusicPos ¶
func FadingMusic ¶
func GetChunkDecoder ¶
func GetError ¶
func GetError() (err error)
GetError const char* SDL_GetError(void); https://wiki.libsdl.org/SDL2/SDL_GetError #define Mix_GetError SDL_GetError
func GetMusicAlbumTag ¶
func GetMusicArtistTag ¶
func GetMusicCopyrightTag ¶
func GetMusicDecoder ¶
func GetMusicHookData ¶
func GetMusicTitle ¶
func GetMusicTitleTag ¶
func GetNumChunkDecoders ¶
func GetNumMusicDecoders ¶
func GetSoundFonts ¶
func GetSoundFonts() string
func GetSynchroValue ¶
func GetTimidityCfg ¶
func GetTimidityCfg() string
func HasChunkDecoder ¶
func HasMusicDecoder ¶
func HookMusic ¶
extern DECLSPEC void SDLCALL Mix_HookMusic(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
func HookMusicFinished ¶
func HookMusicFinished(music_finished mm.MusicFinished)
extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (SDLCALL *music_finished)(void));
func Linked_Version ¶
func LoadLibrary ¶
func LoadLibrary(dllFile string, extFuncs *ExternalFunctions) (err error)
LoadLibrary loads the library and its functions.
func LoadMUSType_RW ¶
func OpenAudioDevice ¶
func PauseMusic ¶
func PauseMusic()
func PausedMusic ¶
func PlayChannelTimed ¶
func PlayingMusic ¶
func RegisterEffect ¶
func RegisterEffect(channel m.Int, f mm.EffectFunc, d mm.EffectDone, arg *m.Void) m.Int
func ResumeMusic ¶
func ResumeMusic()
func RewindMusic ¶
func RewindMusic()
func SetMusicCMD ¶
func SetPostMix ¶
extern DECLSPEC void SDLCALL Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
func SetSoundFonts ¶
func SetTimidityCfg ¶
func Test ¶
func Test(filePath string)
Test This tests shows that Golang is a 'komplete Scheiße'. What does that mean ? Here we are using system calls without any type casts. We use pointers returned by a DLL library directly, i.e. we use pointers returned by C code, and we do not type cast them into Go pointers except one thing. We are using the Go's `uintptr` type, because system calls use them, and we have no other choice other than this. Well, this very simple experiment shows that a pointer to Mix_Music type is not NULL according to the non-zero printed value. What happens next ? This pointer is given to another DLL function. In C code this function returns a positive value of 503, but in Golang it returns zero (0). What does it mean ? Golang is a 'komplete Scheiße'. I and will not create an issue on Golang's GitHub page because they will say as they usually do that they are great and we are nothing. This small example shows how "great" is Golang in reality. Golang ist komplete Scheiße. Das stimmt.
func UnregisterEffect ¶
Types ¶
type ExternalFunctions ¶
type ExternalFunctions struct {
ExtFnGetError uintptr
}