Exemplo n.º 1
0
        public VixenPlusRoadie(IExecutable iExecutable = null, bool pluginsOnly = false)
        {
            InitializeComponent();
            Text        = Vendor.ProductName;
            Icon        = Resources.VixenPlus;
            MinimumSize = Size;

            _suppressErrors = Preference2.GetInstance().GetBoolean("SilenceProfileErrors");

            _isPluginsOnly = pluginsOnly;

            if (!_isPluginsOnly && null != iExecutable && string.IsNullOrEmpty(iExecutable.Name))
            {
                AddProfile((Profile)iExecutable);
            }

            InitializeControls();

            if (_isPluginsOnly)
            {
                tcProfile.TabPages.RemoveByKey(TabChannels);
                _contextProfile    = iExecutable;
                gbProfiles.Visible = false;
            }

            if (null != iExecutable && !_isPluginsOnly)
            {
                SetProfileIndex(iExecutable.Name);
            }
            else
            {
                cbProfiles.SelectedIndex = 0;
            }
        }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
 private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (CheckForUpdates(Preference2.GetScreen(_preferences.GetString("PrimaryDisplay")), false))
     {
         Close();
     }
 }
Exemplo n.º 4
0
        private void btnGroupColor_Click(object sender, EventArgs e)
        {
            using (var color = new ColorDialog {
                AllowFullOpen = true, AnyColor = true, FullOpen = true
            }) {
                color.CustomColors = Preference2.GetInstance().CustomColors;

                if (color.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                SetContextDirty();
                tvGroups.BeginUpdate();
                foreach (var s in tvGroups.SelectedNodes)
                {
                    var affectedNodeText = s.Text;
                    foreach (TreeNode treeNode in tvGroups.Nodes)
                    {
                        SetColorByName(treeNode, color.Color, affectedNodeText);
                    }
                }
                tvGroups.EndUpdate();
                Preference2.GetInstance().CustomColors = color.CustomColors;
            }
        }
Exemplo n.º 5
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();
        }
Exemplo n.º 6
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");
 }
Exemplo n.º 7
0
 private void PopulateScreens()
 {
     foreach (var screen in Screen.AllScreens)
     {
         cbScreens.Items.Add(Preference2.FixDeviceName(screen.DeviceName));
     }
     cbScreens.SelectedIndex = 0;
 }
Exemplo n.º 8
0
        public NewSequenceWizardDialog(Preference2 preferences)
        {
            InitializeComponent();
            _preferences   = preferences;
            _eventSequence = new EventSequence(_preferences);
            _history       = new Stack <int>();

            InitializeClass();
        }
Exemplo n.º 9
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;
            }
        }
Exemplo n.º 10
0
 private void palette_Click(object sender, EventArgs e)
 {
     using (var colorDialog = new ColorDialog {
         AllowFullOpen = true, AnyColor = true, FullOpen = true
     }) {
         colorDialog.CustomColors = Preference2.GetInstance().CustomColors;
         if (colorDialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         ((Label)sender).BackColor = colorDialog.Color;
         Preference2.GetInstance().CustomColors = colorDialog.CustomColors;
     }
 }
Exemplo n.º 11
0
        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;
        }
Exemplo n.º 12
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");
        }
Exemplo n.º 13
0
        public Routine(string filePath)
        {
            FilePath = filePath;
            if (!File.Exists(filePath))
            {
                return;
            }

            Name          = Path.GetFileNameWithoutExtension(filePath);
            _routineColor = Color.FromArgb(Int32.Parse(Preference2.GetInstance().GetString("RoutineBitmap")));
            using (var stream = new FileStream(filePath, FileMode.Open))
                using (var reader = new StreamReader(stream)) {
                    var line  = reader.ReadLine();
                    var width = 0;
                    if (line != null)
                    {
                        width = line.Split(' ').Length - 1;
                    }
                    var height = 1;
                    while (reader.ReadLine() != null)
                    {
                        height++;
                    }
                    stream.Seek(0L, SeekOrigin.Begin);
                    var y = 0;
                    Preview = new Bitmap(width, height);
                    string row;
                    while ((row = reader.ReadLine()) != null)
                    {
                        var x = 0;
                        foreach (var pixels in row.Split(' ').Where(pixels => pixels.Length > 0))
                        {
                            Preview.SetPixel(x++, y, Color.FromArgb(Convert.ToByte(pixels), _routineColor));
                        }
                        y++;
                    }
                }
            if (Preview.Width != DefaultWidth || Preview.Height != DefaultHeight)
            {
                Preview = ResizeImage(Preview);
            }
            PreviewBounds = new Rectangle(0, 0, DefaultWidth, DefaultHeight);
        }
