Beispiel #1
0
 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);
        }
Beispiel #4
0
 private static void HandleVolumeChange(float volume, IntPtr data)
 {
     MLThreadDispatch.Call(volume, OnVolumeChange);
 }
Beispiel #5
0
 private static void HandleStatusChange(MLMusicService.Status status, IntPtr data)
 {
     MLThreadDispatch.Call(status, OnStatusChange);
 }
Beispiel #6
0
 private static void HandlePositionChange(int position, IntPtr data)
 {
     MLThreadDispatch.Call(position, OnPositionChange);
 }
Beispiel #7
0
 private static void HandleMetadataChange(ref MLMusicServiceNativeBindings.MetadataNative metadata, IntPtr data)
 {
     MLMusicService.Metadata lambdaExtra = metadata.Data;
     MLThreadDispatch.Call(lambdaExtra, OnMetadataChange);
 }
Beispiel #8
0
 private static void HandleShuffleStateChange(MLMusicService.ShuffleStateType state, IntPtr data)
 {
     MLThreadDispatch.Call(state, OnShuffleStateChange);
 }
Beispiel #9
0
 private static void HandleRepeatStateChange(MLMusicService.RepeatStateType state, IntPtr data)
 {
     MLThreadDispatch.Call(state, OnRepeatStateChange);
 }
Beispiel #10
0
 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);
 }