jdk/src/share/classes/com/sun/media/sound/DLSSampleOptions.java
author amenkov
Wed, 06 Apr 2011 15:12:33 +0400
changeset 9215 cab45ca6ab44
parent 5506 202f599c92aa
child 18215 b2afd66ce6db
permissions -rw-r--r--
6992523: FindBugs scan - Malicious code vulnerability Warnings in com.sun.media.sound.* Reviewed-by: alexp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
     2
 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
     4
 *
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    10
 *
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    15
 * accompanied this code).
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    16
 *
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
    23
 * questions.
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    24
 */
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    25
package com.sun.media.sound;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    26
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    27
import java.util.ArrayList;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    28
import java.util.List;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    29
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    30
/**
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    31
 * This class stores options how to playback sampled data like pitch/tuning,
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    32
 * attenuation and loops.
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    33
 * It is stored as a "wsmp" chunk inside DLS files.
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    34
 *
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    35
 * @author Karl Helgason
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    36
 */
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    37
public class DLSSampleOptions {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    38
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    39
    protected int unitynote;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    40
    protected short finetune;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    41
    protected int attenuation;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    42
    protected long options;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    43
    protected List<DLSSampleLoop> loops = new ArrayList<DLSSampleLoop>();
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    44
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    45
    public int getAttenuation() {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    46
        return attenuation;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    47
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    48
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    49
    public void setAttenuation(int attenuation) {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    50
        this.attenuation = attenuation;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    51
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    52
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    53
    public short getFinetune() {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    54
        return finetune;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    55
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    56
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    57
    public void setFinetune(short finetune) {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    58
        this.finetune = finetune;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    59
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    60
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    61
    public List<DLSSampleLoop> getLoops() {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    62
        return loops;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    63
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    64
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    65
    public long getOptions() {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    66
        return options;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    67
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    68
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    69
    public void setOptions(long options) {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    70
        this.options = options;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    71
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    72
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    73
    public int getUnitynote() {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    74
        return unitynote;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    75
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    76
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    77
    public void setUnitynote(int unitynote) {
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    78
        this.unitynote = unitynote;
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    79
    }
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff changeset
    80
}