private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { tool.debug("Starting MusicGUI"); window = Window.GetWindow(this); windowHandle = new WindowInteropHelper(window).Handle; window.Title = "Music GUI"; SaveSettings.RestoreMainControl(this); window.Closing += Window_Closing; playlistControl.LinkControls(fileControl); tool.debug("Music GUI Loaded"); GetAllResources(); if (!consoleCheckBox.IsChecked.Value) { tool.HideConsole(); } MusicPlayer.Player.PlayEvent += Player_PlayEvent; SetWindowTitleFromCurrentSong(); if (Current == null) { Current = this; } // Database.Instance.PopulateMusicFiles(); } }
public static void SaveMainControl(MainControl mainControl) { // StoreMusicFileDirectories(mainControl.fileControl.musicFileControl); // StorePlaylistFileDirectories(mainControl.fileControl.playlistFileControl); StorePlaylistControl(mainControl.playlistControl); StoreCurrentSong(MusicPlayer.Player); StoreVolumeLevel(MusicPlayer.Player); StoreCurrentTrackPosition(MusicPlayer.Player); StoreLastPlaylist(MusicPlayer.Player); StoreCurrentPlayState(MusicPlayer.Player); StoreEditingProgram(tool.MusicEditingProgram); StoreShowConsole(mainControl.consoleCheckBox.IsChecked.Value); Save(); }
public static void RestoreMainControl(MainControl mainControl) { // RestoreMusicFileDirectories(mainControl.fileControl.musicFileControl); Database.Instance.RetreiveMusicFiles(); // mainControl.fileControl.musicFileControl.ViewModel. mainControl.fileControl.musicFileControl.ViewModel.LoadDirectoriesToTree(); //RestorePlaylistFileDirectories(mainControl.fileControl.playlistFileControl); Database.Instance.RetreivePlaylistFiles(); //mainControl.fileControl.playlistFileControl.ViewModel.LoadFilesToTree(); mainControl.fileControl.playlistFileControl.ViewModel.LoadDirectoriesToTree(); RestorePlaylistControl(mainControl.playlistControl); RestoreShowConsole(mainControl); //RestoreCurrentPlayState(MusicPlayer.Player); // RestoreCurrentSong(MusicPlayer.Player, SongInfo.Instance); RestoreVolumeLevel(MusicPlayer.Player); RestoreMusicEditingProgram(); }
private static void RestoreShowConsole(MainControl mainControl) { mainControl.consoleCheckBox.IsChecked = Properties.Settings.Default.ShowConsole; }