diff --git a/PC3Player/PC3Player/AdvancedSettingsForm.Designer.cs b/PC3Player/PC3Player/AdvancedSettingsForm.Designer.cs index 86739b4..14412a6 100644 --- a/PC3Player/PC3Player/AdvancedSettingsForm.Designer.cs +++ b/PC3Player/PC3Player/AdvancedSettingsForm.Designer.cs @@ -30,7 +30,6 @@ { components = new System.ComponentModel.Container(); PlaylistPlaybackGroupBox = new GroupBox(); - LoopCheckBox = new CheckBox(); IntermissionUnitDropDown = new ComboBox(); IntermissionTimeCounter = new NumericUpDown(); IntermissionCheckBox = new CheckBox(); @@ -84,13 +83,6 @@ SaveButton = new Button(); CancelButton = new Button(); SelectShowFileDialog = new OpenFileDialog(); - PlaybackGroupBox = new GroupBox(); - label20 = new Label(); - label19 = new Label(); - label18 = new Label(); - ResyncTimeOption = new NumericUpDown(); - FrameShiftOption = new NumericUpDown(); - FrameSkipOption = new NumericUpDown(); PlaylistPlaybackGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)IntermissionTimeCounter).BeginInit(); ShowSelectorGroupBox.SuspendLayout(); @@ -98,15 +90,10 @@ ShowSelectorAssignmentGroupBox.SuspendLayout(); AssignmentPanel.SuspendLayout(); SkitContextMenu.SuspendLayout(); - PlaybackGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)ResyncTimeOption).BeginInit(); - ((System.ComponentModel.ISupportInitialize)FrameShiftOption).BeginInit(); - ((System.ComponentModel.ISupportInitialize)FrameSkipOption).BeginInit(); SuspendLayout(); // // PlaylistPlaybackGroupBox // - PlaylistPlaybackGroupBox.Controls.Add(LoopCheckBox); PlaylistPlaybackGroupBox.Controls.Add(IntermissionUnitDropDown); PlaylistPlaybackGroupBox.Controls.Add(IntermissionTimeCounter); PlaylistPlaybackGroupBox.Controls.Add(IntermissionCheckBox); @@ -116,21 +103,11 @@ PlaylistPlaybackGroupBox.Controls.Add(PlaylistStartedDropDown); PlaylistPlaybackGroupBox.Location = new Point(12, 12); PlaylistPlaybackGroupBox.Name = "PlaylistPlaybackGroupBox"; - PlaylistPlaybackGroupBox.Size = new Size(350, 138); + PlaylistPlaybackGroupBox.Size = new Size(350, 110); PlaylistPlaybackGroupBox.TabIndex = 0; PlaylistPlaybackGroupBox.TabStop = false; PlaylistPlaybackGroupBox.Text = "Playlist Playback"; // - // LoopCheckBox - // - LoopCheckBox.AutoSize = true; - LoopCheckBox.Location = new Point(6, 111); - LoopCheckBox.Name = "LoopCheckBox"; - LoopCheckBox.Size = new Size(162, 19); - LoopCheckBox.TabIndex = 5; - LoopCheckBox.Text = "Loop when Playlist is over"; - LoopCheckBox.UseVisualStyleBackColor = true; - // // IntermissionUnitDropDown // IntermissionUnitDropDown.DropDownStyle = ComboBoxStyle.DropDownList; @@ -211,7 +188,7 @@ ShowSelectorGroupBox.Controls.Add(SelectedShowEndDropDown); ShowSelectorGroupBox.Controls.Add(label4); ShowSelectorGroupBox.Controls.Add(ButtonPressDropDown); - ShowSelectorGroupBox.Location = new Point(12, 156); + ShowSelectorGroupBox.Location = new Point(12, 128); ShowSelectorGroupBox.Name = "ShowSelectorGroupBox"; ShowSelectorGroupBox.Size = new Size(350, 165); ShowSelectorGroupBox.TabIndex = 1; @@ -342,7 +319,7 @@ ShowSelectorAssignmentGroupBox.Location = new Point(368, 12); ShowSelectorAssignmentGroupBox.Name = "ShowSelectorAssignmentGroupBox"; ShowSelectorAssignmentGroupBox.Size = new Size(256, 370); - ShowSelectorAssignmentGroupBox.TabIndex = 3; + ShowSelectorAssignmentGroupBox.TabIndex = 2; ShowSelectorAssignmentGroupBox.TabStop = false; ShowSelectorAssignmentGroupBox.Text = "Show Selector Assignment"; // @@ -600,11 +577,11 @@ SkitListView.ContextMenuStrip = SkitContextMenu; SkitListView.GridLines = true; SkitListView.HeaderStyle = ColumnHeaderStyle.Nonclickable; - SkitListView.Location = new Point(12, 327); + SkitListView.Location = new Point(12, 299); SkitListView.MultiSelect = false; SkitListView.Name = "SkitListView"; - SkitListView.Size = new Size(350, 201); - SkitListView.TabIndex = 2; + SkitListView.Size = new Size(350, 150); + SkitListView.TabIndex = 3; SkitListView.UseCompatibleStateImageBehavior = false; SkitListView.View = View.Details; // @@ -633,7 +610,7 @@ // SaveButton // SaveButton.DialogResult = DialogResult.OK; - SaveButton.Location = new Point(549, 503); + SaveButton.Location = new Point(549, 424); SaveButton.Name = "SaveButton"; SaveButton.Size = new Size(75, 25); SaveButton.TabIndex = 10; @@ -644,7 +621,7 @@ // CancelButton // CancelButton.DialogResult = DialogResult.Cancel; - CancelButton.Location = new Point(468, 503); + CancelButton.Location = new Point(468, 424); CancelButton.Name = "CancelButton"; CancelButton.Size = new Size(75, 25); CancelButton.TabIndex = 11; @@ -656,83 +633,11 @@ SelectShowFileDialog.Filter = "UST Showtapes|*.ust"; SelectShowFileDialog.Multiselect = true; // - // PlaybackGroupBox - // - PlaybackGroupBox.Controls.Add(label20); - PlaybackGroupBox.Controls.Add(label19); - PlaybackGroupBox.Controls.Add(label18); - PlaybackGroupBox.Controls.Add(ResyncTimeOption); - PlaybackGroupBox.Controls.Add(FrameShiftOption); - PlaybackGroupBox.Controls.Add(FrameSkipOption); - PlaybackGroupBox.Location = new Point(368, 388); - PlaybackGroupBox.Name = "PlaybackGroupBox"; - PlaybackGroupBox.Size = new Size(256, 109); - PlaybackGroupBox.TabIndex = 4; - PlaybackGroupBox.TabStop = false; - PlaybackGroupBox.Text = "Tracking Adjustments"; - // - // label20 - // - label20.AutoSize = true; - label20.Location = new Point(6, 82); - label20.Name = "label20"; - label20.Size = new Size(67, 15); - label20.TabIndex = 5; - label20.Text = "Frame Shift"; - // - // label19 - // - label19.AutoSize = true; - label19.Location = new Point(6, 53); - label19.Name = "label19"; - label19.Size = new Size(73, 15); - label19.TabIndex = 4; - label19.Text = "Resync Time"; - // - // label18 - // - label18.AutoSize = true; - label18.Location = new Point(6, 24); - label18.Name = "label18"; - label18.Size = new Size(65, 15); - label18.TabIndex = 3; - label18.Text = "Frame Skip"; - // - // ResyncTimeOption - // - ResyncTimeOption.Location = new Point(200, 51); - ResyncTimeOption.Maximum = new decimal(new int[] { 60, 0, 0, 0 }); - ResyncTimeOption.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); - ResyncTimeOption.Name = "ResyncTimeOption"; - ResyncTimeOption.Size = new Size(50, 23); - ResyncTimeOption.TabIndex = 1; - ResyncTimeOption.Value = new decimal(new int[] { 1, 0, 0, 0 }); - // - // FrameShiftOption - // - FrameShiftOption.Location = new Point(200, 80); - FrameShiftOption.Maximum = new decimal(new int[] { 60, 0, 0, 0 }); - FrameShiftOption.Minimum = new decimal(new int[] { 60, 0, 0, int.MinValue }); - FrameShiftOption.Name = "FrameShiftOption"; - FrameShiftOption.Size = new Size(50, 23); - FrameShiftOption.TabIndex = 2; - // - // FrameSkipOption - // - FrameSkipOption.Location = new Point(200, 22); - FrameSkipOption.Maximum = new decimal(new int[] { 10, 0, 0, 0 }); - FrameSkipOption.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); - FrameSkipOption.Name = "FrameSkipOption"; - FrameSkipOption.Size = new Size(50, 23); - FrameSkipOption.TabIndex = 0; - FrameSkipOption.Value = new decimal(new int[] { 1, 0, 0, 0 }); - // // AdvancedSettingsForm // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(636, 540); - Controls.Add(PlaybackGroupBox); + ClientSize = new Size(636, 461); Controls.Add(CancelButton); Controls.Add(SaveButton); Controls.Add(SkitListView); @@ -753,11 +658,6 @@ ShowSelectorAssignmentGroupBox.PerformLayout(); AssignmentPanel.ResumeLayout(false); SkitContextMenu.ResumeLayout(false); - PlaybackGroupBox.ResumeLayout(false); - PlaybackGroupBox.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)ResyncTimeOption).EndInit(); - ((System.ComponentModel.ISupportInitialize)FrameShiftOption).EndInit(); - ((System.ComponentModel.ISupportInitialize)FrameSkipOption).EndInit(); ResumeLayout(false); } @@ -817,13 +717,5 @@ private ToolStripMenuItem RemoveButton; private OpenFileDialog SelectShowFileDialog; private Panel AssignmentPanel; - private CheckBox LoopCheckBox; - private GroupBox PlaybackGroupBox; - private Label label18; - private NumericUpDown ResyncTimeOption; - private NumericUpDown FrameShiftOption; - private NumericUpDown FrameSkipOption; - private Label label20; - private Label label19; } } \ No newline at end of file diff --git a/PC3Player/PC3Player/AdvancedSettingsForm.cs b/PC3Player/PC3Player/AdvancedSettingsForm.cs index 59d0df6..85b635f 100644 --- a/PC3Player/PC3Player/AdvancedSettingsForm.cs +++ b/PC3Player/PC3Player/AdvancedSettingsForm.cs @@ -13,7 +13,6 @@ IntermissionCheckBox.Checked = EditingObject.PlaylistIntermissionOption; IntermissionTimeCounter.Value = EditingObject.PlaylistIntermissionTimeOption; IntermissionUnitDropDown.SelectedIndex = EditingObject.PlaylistIntermissionUnitOption; - LoopCheckBox.Checked = EditingObject.PlaylistLoopOption; ButtonPressDropDown.SelectedIndex = EditingObject.SelectorButtonPressOption; AlreadyPlayingDropDown.SelectedIndex = EditingObject.SelectorShowAlreadyPlayingOption; @@ -23,10 +22,6 @@ CooldownUnitDropDown.SelectedIndex = EditingObject.SelectorCooldownUnitOption; SkitCheckBox.Checked = EditingObject.SelectorPlaySkitOption; - FrameSkipOption.Value = EditingObject.FramesPerTick; - FrameShiftOption.Value = EditingObject.FrameShift; - ResyncTimeOption.Value = EditingObject.ResyncSeconds; - IntermissionTimeCounter.Enabled = IntermissionCheckBox.Checked; IntermissionUnitDropDown.Enabled = IntermissionCheckBox.Checked; @@ -120,7 +115,6 @@ EditingObject.PlaylistIntermissionOption = IntermissionCheckBox.Checked; EditingObject.PlaylistIntermissionTimeOption = (int)IntermissionTimeCounter.Value; EditingObject.PlaylistIntermissionUnitOption = IntermissionUnitDropDown.SelectedIndex; - EditingObject.PlaylistLoopOption = LoopCheckBox.Checked; EditingObject.SelectorButtonPressOption = ButtonPressDropDown.SelectedIndex; EditingObject.SelectorShowAlreadyPlayingOption = AlreadyPlayingDropDown.SelectedIndex; @@ -130,10 +124,6 @@ EditingObject.SelectorCooldownUnitOption = CooldownUnitDropDown.SelectedIndex; EditingObject.SelectorPlaySkitOption = SkitCheckBox.Checked; - EditingObject.ResyncSeconds = (int)ResyncTimeOption.Value; - EditingObject.FrameShift = (int)FrameShiftOption.Value; - EditingObject.FramesPerTick = (int)FrameSkipOption.Value; - int i = 0; foreach (ComboBox c in AssignmentPanel.Controls) { diff --git a/PC3Player/PC3Player/DataTypes.cs b/PC3Player/PC3Player/DataTypes.cs index 353eb32..9691e36 100644 --- a/PC3Player/PC3Player/DataTypes.cs +++ b/PC3Player/PC3Player/DataTypes.cs @@ -1,6 +1,4 @@ -using System.Diagnostics.Eventing.Reader; - -namespace PC3Player +namespace PC3Player { public class PlaylistShow { @@ -41,7 +39,6 @@ namespace PC3Player public bool PlaylistIntermissionOption { get; set; } = false; public int PlaylistIntermissionTimeOption { get; set; } = 8; public int PlaylistIntermissionUnitOption { get; set; } = 0; - public bool PlaylistLoopOption { get; set; } = true; public int SelectorButtonPressOption { get; set; } = 0; public int SelectorShowAlreadyPlayingOption { get; set; } = 0; diff --git a/PC3Player/PC3Player/MainForm.Designer.cs b/PC3Player/PC3Player/MainForm.Designer.cs index 377a583..29de596 100644 --- a/PC3Player/PC3Player/MainForm.Designer.cs +++ b/PC3Player/PC3Player/MainForm.Designer.cs @@ -60,7 +60,6 @@ SelectMappingFileDialog = new OpenFileDialog(); SavePlaylistFileDialog = new SaveFileDialog(); OpenPlaylistFileDialog = new OpenFileDialog(); - NewPlaylistButton = new Button(); ControllerGroupBox.SuspendLayout(); PlaybackControlsGroupBox.SuspendLayout(); ShowSelectorGroupBox.SuspendLayout(); @@ -75,7 +74,7 @@ ControllerGroupBox.Controls.Add(ControllerAutoDetectButton); ControllerGroupBox.Location = new Point(12, 12); ControllerGroupBox.Name = "ControllerGroupBox"; - ControllerGroupBox.Size = new Size(256, 84); + ControllerGroupBox.Size = new Size(236, 84); ControllerGroupBox.TabIndex = 0; ControllerGroupBox.TabStop = false; ControllerGroupBox.Text = "Controller: Not Connected"; @@ -84,7 +83,7 @@ // ControllerSelectSerialPortButton.Location = new Point(6, 53); ControllerSelectSerialPortButton.Name = "ControllerSelectSerialPortButton"; - ControllerSelectSerialPortButton.Size = new Size(244, 25); + ControllerSelectSerialPortButton.Size = new Size(224, 25); ControllerSelectSerialPortButton.TabIndex = 1; ControllerSelectSerialPortButton.Text = "Select Serial Port"; ControllerSelectSerialPortButton.UseVisualStyleBackColor = true; @@ -94,7 +93,7 @@ // ControllerAutoDetectButton.Location = new Point(6, 22); ControllerAutoDetectButton.Name = "ControllerAutoDetectButton"; - ControllerAutoDetectButton.Size = new Size(244, 25); + ControllerAutoDetectButton.Size = new Size(224, 25); ControllerAutoDetectButton.TabIndex = 0; ControllerAutoDetectButton.Text = "Auto Detect"; ControllerAutoDetectButton.UseVisualStyleBackColor = true; @@ -107,9 +106,9 @@ PlaybackControlsGroupBox.Controls.Add(SkipButton); PlaybackControlsGroupBox.Controls.Add(PauseButton); PlaybackControlsGroupBox.Controls.Add(StartButton); - PlaybackControlsGroupBox.Location = new Point(12, 376); + PlaybackControlsGroupBox.Location = new Point(12, 344); PlaybackControlsGroupBox.Name = "PlaybackControlsGroupBox"; - PlaybackControlsGroupBox.Size = new Size(256, 99); + PlaybackControlsGroupBox.Size = new Size(236, 99); PlaybackControlsGroupBox.TabIndex = 4; PlaybackControlsGroupBox.TabStop = false; PlaybackControlsGroupBox.Text = "Controls: Not Playing"; @@ -126,9 +125,9 @@ // StopButton // StopButton.Enabled = false; - StopButton.Location = new Point(131, 53); + StopButton.Location = new Point(121, 53); StopButton.Name = "StopButton"; - StopButton.Size = new Size(119, 25); + StopButton.Size = new Size(109, 25); StopButton.TabIndex = 3; StopButton.Text = "Stop"; StopButton.UseVisualStyleBackColor = true; @@ -139,7 +138,7 @@ SkipButton.Enabled = false; SkipButton.Location = new Point(6, 53); SkipButton.Name = "SkipButton"; - SkipButton.Size = new Size(119, 25); + SkipButton.Size = new Size(109, 25); SkipButton.TabIndex = 2; SkipButton.Text = "Skip"; SkipButton.UseVisualStyleBackColor = true; @@ -148,9 +147,9 @@ // PauseButton // PauseButton.Enabled = false; - PauseButton.Location = new Point(131, 22); + PauseButton.Location = new Point(121, 22); PauseButton.Name = "PauseButton"; - PauseButton.Size = new Size(119, 25); + PauseButton.Size = new Size(109, 25); PauseButton.TabIndex = 1; PauseButton.Text = "Pause"; PauseButton.UseVisualStyleBackColor = true; @@ -160,7 +159,7 @@ // StartButton.Location = new Point(6, 22); StartButton.Name = "StartButton"; - StartButton.Size = new Size(119, 25); + StartButton.Size = new Size(109, 25); StartButton.TabIndex = 0; StartButton.Text = "Start Playlist"; StartButton.UseVisualStyleBackColor = true; @@ -173,7 +172,7 @@ ShowSelectorGroupBox.Enabled = false; ShowSelectorGroupBox.Location = new Point(12, 102); ShowSelectorGroupBox.Name = "ShowSelectorGroupBox"; - ShowSelectorGroupBox.Size = new Size(256, 84); + ShowSelectorGroupBox.Size = new Size(236, 84); ShowSelectorGroupBox.TabIndex = 1; ShowSelectorGroupBox.TabStop = false; ShowSelectorGroupBox.Text = "Show Selector: Not Connected"; @@ -182,7 +181,7 @@ // ShowSelectorSelectPortButton.Location = new Point(6, 53); ShowSelectorSelectPortButton.Name = "ShowSelectorSelectPortButton"; - ShowSelectorSelectPortButton.Size = new Size(244, 25); + ShowSelectorSelectPortButton.Size = new Size(224, 25); ShowSelectorSelectPortButton.TabIndex = 1; ShowSelectorSelectPortButton.Text = "Select Serial Port"; ShowSelectorSelectPortButton.UseVisualStyleBackColor = true; @@ -192,7 +191,7 @@ // ShowSelectorAutoDetectButton.Location = new Point(6, 22); ShowSelectorAutoDetectButton.Name = "ShowSelectorAutoDetectButton"; - ShowSelectorAutoDetectButton.Size = new Size(244, 25); + ShowSelectorAutoDetectButton.Size = new Size(224, 25); ShowSelectorAutoDetectButton.TabIndex = 0; ShowSelectorAutoDetectButton.Text = "Auto Detect"; ShowSelectorAutoDetectButton.UseVisualStyleBackColor = true; @@ -200,23 +199,22 @@ // // PlaylistGroupBox // - PlaylistGroupBox.Controls.Add(NewPlaylistButton); PlaylistGroupBox.Controls.Add(AdvancedSettingsButton); PlaylistGroupBox.Controls.Add(AddShowButton); PlaylistGroupBox.Controls.Add(LoadPlaylistButton); PlaylistGroupBox.Controls.Add(SavePlaylistButton); PlaylistGroupBox.Location = new Point(12, 254); PlaylistGroupBox.Name = "PlaylistGroupBox"; - PlaylistGroupBox.Size = new Size(256, 116); + PlaylistGroupBox.Size = new Size(236, 84); PlaylistGroupBox.TabIndex = 3; PlaylistGroupBox.TabStop = false; PlaylistGroupBox.Text = "Playlist: Unsaved"; // // AdvancedSettingsButton // - AdvancedSettingsButton.Location = new Point(131, 22); + AdvancedSettingsButton.Location = new Point(121, 22); AdvancedSettingsButton.Name = "AdvancedSettingsButton"; - AdvancedSettingsButton.Size = new Size(119, 25); + AdvancedSettingsButton.Size = new Size(109, 25); AdvancedSettingsButton.TabIndex = 1; AdvancedSettingsButton.Text = "Advanced"; AdvancedSettingsButton.UseVisualStyleBackColor = true; @@ -226,7 +224,7 @@ // AddShowButton.Location = new Point(6, 22); AddShowButton.Name = "AddShowButton"; - AddShowButton.Size = new Size(119, 25); + AddShowButton.Size = new Size(109, 25); AddShowButton.TabIndex = 0; AddShowButton.Text = "Add Show"; AddShowButton.UseVisualStyleBackColor = true; @@ -234,9 +232,9 @@ // // LoadPlaylistButton // - LoadPlaylistButton.Location = new Point(131, 53); + LoadPlaylistButton.Location = new Point(121, 53); LoadPlaylistButton.Name = "LoadPlaylistButton"; - LoadPlaylistButton.Size = new Size(119, 25); + LoadPlaylistButton.Size = new Size(109, 25); LoadPlaylistButton.TabIndex = 3; LoadPlaylistButton.Text = "Load Playlist"; LoadPlaylistButton.UseVisualStyleBackColor = true; @@ -246,7 +244,7 @@ // SavePlaylistButton.Location = new Point(6, 53); SavePlaylistButton.Name = "SavePlaylistButton"; - SavePlaylistButton.Size = new Size(119, 25); + SavePlaylistButton.Size = new Size(109, 25); SavePlaylistButton.TabIndex = 2; SavePlaylistButton.Text = "Save Playlist"; SavePlaylistButton.UseVisualStyleBackColor = true; @@ -257,7 +255,7 @@ ChannelMappingGroupBox.Controls.Add(LoadChannelMapButton); ChannelMappingGroupBox.Location = new Point(12, 192); ChannelMappingGroupBox.Name = "ChannelMappingGroupBox"; - ChannelMappingGroupBox.Size = new Size(256, 56); + ChannelMappingGroupBox.Size = new Size(236, 56); ChannelMappingGroupBox.TabIndex = 2; ChannelMappingGroupBox.TabStop = false; ChannelMappingGroupBox.Text = "Channel Map: None Loaded"; @@ -266,7 +264,7 @@ // LoadChannelMapButton.Location = new Point(6, 22); LoadChannelMapButton.Name = "LoadChannelMapButton"; - LoadChannelMapButton.Size = new Size(244, 25); + LoadChannelMapButton.Size = new Size(224, 25); LoadChannelMapButton.TabIndex = 0; LoadChannelMapButton.Text = "Load Channel Map"; LoadChannelMapButton.UseVisualStyleBackColor = true; @@ -279,10 +277,10 @@ PlaylistListView.ContextMenuStrip = ShowContextMenu; PlaylistListView.GridLines = true; PlaylistListView.HeaderStyle = ColumnHeaderStyle.Nonclickable; - PlaylistListView.Location = new Point(274, 12); + PlaylistListView.Location = new Point(254, 12); PlaylistListView.MultiSelect = false; PlaylistListView.Name = "PlaylistListView"; - PlaylistListView.Size = new Size(400, 463); + PlaylistListView.Size = new Size(400, 431); PlaylistListView.TabIndex = 5; PlaylistListView.UseCompatibleStateImageBehavior = false; PlaylistListView.View = View.Details; @@ -340,21 +338,11 @@ // OpenPlaylistFileDialog.Filter = "PC3Player Playlists (JSON Files)|*.json"; // - // NewPlaylistButton - // - NewPlaylistButton.Location = new Point(6, 84); - NewPlaylistButton.Name = "NewPlaylistButton"; - NewPlaylistButton.Size = new Size(244, 25); - NewPlaylistButton.TabIndex = 4; - NewPlaylistButton.Text = "New Playlist"; - NewPlaylistButton.UseVisualStyleBackColor = true; - NewPlaylistButton.Click += NewPlaylistButton_Click; - // // MainForm // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(686, 487); + ClientSize = new Size(666, 455); Controls.Add(PlaylistListView); Controls.Add(ChannelMappingGroupBox); Controls.Add(PlaylistGroupBox); @@ -409,6 +397,5 @@ private SaveFileDialog SavePlaylistFileDialog; private OpenFileDialog OpenPlaylistFileDialog; private Label TimeLabel; - private Button NewPlaylistButton; } } diff --git a/PC3Player/PC3Player/MainForm.cs b/PC3Player/PC3Player/MainForm.cs index 27aee6a..b3d4196 100644 --- a/PC3Player/PC3Player/MainForm.cs +++ b/PC3Player/PC3Player/MainForm.cs @@ -70,6 +70,12 @@ namespace PC3Player return; } + if (ChannelMappingLoaded) + { + MessageBox.Show("A Channel Map is already loaded.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + if (SelectMappingFileDialog.ShowDialog() == DialogResult.OK) { string tempMappingData = File.ReadAllText(SelectMappingFileDialog.FileName); @@ -87,19 +93,6 @@ namespace PC3Player targetBits.Add(int.Parse(s)); } - if (ChannelMappingLoaded) - { - if (header[3] != Config.Mapping.Type) - { - MessageBox.Show( - $"Selected Channel Map \"{header[2]}\"'s type does not match the old Channel Map's type." + - $"\nOld Channel Map Type: {Config.Mapping.Type}" + - $"\nNew Channel Map Type: {header[3]}" - , "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - } - if (targetBits.Count != ControllerBits) { MessageBox.Show("The mapped channel count is not equal to the connected controller's bit count.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -124,6 +117,7 @@ namespace PC3Player ChannelMappingLoaded = true; ChannelMappingGroupBox.Text = $"Channel Map: {Config.Mapping.Name}"; + LoadChannelMapButton.Enabled = false; InvalidateSave = true; } } @@ -326,8 +320,8 @@ namespace PC3Player private void AdvancedSettingsButton_Click(object sender, EventArgs e) { AdvancedSettingsForm advancedSettingsForm = new AdvancedSettingsForm(Config); - if (Config != advancedSettingsForm.EditingObject) InvalidateSave = true; if (advancedSettingsForm.ShowDialog() == DialogResult.OK) Config = advancedSettingsForm.EditingObject; + InvalidateSave = true; } private void ShowSelectorAutoDetectButton_Click(object sender, EventArgs e) @@ -434,14 +428,13 @@ namespace PC3Player private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { - if (Playing) Stop(); if (InvalidateSave) if (MessageBox.Show( "You have an unsaved Playlist!\nDo you still want to exit?", "Unsaved Playlist", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation - ) != DialogResult.Yes) + ) == DialogResult.No) e.Cancel = true; } @@ -457,18 +450,6 @@ namespace PC3Player private void LoadPlaylistButton_Click(object sender, EventArgs e) { - if (Playing) - { - if (MessageBox.Show( - "A show is currently playing!\nPerforming this action will stop it.\nAre you sure?", - "Show Playing", - MessageBoxButtons.YesNo, - MessageBoxIcon.Exclamation - ) != DialogResult.Yes) - return; - Stop(); - } - if (!ControllerConnected) { MessageBox.Show("You must connect a Controller first."); @@ -481,7 +462,7 @@ namespace PC3Player "Unsaved Playlist", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation - ) != DialogResult.Yes) + ) == DialogResult.No) return; if (OpenPlaylistFileDialog.ShowDialog() == DialogResult.OK) @@ -510,7 +491,7 @@ namespace PC3Player return; } ChannelMappingGroupBox.Text = $"Channel Map: {tempConfig.Mapping.Name}"; - ChannelMappingLoaded = true; + LoadChannelMapButton.Enabled = false; } int showIndex = 0; @@ -655,8 +636,6 @@ namespace PC3Player private void SelectNextShowtape(StartMethod method) { - ShowtapeFrames = []; - ShowtapeIndex = 0; if (Config.Shows.Count() == 0) { MessageBox.Show("There are no shows in the playlist.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); @@ -680,7 +659,7 @@ namespace PC3Player willStartShow = true; break; case 1: - PlaylistIndex = SelectRandom.Next(Config.Shows.Count()); + PlaylistIndex = SelectRandom.Next(Config.Shows.Count() - 1); willStartShow = true; break; } @@ -689,39 +668,29 @@ namespace PC3Player if (Config.PlaylistIntermissionOption && (!bypassIntermission)) { Intermission = true; - IntermissionTotalTime = IntermissionSecondsLeft = Config.PlaylistIntermissionTimeOption * ((Config.PlaylistIntermissionUnitOption == 1) ? 1 : 60); + IntermissionTotalTime = IntermissionSecondsLeft = Config.PlaylistIntermissionTimeOption * (Config.PlaylistIntermissionUnitOption == 1 ? 60 : 1); + GUIUpdateTimer.Start(); SkipButton.Enabled = true; StopButton.Enabled = true; PauseButton.Enabled = true; - Invoke(delegate { PlaybackControlsGroupBox.Text = "Controls: Intermission"; }); - GUIUpdateTimer.Start(); + break; } - else + switch (Config.PlaylistShowEndOption) { - switch (Config.PlaylistShowEndOption) - { - case 0: - PlaylistIndex++; - if (PlaylistIndex >= Config.Shows.Count()) - { - if (Config.PlaylistLoopOption) - { - PlaylistIndex = 0; - willStartShow = true; - } - } - else willStartShow = true; - break; - case 1: - PlaylistIndex = SelectRandom.Next(Config.Shows.Count()); - willStartShow = true; - break; - case 2: - willStartShow = true; - break; - case 3: - break; - } + case 0: + PlaylistIndex++; + if (PlaylistIndex >= Config.Shows.Count()) break; + willStartShow = true; + break; + case 1: + PlaylistIndex = SelectRandom.Next(Config.Shows.Count() - 1); + willStartShow = true; + break; + case 2: + willStartShow = true; + break; + case 3: + break; } break; } @@ -742,8 +711,6 @@ namespace PC3Player dataProvider = new StreamDataProvider(File.OpenRead("pc3playertempaudio.tmp")); AudioPlayer = new SoundPlayer(dataProvider); - Invoke(delegate { PlaybackControlsGroupBox.Text = $"Controls: Playing {CurrentlyPlaying.Name}"; }); - Mixer.Master.AddComponent(AudioPlayer); Playing = true; AudioPlayer.Play(); @@ -754,18 +721,27 @@ namespace PC3Player StopButton.Enabled = true; SkipButton.Enabled = true; } + else Stop(); } void GUIUpdateTick(object sender, ElapsedEventArgs e) { if (Playing) { - Invoke(delegate { TimeLabel.Text = $"({TimeSpan.FromSeconds(AudioPlayer.Time).ToString(@"hh\:mm\:ss")}/{CurrentlyPlaying.Length})"; }); + Invoke(delegate + { + PlaybackControlsGroupBox.Text = $"Controls: Playing {CurrentlyPlaying.Name}"; + TimeLabel.Text = $"({TimeSpan.FromSeconds(AudioPlayer.Time).ToString(@"hh\:mm\:ss")}/{CurrentlyPlaying.Length})"; + }); } - if (Intermission) + else if (Intermission) { if (IntermissionSecondsLeft == 0) SelectNextShowtape(StartMethod.PlaylistShowEnd); - Invoke(delegate { TimeLabel.Text = $"({TimeSpan.FromSeconds(IntermissionTotalTime - IntermissionSecondsLeft).ToString(@"hh\:mm\:ss")}/{TimeSpan.FromSeconds(IntermissionTotalTime).ToString(@"hh\:mm\:ss")})"; }); + Invoke(delegate + { + PlaybackControlsGroupBox.Text = "Controls: Intermission"; + TimeLabel.Text = $"({TimeSpan.FromSeconds(IntermissionTotalTime - IntermissionSecondsLeft).ToString(@"hh\:mm\:ss")}/{TimeSpan.FromSeconds(IntermissionTotalTime).ToString(@"hh\:mm\:ss")})"; + }); if (!Paused) IntermissionSecondsLeft--; } } @@ -827,17 +803,7 @@ namespace PC3Player private void StartButton_Click(object sender, EventArgs e) { - if (Playing) - { - if (MessageBox.Show( - "A show is currently playing!\nPerforming this action will stop it.\nAre you sure?", - "Show Playing", - MessageBoxButtons.YesNo, - MessageBoxIcon.Exclamation - ) != DialogResult.Yes) - return; - Stop(); - } + if (Playing) Stop(); SelectNextShowtape(StartMethod.PlaylistStart); } @@ -848,15 +814,12 @@ namespace PC3Player FrameTimer.Stop(); ResyncTimer.Stop(); GUIUpdateTimer.Stop(); - ResyncTimer.Dispose(); - FrameTimer.Dispose(); PauseButton.Enabled = false; StopButton.Enabled = false; SkipButton.Enabled = false; if (Playing) Mixer.Master.RemoveComponent(AudioPlayer); Paused = false; - Invoke(delegate - { + Invoke(delegate { PlaybackControlsGroupBox.Text = "Controls: Not Playing"; PauseButton.Text = "Pause"; TimeLabel.Text = "(00:00:00/00:00:00)"; @@ -866,35 +829,5 @@ namespace PC3Player ShowtapeFrames = []; ShowtapeIndex = 0; } - - private void NewPlaylistButton_Click(object sender, EventArgs e) - { - if (Playing) - { - if (MessageBox.Show( - "A show is currently playing!\nPerforming this action will stop it.\nAre you sure?", - "Show Playing", - MessageBoxButtons.YesNo, - MessageBoxIcon.Exclamation - ) != DialogResult.Yes) - return; - Stop(); - } - - if (InvalidateSave) - if (MessageBox.Show( - "You have an unsaved Playlist!\nDo you still want to create a new one?", - "Unsaved Playlist", - MessageBoxButtons.YesNo, - MessageBoxIcon.Exclamation - ) != DialogResult.Yes) - return; - - Config = new PlaylistConfig(); - ChannelMappingGroupBox.Text = "Channel Map: None Loaded"; - PlaylistGroupBox.Text = "Playlist: Unsaved"; - UpdateListView(); - InvalidateSave = false; - } } } diff --git a/PC3Player/PC3Player/Properties/PublishProfiles/FolderProfile.pubxml.user b/PC3Player/PC3Player/Properties/PublishProfiles/FolderProfile.pubxml.user index 0694e5c..735b483 100644 --- a/PC3Player/PC3Player/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/PC3Player/PC3Player/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -2,7 +2,7 @@ - True|2025-07-08T03:32:00.3108399Z||;True|2025-07-07T16:13:43.3420483-07:00||; + True|2025-07-07T23:13:43.3420483Z||; \ No newline at end of file