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

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

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

revision 1817 by iliev, Thu Sep 11 18:48:36 2008 UTC revision 1818 by iliev, Wed Dec 24 17:29:47 2008 UTC
# Line 1  Line 1 
1  /*  /*
2   *   JSampler - a java front-end for LinuxSampler   *   JSampler - a java front-end for LinuxSampler
3   *   *
4   *   Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com>   *   Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>
5   *   *
6   *   This file is part of JSampler.   *   This file is part of JSampler.
7   *   *
# Line 55  public class Global { Line 55  public class Global {
55                  }                  }
56                                    
57                  /** The entry point of the task. */                  /** The entry point of the task. */
58                    @Override
59                  public void                  public void
60                  run() {                  run() {
61                          try { setResult(CC.getClient().getServerInfo()); }                          try { setResult(CC.getClient().getServerInfo()); }
# Line 78  public class Global { Line 79  public class Global {
79                  }                  }
80                                    
81                  /** The entry point of the task. */                  /** The entry point of the task. */
82                    @Override
83                  public void                  public void
84                  run() {                  run() {
85                          try { CC.getClient().resetSampler(); }                          try { CC.getClient().resetSampler(); }
# Line 100  public class Global { Line 102  public class Global {
102                  }                  }
103                    
104                  /** The entry point of the task. */                  /** The entry point of the task. */
105                    @Override
106                  public void                  public void
107                  run() {                  run() {
108                          try { setResult(CC.getClient().getVolume()); }                          try { setResult(CC.getClient().getVolume()); }
# Line 129  public class Global { Line 132  public class Global {
132                  }                  }
133                    
134                  /** The entry point of the task. */                  /** The entry point of the task. */
135                    @Override
136                  public void                  public void
137                  run() {                  run() {
138                          try {                          try {
# Line 142  public class Global { Line 146  public class Global {
146    
147                    
148          /**          /**
149             * This task sets the global sampler-wide limits of maximum voices and streams.
150             */
151            public static class SetPolyphony extends EnhancedTask {
152                    private int maxVoices;
153                    private int maxStreams;
154                    
155                    /**
156                     * Creates new instance of <code>SetPolyphony</code>.
157                     * @param maxVoices The new global limit of maximum voices or
158                     * <code>-1</code> to ignore it.
159                     * @param maxStreams The new global limit of maximum disk streams or
160                     * <code>-1</code> to ignore it.
161                     */
162                    public
163                    SetPolyphony(int maxVoices, int maxStreams) {
164                            setTitle("Global.SetPolyphony_task");
165                            setDescription(i18n.getMessage("Global.SetPolyphony.desc"));
166                            this.maxVoices = maxVoices;
167                            this.maxStreams = maxStreams;
168                    }
169            
170                    /** The entry point of the task. */
171                    @Override
172                    public void
173                    run() {
174                            try {
175                                    if(maxVoices != -1) CC.getClient().setGlobalVoiceLimit(maxVoices);
176                                    if(maxStreams != -1) CC.getClient().setGlobalStreamLimit(maxStreams);
177                            } catch(Exception x) {
178                                    setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));
179                                    CC.getLogger().log(Level.FINE, getErrorMessage(), x);
180                            }
181                    }
182            }
183    
184            
185            /**
186           * This task sets the LSCP client's read timeout.           * This task sets the LSCP client's read timeout.
187           */           */
188          public static class SetClientReadTimeout extends EnhancedTask {          public static class SetClientReadTimeout extends EnhancedTask {
# Line 159  public class Global { Line 200  public class Global {
200                  }                  }
201                    
202                  /** The entry point of the task. */                  /** The entry point of the task. */
203                    @Override
204                  public void                  public void
205                  run() {                  run() {
206                          try {                          try {
# Line 185  public class Global { Line 227  public class Global {
227                  }                  }
228                    
229                  /** The entry point of the task. */                  /** The entry point of the task. */
230                    @Override
231                  public void                  public void
232                  run() {                  run() {
233                          try { setResult(CC.getClient().getFileInstruments(filename)); }                          try { setResult(CC.getClient().getFileInstruments(filename)); }
# Line 212  public class Global { Line 255  public class Global {
255                  }                  }
256                    
257                  /** The entry point of the task. */                  /** The entry point of the task. */
258                    @Override
259                  public void                  public void
260                  run() {                  run() {
261                          try { setResult(CC.getClient().getFileInstrumentInfo(filename, instrIdx)); }                          try { setResult(CC.getClient().getFileInstrumentInfo(filename, instrIdx)); }
# Line 223  public class Global { Line 267  public class Global {
267          }          }
268                    
269          public static class DummyTask extends EnhancedTask {          public static class DummyTask extends EnhancedTask {
270                    @Override
271                  public void                  public void
272                  run() { }                  run() { }
273          }          }

Legend:
Removed from v.1817  
changed lines
  Added in v.1818

  ViewVC Help
Powered by ViewVC