private bool exists(string artist) { int i, N; for (i = 0, N = _artists.Count; i < N && !Loosely.eq(_artists[i].Name, artist); i++) { ; } return(i < N); }
public override void Reload() { HashSet <string> added = new HashSet <String>(); _composers.Clear(); List <CueSheet> s = MySource.getSheets(); _composers.Add(_nullComposer); string artist = ""; if (_artist != null) { artist = Loosely.prepare(_artist.Name); } for (int i = 0; i < s.Count; i++) { string comp = Loosely.prepare(s[i].composer()); if (!added.Contains(comp)) { bool do_add = true; if (_genre != null) { if (s[i].genre() != _genre.Genre) { do_add = false; } } if (_artist != null) { if (!Loosely.eqp(artist, s[i].performer())) { do_add = false; } } if (do_add) { CS_ComposerInfo a = new CS_ComposerInfo(s[i]); _composers.Add(a); added.Add(comp); } } } _composers.Sort(new CS_ComposerInfo.Comparer()); base.RaiseReloaded(); }
public override void Reload() { HashSet <string> added = new HashSet <string>(); List <CueSheet> s = MySource.getSheets(); _genres.Clear(); _genres.Add(_nullGenre); for (int i = 0; i < s.Count; i++) { string gen = Loosely.prepare(s[i].genre()); if (!added.Contains(gen)) { _genres.Add(new CS_GenreInfo(s[i].genre())); added.Add(gen); } } _genres.Sort(new CS_GenreInfo.Comparer()); base.RaiseReloaded(); }
public override void Reload() { _filteredList.Clear(); List <CueSheet> s = MySource.getSheets(); int i, N; string artist = ""; if (_artist != null) { artist = Loosely.prepare(_artist.Name); } string composer = ""; if (_composer != null) { composer = Loosely.prepare(_composer.Name); } for (i = 0, N = s.Count; i < N; i++) { bool do_add = true; if (_genre != null) { if (s[i].genre() != _genre.Genre) { do_add = false; } } if (_artist != null && do_add) { if (!Loosely.eqp(artist, s[i].performer())) { do_add = false; } } if (_composer != null && do_add) { if (!Loosely.eqp(composer, s[i].composer())) { do_add = false; } } if (_album_search != null && do_add) { if (!s[i].title().ToLower().Contains(_album_search) && !s[i].performer().ToLower().Contains(_album_search) && !s[i].composer().ToLower().Contains(_album_search)) { if (_also_in_tracks) { CueSheet q = s[i]; int k, M; bool can_add = false; for (k = 0, M = q.nEntries(); k < M && !can_add; k++) { CueSheetEntry e = q.entry(k); if (e.title().ToLower().Contains(_album_search) || e.performer().ToLower().Contains(_album_search) || e.getComposer().ToLower().Contains(_album_search)) { can_add = true; } } do_add = can_add; } else { do_add = false; } } } if (do_add) { _filteredList.Add(new CS_AlbumInfo(s[i])); } } _filteredList.Sort(new CS_AlbumInfo.Comparer()); base.RaiseReloaded(); }