Beispiel #1
0
        public void SelectInstrument(BaseInstrument instr)
        {
            if (_instr == instr)
            {
                return;
            }

            if (_instr != null)
            {
                _instr.Deactivate();
            }

            _prevInstr = _instr;
            _instr     = instr;
            if (_instr.Cursor != null)
            {
                viewer.Cursor = _instr.Cursor;
            }
            else
            {
                viewer.Cursor = Cursors.Default;
            }

            foreach (ToolStripButton b in _instrumentButtons)
            {
                if (b.Tag != instr && b.Checked)
                {
                    b.Checked = false;
                }
                else if (b.Tag == instr && !b.Checked)
                {
                    b.Checked = true;
                }
            }

            viewer.CurrInstrument = _instr;
        }