差分発生行の前後
無視リスト:
更新日時:
2010/05/11 20:15:55 (2 年 前)
更新者:
h
ログメッセージ:

refs #2 #8 #9 #7 #6
現状のソースをコミット。一部完了。一部未完了。
関連づいてない完了チケットのチェンジセットもまとめて。
パッケージ階層も大幅に変更。

パス:
trunk/src/org/rayflood/mikuvat/io/midi
ファイル:
1 追加
1 移動

凡例:

変更なし
追加
削除
  • trunk/src/org/rayflood/mikuvat/io/midi/MidiMeta.java

    r2 r4  
    1 package org.rayflood.mikuvat.io; 
     1package org.rayflood.mikuvat.io.midi; 
    22 
    3 import static org.rayflood.mikuvat.io.VSQDecoder.getByteArrayString; 
     3import static org.rayflood.mikuvat.Utilities.getByteArrayString; 
    44 
    55import java.io.File; 
     6import java.io.FileNotFoundException; 
     7import java.io.IOException; 
    68import java.util.ArrayList; 
    79import java.util.List; 
    810 
     11import javax.sound.midi.InvalidMidiDataException; 
    912import javax.sound.midi.MetaMessage; 
    1013import javax.sound.midi.MidiMessage; 
     14 
     15import org.rayflood.mikuvat.io.BaseObject; 
    1116 
    1217public class MidiMeta extends MidiData{ 
     
    1520        private byte[] data; 
    1621 
    17         public MidiMeta(MidiMessage mm){ 
     22        protected MidiMeta(MidiMessage mm){ 
    1823                setMidiEvent(mm); 
     24        } 
     25 
     26        public MidiMeta(MetaMessage meta){ 
     27                setMidiEvent(meta); 
    1928        } 
    2029 
     
    2433        } 
    2534 
    26         public MetaMessage getMidiEvent() throws Exception{ 
     35        public MetaMessage getMidiEvent() throws InvalidMidiDataException{ 
    2736                MetaMessage meta = new MetaMessage(); 
    2837                meta.setMessage(getType(), getData(), getData().length); 
     
    3039        } 
    3140 
    32         public void setMidiEvent(MidiMessage mm){ 
    33                 MetaMessage meta = (MetaMessage)mm; 
     41        protected void setMidiEvent(MidiMessage mm){ 
     42                setMidiEvent((MetaMessage)mm); 
     43        } 
     44 
     45        public void setMidiEvent(MetaMessage meta){ 
    3446                setType(meta.getType()); 
    3547                setData(meta.getData()); 
     
    4153                sl.add("Data=" + getByteArrayString(getData())); 
    4254 
    43                 StringBuffer sb = new StringBuffer(); 
     55                StringBuilder sb = new StringBuilder(); 
    4456                sb.append("MidiMeta={"); 
    4557                if(!sl.isEmpty()){ 
     
    5365        } 
    5466 
    55         public boolean isReadied(){ 
     67        public boolean validate(){ 
    5668                return true; 
    5769        } 
    5870 
    59         public int compareTo(ImmutableObject obj){ 
     71        public int compareTo(BaseObject obj){ 
    6072                MidiMeta midiMeta = (MidiMeta)obj; 
    6173                return compare(getType(), midiMeta.getType()); 
    6274        } 
    6375 
    64         public MidiMeta over(Object obj, boolean fill, boolean has){ 
     76        public MidiMeta over(BaseObject obj, boolean fill, boolean has){ 
    6577                MidiMeta midiMeta = ((MidiMeta)obj).clone(); 
    6678                setType(midiMeta.getType()); 
     
    112124        } 
    113125 
    114         public static MidiMeta load(String file) throws Exception{ 
    115                 return (MidiMeta)ImmutableObject.load(file); 
     126        public static MidiMeta load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 
     127                return (MidiMeta)BaseObject.load(file); 
    116128        } 
    117129 
    118         public static MidiMeta load(File file) throws Exception{ 
    119                 return (MidiMeta)ImmutableObject.load(file); 
     130        public static MidiMeta load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 
     131                return (MidiMeta)BaseObject.load(file); 
    120132        } 
    121133 
    122         public void store(String file) throws Exception{ 
     134        public void store(String file) throws FileNotFoundException, IOException{ 
    123135                super.store(file); 
    124136        } 
    125137 
    126         public void store(File file) throws Exception{ 
     138        public void store(File file) throws FileNotFoundException, IOException{ 
    127139                super.store(file); 
    128140        } 
    129141 
    130         public static MidiMeta unzip(String file) throws Exception{ 
    131                 return (MidiMeta)ImmutableObject.unzip(file); 
     142        public static MidiMeta unzip(String file) throws IOException, ClassNotFoundException{ 
     143                return (MidiMeta)BaseObject.unzip(file); 
    132144        } 
    133145 
    134         public static MidiMeta unzip(File file) throws Exception{ 
    135                 return (MidiMeta)ImmutableObject.unzip(file); 
     146        public static MidiMeta unzip(File file) throws IOException, ClassNotFoundException{ 
     147                return (MidiMeta)BaseObject.unzip(file); 
    136148        } 
    137149 
    138         public void zip(String file) throws Exception{ 
     150        public void zip(String file) throws IOException{ 
    139151                super.zip(file); 
    140152        } 
    141153 
    142         public void zip(File file) throws Exception{ 
     154        public void zip(File file) throws IOException{ 
    143155                super.zip(file); 
    144156        }