当前位置: 首页>>代码示例>>Java>>正文


Java ModelPerformer类代码示例

本文整理汇总了Java中com.sun.media.sound.ModelPerformer的典型用法代码示例。如果您正苦于以下问题:Java ModelPerformer类的具体用法?Java ModelPerformer怎么用?Java ModelPerformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ModelPerformer类属于com.sun.media.sound包,在下文中一共展示了ModelPerformer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDirector

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:32,代码来源:ModelStandardIndexedDirectorTest.java

示例2: testDirectorCombinations

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
private static void testDirectorCombinations(
        ModelPerformer[] performers) throws Exception
{
    for (int i = 0; i < performers.length; i++) {
        ModelPerformer[] performers2 = new ModelPerformer[i];
        for (int j = 0; j < performers2.length; j++) {
            performers2[j] = performers[i];
        }
        testDirector(performers2);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:ModelStandardIndexedDirectorTest.java

示例3: addPerformer

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
private static void addPerformer(
        List<ModelPerformer> performers,
        int keyfrom,
        int keyto,
        int velfrom,
        int velto)
{
    ModelPerformer performer = new ModelPerformer();
    performer.setKeyFrom(keyfrom);
    performer.setKeyTo(keyto);
    performer.setVelFrom(velfrom);
    performer.setVelTo(velto);
    performers.add(performer);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:ModelStandardIndexedDirectorTest.java

示例4: add

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
public void add(ModelPerformer[] performers, int keyFrom, int keyTo,
        int velFrom, int velTo, int exclusiveClass) {
    SimpleInstrumentPart part = new SimpleInstrumentPart();
    part.performers = performers;
    part.keyFrom = keyFrom;
    part.keyTo = keyTo;
    part.velFrom = velFrom;
    part.velTo = velTo;
    part.exclusiveClass = exclusiveClass;
    parts.add(part);
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:12,代码来源:SimpleInstrument.java

示例5: convertModulator

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
private void convertModulator(ModelPerformer performer,
        SF2Modulator modulator) {
    ModelSource src1 = convertSource(modulator.getSourceOperator());
    ModelSource src2 = convertSource(modulator.getAmountSourceOperator());
    if (src1 == null && modulator.getSourceOperator() != 0)
        return;
    if (src2 == null && modulator.getAmountSourceOperator() != 0)
        return;
    double amount = modulator.getAmount();
    double[] amountcorrection = new double[1];
    ModelSource[] extrasrc = new ModelSource[1];
    amountcorrection[0] = 1;
    ModelDestination dst = convertDestination(
            modulator.getDestinationOperator(), amountcorrection, extrasrc);
    amount *= amountcorrection[0];
    if (dst == null)
        return;
    if (modulator.getTransportOperator() == SF2Modulator.TRANSFORM_ABSOLUTE) {
        ((ModelStandardTransform)dst.getTransform()).setTransform(
                ModelStandardTransform.TRANSFORM_ABSOLUTE);
    }
    ModelConnectionBlock conn = new ModelConnectionBlock(src1, src2, amount, dst);
    if (extrasrc[0] != null)
        conn.addSource(extrasrc[0]);
    performer.getConnectionBlocks().add(conn);

}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:28,代码来源:SF2Instrument.java

示例6: addTimecentValue

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
private void addTimecentValue(ModelPerformer performer,
        ModelIdentifier dest, short value) {
    double fvalue;
    if (value == -12000)
        fvalue = Double.NEGATIVE_INFINITY;
    else
        fvalue = value;
    performer.getConnectionBlocks().add(
            new ModelConnectionBlock(fvalue, new ModelDestination(dest)));
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:11,代码来源:SF2Instrument.java

示例7: SoftInstrument

import com.sun.media.sound.ModelPerformer; //导入依赖的package包/类
public SoftInstrument(ModelInstrument ins,
        ModelPerformer[] overrideperformers) {
    super(ins.getSoundbank(), ins.getPatch(), ins.getName(),
            ins.getDataClass());
    data = ins.getData();
    this.ins = ins;
    initPerformers(overrideperformers);
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:9,代码来源:SoftInstrument.java


注:本文中的com.sun.media.sound.ModelPerformer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。