Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用bass设置歌曲/文件结尾的回调?_C#_.net_Bass - Fatal编程技术网

C# 如何使用bass设置歌曲/文件结尾的回调?

C# 如何使用bass设置歌曲/文件结尾的回调?,c#,.net,bass,C#,.net,Bass,我正在使用。我想设置一个回调,这样当歌曲结束时,我可以直接播放另一首歌曲 这不是C#,但这里有一些VB.Net代码,您应该能够很容易地转换: 设置回调 ' Mixer handle to the bass synch callback when the current track in the mixer ends Private m_MixerSynchProc As Un4seen.Bass.SYNCPROC Private m_MixerSyncHandle As Int32 = 0 '

我正在使用。我想设置一个回调,这样当歌曲结束时,我可以直接播放另一首歌曲

这不是C#,但这里有一些VB.Net代码,您应该能够很容易地转换:

设置回调

' Mixer handle to the bass synch callback when the current track in the mixer ends
Private m_MixerSynchProc As Un4seen.Bass.SYNCPROC
Private m_MixerSyncHandle As Int32 = 0

' Create a new callback for when the current track in the mixer has ended
m_MixerSynchProc = New Un4seen.Bass.SYNCPROC(AddressOf CurrentTrackEnded)

m_MixerSyncHandle = Bass.BASS_ChannelSetSync(m_MixerHandle, Un4seen.Bass.BASSSync.BASS_SYNC_END Or Un4seen.Bass.BASSSync.BASS_SYNC_MIXTIME, 0, m_MixerSynchProc, 0)
当曲目结束时BASS将调用的代理sub

' Mixer sync proc callback for when the current track has ended
Private Sub CurrentTrackEnded(ByVal MixerHandle As Int32, ByVal Channel As Int32, ByVal Data As Int32, ByVal User As IntPtr)
    ' Do stuff here when the track ends
End Sub