private static void HandleError(MLMusicService.ErrorType type, int code, IntPtr data) { MLMusicService.Error error = new MLMusicService.Error { Type = type, Code = code }; MLThreadDispatch.Call(error, OnError); }
public static void OnConnectionCallbackInternal(MLResult.Code result, [MarshalAs(UnmanagedType.LPStr)] string connectionName, IntPtr userData) { if (MLResult.IsOK(result)) { MLAppConnect.RegisterEventCallback(connectionName); } MLThreadDispatch.Call(result, connectionName, OnConnection); }
public static void OnEventCallbackInternal(IntPtr unmanagedEventInfo, IntPtr userData) { EventInfoInternal internalEventInfo = (EventInfoInternal)Marshal.PtrToStructure(unmanagedEventInfo, typeof(EventInfoInternal)); MLAppConnect.EventInfo eventInfo = new MLAppConnect.EventInfo(); eventInfo.Version = internalEventInfo.Version; eventInfo.EventName = internalEventInfo.EventName; eventInfo.ConnectionName = internalEventInfo.ConnectionName; switch (eventInfo.EventName) { case MLAppConnect.EventType.UserExited: case MLAppConnect.EventType.UserJoined: case MLAppConnect.EventType.UserInvite: case MLAppConnect.EventType.UsersInviteAbort: eventInfo.UserInfo = (MLAppConnect.UserEventInfo)Marshal.PtrToStructure(internalEventInfo.UserInfo, typeof(MLAppConnect.UserEventInfo)); MLThreadDispatch.Call(eventInfo.EventName, eventInfo.UserInfo, OnUsersEvent); break; case MLAppConnect.EventType.MicMuted: case MLAppConnect.EventType.MicUnmuted: eventInfo.MicrophoneInfo = (MLAppConnect.MicrophoneEventInfo)Marshal.PtrToStructure(internalEventInfo.MicrophoneInfo, typeof(MLAppConnect.MicrophoneEventInfo)); MLThreadDispatch.Call(eventInfo.EventName, eventInfo.MicrophoneInfo, OnMicrophoneEvent); break; case MLAppConnect.EventType.PipeCreated: case MLAppConnect.EventType.PipeDeleted: case MLAppConnect.EventType.PipeFailed: case MLAppConnect.EventType.PipeLargeData: eventInfo.PipeInfo = (MLAppConnect.PipeEventInfo)Marshal.PtrToStructure(internalEventInfo.PipeInfo, typeof(MLAppConnect.PipeEventInfo)); MLThreadDispatch.Call(eventInfo.EventName, eventInfo.PipeInfo, OnPipeEvent); break; default: return; } MLThreadDispatch.Call(eventInfo.EventName, OnEvent); }
private static void HandleVolumeChange(float volume, IntPtr data) { MLThreadDispatch.Call(volume, OnVolumeChange); }
private static void HandleStatusChange(MLMusicService.Status status, IntPtr data) { MLThreadDispatch.Call(status, OnStatusChange); }
private static void HandlePositionChange(int position, IntPtr data) { MLThreadDispatch.Call(position, OnPositionChange); }
private static void HandleMetadataChange(ref MLMusicServiceNativeBindings.MetadataNative metadata, IntPtr data) { MLMusicService.Metadata lambdaExtra = metadata.Data; MLThreadDispatch.Call(lambdaExtra, OnMetadataChange); }
private static void HandleShuffleStateChange(MLMusicService.ShuffleStateType state, IntPtr data) { MLThreadDispatch.Call(state, OnShuffleStateChange); }
private static void HandleRepeatStateChange(MLMusicService.RepeatStateType state, IntPtr data) { MLThreadDispatch.Call(state, OnRepeatStateChange); }
private static void HandlePlaybackStateChange(MLMusicService.PlaybackStateType state, IntPtr data) { MLThreadDispatch.Call(state, OnPlaybackStateChange); }
public static void OnInviteCallbackInternal([MarshalAs(UnmanagedType.LPStr)] string connectionName, MLAppConnect.KeyValue[] arguments, uint argumentsCount, IntPtr userData) { MLAppConnect.ConnectionName = connectionName; MLThreadDispatch.Call(connectionName, OnInvite); }