Exemple #1
0
        public bool Init()
        {
            if (!_intf.Init())
            {
                return(false);
            }

            _activeChannels   = new sbyte[16];
            _sustainChannels  = new sbyte[16];
            _assignedChannels = new ActiveChannel[128];
            for (int i = 0; i < _assignedChannels.Length; i++)
            {
                _assignedChannels[i] = new ActiveChannel();
            }
            _eventBuffer = new DlEvent[64];

            _tEnable    = new byte[32];
            _tMode      = new byte[32];
            _tOrdr      = new byte[32];
            _tLevel     = new sbyte[32];
            _tTranspose = new sbyte[32];

            Reset();

            return(true);
        }
Exemple #2
0
 public void ClearMessages()
 {
     if (ActiveChannel != null)
     {
         ActiveChannel.ClearMessages();
     }
 }
Exemple #3
0
        public int AssignChannel(int chan, int tableEntry)
        {
            if (tableEntry > 15 || chan > 127 || chan < 0)
            {
                return(3);
            }

            ActiveChannel a = _assignedChannels[chan];

            if (a.chan == tableEntry)
            {
                return(0);
            }

            if (a.chan != -1)
            {
                var   c = new Action <sbyte>(i => _activeChannels[a.chan] = i);
                sbyte b = _activeChannels[a.chan];
                while (b != chan)
                {
                    c = new Action <sbyte>(i => _assignedChannels[b].next = i);
                    b = _assignedChannels[b].next;
                    if (b == -1 && b != chan)
                    {
                        return(3);
                    }
                }

                c(a.next);

                if (a.note != 0)
                {
                    _intf.Callback(2, chan);
                }

                a.chan = a.next = -1;
                a.note = 0;
            }

            a.next = _activeChannels[tableEntry];
            _activeChannels[tableEntry] = (sbyte)chan;
            a.chan = (sbyte)tableEntry;
            a.note = a.sub = 0;

            return(0);
        }
Exemple #4
0
        public bool Init()
        {
            if (!_intf.Init())
                return false;

            _activeChannels = new sbyte[16];
            _sustainChannels = new sbyte[16];
            _assignedChannels = new ActiveChannel[128];
            for (int i = 0; i < _assignedChannels.Length; i++)
            {
                _assignedChannels[i] = new ActiveChannel();
            }
            _eventBuffer = new DlEvent[64];

            _tEnable = new byte[32];
            _tMode = new byte[32];
            _tOrdr = new byte[32];
            _tLevel = new sbyte[32];
            _tTranspose = new sbyte[32];

            Reset();

            return true;
        }
Exemple #5
0
 public void OnChannelActivate(NodeAddedEvent e, ActiveChannel activeChannel, Dialog dialog)
 {
     dialog.chatDialog.SetHeader(activeChannel.chatChannelUI.GetSpriteUid(), activeChannel.chatChannelUI.Name, activeChannel.chatChannel.ChatType == ChatType.PERSONAL);
     dialog.chatDialog.SelectChannel(activeChannel.chatChannel.ChatType, activeChannel.chatChannel.Messages);
 }