代码拉取完成,页面将自动刷新
'BASS for freebasic translate by Cm.Wang
#include once "BassPlayback.bi"
#pragma once
Private Constructor BassPlayback
PlayStatus = BassStatus.BassStop
PlayBuffer = False
End Constructor
Private Destructor BassPlayback
Stop()
End Destructor
Private Sub BassPlayback.Pause()
If (PlayStream) Then
Bass_ChannelPause(PlayStream)
PlayStatus = BassStatus.BassPause
End If
End Sub
Private Sub BassPlayback.Play()
If (PlayStream) Then
Bass_ChannelPlay(PlayStream, 0)
PlayStatus = BassStatus.BassPlay
End If
End Sub
Private Sub BassPlayback.Resume()
Play()
End Sub
Private Function BassPlayback.OpenBuffer(aBuffer As Any Ptr, qLength As QWORD, bLoop As Boolean = True) As Boolean
Stop()
Dim As DWORD flag = BASS_SAMPLE_FX Or BASS_UNICODE
If bLoop Then flag = flag Or BASS_SAMPLE_LOOP
PlayStream = BASS_StreamCreateFile(True , aBuffer, 0, qLength, flag)
If PlayStream Then
PlayLength = BASS_ChannelGetLength(PlayStream , BASS_POS_BYTE)
Play()
PlayBuffer = True
Return True
End If
End Function
Private Function BassPlayback.OpenFile(File As WString, bLoop As Boolean = True) As Boolean
Stop()
Dim As DWORD flag = BASS_SAMPLE_FX Or BASS_UNICODE
If bLoop Then flag = flag Or BASS_SAMPLE_LOOP
PlayStream = BASS_StreamCreateFile(0 , @File, 0, 0, flag)
If PlayStream Then
PlayLength = BASS_ChannelGetLength(PlayStream , BASS_POS_BYTE)
Play()
PlayBuffer = False
Return True
End If
End Function
Private Sub BassPlayback.Stop()
If PlayStream Then
Bass_ChannelStop(PlayStream)
Bass_StreamFree(PlayStream)
PlayStream = 0
PlayStatus = BassStatus.BassStop
PlayBuffer = False
End If
End Sub
Private Property BassPlayback.BufferPlaying As Boolean
Property = PlayBuffer
End Property
Private Property BassPlayback.Status As BassStatus
Property = PlayStatus
End Property
Private Property BassPlayback.Stream As HSTREAM
Property = PlayStream
End Property
Private Property BassPlayback.Length As DWORD
Property = PlayLength
End Property
Private Property BassPlayback.Position As DWORD
PlayPosition = BASS_ChannelGetPosition(PlayStream, BASS_POS_BYTE)
Property = PlayPosition
End Property
Private Property BassPlayback.Position(dpos As DWORD)
BASS_ChannelSetPosition(PlayStream, dpos, BASS_POS_BYTE)
PlayPosition = dpos
End Property
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。