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
        public PreferencesDialog()
        {
            InitializeComponent();

            UpdateFolderLabel();

            Icon = Resources.VixenPlus;
            _preferences = Preference2.GetInstance();
            treeView.Nodes["nodeGeneral"].Tag = generalTab;
            treeView.Nodes["nodeScreen"].Tag = screenTab;
            treeView.Nodes["nodeNewSequenceSettings"].Tag = newSequenceSettingsTab;
            treeView.Nodes["nodeSequenceEditing"].Tag = sequenceEditingTab;
            treeView.Nodes["nodeSequenceExecution"].Tag = sequenceExecutionTab;
            tabControl.SelectedTab = generalTab;
            ReadPreferences(tabControl.TabPages.IndexOf(generalTab));
            PopulateProfileLists();
            PopulateScreens();
            PopulateColors();
            if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "shutdown.exe"))) {
                labelAutoShutdownTime.Enabled = false;
                dateTimePickerAutoShutdownTime.Checked = false;
                dateTimePickerAutoShutdownTime.Enabled = false;
            }
            PopulateAudioDeviceList();
        }
Beispiel #3
0
 public ExecutionImpl(Host host)
 {
     _host = host;
     _registeredContexts = new Dictionary<int, ExecutionContext>();
     _preferences = ((ISystem) Interfaces.Available["ISystem"]).UserPreferences;
     _errorLog = Path.Combine(Paths.DataPath, "iexecution.err");
 }
Beispiel #4
0
        public VixenPlusForm(IEnumerable<string> args)
        {
            var startupArgs = args as IList<string> ?? args.ToList();
            SetDataPath();
            Ensure(Paths.DataPath);
            Ensure(Paths.SequencePath);
            Ensure(Paths.ImportExportPath);
            Ensure(Paths.AudioPath);
            Ensure(Paths.ProfilePath);
            Ensure(Paths.SupportingFilesPath);
            Ensure(Paths.ProfileGeneration);
            Ensure(Paths.MapperPath);
            Ensure(Paths.NutcrackerDataPath);
            Ensure(Paths.RoutinePath);
            Ensure(Paths.CurveLibraryPath);
            _preferences = Preference2.GetInstance();
            PrepareUpdateSupportFiles();
            using (var splash = new Splash()) {
                var screen = Preference2.GetScreen(_preferences.GetString("PrimaryDisplay"));
                splash.FadeIn(screen);

                if (CheckForUpdates(screen, true)) {
                    Environment.Exit(0);
                }

                InitializeComponent();
                Icon = common.Resources.VixenPlus;
                SetVendorData();
                _registeredFileTypes = new Dictionary<string, IUIPlugIn>();
                _preferences.PreferenceChange += PreferencesPreferenceChange;
                Interfaces.Available["ISystem"] = this;
                Interfaces.Available["IExecution"] = new ExecutionImpl(new Host(this));
                _historyItemClick = HistoryItemClick;
                LoadHistory();
                var loadableData = new LoadableData();
                loadableData.LoadFromXml(_preferences.XmlDoc.DocumentElement);
                LoadUIPlugins();
                Cursor = Cursors.WaitCursor;
                try {
                    foreach (var sequence in startupArgs.Where(File.Exists)) {
                        OpenSequence(sequence);
                    }
                }
                finally {
                    Cursor = Cursors.Default;
                }
                SetShutdownTime(_preferences.GetString("ShutdownTime"));

                splash.FadeOut();
                Left = screen.Bounds.Left;
                Top = screen.Bounds.Top;
            }
        }
        public ChannelPropertyDialog(List<Channel> channels, Channel currentChannel, bool showOutputChannel)
        {
            InitializeComponent();
            Icon = Resources.VixenPlus;
            _preferences = Preference2.GetInstance();
            _channels = channels;
            _internalChange = true;
            comboBoxChannels.Items.AddRange(channels.ToArray());
            _internalChange = false;
            label3.Visible = labelOutputChannel.Visible = showOutputChannel;
            GotoChannel(currentChannel);

            colorDialog.CustomColors = _preferences.CustomColors;
        }
Beispiel #6
0
        public UpdateDialog(Screen startupScreen, bool isInStartup)
        {
            Log("Instantiate UpdateDialog start");
            _isInStartup = isInStartup;
            _preferences = Preference2.GetInstance();

            InitializeComponent();

            Left = startupScreen.Bounds.X + (startupScreen.WorkingArea.Width - Width) / 2;
            Top = startupScreen.Bounds.Y + (startupScreen.WorkingArea.Height - Height) / 2;
            MinimumSize = Size;
            MaximumSize = Size;
            Log("Instantiate UpdateDialog complete");
        }
        public AllChannelsColorDialog(List<Channel> channels)
        {
            InitializeComponent();
            Icon = common.Resources.VixenPlus;

            foreach (var channel in channels) {
                listBoxChannels.Items.Add(channel.Clone());
            }
            _colorsInUse = new Dictionary<int, Color>();
            _solidBrush = new SolidBrush(Color.White);
            foreach (var channel in channels) {
                if (_colorsInUse.ContainsKey(channel.Color.ToArgb())) {
                    continue;
                }

                listBoxColorsInUse.Items.Add(channel.Color);
                _colorsInUse.Add(channel.Color.ToArgb(), channel.Color);
            }
            _preferences = ((ISystem) Interfaces.Available["ISystem"]).UserPreferences;
            colorDialog.CustomColors = _preferences.CustomColors;
        }
Beispiel #8
0
 public SoundDeviceDialog(Preference2 preferences)
 {
     InitializeComponent();
     Icon = common.Resources.VixenPlus;
     _preferences = preferences;
 }
Beispiel #9
0
 public static Preference2 GetInstance()
 {
     return _preference2 ?? (_preference2 = new Preference2(Path.Combine(Paths.DataPath, "preferences")));
 }
        public NewSequenceWizardDialog(Preference2 preferences)
        {
            InitializeComponent();
            _preferences = preferences;
            _eventSequence = new EventSequence(_preferences);
            _history = new Stack<int>();

            InitializeClass();
        }
Beispiel #11
0
 public static Preference2 GetInstance()
 {
     return(_preference2 ?? (_preference2 = new Preference2(Path.Combine(Paths.DataPath, "preferences"))));
 }