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; } }
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(); }
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; } }
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 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 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; }
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; } }
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); }
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); }
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; }
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); } }