sdlm

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHANNELS          = 8
	DEFAULT_FREQUENCY = 44100
	DEFAULT_CHANNELS  = 2
)
View Source
const (
	SdlMixDll         = "SDL2_mixer.dll"
	DllFuncNamePrefix = "Mix_"
)
View Source
const (
	ErrExternalFunctionsNotSet = "external functions are not set"
)

Variables

This section is empty.

Functions

func AllocateChannels

func AllocateChannels(numchans m.Int) m.Int

func BytePtrFromStringP

func BytePtrFromStringP(s string) (cpS *byte)

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

func EachSoundFont(function mm.Function, data *m.Void) m.Int

extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data);

func ExpireChannel

func ExpireChannel(channel m.Int, ticks m.Int) m.Int

func FadeInChannel

func FadeInChannel(channel m.Int, chunk *mm.Chunk, loops m.Int, ms m.Int) m.Int

func FadeInChannelTimed

func FadeInChannelTimed(channel m.Int, chunk *mm.Chunk, loops m.Int, ms m.Int, ticks m.Int) m.Int

func FadeInMusic

func FadeInMusic(music *mm.Music, loops m.Int, ms m.Int) m.Int

func FadeInMusicPos

func FadeInMusicPos(music *mm.Music, loops m.Int, ms m.Int, position m.Double) m.Int

func FadeOutChannel

func FadeOutChannel(which m.Int, ms m.Int) m.Int

func FadeOutGroup

func FadeOutGroup(tag m.Int, ms m.Int) m.Int

func FadeOutMusic

func FadeOutMusic(ms m.Int) m.Int

func FadingChannel

func FadingChannel(which m.Int) mm.Fading

func FadingMusic

func FadingMusic() mm.Fading

func FreeChunk

func FreeChunk(chunk *mm.Chunk)

func FreeMusic

func FreeMusic(music *mm.Music)

func GetChunk

func GetChunk(channel m.Int) *mm.Chunk

func GetChunkDecoder

func GetChunkDecoder(index m.Int) string

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 GetMusicAlbumTag(music *mm.Music) string

func GetMusicArtistTag

func GetMusicArtistTag(music *mm.Music) string

func GetMusicCopyrightTag

func GetMusicCopyrightTag(music *mm.Music) string

func GetMusicDecoder

func GetMusicDecoder(index m.Int) string

func GetMusicHookData

func GetMusicHookData() *m.Void

func GetMusicLoopEndTime

func GetMusicLoopEndTime(music *mm.Music) m.Double

func GetMusicLoopLengthTime

func GetMusicLoopLengthTime(music *mm.Music) m.Double

func GetMusicLoopStartTime

func GetMusicLoopStartTime(music *mm.Music) m.Double

func GetMusicPosition

func GetMusicPosition(music *mm.Music) m.Double

func GetMusicTitle

func GetMusicTitle(music *mm.Music) string

func GetMusicTitleTag

func GetMusicTitleTag(music *mm.Music) string

func GetMusicType

func GetMusicType(music *mm.Music) mm.MusicType

func GetMusicVolume

func GetMusicVolume(music *mm.Music) m.Int

func GetNumChunkDecoders

func GetNumChunkDecoders() m.Int

func GetNumMusicDecoders

func GetNumMusicDecoders() m.Int

func GetSoundFonts

func GetSoundFonts() string

func GetSynchroValue

func GetSynchroValue() m.Int

func GetTimidityCfg

func GetTimidityCfg() string

func GroupAvailable

func GroupAvailable(tag m.Int) m.Int

func GroupChannel

func GroupChannel(which m.Int, tag m.Int) m.Int

func GroupChannels

func GroupChannels(from m.Int, to m.Int, tag m.Int) m.Int

func GroupCount

func GroupCount(tag m.Int) m.Int

func GroupNewer

func GroupNewer(tag m.Int) m.Int

func GroupOldest

func GroupOldest(tag m.Int) m.Int

func HaltChannel

func HaltChannel(channel m.Int) m.Int

func HaltGroup

func HaltGroup(tag m.Int) m.Int

func HaltMusic

func HaltMusic() m.Int

func HasChunkDecoder

func HasChunkDecoder(name string) m.Bool

func HasMusicDecoder

func HasMusicDecoder(name string) m.Bool

func HookMusic

