+ // Find point object and its index
+ if (audio.isConnected()) {
+ pointIndex = _track.getPointIndex(audio.getDataPoint());
+ }
+ else {
+ // Check whether to deselect current point or not if audio not correlated
+ if (pointIndex >= 0 && _track.getPoint(pointIndex).getAudio() != null) {
+ pointIndex = -1;
+ }
+ }
+ }
+ else {
+ // check if current point has audio or not
+ if (currPoint != null && currPoint.getAudio() != null) {
+ pointIndex = -1;
+ }
+ }
+ // Has the new point got a photo?
+ DataPoint selectedPoint = _track.getPoint(pointIndex);
+ int photoIndex = _selection.getCurrentPhotoIndex();
+ if (selectedPoint != null) {
+ if (selectedPoint.getPhoto() != null) photoIndex = _photoList.getPhotoIndex(selectedPoint.getPhoto());
+ }
+ else {
+ if (selectedPoint != currPoint && currPoint.getPhoto() != null) {photoIndex = -1;}
+ }
+ // give to selection object
+ _selection.selectPointPhotoAudio(pointIndex, photoIndex, inAudioIndex);
+ }
+
+
+ /**
+ * Extend the current selection to end at the given point, eg by shift-clicking
+ * @param inPointNum index of end point
+ */
+ public void extendSelection(int inPointNum)
+ {
+ // See whether to start selection from current range start or current point
+ int rangeStart = _selection.getStart();
+ if (rangeStart < 0 || _selection.getCurrentPointIndex() != _selection.getEnd()) {
+ rangeStart = _selection.getCurrentPointIndex();
+ }
+ selectPoint(inPointNum);
+ if (rangeStart < inPointNum) {
+ _selection.selectRange(rangeStart, inPointNum);