本文整理汇总了C#中CHANNEL_CALLBACK类的典型用法代码示例。如果您正苦于以下问题:C# CHANNEL_CALLBACK类的具体用法?C# CHANNEL_CALLBACK怎么用?C# CHANNEL_CALLBACK使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CHANNEL_CALLBACK类属于命名空间,在下文中一共展示了CHANNEL_CALLBACK类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCallback
public void SetCallback(Action<ChannelControlCallbackType, IntPtr, IntPtr> callback)
{
//Remove previous callback
RemoveCallback();
//Passing in null to set removes any existing callbacks
if (callback == null)
return;
//Keep a reference to the callback handler
//Create a callback which wraps the actual callback
//This will clean itself up when the "end" event happens
var callbackFunction = new CHANNEL_CALLBACK((channelraw, controltype, type, commanddata1, commanddata2) =>
{
//Call the real callback
callback((ChannelControlCallbackType)type, commanddata1, commanddata2);
//Clean up as necessary
if (type == CHANNELCONTROL_CALLBACK_TYPE.END)
{
// End of sound, we can release our callback handle now
_callbackHandle = null;
}
return RESULT.OK;
});
//Set the callback into FMOD
_fmod.setCallback(callbackFunction).Check();
// Hold the delegate object in memory
_callbackHandle = callbackFunction;
}
示例2: MusicPlayer
public MusicPlayer()
{
RESULT result;
result = Factory.System_Create(ref system);
ErrCheck(result);
uint version = 0;
result = system.getVersion(ref version);
ErrCheck(result);
if (version < VERSION.number)
throw new ApplicationException("Error! You are using an old version of FMOD " + version.ToString("X") + ". This program requires " + VERSION.number.ToString("X") + ".");
result = system.init(32, INITFLAGS.NORMAL, (IntPtr)null);
ErrCheck(result);
channelCallback = new CHANNEL_CALLBACK(OnEndMusic);
}
示例3: Music
public Music(FMOD.System system, string intropath, string looppath, float baseVol)
{
this.system = system;
callback = new CHANNEL_CALLBACK(SyncCallback);
baseVolume = baseVol;
volume = 1;
if (looppath != null) system.createSound(looppath, MODE.LOOP_NORMAL, ref loop);
if (intropath != null)
{
system.createSound(intropath, MODE.DEFAULT, ref intro);
}
Playing = false;
}
示例4: FMOD_Channel_SetCallback
private static extern RESULT FMOD_Channel_SetCallback(IntPtr channel, CHANNEL_CALLBACK callback);
示例5: setCallback
public RESULT setCallback(CHANNEL_CALLBACK callback)
{
return FMOD_Channel_SetCallback(channelraw, callback);
}
示例6: setCallback
public RESULT setCallback(CHANNEL_CALLBACK callback)
{
return FMOD_ChannelGroup_SetCallback(rawPtr, callback);
}
示例7: FMOD5_ChannelGroup_SetCallback
private static extern RESULT FMOD5_ChannelGroup_SetCallback(IntPtr channelgroup, CHANNEL_CALLBACK callback);
示例8: FMOD_Channel_SetCallback
private static extern RESULT FMOD_Channel_SetCallback(IntPtr channel, CHANNEL_CALLBACKTYPE type, CHANNEL_CALLBACK callback, int command);
示例9: setCallback
public RESULT setCallback(CHANNEL_CALLBACKTYPE type, CHANNEL_CALLBACK callback, int command)
{
return FMOD_Channel_SetCallback(channelraw, type, callback, command);
}
示例10: setCallback
public RESULT setCallback(CHANNEL_CALLBACK callback)
{
return ChannelControl.FMOD5_ChannelGroup_SetCallback(this.rawPtr, callback);
}
示例11: WavEffect
public WavEffect(FMOD.System system, string path, bool loop, float baseVol)
{
this.system = system;
callback = new CHANNEL_CALLBACK(SyncCallback);
baseVolume = baseVol;
volume = 1;
system.createSound(path, MODE.SOFTWARE | (loop ? MODE.LOOP_NORMAL : MODE.LOOP_OFF), ref sound);
channel = new Channel();
playCount = 0;
}