public LuteBotForm() { InitializeComponent(); onlineManager = new OnlineSyncManager(); playList = new PlayListManager(); trackSelectionManager = new TrackSelectionManager(); playList.PlayListUpdatedEvent += new EventHandler <PlayListEventArgs>(HandlePlayListChanged); soundBoardManager = new SoundBoardManager(); soundBoardManager.SoundBoardTrackRequest += new EventHandler <SoundBoardEventArgs>(HandleSoundBoardTrackRequest); player = new MidiPlayer(trackSelectionManager); player.SongLoaded += new EventHandler <AsyncCompletedEventArgs>(PlayerLoadCompleted); hotkeyManager = new HotkeyManager(); hotkeyManager.NextKeyPressed += new EventHandler(NextButton_Click); hotkeyManager.PlayKeyPressed += new EventHandler(PlayButton_Click); hotkeyManager.PreviousKeyPressed += new EventHandler(PreviousButton_Click); trackSelectionManager.OutDeviceResetRequest += new EventHandler(ResetDevice); trackSelectionManager.ToggleTrackRequest += new EventHandler <TrackItem>(ToggleTrack); PlayButton.Enabled = false; StopButton.Enabled = false; PreviousButton.Enabled = false; NextButton.Enabled = false; MusicProgressBar.Enabled = false; _hookID = SetHook(_proc); OpenDialogs(); this.StartPosition = FormStartPosition.Manual; Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.MainWindowPos)); Top = coords.Y; Left = coords.X; }
protected override void OnClosing(CancelEventArgs e) { player.Dispose(); WindowPositionUtils.UpdateBounds(PropertyItem.MainWindowPos, new Point() { X = Left, Y = Top }); if (soundBoardForm != null) { soundBoardForm.Close(); } if (playListForm != null) { playListForm.Close(); } if (trackSelectionForm != null) { trackSelectionForm.Close(); } if (liveInputForm != null) { liveInputForm.Close(); } ConfigManager.SaveConfig(); base.OnClosing(e); }
private void OpenDialogs() { if (ConfigManager.GetBooleanProperty(PropertyItem.SoundBoard)) { soundBoardForm = new SoundBoardForm(soundBoardManager); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.SoundBoardPos)); soundBoardForm.Show(); soundBoardForm.Top = coords.Y; soundBoardForm.Left = coords.X; } if (ConfigManager.GetBooleanProperty(PropertyItem.PlayList)) { playListForm = new PlayListForm(playList); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.PlayListPos)); playListForm.Show(); playListForm.Top = coords.Y; playListForm.Left = coords.X; } if (ConfigManager.GetBooleanProperty(PropertyItem.TrackSelection)) { trackSelectionForm = new TrackSelectionForm(trackSelectionManager); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.TrackSelectionPos)); trackSelectionForm.Show(); trackSelectionForm.Top = coords.Y; trackSelectionForm.Left = coords.X; } if (ConfigManager.GetBooleanProperty(PropertyItem.LiveMidi)) { liveInputForm = new LiveInputForm(); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.LiveMidiPos)); liveInputForm.Show(); liveInputForm.Top = coords.Y; liveInputForm.Left = coords.X; } }
private void TrackSelectionForm_Closing(object sender, FormClosingEventArgs e) { WindowPositionUtils.UpdateBounds(PropertyItem.TrackSelectionPos, new Point() { X = Left, Y = Top }); ConfigManager.SaveConfig(); }
private void PartitionsForm_FormClosing(object sender, FormClosingEventArgs e) { WindowPositionUtils.UpdateBounds(PropertyItem.PartitionListPos, new Point() { X = Left, Y = Top }); ConfigManager.SaveConfig(); }
private void PlayListForm_Closing(object sender, FormClosingEventArgs e) { ConfigManager.SetProperty(PropertyItem.LastPlaylistLocation, playListManager.playlist.Path); WindowPositionUtils.UpdateBounds(PropertyItem.PlayListPos, new Point() { X = Left, Y = Top }); ConfigManager.SaveConfig(); }
private void SoundBoardForm_Closing(object sender, FormClosingEventArgs e) { ConfigManager.SetProperty(PropertyItem.LastSoundBoardLocation, soundBoardManager.LastSoundBoardLocation); WindowPositionUtils.UpdateBounds(PropertyItem.SoundBoardPos, new Point() { X = Left, Y = Top }); ConfigManager.SaveConfig(); }
public LuteBotForm() { InitializeComponent(); onlineManager = new OnlineSyncManager(); playList = new PlayListManager(); trackSelectionManager = new TrackSelectionManager(); playList.PlayListUpdatedEvent += new EventHandler <PlayListEventArgs>(HandlePlayListChanged); soundBoardManager = new SoundBoardManager(); soundBoardManager.SoundBoardTrackRequest += new EventHandler <SoundBoardEventArgs>(HandleSoundBoardTrackRequest); player = new MidiPlayer(trackSelectionManager); player.SongLoaded += new EventHandler <AsyncCompletedEventArgs>(PlayerLoadCompleted); hotkeyManager = new HotkeyManager(); hotkeyManager.NextKeyPressed += new EventHandler(NextButton_Click); hotkeyManager.PlayKeyPressed += new EventHandler(PlayButton_Click); hotkeyManager.StopKeyPressed += new EventHandler(StopButton_Click); hotkeyManager.SynchronizePressed += HotkeyManager_SynchronizePressed; hotkeyManager.PreviousKeyPressed += new EventHandler(PreviousButton_Click); trackSelectionManager.OutDeviceResetRequest += new EventHandler(ResetDevice); trackSelectionManager.ToggleTrackRequest += new EventHandler <TrackItem>(ToggleTrack); liveMidiManager = new LiveMidiManager(trackSelectionManager); hotkeyManager.LiveInputManager = liveMidiManager; PlayButton.Enabled = false; StopButton.Enabled = false; PreviousButton.Enabled = false; NextButton.Enabled = false; MusicProgressBar.Enabled = false; _hookID = SetHook(_proc); OpenDialogs(); this.StartPosition = FormStartPosition.Manual; Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.MainWindowPos)); Top = coords.Y; Left = coords.X; // We may package this with a guild library for now. Check for it and extract it, if so var files = Directory.GetFiles(Environment.CurrentDirectory, "BGML*.zip", SearchOption.TopDirectoryOnly); if (files.Length > 0) { Task.Run(() => { // extract to libraryPath + "\songs\" try { ZipFile.ExtractToDirectory(files[0], libraryPath + @"\songs\"); //File.Delete(files[0]); } catch (Exception e) { } // Gross I know, but no reason to do anything }); } }
private void LiveInputForm_FormClosed(object sender, FormClosedEventArgs e) { ConfigManager.SetProperty(PropertyItem.LastMidiDeviceUsed, liveInputManager.CurrentDevice.ToString()); WindowPositionUtils.UpdateBounds(PropertyItem.LiveMidiPos, new Point() { X = Left, Y = Top }); ConfigManager.SetProperty(PropertyItem.LastMidiLowBoundUsed, liveInputManager.OutDevice.LowNoteId.ToString()); liveInputManager.Dispose(); ConfigManager.SaveConfig(); }
private void liveInputToolStripMenuItem_Click(object sender, EventArgs e) { if (liveInputForm == null || liveInputForm.IsDisposed) { liveInputForm = new LiveInputForm(); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.LiveMidiPos)); liveInputForm.Show(); liveInputForm.Top = coords.Y; liveInputForm.Left = coords.X; } }
private void TrackFilteringToolStripMenuItem_Click(object sender, EventArgs e) { if (trackSelectionForm == null || trackSelectionForm.IsDisposed) { trackSelectionForm = new TrackSelectionForm(trackSelectionManager); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.TrackSelectionPos)); trackSelectionForm.Show(); trackSelectionForm.Top = coords.Y; trackSelectionForm.Left = coords.X; } }
private void SoundBoardToolStripMenuItem_Click(object sender, EventArgs e) { if (soundBoardForm == null || soundBoardForm.IsDisposed) { soundBoardForm = new SoundBoardForm(soundBoardManager); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.SoundBoardPos)); soundBoardForm.Show(); soundBoardForm.Top = coords.Y; soundBoardForm.Left = coords.X; } }
private void PlayListToolStripMenuItem_Click(object sender, EventArgs e) { if (playListForm == null || playListForm.IsDisposed) { playListForm = new PlayListForm(playList); Point coords = WindowPositionUtils.CheckPosition(ConfigManager.GetCoordsProperty(PropertyItem.PlayListPos)); playListForm.Show(); playListForm.Top = coords.Y; playListForm.Left = coords.X; } }