public void Remove() { SQLiteDatabase sqlDatabase = null; try { Globals dbHelp = new Globals(); dbHelp.OpenDatabase(); sqlDatabase = dbHelp.GetSQLiteDatabase(); if (sqlDatabase != null && sqlDatabase.IsOpen) { var sql = "DELETE FROM [PlayLists] WHERE PlayListID = " + PlayListID.ToString(); sqlDatabase.ExecSQL(sql); Log.Info(TAG, "Remove: Removed PlayList with ID " + PlayListID.ToString() + " successfully"); sql = "DELETE FROM [Tracks] WHERE PlayListID = " + PlayListID.ToString(); sqlDatabase.ExecSQL(sql); Log.Info(TAG, "Remove: Removed Tracks with PLayList ID " + PlayListID.ToString() + " successfully"); sqlDatabase.Close(); } else { Log.Error(TAG, "Remove: SQLite database is null or was not opened - remove failed"); } } catch (Exception e) { Log.Error(TAG, "Remove: Exception - " + e.Message); if (sqlDatabase != null && sqlDatabase.IsOpen) { sqlDatabase.Close(); } } }
public void PlayRandomSoundFromList(PlayListID playListID) { AudioClip[] playList = null; switch (playListID) { case PlayListID.Apple: playList = AppleSounds; break; case PlayListID.Brick: playList = BrickSounds; break; case PlayListID.Boss: playList = BossSounds; break; } playFromPlayList(playList); }
public void PlayRandomSoundFromList(PlayListID playListID) { AudioClip[] playList = null; switch (playListID) { case PlayListID.Apple: playList = AppleSounds; break; case PlayListID.Brick: playList = BrickSounds; break; case PlayListID.Boss: playList = BossSounds; break; } //print("SoundSystem/PlayRandomSoundFromList: playing based on PlayListID: " + playListID.ToString()); playFromPlayList(playList); }
public override int GetHashCode() { unchecked { var hashCode = PlayListID; hashCode = (hashCode * 397) ^ Name.GetHashCode(); hashCode = (hashCode * 397) ^ Master.GetHashCode(); hashCode = (hashCode * 397) ^ PlayListID.GetHashCode(); hashCode = (hashCode * 397) ^ PlaylistPersistentID.GetHashCode(); hashCode = (hashCode * 397) ^ ParentPersistentID.GetHashCode(); hashCode = (hashCode * 397) ^ Visible.GetHashCode(); hashCode = (hashCode * 397) ^ AllItems.GetHashCode(); hashCode = (hashCode * 397) ^ DistinguishedKind.GetHashCode(); hashCode = (hashCode * 397) ^ Movies.GetHashCode(); hashCode = (hashCode * 397) ^ TVShows.GetHashCode(); hashCode = (hashCode * 397) ^ PodCasts.GetHashCode(); hashCode = (hashCode * 397) ^ iTunesU.GetHashCode(); hashCode = (hashCode * 397) ^ Audiobooks.GetHashCode(); hashCode = (hashCode * 397) ^ Books.GetHashCode(); hashCode = (hashCode * 397) ^ Folder.GetHashCode(); hashCode = (hashCode * 397) ^ PlaylistItems.GetHashCode(); return(hashCode); } }
public void Save() { SQLiteDatabase sqlDatabase = null; try { Globals dbHelp = new Globals(); dbHelp.OpenDatabase(); sqlDatabase = dbHelp.GetSQLiteDatabase(); if (sqlDatabase != null) { if (sqlDatabase.IsOpen) { ContentValues values = new ContentValues(); values.Put("PlayListName", PlayListName.Trim()); values.Put("PlayListTrackCount", PlayListTrackCount); if (IsNew) { PlayListID = (int)sqlDatabase.Insert("PlayLists", null, values); IsNew = false; IsDirty = false; } if (IsDirty) { string whereClause = "PlayListID = ?"; sqlDatabase.Update("PlayLists", values, whereClause, new string[] { PlayListID.ToString() }); IsDirty = false; } sqlDatabase.Close(); } } } catch (Exception e) { Log.Error(TAG, "Save: Exception - " + e.Message); } }