1 |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
4 |
* Copyright (C) 2005-2011 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
6 |
* This file is part of JSampler. |
7 |
* |
8 |
* JSampler 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 |
* JSampler 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 JSampler; 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.jsampler.android.view; |
24 |
|
25 |
import org.jsampler.SamplerChannelModel; |
26 |
import org.jsampler.view.JSChannel; |
27 |
import org.linuxsampler.lscp.SamplerChannel; |
28 |
|
29 |
public class AndroidChannel implements JSChannel { |
30 |
private SamplerChannelModel model; |
31 |
|
32 |
/** |
33 |
* Creates a new instance of <code>AndroidChannel</code> using the specified |
34 |
* non-<code>null</code> channel model. |
35 |
* @param model The model to be used by this channel. |
36 |
* @throws IllegalArgumentException If the model is <code>null</code>. |
37 |
*/ |
38 |
public AndroidChannel(SamplerChannelModel model) { |
39 |
if(model == null) throw new IllegalArgumentException("model must be non null"); |
40 |
this.model = model; |
41 |
} |
42 |
|
43 |
/** |
44 |
* Gets the model that is currently used by this channel. |
45 |
* @return model The <code>SamplerChannelModel</code> instance |
46 |
* which provides information about this channel. |
47 |
*/ |
48 |
@Override |
49 |
public SamplerChannelModel |
50 |
getModel() { return model; } |
51 |
|
52 |
/** |
53 |
* Gets the numerical ID of this sampler channel. |
54 |
* @return The numerical ID of this sampler channel or -1 if the channel's ID is not set. |
55 |
*/ |
56 |
@Override |
57 |
public int |
58 |
getChannelId() { |
59 |
return getChannelInfo() == null ? -1 : getChannelInfo().getChannelId(); |
60 |
} |
61 |
|
62 |
/** |
63 |
* Gets the current settings of this sampler channel. |
64 |
* @return <code>SamplerChannel</code> instance containing |
65 |
* the current settings of this sampler channel. |
66 |
*/ |
67 |
@Override |
68 |
public SamplerChannel |
69 |
getChannelInfo() { return getModel().getChannelInfo(); } |
70 |
|
71 |
@Override |
72 |
public boolean |
73 |
isSelected() { return false; } |
74 |
|
75 |
@Override |
76 |
public void |
77 |
setSelected(boolean select) { } |
78 |
} |