bass

package module
v0.0.0-...-8d8308a Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

go interface lib for bass copy from github.com/ying32/govcl/pkgs/bass

Documentation

Index

Constants

View Source
const (
	BASSVERSION     = 0x204 // API version
	BASSVERSIONTEXT = "2.4"
)
View Source
const (
	PsUnkown = iota + 0
	PsPlaying
	PsStoped
	PsPaused
)
View Source
const (
	// BASS_ChannelGetLength/GetPosition/SetPosition modes
	BASS_POS_BYTE        = 0          // byte position
	BASS_POS_MUSIC_ORDER = 1          // order.row position, MAKELONG(order,row)
	BASS_POS_OGG         = 3          // OGG bitstream number
	BASS_POS_INEXACT     = 0x8000000  // flag: allow seeking to inexact position
	BASS_POS_DECODE      = 0x10000000 // flag: get the decoding (not playing) position
	BASS_POS_DECODETO    = 0x20000000 // flag: decode to the position instead of seeking
	BASS_POS_SCAN        = 0x40000000 // flag: scan to the position

	// Channel attributes
	BASS_ATTRIB_FREQ = 1
	BASS_ATTRIB_VOL  = 2

	// Error codes returned by BASS_ErrorGetCode
	BASS_OK             = 0  // all is OK
	BASS_ERROR_MEM      = 1  // memory error
	BASS_ERROR_FILEOPEN = 2  // can't open the file
	BASS_ERROR_DRIVER   = 3  // can't find a free/valid driver
	BASS_ERROR_BUFLOST  = 4  // the sample buffer was lost
	BASS_ERROR_HANDLE   = 5  // invalid handle
	BASS_ERROR_FORMAT   = 6  // unsupported sample format
	BASS_ERROR_POSITION = 7  // invalid position
	BASS_ERROR_INIT     = 8  // BASS_Init has not been successfully called
	BASS_ERROR_START    = 9  // BASS_Start has not been successfully called
	BASS_ERROR_SSL      = 10 // SSL/HTTPS support isn't available
	BASS_ERROR_ALREADY  = 14 // already initialized/paused/whatever
	BASS_ERROR_NOCHAN   = 18 // can't get a free channel
	BASS_ERROR_ILLTYPE  = 19 // an illegal type was specified
	BASS_ERROR_ILLPARAM = 20 // an illegal parameter was specified
	BASS_ERROR_NO3D     = 21 // no 3D support
	BASS_ERROR_NOEAX    = 22 // no EAX support
	BASS_ERROR_DEVICE   = 23 // illegal device number
	BASS_ERROR_NOPLAY   = 24 // not playing
	BASS_ERROR_FREQ     = 25 // illegal sample rate
	BASS_ERROR_NOTFILE  = 27 // the stream is not a file stream
	BASS_ERROR_NOHW     = 29 // no hardware voices available
	BASS_ERROR_EMPTY    = 31 // the MOD music has no sequence data
	BASS_ERROR_NONET    = 32 // no internet connection could be opened
	BASS_ERROR_CREATE   = 33 // couldn't create the file
	BASS_ERROR_NOFX     = 34 // effects are not available
	BASS_ERROR_NOTAVAIL = 37 // requested data is not available
	BASS_ERROR_DECODE   = 38 // the channel is/isn't a "decoding channel"
	BASS_ERROR_DX       = 39 // a sufficient DirectX version is not installed
	BASS_ERROR_TIMEOUT  = 40 // connection timedout
	BASS_ERROR_FILEFORM = 41 // unsupported file format
	BASS_ERROR_SPEAKER  = 42 // unavailable speaker
	BASS_ERROR_VERSION  = 43 // invalid BASS version (used by add-ons)
	BASS_ERROR_CODEC    = 44 // codec is not available/supported
	BASS_ERROR_ENDED    = 45 // the channel/file has ended
	BASS_ERROR_BUSY     = 46 // the device is busy
	BASS_ERROR_UNKNOWN  = -1 // some other mystery problem
)

Variables

This section is empty.

Functions

func BASS_ChannelBytes2Seconds

func BASS_ChannelBytes2Seconds(handle HSTREAM, pos uint64) float64

func BASS_ChannelGetAttribute

func BASS_ChannelGetAttribute(handle HSTREAM, attrib uint32, value *float32) bool

func BASS_ChannelGetDevice

func BASS_ChannelGetDevice(handle HSTREAM) uint32

func BASS_ChannelGetLength

func BASS_ChannelGetLength(handle HSTREAM, mode uint32) uint64

func BASS_ChannelGetPosition

func BASS_ChannelGetPosition(handle HSTREAM, mode uint32) uint64

