Exemplo n.º 1
0
        public MainForm(Engine engine)
        {
            InitializeComponent();

            Text = App.GetProductName() + " " + App.GetVersionString(false);
            #if DEBUG
            Text += Strings.DebugSuffix;
            #endif
            Icon = Properties.Resources.App;

            _engine = engine;
            _engine.Invoker = this;
            _engine.Hook += EngineHook;

            _tray = new NotifyIcon();
            _tray.MouseClick += TrayClick;
            _tray.Text = this.Text;
            _tray.Icon = this.Icon;
            _tray.ContextMenu = mnuTray;

            _previewer = new MciAudio();

            lnkMainNapLen.Bounds = txtMainNapLen.Bounds;
            lnkMainCoreLen.Bounds = txtMainCoreLen.Bounds;
            cboMainTestMethod.SelectedIndex = 0;

            imlImages.Images.Add(Properties.Resources.Open);
            imlImages.Images.Add(Properties.Resources.Play);
            imlImages.Images.Add(Properties.Resources.Stop);

            RefreshSettings();
        }
Exemplo n.º 2
0
        public Sounder(Engine engine)
        {
            _engine = engine;
            _engine.Hook += EngineHook;

            _fadeInTimer = new Timer(FadeInGranMsec);
            _fadeInTimer.AutoReset = true;
            _fadeInTimer.Elapsed += FadeInTimer_Elapsed;

            _warning = new MciAudio();
            _warning.Repeat = true;
            _alarm = new MciAudio();
            _alarm.Repeat = true;
        }
Exemplo n.º 3
0
        public NappingForm(Engine engine)
        {
            InitializeComponent();

            #if DEBUG
            TopMost = false;
            #endif

            _engine = engine;
            _engine.Hook += EngineHook;

            _secondsTimer = new Timer();
            _secondsTimer.Interval = 1000;
            _secondsTimer.Tick += SecondsTick;
        }
Exemplo n.º 4
0
        public TestForm(Engine engine)
        {
            InitializeComponent();

            #if DEBUG
            TopMost = false;
            #endif

            _engine = engine;
            _random = new Random();
            _muteTimer = new Countdown();
            _muteTimer.Elapsed += MuteTimer_Elapsed;
            _vitalTimer = new Countdown();
            _vitalTimer.Elapsed += VitalTimer_Elapsed;
        }
Exemplo n.º 5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if(!CheckSingleInstance())
                return;

            Settings = new Settings();
            Settings.LoadFromFile();

            _engine = new Engine();
            new Logger(_engine);

            // This is created before the engine is init'd so it can receive and
            // display messages that happen while the engine is loading
            var mainForm = new MainForm(_engine);

            new Sounder(_engine);
            _engine.RaiseEvent(EngineEvent.Init);
            _engine.RaiseEvent(EngineEvent.LoadSettings);

            try {
                Application.Run(mainForm);
            } finally {
                _engine.RaiseEvent(EngineEvent.Shutdown);
            }
        }
Exemplo n.º 6
0
 void PseudoDispose()
 {
     _secondsTimer.Stop();
     _secondsTimer.Dispose();
     _engine.Hook -= EngineHook;
     _engine = null;
 }
Exemplo n.º 7
0
 public Logger(Engine engine)
 {
     _engine = engine;
     _engine.Hook += EngineHook;
 }