Beispiel #1
0
 public EventSequence(Preference2 preferences) : this()
 {
     _fullChannels = new List <Channel>();
     Channels      = new List <Channel>();
     PlugInData    = new SetupData();
     Extensions    = new SequenceExtensions();
     if (preferences != null)
     {
         _eventPeriod = preferences.GetInteger("EventPeriod");
         MinimumLevel = (byte)preferences.GetInteger("MinimumLevel");
         MaximumLevel = (byte)preferences.GetInteger("MaximumLevel");
         var profileName = preferences.GetString("DefaultProfile");
         if (profileName.Length > 0)
         {
             AttachToProfile(profileName);
         }
         AudioDeviceIndex = preferences.GetInteger("DefaultSequenceAudioDevice");
     }
     else
     {
         _eventPeriod     = 100;
         MinimumLevel     = 0;
         MaximumLevel     = 255;
         AudioDeviceIndex = -1;
     }
     Time = 60000;
 }
Beispiel #2
0
        private bool ExecutePlay(int contextHandle, int startMillisecond, int endMillisecond, bool logAudio)
        {
            ExecutionContext context;

            if (!_registeredContexts.TryGetValue(contextHandle, out context))
            {
                return(false);
            }
            if (!(((context.SynchronousEngineInstance != null) && (context.Object != null)) && context.Object.CanBePlayed))
            {
                return(false);
            }
            if (context.SynchronousEngineInstance.IsRunning)
            {
                return(false);
            }
            if (!context.SynchronousEngineInstance.IsPaused)
            {
                try {
                    context.SynchronousEngineInstance.Initialize(context.Object);
                }
                catch (Exception exception) {
                    LogError("ExecutePlay", exception);
                    return(false);
                }
            }
            var str = context.SynchronousEngineInstance.CurrentObject.Key.ToString(CultureInfo.InvariantCulture);

            Host.Communication["KeyInterceptor_" + str]   = context.KeyInterceptor;
            Host.Communication["ExecutionContext_" + str] = context;
            var flag         = context.SynchronousEngineInstance.Play(startMillisecond, endMillisecond, logAudio);
            var saveSettings = false;

            foreach (var form in context.OutputPlugInForms)
            {
                form.BringToFront();

                if (_preferences.CreateIfMissing("SavePlugInDialogPositions", form.Name + ".x", 0) |
                    _preferences.CreateIfMissing("SavePlugInDialogPositions", form.Name + ".y", 0))
                {
                    saveSettings = true;
                }
                form.Location = new Point(_preferences.GetInteger(form.Name + ".x"), _preferences.GetInteger(form.Name + ".y"));
            }

            if (saveSettings)
            {
                _preferences.SaveSettings();
            }

            return(flag);
        }
Beispiel #3
0
        private void AddToFileHistory(string fileName)
        {
            var item = Path.GetFileName(fileName);

            _history.Remove(item);
            _history.Insert(0, item);
            var maxCount = _preferences.GetInteger("RecentFiles");

            while (_history.Count > maxCount)
            {
                _history.RemoveAt(_history.Count - 1);
            }
            FlushHistory();
            LoadHistory();
        }
Beispiel #4
0
        private void ReadGeneralNodes()
        {
            textBoxMouseWheelVertical.Text   = _preferences.GetString("MouseWheelVerticalDelta");
            textBoxMouseWheelHorizontal.Text = _preferences.GetString("MouseWheelHorizontalDelta");
            var s = _preferences.GetString("ShutdownTime");

            if (s != string.Empty)
            {
                dateTimePickerAutoShutdownTime.Checked = true;
                dateTimePickerAutoShutdownTime.Value   = DateTime.Parse(s);
            }
            cbUpdateFrequency.SelectedItem   = _preferences.GetString("AutoUpdateCheckFreq");
            numericUpDownHistoryImages.Value = _preferences.GetInteger("HistoryImages");
            nudRecentFiles.Value             = _preferences.GetInteger("RecentFiles");
            cbToolbarAutoSave.Checked        = _preferences.GetBoolean("AutoSaveToolbars");
        }
        private void buttonAssignAudio_Click(object sender, EventArgs e)
        {
            var preferredSoundDevice = _preferences.GetInteger("SoundDevice");

            using (var dialog = new AudioDialog(_eventSequence, _preferences.GetBoolean("EventSequenceAutoSize"), preferredSoundDevice)) {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    SetSequenceTime();
                }
            }
        }
Beispiel #6
0
        private void SoundDeviceDialog_Load(object sender, EventArgs e)
        {
            comboBoxDevice.Items.AddRange(fmod.GetSoundDeviceList());
            var integer = _preferences.GetInteger("SoundDevice");

            if (integer >= comboBoxDevice.Items.Count)
            {
                return;
            }
            _internal = true;
            comboBoxDevice.SelectedIndex = integer;
            _internal = false;
        }