~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar-winmm/src/org/herac/tuxguitar/player/impl/midiport/winmm/MidiPortImpl.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.player.impl.midiport.winmm;
 
2
 
 
3
import org.herac.tuxguitar.player.base.MidiOut;
 
4
import org.herac.tuxguitar.player.base.MidiPort;
 
5
 
 
6
public class MidiPortImpl extends MidiPort{
 
7
        
 
8
        private final int device;
 
9
        private final MidiOutImpl midiOut;
 
10
        
 
11
        public MidiPortImpl(MidiSystem midiSystem,String name,int device){
 
12
                super(MidiPortImpl.toString(device),name);
 
13
                this.device = device;
 
14
                this.midiOut = new MidiOutImpl(this,midiSystem);
 
15
        }
 
16
        
 
17
        public void open(){
 
18
                if(!this.midiOut.isConnected()){
 
19
                        this.midiOut.connect();
 
20
                }
 
21
        }
 
22
        
 
23
        public void close(){
 
24
                this.midiOut.disconnect();
 
25
        }
 
26
        
 
27
        public MidiOut out(){
 
28
                this.open();
 
29
                return this.midiOut;
 
30
        }
 
31
        
 
32
        public void check(){
 
33
                // Not implemented
 
34
        }
 
35
        
 
36
        public int getDevice() {
 
37
                return this.device;
 
38
        }
 
39
        
 
40
        public static String toString(int device){
 
41
                return (Integer.toString(device));
 
42
        }
 
43
}
 
 
b'\\ No newline at end of file'