/// <summary> /// Gets the mix level for mixing track 1 into track 1 /// </summary> /// <param name="track1">The track 1.</param> /// <param name="track2">The track 2.</param> /// <returns>A mix level from 0 to 5</returns> public int GetMixLevel(Track track1, Track track2) { if (track1 == null || track2 == null) { return(0); } var mixRank = GetMixRank(track1.Description, track2.Description); if (mixRank != null) { return(mixRank.MixLevel); } return(BpmHelper.IsBpmInRange(track1.EndBpm, track2.StartBpm, 5M) ? 1 : 0); }
/// <summary> /// Gets the tracks in BPM range. /// </summary> /// <param name="bpm">The BPM.</param> /// <param name="percentVariance">The percent variance.</param> /// <param name="tracks">The tracks.</param> /// <returns>A list of matching tracks</returns> public List <Track> GetTracksInStartBpmRange(decimal bpm, decimal percentVariance, List <Track> tracks) { return(tracks .Where(t => BpmHelper.IsBpmInRange(bpm, t.StartBpm, percentVariance)) .ToList()); }