/// <summary> /// This function makes sure your default device is being used, if not, reload Bass and the song back and continue as if nothing happened. /// </summary> private void CheckDevice() { if (!BassManager.CheckDevice(streamID)) { var pos = Bass.BASS_ChannelGetPosition(streamID, BASSMode.BASS_POS_BYTES); var secs = TimeSpan.FromSeconds(Bass.BASS_ChannelBytes2Seconds(streamID, pos)); var state = Bass.BASS_ChannelIsActive(streamID); var volume = 0.3f; Bass.BASS_ChannelGetAttribute(streamID, BASSAttribute.BASS_ATTRIB_VOL, ref volume); BassManager.Reload(); Load(lastFile); Volume = volume; CurrentTime = secs; switch (state) { case BASSActive.BASS_ACTIVE_PAUSED: case BASSActive.BASS_ACTIVE_STOPPED: Bass.BASS_ChannelPause(streamID); Bass.BASS_ChannelSetPosition(streamID, pos, BASSMode.BASS_POS_BYTES); break; case BASSActive.BASS_ACTIVE_STALLED: case BASSActive.BASS_ACTIVE_PLAYING: Bass.BASS_ChannelPlay(streamID, false); break; } } }