Exemplo n.º 14
0
        public ChannelMapper(EventSequence sequence)
        {
            _sourceSequence = sequence;
            _useCheckmark   = Preference2.GetInstance().GetBoolean("UseCheckmark");

            InitializeComponent();

            _sourceProfile = new ChannelMapperProfile(_sourceSequence.Profile.FileName);
            //_sourceNatural = new ChannelMapperProfile(sourceSequence.Profile.FileName);
            _sourceChannelCount = _sourceProfile.GetChannelCount();
            InitializeDropDownList();
            InitializeScrollbar();

            GetDestinationProfile();

            BuildDynamicComponents();
            InitializeDynamicComponents();
            IsMapValid            = false;
            MouseWheel           += MapperMouseWheel;
            _previewButtonToolTip = toolTips.GetToolTip(btnPreviewEdit);
            _previewButtonText    = btnPreviewEdit.Text;
            TogglePreviewElements(true);
        }
Exemplo n.º 15
0
        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;
        }
Exemplo n.º 16
0
        public DimmingCurveDialog(EventSequence sequence, Channel selectChannel)
        {
            var miniBoxColor    = Color.BlueViolet;
            var miniLineColor   = Color.Blue;
            var curveGridColor  = Color.LightGray;
            var curveLineColor  = Color.Blue;
            var curvePointColor = Color.Black;

            _pointSize = 4;
            const int dotPitch = 4;

            _miniMouseDownLast     = new Point(-1, -1);
            _miniMouseMinLocation  = new Point(0, 0);
            _miniMouseMaxLocation  = new Point(0, 0);
            _selectedPointAbsolute = -1;
            _selectedPointRelative = -1;
            _usingActualLevels     = true;
            _availableValues       = 256f;
            components             = null;
            InitializeComponent();
            Icon = common.Resources.VixenPlus;
            if (sequence != null)
            {
                Action <Channel> action = c => comboBoxChannels.Items.Add(c.Clone());
                sequence.Channels.ForEach(action);
                _eventSequence = sequence;
            }
            else
            {
                labelSequenceChannels.Enabled = false;
                comboBoxChannels.Enabled      = false;
                if (selectChannel != null)
                {
                    _originalChannel = selectChannel;
                    comboBoxChannels.Items.Add(selectChannel = selectChannel.Clone());
                }
            }
            _gridSpacing   = _pointSize + dotPitch;
            _halfPointSize = (_pointSize) / 2f;
            _curveRowPointsPerMiniPixel = _availableValues / (pbMini.Width);
            _curveColPointsPerMiniPixel = _availableValues / (pbMini.Height);
            if (pictureBoxCurve != null)
            {
                _miniBoxBounds = new Rectangle(0, 0, (int)(pictureBoxCurve.Width / (float)_gridSpacing / _availableValues * pbMini.Width),
                                               (int)(pictureBoxCurve.Height / (float)_gridSpacing / _availableValues * pbMini.Height));
            }
            _miniBackBrush = new SolidBrush(pbMini.BackColor);
            if (pictureBoxCurve != null)
            {
                _curveBackBrush = new SolidBrush(pictureBoxCurve.BackColor);
            }
            _miniBoxPen      = new Pen(miniBoxColor);
            _miniLinePen     = new Pen(miniLineColor);
            _curveGridPen    = new Pen(curveGridColor);
            _curveLinePen    = new Pen(curveLineColor);
            _curvePointBrush = new SolidBrush(curvePointColor);
            if (comboBoxChannels.Items.Count > 0)
            {
                comboBoxChannels.SelectedItem = selectChannel ?? comboBoxChannels.Items[0];
            }
            SwitchDisplay(Preference2.GetInstance().GetBoolean("ActualLevels"));
            comboBoxImport.SelectedIndex = 0;
            comboBoxExport.SelectedIndex = 0;
        }
Exemplo n.º 17
0
        public VixenPlusForm(string[] args)
        {
            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;
                _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;

                CommandLineOptions options = AutoPlay.ParseCommandLine(args);

                try {
                    if (!options.Play)
                    {
                        foreach (var sequence in options.Sequences.Where(File.Exists))
                        {
                            OpenSequence(sequence);
                        }
                    }
                }
                finally {
                    Cursor = Cursors.Default;
                }

                SetShutdownTime(_preferences.GetString("ShutdownTime"));

                splash.FadeOut();
                Left = screen.Bounds.Left;
                Top  = screen.Bounds.Top;

                helpToolStripMenuItem.Visible = false; //No need for a help menu, miht add back if I publish to everyone

                AutoPlay.Begin(options, this);
            }
        }
Exemplo n.º 18
0
 public SoundDeviceDialog(Preference2 preferences)
 {
     InitializeComponent();
     Icon         = common.Resources.VixenPlus;
     _preferences = preferences;
 }