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

« back to all changes in this revision

Viewing changes to TuxGuitar-ptb/src/org/herac/tuxguitar/io/ptb/helper/TrackInfoHelper.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.io.ptb.helper;
 
2
 
 
3
import java.util.ArrayList;
 
4
import java.util.List;
 
5
 
 
6
import org.herac.tuxguitar.io.ptb.base.PTTrackInfo;
 
7
import org.herac.tuxguitar.song.models.TGTrack;
 
8
 
 
9
public class TrackInfoHelper {
 
10
        
 
11
        private List staffTracks = new ArrayList();
 
12
        private PTTrackInfo defaultInfo;
 
13
        
 
14
        public TrackInfoHelper(){
 
15
                this.staffTracks = new ArrayList();
 
16
        }
 
17
        
 
18
        public void reset(PTTrackInfo defaultInfo){
 
19
                this.defaultInfo = defaultInfo;
 
20
                this.staffTracks.clear();
 
21
        }
 
22
        
 
23
        public PTTrackInfo getDefaultInfo() {
 
24
                return this.defaultInfo;
 
25
        }
 
26
        
 
27
        public TGTrack getStaffTrack(int staff) {
 
28
                if(staff >= 0 && staff < this.staffTracks.size() ){
 
29
                        return (TGTrack)this.staffTracks.get( staff );
 
30
                }
 
31
                return null;
 
32
        }
 
33
        
 
34
        public int countStaffTracks() {
 
35
                return this.staffTracks.size();
 
36
        }
 
37
        
 
38
        public void addStaffTrack(TGTrack track) {
 
39
                this.staffTracks.add( track );
 
40
        }
 
41
        
 
42
        public void removeStaffTrack(int staff) {
 
43
                this.staffTracks.remove( staff );
 
44
        }
 
45
}