Made empty tracks not be drawn.
private MooView view;
private JLabel statusBar;
private java.util.Timer timer;
- private boolean drawEmptyTracks = false;
public static final int statusResetDelay = 3000;
public static final Font FONT = new Font("Helvetica", Font.PLAIN, 10);
public static final Color bgColor = new Color(192, 224, 255);
toolbar.updateProgInd(tickPosition);
}
- /**
- * Shows the given message in the status bar.
- * @param text the message to show
- */
- public boolean drawEmptyTracks() {
- return drawEmptyTracks;
- }
-
- /**
- * Shows the given message in the status bar.
- * @param text the message to show
- */
- public void setDrawEmptyTracks(boolean state) {
- drawEmptyTracks = state;
- }
-
private Action createOctaveAction(final int octave) {
Action octaveAction = new AbstractAction() {
public void actionPerformed(ActionEvent ae) {
super(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
trackPanel = new JPanel(new GridLayout(1,3), true);
setViewportView(trackPanel);
+ getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);
titlePanel = new JPanel(new GridLayout(1,3),true);
JViewport columnHeader = new JViewport();
progressDialog.setVisible(true);
// Starts filling the track panel with track views, while updating the progress bar.
- trackPanel.setLayout(new GridLayout(1,numberOfTracks));
+ GridLayout gL = new GridLayout(1,numberOfTracks);
+ trackPanel.setLayout(gL);
for (int i = 1; i < tracks.length; i++) {
- trackPanel.add(new MooTrackView(tracks[i]));
- titlePanel.add(new MooTrackTitle(tracks[i],i));
- progressBar.setValue(i);
+ if (Moosique.shouldBeDrawn(tracks[i])) {
+ System.out.println("Draws track " + i);
+ trackPanel.add(new MooTrackView(tracks[i]));
+ titlePanel.add(new MooTrackTitle(tracks[i],i));
+ progressBar.setValue(i);
+ } else {
+ System.out.println("Doesn't draw track " + i);
+ gL.setColumns(--numberOfTracks);
+ trackPanel.setLayout(gL);
+ }
}
progressDialog.dispose();
}
private static String filename, fileArg;
private static long editPosition;
- private static boolean makeGUI = true, isEdited;
+ private static boolean makeGUI = true, isEdited = false, drawEmptyTracks = false;
private static Thread player;
public static final int DEFAULT_RESOLUTION = 96, DEFAULT_TRACKS = 4;
editPosition += ticks;
}
+ /**
+ * Shows the given message in the status bar.
+ * @param text the message to show
+ */
+ public static boolean shouldBeDrawn(Track track) {
+ if (drawEmptyTracks) return true;
+ else return (!emptyTracks.contains(track));
+ }
+
+
+ /**
+ * Shows the given message in the status bar.
+ * @param text the message to show
+ */
+ public static void setDrawEmptyTracks(boolean state) {
+ drawEmptyTracks = state;
+ }
+
/**
* Loads the MooSequence in the given file.
* @param filename the filename to use
noteOffs.trimToSize();
boolean isEmpty = (noteOns.size() == 0);
String text = "Track " + i + " has " + noteOns.size() + "/" + noteOffs.size() + "/" + tracks[i].size();
- if (isEmpty) text += " and will not be removed.";
+ if (isEmpty) {
+ text += " and will be removed.";
+ emptyTracks.add(tracks[i]);
+ }
System.out.println(text);
- emptyTracks.add(tracks[i]);
// Sorts the note lists by tick position.
Comparator c = new Comparator() {
x VIKTIGT!!! HUR LÄGGA TILL NOTER?!?
-x Varför funkar inte lyssnarna på MooTrackView?!?
-
x Spara konfiguration?
Arbetskatalog
Fem senast öppnade filerna