예제 #1
0
 public MidiEntry(MidiEntry midiEntry)
 {
     _frequency    = midiEntry._frequency;
     _stepsize     = midiEntry._stepsize;
     _audiogain    = midiEntry._audiogain;
     _bandbreite   = midiEntry._bandbreite;
     _detectorType = midiEntry._detectorType;
     _startstop    = midiEntry._startstop;
 }
예제 #2
0
        public void leftVfo(int freq)
        {
            var  midiEntry = new MidiEntry();
            long step      = 1;

            midiEntry.Frequency = _controlInterface.Frequency;
            midiEntry.Stepsize  = _controlInterface.StepSize;


            switch (steppi)
            {
            case 1:
                step = 1;
                break;

            case 2:
                step = 100;
                break;

            case 3:
                step = 1000;
                break;

            case 4:
                step = 10000;
                break;

            case 5:
                step = midiEntry.Stepsize;
                break;

            case 6:
                step = midiEntry.Stepsize;
                break;

            default:
                step = midiEntry.Stepsize;
                break;
            }

            if (freq == 1)
            {
                _controlInterface.Frequency = midiEntry.Frequency + step;
            }
            else
            {
                _controlInterface.Frequency = midiEntry.Frequency - step;
            }
        }
예제 #3
0
        public void bandbreite(int pegel)
        {
            var midiEntry = new MidiEntry();

            midiEntry.Bandbreite = _controlInterface.FilterBandwidth;

            if (pegel == 127 && midiEntry.Bandbreite > 10)
            {
                _controlInterface.FilterBandwidth = midiEntry.Bandbreite - 10;
            }
            else if (pegel != 127 && midiEntry.Bandbreite < 32000)
            {
                _controlInterface.FilterBandwidth = midiEntry.Bandbreite + 10;
            }
        }
예제 #4
0
        public void fineTunigFreq(int pegel)
        {
            var midiEntry = new MidiEntry();

            midiEntry.Frequency = _controlInterface.Frequency;

            if (pegel == 127)
            {
                _controlInterface.Frequency = midiEntry.Frequency - 1;
            }
            else
            {
                _controlInterface.Frequency = midiEntry.Frequency + 1;
            }
        }
예제 #5
0
        private void lautleise(double pegel)
        {
            var midiEntry = new MidiEntry();

            double range    = 34.0;
            double max_in   = 127.0;
            double min_scal = 26.0;

            var scal = min_scal + (range / max_in * pegel);

            if (pegel != 0)
            {
                midiEntry.Audiogain         = (int)Math.Truncate(scal);
                _controlInterface.AudioGain = midiEntry.Audiogain;
            }
        }
예제 #6
0
        private void startStop(int pegel)
        {
            var midiEntry = new MidiEntry();

            midiEntry.Startstop = _controlInterface.IsPlaying;

            if (pegel == 127)
            {
                if (midiEntry.Startstop == true)
                {
                    _controlInterface.StopRadio();
                }
                else
                {
                    _controlInterface.StartRadio();
                }
            }
        }
예제 #7
0
        public void bandType(int pegel)
        {
            var midiEntry = new MidiEntry();

            midiEntry.DetectorType = _controlInterface.DetectorType;

            if (pegel == 1)
            {
                switch (midiEntry.DetectorType)
                {
                case DetectorType.NFM:
                    _controlInterface.DetectorType = DetectorType.AM;
                    break;

                case DetectorType.AM:
                    _controlInterface.DetectorType = DetectorType.LSB;
                    break;

                case DetectorType.LSB:
                    _controlInterface.DetectorType = DetectorType.USB;
                    break;

                case DetectorType.USB:
                    _controlInterface.DetectorType = DetectorType.WFM;
                    break;

                case DetectorType.WFM:
                    _controlInterface.DetectorType = DetectorType.DSB;
                    break;

                case DetectorType.DSB:
                    _controlInterface.DetectorType = DetectorType.CW;
                    break;

                case DetectorType.CW:
                    _controlInterface.DetectorType = DetectorType.RAW;
                    break;

                case DetectorType.RAW:
                    _controlInterface.DetectorType = DetectorType.NFM;
                    break;
                }
            }
            else
            {
                switch (midiEntry.DetectorType)
                {
                case DetectorType.NFM:
                    _controlInterface.DetectorType = DetectorType.RAW;
                    break;

                case DetectorType.RAW:
                    _controlInterface.DetectorType = DetectorType.CW;
                    break;

                case DetectorType.CW:
                    _controlInterface.DetectorType = DetectorType.DSB;
                    break;

                case DetectorType.DSB:
                    _controlInterface.DetectorType = DetectorType.WFM;
                    break;

                case DetectorType.WFM:
                    _controlInterface.DetectorType = DetectorType.USB;
                    break;

                case DetectorType.USB:
                    _controlInterface.DetectorType = DetectorType.LSB;
                    break;

                case DetectorType.LSB:
                    _controlInterface.DetectorType = DetectorType.AM;
                    break;

                case DetectorType.AM:
                    _controlInterface.DetectorType = DetectorType.NFM;
                    break;
                }
            }
        }