func BASS_ChannelPause

func BASS_ChannelPause(handle HSTREAM) bool

func BASS_ChannelPlay

func BASS_ChannelPlay(handle HSTREAM, restart bool) bool

func BASS_ChannelSeconds2Bytes

func BASS_ChannelSeconds2Bytes(handle HSTREAM, pos float64) uint64

func BASS_ChannelSetAttribute

func BASS_ChannelSetAttribute(handle HSTREAM, attrib uint32, value float32) bool

func BASS_ChannelSetDevice

func BASS_ChannelSetDevice(handle HSTREAM, device uint32) bool

func BASS_ChannelSetPosition

func BASS_ChannelSetPosition(handle HSTREAM, pos uint64, mode uint32) bool

func BASS_ChannelStop

func BASS_ChannelStop(handle HSTREAM) bool

func BASS_ErrorGetCode

func BASS_ErrorGetCode() int

func BASS_Free

func BASS_Free() bool

func BASS_GetDevice

func BASS_GetDevice() uint32

func BASS_GetDeviceInfo

func BASS_GetDeviceInfo(device uint32, info *DeviceInfo) bool

func BASS_GetInfo

func BASS_GetInfo(info *BassInfo) bool

func BASS_GetVersion

func BASS_GetVersion() uint32

func BASS_Init

func BASS_Init(device int, freq, flags uint32, win HWND, dsguid uintptr) bool

func BASS_SetDevice

func BASS_SetDevice(device uint32) bool

func BASS_SetVolume

func BASS_SetVolume(vol uint32) bool

func BASS_StreamFree

func BASS_StreamFree(handle HSTREAM) bool

func BassFree

func BassFree()

BassFree 释放库

func ErrorFromCode

func ErrorFromCode() error

func GetFileLength

func GetFileLength(fileName string) int

func ToUInt64

func ToUInt64(r1, r2 uintptr) uint64

Types

type BassInfo

type BassInfo struct {
	Flags     uint32
	Hwsize    uint32
	Hwfree    uint32
	Freesam   uint32
	Free3d    uint32
	Minrate   uint32
	Maxrate   uint32
	Eax       bool
	Minbuf    uint32
	Dsver     uint32
	Latency   uint32
	Initflags uint32
	Speakers  uint32
	Freq      uint32
}

type DeviceInfo

type DeviceInfo struct {
	Flags uint32
	// contains filtered or unexported fields
}

func (*DeviceInfo) Driver

func (d *DeviceInfo) Driver() string

func (*DeviceInfo) Name

func (d *DeviceInfo) Name() string

type HSTREAM

type HSTREAM uint32

func BASS_StreamCreateFile

func BASS_StreamCreateFile(mem bool, file string, offset, length uint64, flags uint32) HSTREAM

type HWND

type HWND = uintptr

type TBass

type TBass struct {
	State TPlayState
	// contains filtered or unexported fields
}

func NewBass

func NewBass(device int) (*TBass, error)

func NewDefaultBass

func NewDefaultBass() *TBass

NewBass 新建播放类

func (*TBass) Close

func (c *TBass) Close() error

Close 停止并释放一个流

func (*TBass) GetDevice

func (c *TBass) GetDevice() (uint32, error)

GetDevice 获取播放设备

func (*TBass) GetLength

func (c *TBass) GetLength() (uint, error)

GetLength 在取媒体文件长度

func (*TBass) GetPosition

func (c *TBass) GetPosition() (uint, error)

GetPosition 获取媒体当前播放的位置

func (*TBass) GetVolume

func (c *TBass) GetVolume() (uint32, error)

GetVolume 获取播放音量

func (*TBass) IsValid

func (c *TBass) IsValid() bool

IsValid 文件是否效

func (*TBass) OpenFile

func (c *TBass) OpenFile(filename string) error

OpenFile 打开一个文件,用作播放的

func (*TBass) Pause

func (c *TBass) Pause() error

Pause 暂停播放

func (*TBass) Play

func (c *TBass) Play(loop bool) error

Play 播放

func (*TBass) SetDevice

func (c *TBass) SetDevice(val uint32) error

SetDevice 设置播放设备

func (*TBass) SetPosition

func (c *TBass) SetPosition(val uint) error

SetPosition 设置媒体播放位置

func (*TBass) SetVolume

func (c *TBass) SetVolume(val int) error

SetVolume 设置播放音量

func (*TBass) Stop

func (c *TBass) Stop() error

Stop 停止播放

func (*TBass) TimeStrLabel

func (c *TBass) TimeStrLabel() string

type TPlayState

type TPlayState int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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