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


Java ModelChannelMixer类代码示例

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


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

示例1: createTestSoundbankWithChannelMixer

import com.sun.media.sound.ModelChannelMixer; //导入依赖的package包/类
public static Soundbank createTestSoundbankWithChannelMixer() {
    SF2Soundbank soundbank = createTestSoundbank();

    SimpleSoundbank simplesoundbank = new SimpleSoundbank();
    SimpleInstrument simpleinstrument = new SimpleInstrument() {

        public ModelChannelMixer getChannelMixer(MidiChannel channel,
                AudioFormat format) {
            return new ModelAbstractChannelMixer() {
                boolean active = true;

                public boolean process(float[][] buffer, int offset, int len) {
                    for (int i = 0; i < buffer.length; i++) {
                        float[] cbuffer = buffer[i];
                        for (int j = 0; j < cbuffer.length; j++) {
                            cbuffer[j] = -cbuffer[j];
                        }
                    }
                    return active;
                }

                public void stop() {
                    active = false;
                }
            };
        }

    };
    simpleinstrument.add(soundbank.getInstruments()[0]);
    simplesoundbank.addInstrument(simpleinstrument);

    return simplesoundbank;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:34,代码来源:TestPreciseTimestampRendering.java

示例2: stopMixer

import com.sun.media.sound.ModelChannelMixer; //导入依赖的package包/类
public void stopMixer(ModelChannelMixer mixer) {
    if (stoppedMixers == null)
        stoppedMixers = new HashSet<ModelChannelMixer>();
    stoppedMixers.add(mixer);
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:6,代码来源:SoftMainMixer.java

示例3: registerMixer

import com.sun.media.sound.ModelChannelMixer; //导入依赖的package包/类
public void registerMixer(ModelChannelMixer mixer) {
    if (registeredMixers == null)
        registeredMixers = new HashSet<ModelChannelMixer>();
    registeredMixers.add(mixer);
    cur_registeredMixers = null;
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:7,代码来源:SoftMainMixer.java

示例4: initVoice

import com.sun.media.sound.ModelChannelMixer; //导入依赖的package包/类
protected void initVoice(SoftVoice voice, SoftPerformer p, int voiceID,
        int noteNumber, int velocity, ModelConnectionBlock[] connectionBlocks,
        ModelChannelMixer channelmixer, boolean releaseTriggered) {
    if (voice.active) {
        // Voice is active , we must steal the voice
        voice.stealer_channel = this;
        voice.stealer_performer = p;
        voice.stealer_voiceID = voiceID;
        voice.stealer_noteNumber = noteNumber;
        voice.stealer_velocity = velocity;
        voice.stealer_extendedConnectionBlocks = connectionBlocks;
        voice.stealer_channelmixer = channelmixer;
        voice.stealer_releaseTriggered = releaseTriggered;
        for (int i = 0; i < voices.length; i++)
            if (voices[i].active && voices[i].voiceID == voice.voiceID)
                voices[i].soundOff();
        return;
    }

    voice.extendedConnectionBlocks = connectionBlocks;
    voice.channelmixer = channelmixer;
    voice.releaseTriggered = releaseTriggered;
    voice.voiceID = voiceID;
    voice.tuning = tuning;
    voice.exclusiveClass = p.exclusiveClass;
    voice.softchannel = this;
    voice.channel = channel;
    voice.bank = bank;
    voice.program = program;
    voice.instrument = current_instrument;
    voice.performer = p;
    voice.objects.clear();
    voice.objects.put("midi", co_midi[noteNumber]);
    voice.objects.put("midi_cc", co_midi_cc);
    voice.objects.put("midi_rpn", co_midi_rpn);
    voice.objects.put("midi_nrpn", co_midi_nrpn);
    voice.noteOn(noteNumber, velocity);
    voice.setMute(mute);
    voice.setSoloMute(solomute);
    if (releaseTriggered)
        return;
    if (portamento_control_note != -1) {
        voice.co_noteon_keynumber[0]
                = (tuning.getTuning(portamento_control_note) / 100.0)
                * (1f / 128f);
        voice.portamento = true;
        portamento_control_note = -1;
    } else if (portamento) {
        if (mono) {
            if (portamento_lastnote[0] != -1) {
                voice.co_noteon_keynumber[0]
                        = (tuning.getTuning(portamento_lastnote[0]) / 100.0)
                        * (1f / 128f);
                voice.portamento = true;
                portamento_control_note = -1;
            }
            portamento_lastnote[0] = noteNumber;
        } else {
            if (portamento_lastnote_ix != 0) {
                portamento_lastnote_ix--;
                voice.co_noteon_keynumber[0]
                        = (tuning.getTuning(
                                portamento_lastnote[portamento_lastnote_ix])
                            / 100.0)
                        * (1f / 128f);
                voice.portamento = true;
            }
        }
    }
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:71,代码来源:SoftChannel.java


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