public ElementPitchedNote( ViewManager manager, Project.TrackPitchedNotes projectTrackPitchedNode, Project.PitchedNote pitchedNote) : base(manager) { this.projectTrackPitchedNode = projectTrackPitchedNode; this.projectPitchedNote = pitchedNote; this.interactableRegions = new List <InteractableRegion>(); this.segments = new List <Segment>(); this.timeRange = this.projectPitchedNote.timeRange; this.pitch = this.projectPitchedNote.pitch; this.assignedTrack = -1; for (var i = 0; i < this.manager.rows[0].trackSegments.Count; i++) { var trackPitchedNote = (this.manager.rows[0].trackSegments[i] as TrackSegmentPitchedNotes); if (trackPitchedNote != null && trackPitchedNote.projectTracks.Contains(this.projectTrackPitchedNode)) { this.assignedTrack = i; break; } } }
public void SetPitchedNoteSelection(int projectTrackIndex, Project.PitchedNote pitchedNote, bool selected) { var projectTrack = this.project.tracks[projectTrackIndex]; foreach (var element in this.elements) { var note = element as ElementPitchedNote; if (note != null) { if (note.projectTrackPitchedNode == projectTrack && note.projectPitchedNote == pitchedNote) { note.selected = selected; } } } }