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 
  26 package com.sun.media.sound;
  27 
  28 import java.util.ArrayList;
  29 import java.util.List;
  30 
  31 /**
  32  * This class is used to define how to synthesize audio in universal maner
  33  * for both SF2 and DLS instruments.
  34  *
  35  * @author Karl Helgason
  36  */
  37 public final class ModelPerformer {
  38 
  39     private final List<ModelOscillator> oscillators = new ArrayList<>();
  40     private List<ModelConnectionBlock> connectionBlocks = new ArrayList<>();
  41 
  42     private int keyFrom = 0;
  43     private int keyTo = 127;
  44     private int velFrom = 0;
  45     private int velTo = 127;
  46     private int exclusiveClass = 0;
  47     private boolean releaseTrigger = false;
  48     private boolean selfNonExclusive = false;
  49     private Object userObject = null;
  50     private boolean addDefaultConnections = true;
  51     private String name = null;
  52 
  53     public String getName() {
  54         return name;
  55     }
  56 
  57     public void setName(String name) {
  58         this.name = name;
  59     }
  60 
  61     public List<ModelConnectionBlock> getConnectionBlocks() {
  62         return connectionBlocks;
  63     }
  64 
  65     public void setConnectionBlocks(List<ModelConnectionBlock> connectionBlocks) {
  66         this.connectionBlocks = connectionBlocks;
  67     }
  68 
  69     public List<ModelOscillator> getOscillators() {
  70         return oscillators;
  71     }
  72 
  73     public int getExclusiveClass() {
  74         return exclusiveClass;
  75     }
  76 
  77     public void setExclusiveClass(int exclusiveClass) {
  78         this.exclusiveClass = exclusiveClass;
  79     }
  80 
  81     public boolean isSelfNonExclusive() {
  82         return selfNonExclusive;
  83     }
  84 
  85     public void setSelfNonExclusive(boolean selfNonExclusive) {
  86         this.selfNonExclusive = selfNonExclusive;
  87     }
  88 
  89     public int getKeyFrom() {
  90         return keyFrom;
  91     }
  92 
  93     public void setKeyFrom(int keyFrom) {
  94         this.keyFrom = keyFrom;
  95     }
  96 
  97     public int getKeyTo() {
  98         return keyTo;
  99     }
 100 
 101     public void setKeyTo(int keyTo) {
 102         this.keyTo = keyTo;
 103     }
 104 
 105     public int getVelFrom() {
 106         return velFrom;
 107     }
 108 
 109     public void setVelFrom(int velFrom) {
 110         this.velFrom = velFrom;
 111     }
 112 
 113     public int getVelTo() {
 114         return velTo;
 115     }
 116 
 117     public void setVelTo(int velTo) {
 118         this.velTo = velTo;
 119     }
 120 
 121     public boolean isReleaseTriggered() {
 122         return releaseTrigger;
 123     }
 124 
 125     public void setReleaseTriggered(boolean value) {
 126         this.releaseTrigger = value;
 127     }
 128 
 129     public Object getUserObject() {
 130         return userObject;
 131     }
 132 
 133     public void setUserObject(Object object) {
 134         userObject = object;
 135     }
 136 
 137     public boolean isDefaultConnectionsEnabled() {
 138         return addDefaultConnections;
 139     }
 140 
 141     public void setDefaultConnectionsEnabled(boolean addDefaultConnections) {
 142         this.addDefaultConnections = addDefaultConnections;
 143     }
 144 }