Package javax.sound.midi

Examples of javax.sound.midi.Transmitter


     * sequencer with a Transmitter-Receiver pair.
     */
    synthesizer = MidiSystem.getSynthesizer();
    synthesizer.open();
    Receiver synthReceiver = synthesizer.getReceiver();
    Transmitter seqTransmitter = sequencer.getTransmitter();
    seqTransmitter.setReceiver(synthReceiver);

    /*
     * To free system resources, it is recommended to close the synthesizer
     * and sequencer properly.
     *
 
View Full Code Here


     * sequencer with a Transmitter-Receiver pair.
     */
    synthesizer = MidiSystem.getSynthesizer();
    synthesizer.open();
    Receiver synthReceiver = synthesizer.getReceiver();
    Transmitter seqTransmitter = sequencer.getTransmitter();
    seqTransmitter.setReceiver(synthReceiver);

    /*
     * To free system resources, it is recommended to close the synthesizer
     * and sequencer properly.
     *
 
View Full Code Here

     *            The transmitter handle.
     * @return The transmitter.
     */
    private Transmitter resolveTransmitterHandle(final int handle)
    {
        final Transmitter transmitter = this.transmitterMap.get(handle);
        if (transmitter == null)
            throw new RuntimeException("No transmitter with handle " + handle +
                " found");
        return transmitter;
    }
View Full Code Here

     */
    public int getTransmitter(final int deviceHandle)
        throws MidiUnavailableException
    {
        final MidiDevice device = resolveDeviceHandle(deviceHandle);
        final Transmitter transmitter = device.getTransmitter();
        final int transmitterHandle = System.identityHashCode(transmitter);
        this.transmitterMap.put(transmitterHandle, transmitter);
        return transmitterHandle;
    }
View Full Code Here

     * @param transmitterHandle
     *            The transmitter handle to release.
     */
    public void closeTransmitter(final int transmitterHandle)
    {
        final Transmitter transmitter =
            resolveTransmitterHandle(transmitterHandle);
        transmitter.close();
        this.transmitterMap.remove(transmitterHandle);
    }
View Full Code Here

     *            The handle of the receiver. 0 to unset.
     */
    public void setTransmitterReceiver(final int transmitterHandle,
        final int receiverHandle)
    {
        final Transmitter transmitter =
            resolveTransmitterHandle(transmitterHandle);
        final Receiver receiver =
            receiverHandle == 0 ? null : resolveReceiverHandle(receiverHandle);
        transmitter.setReceiver(receiver);
    }
View Full Code Here

     *            The handle of the transmitter.
     * @return The handle of the receiver or 0 if none.
     */
    public int getTransmitterReceiver(final int transmitterHandle)
    {
        final Transmitter transmitter =
            resolveTransmitterHandle(transmitterHandle);
        final Receiver receiver = transmitter.getReceiver();
        return System.identityHashCode(receiver);
    }
View Full Code Here

        sm_sequencer.setSequence(sequence);
        if (!(sm_sequencer instanceof Synthesizer)) {
            sm_synthesizer = MidiSystem.getSynthesizer();
            sm_synthesizer.open();
            Receiver synthReceiver = sm_synthesizer.getReceiver();
            Transmitter seqTransmitter = sm_sequencer.getTransmitter();
            seqTransmitter.setReceiver(synthReceiver);
        }
    }
View Full Code Here

        sm_sequencer.setSequence(sequence);
        if (!(sm_sequencer instanceof Synthesizer)) {
            sm_synthesizer = MidiSystem.getSynthesizer();
            sm_synthesizer.open();
            Receiver synthReceiver = sm_synthesizer.getReceiver();
            Transmitter seqTransmitter = sm_sequencer.getTransmitter();
            seqTransmitter.setReceiver(synthReceiver);
        }
    }
View Full Code Here

TOP

Related Classes of javax.sound.midi.Transmitter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.