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


Java Info类代码示例

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


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

示例1: getAvailableMidiInDevices

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static Collection<String> getAvailableMidiInDevices() {
	ArrayList<String> a = new ArrayList<String>();
	Info infos[] = MidiSystem.getMidiDeviceInfo();
	for (Info info : infos) {
		try {
			MidiDevice dev=MidiSystem.getMidiDevice(info);
			if (dev.getMaxTransmitters() == 0 ) continue;
			String str = info.toString();
			a.add(str);
		} catch (MidiUnavailableException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
		}
	
	}
	return a;
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:18,代码来源:FrinikaConfig.java

示例2: findAudioSynthesizer

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
/**
 * Find available AudioSynthesizer
 */
public static AudioSynthesizer findAudioSynthesizer() throws MidiUnavailableException
{
	// First check if default synthesizer is AudioSynthesizer.
	Synthesizer synth = MidiSystem.getSynthesizer();
	if (synth instanceof AudioSynthesizer)
		return (AudioSynthesizer) synth;

	// If default synhtesizer is not AudioSynthesizer, check others.
	for (Info info : MidiSystem.getMidiDeviceInfo())
	{
		MidiDevice dev = MidiSystem.getMidiDevice(info);
		if (dev instanceof AudioSynthesizer)
			return (AudioSynthesizer) dev;
	}

	// No AudioSynthesizer was found, return null.
	return null;
}
 
开发者ID:digero,项目名称:maestro,代码行数:22,代码来源:SynthesizerFactory.java

示例3: findAudioSynthesizer

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static AudioSynthesizer findAudioSynthesizer() throws MidiUnavailableException, IOException, InvalidMidiDataException {
    // First check if default synthesizer is AudioSynthesizer.
    Synthesizer synth = MidiSystem.getSynthesizer();
    if (synth instanceof AudioSynthesizer) {
        return (AudioSynthesizer) synth;
    }

    // If default synhtesizer is not AudioSynthesizer, check others.
    Info[] infos = MidiSystem.getMidiDeviceInfo();
    for (int i = 0; i < infos.length; i++) {
        MidiDevice dev = MidiSystem.getMidiDevice(infos[i]);
        if (dev instanceof AudioSynthesizer) {
            return (AudioSynthesizer) dev;
        }
    }

    // No AudioSynthesizer was found, return null.
    return null;
}
 
开发者ID:Glamdring,项目名称:computoser,代码行数:20,代码来源:Midi2WavRenderer.java

示例4: getMidiDeviceInfo

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static MidiDevice.Info[] getMidiDeviceInfo() {
    /*
     * obtain the list of MidiDeviceProviders
     */
    List<?> deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
    //variable to save MidiDevice.Info
    List<MidiDevice.Info> infos = new ArrayList<MidiDevice.Info>();
    /*
     * look through list of providers and save info of devices
     */
    for (int i = 0; i < deviceProviders.size(); i++) {
        MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
        for (Info element : deviceInfo) {
            infos.add(element);
        }
    }
    
    MidiDevice.Info[] temp = new MidiDevice.Info[infos.size()];
    return infos.toArray(temp);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:MidiSystem.java

示例5: findAudioSynthesizer

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static AudioSynthesizer findAudioSynthesizer()
		throws MidiUnavailableException {
	// First check if default synthesizer is AudioSynthesizer.
	Synthesizer synth = MidiSystem.getSynthesizer();
	if (synth instanceof AudioSynthesizer)
		return (AudioSynthesizer) synth;

	// If default synhtesizer is not AudioSynthesizer, check others.
	Info[] infos = MidiSystem.getMidiDeviceInfo();
	for (int i = 0; i < infos.length; i++) {
		MidiDevice dev = MidiSystem.getMidiDevice(infos[i]);
		if (dev instanceof AudioSynthesizer)
			return (AudioSynthesizer) dev;
	}

	// No AudioSynthesizer was found, return null.
	return null;
}
 
开发者ID:bluenote10,项目名称:gervill,代码行数:19,代码来源:SimpleMidiPlayer.java

示例6: findAudioSynthesizer

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static AudioSynthesizer findAudioSynthesizer()
	throws MidiUnavailableException {
	// First check if default synthesizer is AudioSynthesizer.
	Synthesizer synth = MidiSystem.getSynthesizer();
	if (synth instanceof AudioSynthesizer)
		return (AudioSynthesizer) synth;

	// If default synhtesizer is not AudioSynthesizer, check others.
	Info[] infos = MidiSystem.getMidiDeviceInfo();
	for (val info : infos) {
		MidiDevice dev = MidiSystem.getMidiDevice(info);
		if (dev instanceof AudioSynthesizer)
			return (AudioSynthesizer) dev;
	}

	// No AudioSynthesizer was found, return null.
	return null;
}
 
开发者ID:Xenoage,项目名称:Zong,代码行数:19,代码来源:MidiToWaveRenderer.java

示例7: findAudioSynthesizer

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
private AudioSynthesizer findAudioSynthesizer()
	throws MidiUnavailableException {
	//first check if default synthesizer is AudioSynthesizer.
	Synthesizer synth = MidiSystem.getSynthesizer();
	if (synth instanceof AudioSynthesizer)
		return (AudioSynthesizer) synth;

	//if default synthesizer is not AudioSynthesizer, check others.
	Info[] infos = MidiSystem.getMidiDeviceInfo();
	for (val info : infos) {
		MidiDevice dev = MidiSystem.getMidiDevice(info);
		if (dev instanceof AudioSynthesizer)
			return (AudioSynthesizer) dev;
	}

	//no AudioSynthesizer was found, return null.
	return null;
}
 
开发者ID:Xenoage,项目名称:Zong,代码行数:19,代码来源:SynthManager.java

示例8: getMidiDevice

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static MidiDevice getMidiDevice(String name) {

		MidiDevice.Info[] info = MidiSystem.getMidiDeviceInfo();

		for (Info element : info) {
			if (element.getName().equals(name)) {
				try {
					return MidiSystem.getMidiDevice(element);
				} catch (MidiUnavailableException e) {
					log.error("{}", e);
				}
			}
		}

		return null;

	}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:18,代码来源:SharedMidiObject.java

示例9: getDeviceMap

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
/**
 * Returns the map of all available MIDI devices.
 *
 * @return the map of all available MIDI devices.
 */
public static Map<MidiDevice.Info, MidiDevice> getDeviceMap() {
    Map<MidiDevice.Info, MidiDevice> result = new LinkedHashMap<>();

    try {
        for (Info info : MidiSystem.getMidiDeviceInfo()) {
            result.put(info, MidiSystem.getMidiDevice(info));
        }
    } catch (MidiUnavailableException e) {
        throw SpongeUtils.wrapException(e);
    }

    return result;
}
 
开发者ID:softelnet,项目名称:sponge,代码行数:19,代码来源:MidiUtils.java

示例10: main

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
    assertTrue(provider.getDevice(new FakeInfo()) == null);

}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:GetDevice.java

示例11: main

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    SoftProvider provider = new SoftProvider();
    Info[] infos = provider.getDeviceInfo();
    assertTrue(infos.length > 0);
    for (int i = 0; i < infos.length; i++) {
        assertTrue(infos[i] != null);
        MidiDevice d = provider.getDevice(infos[i]);
        assertTrue(d instanceof SoftSynthesizer);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:GetDevice.java

示例12: getDevice

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public MidiDevice getDevice(Info info)
{
  for (int i = 0; i < infos.length; i++)
  {
    if (info.equals(infos[i]))
    {
        return new DSSISynthesizer(infos[i],
                                   infos[i].soname,
                                   infos[i].index);
    }
  }
  throw new IllegalArgumentException("Don't recognize MIDI device " + info);
}
 
开发者ID:vilie,项目名称:javify,代码行数:14,代码来源:DSSIMidiDeviceProvider.java

示例13: getDevice

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public MidiDevice getDevice(Info info)
{
  for (int i = 0; i < infos.length; i++)
  {
    if (info.equals(infos[i]))
    {
      return infos[i].getDevice();
    }
  }
  throw new IllegalArgumentException("Don't recognize MIDI device " + info);
}
 
开发者ID:vilie,项目名称:javify,代码行数:12,代码来源:AlsaMidiDeviceProvider.java

示例14: getDevice

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
public MidiDevice getDevice(Info info)
{
  for (int i = 0; i < infos.length; i++)
  {
    if (info.equals(infos[i]))
    {
        return new DSSISynthesizer(infos[i],
                                   infos[i].soname, 
                                   infos[i].index);
    }
  }
  throw new IllegalArgumentException("Don't recognize MIDI device " + info);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:14,代码来源:DSSIMidiDeviceProvider.java

示例15: processMidiMessageFromDevice

import javax.sound.midi.MidiDevice.Info; //导入依赖的package包/类
/**
 * Redirects midi events used for controls
 * 
 * If not consumed event is sent to midiReciever.
 *  
 * 
 * @param devInfo
 * @param arg0
 * @param arg1
 */
public void processMidiMessageFromDevice(Info devInfo, MidiMessage arg0, long arg1) {
    if (midiDeviceRouter != null && midiDeviceRouter.consume(devInfo, arg0, arg1)) {
        return;
    }
    try {
        sequencer.getReceiver().send(arg0, arg1);
    } catch (MidiUnavailableException ex) {
        Logger.getLogger(ProjectContainer.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:21,代码来源:ProjectContainer.java


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