+ public static void setEdited() {
+ edited = true;
+ }
+
+ /**
+ * Sets the current editing position of the sequencer.
+ * @param ticks the tick position
+ */
+ public static void setEditPosition(long ticks) {
+ editPosition = ticks;
+ }
+
+ /**
+ * Sets the current editing position of the sequencer.
+ * @param ticks the tick position
+ */
+ public static void setTempo(int bpm) {
+ // tempoMsg
+ }
+
+ /**
+ * Sets the current editing position of the sequencer.
+ * @param ticks the tick position
+ */
+ public static void setTimeSig(int bpm) {
+ // timeSigMsg
+ }
+
+ /**
+ * Sets the solo setting of the given track.
+ * @param on true for solo, false for not
+ */
+ public static void setTrackSolo(Track track, boolean on){
+ trackSolo.put(track, new Boolean(on));
+ }
+
+ /**
+ * Sets the mute setting of the given track.
+ * @param on true for mute, false for not
+ */
+ public static void setTrackMute(Track track, boolean on){
+ trackMute.put(track, new Boolean(on));
+ }
+
+ /**
+ * Sets the current playback volume.
+ * @param volume the volume, between 0 and 1
+ */
+ public void setVolume(long volume) {
+ for (int i = 0; i < channels.length; i++) {
+ channels[i].controlChange(7, (int)(volume * 127.0));
+ }
+ }
+
+
+
+
+
+
+
+
+ /* ***
+ ** SELECTION METHODS **
+ *** */
+
+
+
+
+
+
+
+
+ /**
+ * Returns the current selection.
+ * @return the current selection
+ */
+ public static TreeSet getSelection() {
+ return selection;
+ }
+
+ /**
+ * Selects the given note
+ * @param the note to select
+ */
+ public static void selectNote(MooNoteElement elem) {
+ selection.add(elem);
+ }
+
+ /**
+ * Deselects the given note
+ * @param the note to deselect
+ */
+ public static void deselectNote(MooNoteElement elem) {
+ selection.remove(elem);
+ }
+
+ /**
+ * Deselects all notes.
+ */
+ public static void deselectAllNotes() {
+ Iterator it = selection.iterator();
+ while(it.hasNext()) {
+ ((MooNoteElement)it.next()).deselect();
+ }
+ selection.clear();
+ }
+
+ /**
+ * Determines if the given MooNoteElement is the only one in the track view that is selected.
+ * @return if the given element is the only selected one
+ */
+ public static boolean isTheOnlySelected(MooNoteElement elem) {
+ Iterator it = selection.iterator();
+ while(it.hasNext()) {
+ if (!it.next().equals(elem)) return false;