Пример #1
0
        public void ApplyCommand(byte commandCode)
        {
            var command = PsgCommandUtils.Create(commandCode);

            switch (command)
            {
            case LatchPsgCommand lc:
                _latchType    = lc.Type;
                _latchChannel = lc.Channel;
                WriteFourLowBits(lc.FourLowBits);
                UpdateLatchFrequencyAndVolume();
                break;

            case DataPsgCommand dc:
                WriteHighBits(dc.Data);
                UpdateLatchFrequencyAndVolume();
                break;

            default:
                throw new InvalidOperationException();
            }
        }
Пример #2
0
 public LatchPsgCommand(PsgChannel channel, PsgLatchType type, int fourLowBits)
 {
     Channel     = channel;
     Type        = type;
     FourLowBits = fourLowBits;
 }