Esempio n. 1
0
        protected virtual void OnSysRealtimeMessageDispatched(SysRealtimeMessageEventArgs e)
        {
            EventHandler <SysRealtimeMessageEventArgs> handler = SysRealtimeMessageDispatched;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        protected virtual void OnSysRealtimeMessageReceived(SysRealtimeMessageEventArgs e)
        {
            EventHandler <SysRealtimeMessageEventArgs> handler = SysRealtimeMessageReceived;

            if (handler != null)
            {
                context.Post(delegate(object dummy)
                {
                    handler(this, e);
                }, null);
            }
        }
Esempio n. 3
0
        protected virtual void OnSysRealtimeMessageReceived(SysRealtimeMessageEventArgs e)
        {
            EventHandler<SysRealtimeMessageEventArgs> handler = SysRealtimeMessageReceived;

            if(handler != null)
            {
                context.Post(delegate(object dummy)
                {
                    handler(this, e);
                }, null);
            }
        }
Esempio n. 4
0
        protected virtual void OnSysRealtimeMessageReceived(SysRealtimeMessageEventArgs e)
        {
            EventHandler <SysRealtimeMessageEventArgs> handler = SysRealtimeMessageReceived;

            if (context == null)
            {
                context = SynchronizationContext.Current;
            }
            if (handler != null && context != null)
            {
                context.Post(delegate(object dummy)
                {
                    handler(this, e);
                }, null);
            }
        }
 private void EventSource_SysRealtimeMessageReceived(object sender, SysRealtimeMessageEventArgs e)
 {
     FOutDevice.Send(e.Message);
 }
Esempio n. 6
0
        private void HandleSysRealtimeMessageReceived(object sender, SysRealtimeMessageEventArgs e)
        {
            context.Post(delegate(object dummy)
            {
                sysRealtimeListBox.Items.Add(
                    e.Message.SysRealtimeType.ToString());

                sysRealtimeListBox.SelectedIndex = sysRealtimeListBox.Items.Count - 1;
            }, null);
        }
 public static ShortMessageEventArgs FromSysRealtimeMessage(SysRealtimeMessageEventArgs arg)
 {
     return(new ShortMessageEventArgs(arg.Message));
 }
        private void HandleShortMessage(object state)
        {
            int message = (int)state;
            int status  = ShortMessage.UnpackStatus(message);

            if (status >= (int)ChannelCommand.NoteOff &&
                status <= (int)ChannelCommand.PitchWheel +
                ChannelMessage.MidiChannelMaxValue)
            {
                cmBuilder.Message = message;
                cmBuilder.Build();

                OnChannelMessageReceived(new ChannelMessageEventArgs(cmBuilder.Result));
            }
            else if (status == (int)SysCommonType.MidiTimeCode ||
                     status == (int)SysCommonType.SongPositionPointer ||
                     status == (int)SysCommonType.SongSelect ||
                     status == (int)SysCommonType.TuneRequest)
            {
                scBuilder.Message = message;
                scBuilder.Build();

                OnSysCommonMessageReceived(new SysCommonMessageEventArgs(scBuilder.Result));
            }
            else
            {
                SysRealtimeMessageEventArgs e = null;

                switch ((SysRealtimeType)status)
                {
                case SysRealtimeType.ActiveSense:
                    e = SysRealtimeMessageEventArgs.ActiveSense;
                    break;

                case SysRealtimeType.Clock:
                    e = SysRealtimeMessageEventArgs.Clock;
                    break;

                case SysRealtimeType.Continue:
                    e = SysRealtimeMessageEventArgs.Continue;
                    break;

                case SysRealtimeType.Reset:
                    e = SysRealtimeMessageEventArgs.Reset;
                    break;

                case SysRealtimeType.Start:
                    e = SysRealtimeMessageEventArgs.Start;
                    break;

                case SysRealtimeType.Stop:
                    e = SysRealtimeMessageEventArgs.Stop;
                    break;

                case SysRealtimeType.Tick:
                    e = SysRealtimeMessageEventArgs.Tick;
                    break;
                }

                OnSysRealtimeMessageReceived(e);
            }
        }
 protected virtual void OnSysRealtimeMessageReceived(SysRealtimeMessageEventArgs e)
 {
     EventHandler<SysRealtimeMessageEventArgs> handler = SysRealtimeMessageReceived;
     if (context == null)
         context = SynchronizationContext.Current;
     if (handler != null && context != null)
     {
         context.Post(delegate(object dummy)
         {
             handler(this, e);
         }, null);
     }
 }
        protected virtual void OnSysRealtimeMessageDispatched(SysRealtimeMessageEventArgs e)
        {
            EventHandler<SysRealtimeMessageEventArgs> handler = SysRealtimeMessageDispatched;

            if(handler != null)
            {
                handler(this, e);
            }
        }
Esempio n. 11
0
 protected virtual void OnSysRealtimeMessageDispatched(SysRealtimeMessageEventArgs e)
 {
     SysRealtimeMessageDispatched?.Invoke(this, e);
 }