+ selectPoint(_track.getPointIndex(inPoint));
+ }
+
+ /**
+ * Increment the selected point index by the given increment
+ * @param inPointIncrement +1 for next point, -1 for previous etc
+ */
+ public void incrementPointIndex(int inPointIncrement)
+ {
+ int index = _selection.getCurrentPointIndex() + inPointIncrement;
+ if (index < 0) index = 0;
+ else if (index >= _track.getNumPoints()) index = _track.getNumPoints()-1;
+ selectPoint(index);
+ }
+
+ /**
+ * Select the data point with the given index
+ * @param inPointIndex index of DataPoint to select, or -1 for none
+ */
+ public void selectPoint(int inPointIndex)
+ {
+ if (_selection.getCurrentPointIndex() == inPointIndex || inPointIndex >= _track.getNumPoints()) {return;}
+ DataPoint selectedPoint = _track.getPoint(inPointIndex);
+ // get the index of the current photo
+ int photoIndex = _selection.getCurrentPhotoIndex();
+ // Check if point has photo or not
+ boolean pointHasPhoto = inPointIndex >= 0 && selectedPoint.getPhoto() != null;
+ if (pointHasPhoto) {
+ photoIndex = _photoList.getPhotoIndex(selectedPoint.getPhoto());
+ }
+ else if (photoIndex < 0 || _photoList.getPhoto(photoIndex).isConnected()) {
+ // selected point hasn't got a photo - deselect photo if necessary
+ photoIndex = -1;
+ }
+ // Check if point has an audio item or not
+ int audioIndex = _selection.getCurrentAudioIndex();
+ boolean pointHasAudio = inPointIndex >= 0 && selectedPoint.getAudio() != null;
+ if (pointHasAudio) {
+ audioIndex = _audioList.getAudioIndex(selectedPoint.getAudio());
+ }
+ else if (audioIndex < 0 || _audioList.getAudio(audioIndex).isConnected()) {
+ // deselect current audio clip
+ audioIndex = -1;
+ }