Beispiel #1
0
 public void CopyTo(Instrument dest)
 {
     if (_instrument != null)
         _instrument.CopyTo(dest);
     else
         dest.Clear();
 }
Beispiel #2
0
 public void CopyTo(Instrument dest)
 {
     dest.Adlib(_instrument);
 }
Beispiel #3
0
 public void CopyTo(Instrument dest)
 {
     dest.Program(_program, _mt32);
 }
Beispiel #4
0
        // For diagnostic reporting purposes only

        public Part()
        {
            Instrument = new Instrument();
        }
Beispiel #5
0
 public void CopyTo(Instrument dest)
 {
     dest.PcSpk(_instrument);
 }
Beispiel #6
0
 public IMuseInternal()
 {
     _snm_triggers = new ImTrigger[16];
     for (int i = 0; i < _snm_triggers.Length; i++)
     {
         _snm_triggers[i] = new ImTrigger();
     }
     _channel_volume = new ushort[8];
     _channel_volume_eff = new ushort[8];
     _volchan_table = new ushort[8];
     _players = new Player[8];
     for (int i = 0; i < _players.Length; i++)
     {
         _players[i] = new Player();
     }
     _player_limit = _players.Length;
     _parts = new Part[32];
     for (int i = 0; i < _parts.Length; i++)
     {
         _parts[i] = new Part();
     }
     _global_instruments = new Instrument[32];
     for (int i = 0; i < _global_instruments.Length; i++)
     {
         _global_instruments[i] = new Instrument();
     }
     _cmd_queue = new CommandQueue[64];
     for (int i = 0; i < _cmd_queue.Length; i++)
     {
         _cmd_queue[i] = new CommandQueue();
     }
     _deferredCommands = new DeferredCommand[4];
     for (int i = 0; i < _deferredCommands.Length; i++)
     {
         _deferredCommands[i] = new DeferredCommand();
     }
     _timer_info_adlib = new TimerCallbackInfo();
     _timer_info_native = new TimerCallbackInfo();
 }
Beispiel #7
0
        internal protected void CopyGlobalInstrument(byte slot, Instrument dest)
        {
            if (slot >= 32)
                return;

            // Both the AdLib code and the PC Speaker code use an all zero instrument
            // as default in the original, thus we do the same.
            // PC Speaker instrument size is 23, while AdLib instrument size is 30.
            // Thus we just use a 30 byte instrument data array as default.
            var defaultInstr = new byte[PcSpeaker ? 23 : 30];

            if (_global_instruments[slot].IsValid)
            {
                // In case we have an valid instrument set up, copy it to the part.
                _global_instruments[slot].CopyTo(dest);
            }
            else if (PcSpeaker)
            {
                Debug.WriteLine("Trying to use non-existent global PC Speaker instrument {0}", slot);
                dest.PcSpk(defaultInstr);
            }
            else
            {
                Debug.WriteLine("Trying to use non-existent global AdLib instrument {0}", slot);
                dest.Adlib(defaultInstr);
            }
        }