]> ruin.nu Git - moosique.git/commitdiff
no message
authorEinar Pehrson <einarp@itstud.chalmers.se>
Wed, 21 May 2003 00:45:07 +0000 (00:45 +0000)
committerEinar Pehrson <einarp@itstud.chalmers.se>
Wed, 21 May 2003 00:45:07 +0000 (00:45 +0000)
MooTrackView.java
Moosique.java
To Do.txt

index f7e8335bf365748478972feff97c7ce4fb879f53..0c48df37ad736b7ccc2d2dbc6c3c9545c498f7d4 100644 (file)
@@ -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);
 
index c99d93cef21971aa71ae7bcf4ede6db984c0521a..860f561a3d720e50dcf333554824f65f6fd18a0c 100644 (file)
@@ -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));
+               }
+       }
+
 
 
 
index f53632ac97fb4d38fcb9d6898ed40e3f51e0e4f7..37c1bb99999b7b589ceb286fa1b41e1bff86687b 100644 (file)
--- 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.)