예제 #1
0
        public SchedulingCore(AudioCore audio, ILCDCharDisplay charDisplay, LocalControlModule lcm)
        {
            _audio = audio;
            _display = charDisplay;
            _lcm = lcm;

            MediaEntries = new ArrayList();
            LoadScheduleFile();

            var t = new Thread(ScheduleThread) { Priority = ThreadPriority.BelowNormal };
            t.Start();
        }
예제 #2
0
        public KnobSet(IRotaryEncoder rotaryEncoder, ILCDCharDisplay charDisplay, AudioCore audio, SchedulingCore scheduler, LocalControlModule lcm)
        {
            PlayModeActivated = true;
            _audio = audio;
            _lcm = lcm;
            _currentButtonState = (ButtonState) (-1);
            _position = -1;
            _playingPosition = -1;
            _playing = false;
            _isKnobPressed = false;
            KnobEntries = new ArrayList();

            _encoder = rotaryEncoder;

            // TODO : Optimize is to not to install eventhandlers when knob is disabled by user settings
            // TODO : also no need to load the knob file
            _encoder.RotaryMoved += EncoderMoved;
            _encoder.ButtonStateChanged += EncoderButtonStateChanged;
            _encoder.RotaryMoved += _lcm.EncoderMoved;

            Parse();
        }
예제 #3
0
        public Scii()
        {
            _lcdDisplay = new CharDisplay();

            PrintScreen("Schedulon II", "by Technomad LLC");
            Thread.Sleep(1000);
            PrintScreen("Audio.", "       Anywhere.");
            Thread.Sleep(1000);
            _lcdDisplay.Clear();
            PrintScreen("Schedulon II");

            Log.LogFileName = Settings.FileSystem.RootDir + Settings.FileSystem.SystemDir + @"log\logfile.txt";
            Log.InsertBlankLine();
            Log.WriteString(LogMessageType.Info, "Application start");

            IRotaryEncoder rotaryEncoder = new RotaryEncoder();
            IAudioRecordPlayer audioplayer = new AudioPlayer();

            var audioCore = new AudioCore(audioplayer);
            audioCore.NowPlaying += OnNowPlaying;
            audioCore.NowRecording += OnNowRecording;

            var lcm = new LocalControlModule(_lcdDisplay, rotaryEncoder, audioCore);
            var schedulingCore = new SchedulingCore(audioCore, _lcdDisplay, lcm);

            var knobSet = new KnobSet(rotaryEncoder, _lcdDisplay, audioCore, schedulingCore, lcm);

            var fileCore = new FileCore();

            try
            {
                Settings.Load();
            }
            catch (Exception e)
            {
                Log.WriteException(e, "Error loading system settings. System locked");
                PrintScreen("System halted", "Settings error");
                Thread.Sleep(Timeout.Infinite);
            }

            if (Settings.Web.UseLlmnr)
            {
                _llmnr = new LinkLocalMultiCastNameResolution("Schedulon");
                _llmnr.Start(IPAddress.Parse("10.0.0.110"));
            }

            var webServer = new WebServer(schedulingCore, knobSet, audioCore, fileCore);

            var webserverThread = new Thread(webServer.Run);
            webserverThread.Start();
        }