private void moveToNext() { if (TuxGuitar.instance().getPlayer().isRunning()) { TuxGuitar.instance().getTransport().gotoNext(); } else { Caret caret = getEditor().getTablature().getCaret(); TGTrackImpl track = caret.getTrack(); TGMeasure measure = getSongManager().getTrackManager().getNextMeasure(caret.getMeasure()); if (track != null && measure != null) { caret.update(track.getNumber(), measure.getStart(), caret.getSelectedString().getNumber()); } } }
public void update() { if (!isDisposed()) { TGTrackImpl track = TuxGuitar.instance().getTablatureEditor().getTablature().getCaret().getTrack(); int tracks = track.getSong().countTracks(); boolean isFirst = (track.getNumber() == 1); boolean isLast = (track.getNumber() == tracks); boolean running = TuxGuitar.instance().getPlayer().isRunning(); this.addTrack.setEnabled(!running); this.cloneTrack.setEnabled(!running); this.removeTrack.setEnabled(!running); this.moveUp.setEnabled(!running && tracks > 1); this.moveDown.setEnabled(!running && tracks > 1); this.first.setEnabled(!isFirst); this.previous.setEnabled(!isFirst); this.next.setEnabled(!isLast); this.last.setEnabled(!isLast); this.properties.setEnabled(!running); this.changeSolo.setSelection(track.isSolo()); this.changeMute.setSelection(track.isMute()); } }