1 |
/* |
2 |
* jlscp - a java LinuxSampler control protocol API |
3 |
* |
4 |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
6 |
* This file is part of jlscp. |
7 |
* |
8 |
* jlscp is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License version 2 |
10 |
* as published by the Free Software Foundation. |
11 |
* |
12 |
* jlscp is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with jlscp; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
* MA 02111-1307 USA |
21 |
*/ |
22 |
|
23 |
package org.linuxsampler.lscp; |
24 |
|
25 |
/** |
26 |
* Represents a MIDI instrument map used for mapping instruments |
27 |
* to corresponding MIDI bank select and MIDI program change messages. |
28 |
* @author Grigor Iliev |
29 |
*/ |
30 |
public class MidiInstrumentMapInfo { |
31 |
private int mapId; |
32 |
private String name; |
33 |
private boolean defaultMap; |
34 |
|
35 |
|
36 |
/** |
37 |
* Creates a new instance of <code>MidiInstrumentMapInfo</code> |
38 |
* with the specified name and map ID. |
39 |
* @param mapId Specifies the ID of the map. |
40 |
* @param name Specifies the name of the map. |
41 |
*/ |
42 |
public |
43 |
MidiInstrumentMapInfo(int mapId, String name) { |
44 |
this(mapId, name, false); |
45 |
} |
46 |
|
47 |
/** |
48 |
* Creates a new instance of <code>MidiInstrumentMapInfo</code>. |
49 |
* @param mapId Specifies the ID of the map. |
50 |
* @param name Specifies the name of the map. |
51 |
* @param defaultMap Specifies whether this is the default map. |
52 |
*/ |
53 |
public |
54 |
MidiInstrumentMapInfo(int mapId, String name, boolean defaultMap) { |
55 |
this.mapId = mapId; |
56 |
this.name = name; |
57 |
this.defaultMap = defaultMap; |
58 |
} |
59 |
|
60 |
/* Gets the ID of this MIDI instrument map. */ |
61 |
public int |
62 |
getMapId() { return mapId; } |
63 |
|
64 |
/** |
65 |
* Gets the name of this MIDI instrument map. |
66 |
* @return The name of this MIDI instrument map. |
67 |
*/ |
68 |
public String |
69 |
getName() { return name; } |
70 |
|
71 |
/** |
72 |
* Sets the name of this MIDI instrument map. |
73 |
* @param name The new name of this MIDI instrument map. |
74 |
*/ |
75 |
public void |
76 |
setName(String name) { this.name = name; } |
77 |
|
78 |
/** |
79 |
* Determines whether this map is the default map. |
80 |
* @return <code>true</code> if this is the default |
81 |
* map, <code>false</code> otherwise. |
82 |
*/ |
83 |
public boolean |
84 |
isDefault() { return defaultMap; } |
85 |
|
86 |
/** |
87 |
* Returns the name of this map. |
88 |
* @return The name of this map. |
89 |
*/ |
90 |
public String |
91 |
toString() { return getName(); } |
92 |
} |