From: Einar Pehrson Date: Wed, 21 May 2003 00:45:07 +0000 (+0000) Subject: no message X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=commitdiff_plain;h=ae0bb1ddc2361a9c7f08579488870f0b99b14cb6 no message --- diff --git a/MooTrackView.java b/MooTrackView.java index f7e8335..0c48df3 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -132,8 +132,10 @@ public class MooTrackView extends JPanel { // Calculates coordinates. x = insets.left; - y = insets.top + Math.round(mn.getTick() / ticksPerSixteenth) * NOTE_HEIGHT; - height = (mn.getDuration() / ticksPerSixteenth) * NOTE_HEIGHT; + y = insets.top + (int)((mn.getTick() * NOTE_HEIGHT) / ticksPerSixteenth); + height = (mn.getDuration() * NOTE_HEIGHT) / ticksPerSixteenth; + System.out.println("y=i(" + insets.top + ")+t(" + mn.getTick() + ")/s(" + ticksPerSixteenth + ") *n(" + NOTE_HEIGHT + ") = " + y); + System.out.println("h=t(" + mn.getDuration() + ")/s(" + ticksPerSixteenth + ") *n(" + NOTE_HEIGHT + ") = " + height); if (height == 0) height = NOTE_HEIGHT; r = new Rectangle(x, y, NOTE_WIDTH, height); diff --git a/Moosique.java b/Moosique.java index c99d93c..860f561 100644 --- a/Moosique.java +++ b/Moosique.java @@ -345,14 +345,32 @@ public class Moosique { // 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)); + } + } + diff --git a/To Do.txt b/To Do.txt index f53632a..37c1bb9 100644 --- a/To Do.txt +++ b/To Do.txt @@ -29,6 +29,13 @@ x Spara konfiguration? Fem senast öppnade filerna Valda MIDI-enheter +x Stopp +sequencer.addMetaEventListener(new MetaEventListener() { + public void meta(MetaMessage event) { + if (event.getType() == 47 ) sequencer.stop(); // End of stream + } +}; + TEMPO / TAKTART x Räkna ut tempo och taktart. Skicka (på nåt sätt) tempovektorn till MooToolbar. x Räkna ut position (takt, slag, cent) för tick i Moosique. Behövs i NoteProp, ViewCounter, Menu etc. @@ -45,6 +52,11 @@ ANNAT x Fixa InstrumentList. x Textfält som gör att man bara kan skriva in siffror? (MooNoteProp) +MooToolbar + +Volymkontroll? - Använd Moosique.setVolume(long volume); +Progress Bar? - getTickLength() för max, getTickPosition() för position. + MooTrackView x Highlighta noter som spelas? (Enligt kravspec.)