func HookMusic(mix_func mm.MixFunc, arg *m.Void)

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 Init

func Init(flags m.Int) m.Int

func Linked_Version

func Linked_Version() *m.Version

func LoadLibrary

func LoadLibrary(dllFile string, extFuncs *ExternalFunctions) (err error)

LoadLibrary loads the library and its functions.

func LoadMUS

func LoadMUS(file string) *mm.Music

func LoadMUSType_RW

func LoadMUSType_RW(src *m.RWops, musicType mm.MusicType, freesrc m.Int) *mm.Music

func LoadMUS_RW

func LoadMUS_RW(src *m.RWops, freesrc m.Int) *mm.Music

func LoadWAV

func LoadWAV(file string) *mm.Chunk

func LoadWAV_RW

func LoadWAV_RW(src *m.RWops, freesrc m.Int) *mm.Chunk

func MasterVolume

func MasterVolume(volume m.Int) m.Int

func ModMusicJumpToOrder

func ModMusicJumpToOrder(order m.Int) m.Int

func MusicDuration

func MusicDuration(music *mm.Music) m.Double

func OpenAudio

func OpenAudio(frequency m.Int, format m.Uint16, channels m.Int, chunksize m.Int) m.Int

func OpenAudioDevice

func OpenAudioDevice(frequency m.Int, format m.Uint16, channels m.Int, chunksize m.Int, device string, allowed_changes m.Int) m.Int

func Pause

func Pause(channel m.Int)

func PauseMusic

func PauseMusic()

func Paused

func Paused(channel m.Int) m.Int

func PausedMusic

func PausedMusic() m.Int

func PlayChannel

func PlayChannel(channel m.Int, chunk *mm.Chunk, loops m.Int) m.Int

func PlayChannelTimed

func PlayChannelTimed(channel m.Int, chunk *mm.Chunk, loops m.Int, ticks m.Int) m.Int

func PlayMusic

func PlayMusic(music *mm.Music, loops m.Int) m.Int

func Playing

func Playing(channel m.Int) m.Int

func PlayingMusic

func PlayingMusic() m.Int

func QuerySpec

func QuerySpec(frequency *m.Int, format *m.Uint16, channels *m.Int) m.Int

func QuickLoad_RAW

func QuickLoad_RAW(mem *m.Uint8, len m.Uint32) *mm.Chunk

func QuickLoad_WAV

func QuickLoad_WAV(mem *m.Uint8) *mm.Chunk

func Quit

func Quit()

func RegisterEffect

func RegisterEffect(channel m.Int, f mm.EffectFunc, d mm.EffectDone, arg *m.Void) m.Int

func ReserveChannels

func ReserveChannels(num m.Int) m.Int

func Resume

func Resume(channel m.Int)

func ResumeMusic

func ResumeMusic()

func RewindMusic

func RewindMusic()

func SetDistance

func SetDistance(channel m.Int, distance m.Uint8) m.Int

func SetMusicCMD

func SetMusicCMD(command string) m.Int

func SetMusicPosition

func SetMusicPosition(position m.Double) m.Int

func SetPanning

func SetPanning(channel m.Int, left m.Uint8, right m.Uint8) m.Int

func SetPosition

func SetPosition(channel m.Int, angle m.Int16, distance m.Uint8) m.Int

func SetPostMix

func SetPostMix(mix_func mm.MixFunc, arg *m.Void)

extern DECLSPEC void SDLCALL Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);

func SetReverseStereo

func SetReverseStereo(channel m.Int, flip m.Int) m.Int

func SetSoundFonts

func SetSoundFonts(paths string) m.Int

func SetSynchroValue

func SetSynchroValue(value m.Int) m.Int

func SetTimidityCfg

func SetTimidityCfg(path string) m.Int

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 UnregisterAllEffects

func UnregisterAllEffects(channel m.Int) m.Int

func UnregisterEffect

func UnregisterEffect(channel m.Int, f mm.EffectFunc) m.Int

func Volume

func Volume(channel m.Int, volume m.Int) m.Int

func VolumeChunk

func VolumeChunk(chunk *mm.Chunk, volume m.Int) m.Int

func VolumeMusic

func VolumeMusic(volume m.Int) m.Int

Types

type ExternalFunctions

type ExternalFunctions struct {
	ExtFnGetError uintptr
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL