1 /*
   2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.media.sound;
  26 
  27 import java.util.ArrayList;
  28 import java.util.List;
  29 
  30 /**
  31  * This class is used to define how to synthesize audio in universal maner
  32  * for both SF2 and DLS instruments.
  33  *
  34  * @author Karl Helgason
  35  */
  36 public final class ModelPerformer {
  37 
  38     private final List<ModelOscillator> oscillators = new ArrayList<ModelOscillator>();
  39     private List<ModelConnectionBlock> connectionBlocks
  40             = new ArrayList<ModelConnectionBlock>();
  41     private int keyFrom = 0;
  42     private int keyTo = 127;
  43     private int velFrom = 0;
  44     private int velTo = 127;
  45     private int exclusiveClass = 0;
  46     private boolean releaseTrigger = false;
  47     private boolean selfNonExclusive = false;
  48     private Object userObject = null;
  49     private boolean addDefaultConnections = true;
  50     private String name = null;
  51 
  52     public String getName() {
  53         return name;
  54     }
  55 
  56     public void setName(String name) {
  57         this.name = name;
  58     }
  59 
  60     public List<ModelConnectionBlock> getConnectionBlocks() {
  61         return connectionBlocks;
  62     }
  63 
  64     public void setConnectionBlocks(List<ModelConnectionBlock> connectionBlocks) {
  65         this.connectionBlocks = connectionBlocks;
  66     }
  67 
  68     public List<ModelOscillator> getOscillators() {
  69         return oscillators;
  70     }
  71 
  72     public int getExclusiveClass() {
  73         return exclusiveClass;
  74     }
  75 
  76     public void setExclusiveClass(int exclusiveClass) {
  77         this.exclusiveClass = exclusiveClass;
  78     }
  79 
  80     public boolean isSelfNonExclusive() {
  81         return selfNonExclusive;
  82     }
  83 
  84     public void setSelfNonExclusive(boolean selfNonExclusive) {
  85         this.selfNonExclusive = selfNonExclusive;
  86     }
  87 
  88     public int getKeyFrom() {
  89         return keyFrom;
  90     }
  91 
  92     public void setKeyFrom(int keyFrom) {
  93         this.keyFrom = keyFrom;
  94     }
  95 
  96     public int getKeyTo() {
  97         return keyTo;
  98     }
  99 
 100     public void setKeyTo(int keyTo) {
 101         this.keyTo = keyTo;
 102     }
 103 
 104     public int getVelFrom() {
 105         return velFrom;
 106     }
 107 
 108     public void setVelFrom(int velFrom) {
 109         this.velFrom = velFrom;
 110     }
 111 
 112     public int getVelTo() {
 113         return velTo;
 114     }
 115 
 116     public void setVelTo(int velTo) {
 117         this.velTo = velTo;
 118     }
 119 
 120     public boolean isReleaseTriggered() {
 121         return releaseTrigger;
 122     }
 123 
 124     public void setReleaseTriggered(boolean value) {
 125         this.releaseTrigger = value;
 126     }
 127 
 128     public Object getUserObject() {
 129         return userObject;
 130     }
 131 
 132     public void setUserObject(Object object) {
 133         userObject = object;
 134     }
 135 
 136     public boolean isDefaultConnectionsEnabled() {
 137         return addDefaultConnections;
 138     }
 139 
 140     public void setDefaultConnectionsEnabled(boolean addDefaultConnections) {
 141         this.addDefaultConnections = addDefaultConnections;
 142     }
 143 }