This commit is contained in:
Royce551 2020-05-07 16:45:28 -05:00
parent 6a7f37fbf0
commit f2f5ccc635

View file

@ -103,7 +103,6 @@ namespace FRESHMusicPlayer
public static void RepositionMusic(int seconds)
{
audioFile.CurrentTime = TimeSpan.FromSeconds(seconds);
//position = (int)audioFile.CurrentTime.TotalSeconds;
}
/// <summary>
@ -146,46 +145,30 @@ namespace FRESHMusicPlayer
}
catch (System.IO.FileNotFoundException)
{
// TODO: This is a temporary solution. In the future, I'd like to make a more robust error handler.
/*MessageBox.Show("Onee-Chan~~! That's not a valid file path, you BAKA! (or it's not a supported file type!)", "Incorrect file path", MessageBoxButtons.OK, MessageBoxIcon.Warning);
DatabaseHandler.DeleteSong(filePath);
UserInterface.LibraryNeedsUpdating = true;*/
PlaybackExceptionEventArgs args = new PlaybackExceptionEventArgs();
args.Details = "That's not a valid file path!";
songException.Invoke(null, args);
}
/*catch (System.ArgumentException)
catch (System.ArgumentException)
{
/*MessageBox.Show("Onee-Chan~~! You BAKA! You're supposed to actually put something in the box!", "Nothing typed in file path box", MessageBoxButtons.OK, MessageBoxIcon.Warning);
DatabaseHandler.DeleteSong(filePath);
UserInterface.LibraryNeedsUpdating = true;*//*
PlaybackExceptionEventArgs args = new PlaybackExceptionEventArgs();
args.Details = "That's not a valid file path!";
songException.Invoke(null, args);
}*/
}
catch (System.Runtime.InteropServices.COMException)
{
/*MessageBox.Show("Onee-Chan~! That's not a valid audio file!", "File Format Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
DatabaseHandler.DeleteSong(filePath);
UserInterface.LibraryNeedsUpdating = true;*/
PlaybackExceptionEventArgs args = new PlaybackExceptionEventArgs();
args.Details = "This isn't a valid audio file!";
songException.Invoke(null, args);
}
catch (System.FormatException)
{
/*MessageBox.Show("Onee-Chan~! This audio file must be corrupt! I can't play it!", "Format Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
DatabaseHandler.DeleteSong(filePath);
UserInterface.LibraryNeedsUpdating = true;*/
PlaybackExceptionEventArgs args = new PlaybackExceptionEventArgs();
args.Details = "This audio file might be corrupt!";
songException.Invoke(null, args);
}
catch (System.InvalidOperationException)
{
/*MessageBox.Show("Onee-Chan~! FRESHMusicPlayer doesn't support fancy VBR audio files! (or your audio file is corrupt in some way)", "VBR Files Not Supported", MessageBoxButtons.OK, MessageBoxIcon.Error);
DatabaseHandler.DeleteSong(filePath);
UserInterface.LibraryNeedsUpdating = true;*/
PlaybackExceptionEventArgs args = new PlaybackExceptionEventArgs();
args.Details = "This audio file uses VBR \nor might be corrupt!";
songException.Invoke(null, args);