1990N/A/*
2365N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1990N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1990N/A *
1990N/A * This code is free software; you can redistribute it and/or modify it
1990N/A * under the terms of the GNU General Public License version 2 only, as
2365N/A * published by the Free Software Foundation. Oracle designates this
1990N/A * particular file as subject to the "Classpath" exception as provided
2365N/A * by Oracle in the LICENSE file that accompanied this code.
1990N/A *
1990N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1990N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1990N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1990N/A * version 2 for more details (a copy is included in the LICENSE file that
1990N/A * accompanied this code).
1990N/A *
1990N/A * You should have received a copy of the GNU General Public License version
1990N/A * 2 along with this work; if not, write to the Free Software Foundation,
1990N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1990N/A *
2365N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2365N/A * or visit www.oracle.com if you need additional information or have any
2365N/A * questions.
1990N/A */
1990N/A
1990N/A/* @test
1990N/A @summary Test SoftReceiver getMidiDevice method */
1990N/A
1990N/Aimport javax.sound.midi.Receiver;
1990N/A
1990N/Aimport com.sun.media.sound.AudioSynthesizer;
1990N/Aimport com.sun.media.sound.SoftReceiver;
1990N/Aimport com.sun.media.sound.SoftSynthesizer;
1990N/A
1990N/Apublic class GetMidiDevice {
1990N/A
1990N/A public static void main(String[] args) throws Exception {
1990N/A
1990N/A AudioSynthesizer synth = new SoftSynthesizer();
1990N/A synth.openStream(null, null);
1990N/A Receiver recv = synth.getReceiver();
1990N/A if (((SoftReceiver) recv).getMidiDevice() != synth) {
1990N/A throw new Exception("SoftReceiver.getMidiDevice() doesn't return "
1990N/A + "instance of the synthesizer");
1990N/A }
1990N/A synth.close();
1990N/A }
2365N/A}
2365N/A