/[svn]/jsampler/trunk/src/org/jsampler/task/Channel.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/task/Channel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1333 by iliev, Thu Aug 30 22:44:29 2007 UTC revision 1334 by iliev, Sun Sep 9 17:43:30 2007 UTC
# Line 64  public class Channel { Line 64  public class Channel {
64                  run() {                  run() {
65                          try {                          try {
66                                  setResult(CC.getClient().addSamplerChannel());                                  setResult(CC.getClient().addSamplerChannel());
67                                    int chnId = getResult();
68                                                                    
69                                  JSPrefs p = CC.getViewConfig().preferences();                                  JSPrefs p = CC.getViewConfig().preferences();
70                                  if(!p.getBoolProperty(USE_CHANNEL_DEFAULTS)) return;                                  if(!p.getBoolProperty(USE_CHANNEL_DEFAULTS)) return;
71                                                                    
72                                  String s = p.getStringProperty(DEFAULT_ENGINE);                                  String s = p.getStringProperty(DEFAULT_ENGINE);
73                                  if(s != null && s.length() > 0) {                                  if(s != null && s.length() > 0) {
74                                          CC.getClient().loadSamplerEngine(s, getResult());                                          CC.getClient().loadSamplerEngine(s, chnId);
75                                  }                                  }
76                                                                    
77                                  s = p.getStringProperty(DEFAULT_MIDI_INPUT);                                  s = p.getStringProperty(DEFAULT_MIDI_INPUT);
# Line 84  public class Channel { Line 85  public class Channel {
85                                  if(s != null && s.equals("firstDevice")) {                                  if(s != null && s.equals("firstDevice")) {
86                                          assignFirstAudioDevice();                                          assignFirstAudioDevice();
87                                  }                                  }
88                                    
89                                    s = p.getStringProperty(DEFAULT_MIDI_INSTRUMENT_MAP);
90                                    if(s != null && s.equals("midiInstrumentMap.none")) {
91                                            CC.getClient().setChannelMidiInstrumentMap(chnId, -1);
92                                    } else if(s != null && s.equals("midiInstrumentMap.default")) {
93                                            CC.getClient().setChannelMidiInstrumentMap(chnId, -2);
94                                    }
95                                    
96                                    float volume = p.getIntProperty(DEFAULT_CHANNEL_VOLUME);
97                                    volume /= 100;
98                                    CC.getClient().setChannelVolume(chnId, volume);
99                          } catch(Exception x) {                          } catch(Exception x) {
100                                  setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));                                  setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));
101                                  CC.getLogger().log(Level.FINE, getErrorMessage(), x);                                  CC.getLogger().log(Level.FINE, getErrorMessage(), x);

Legend:
Removed from v.1333  
changed lines
  Added in v.1334

  ViewVC Help
Powered by ViewVC