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


Java MidiFileWriter.getMidiFileTypes方法代码示例

本文整理汇总了Java中javax.sound.midi.spi.MidiFileWriter.getMidiFileTypes方法的典型用法代码示例。如果您正苦于以下问题:Java MidiFileWriter.getMidiFileTypes方法的具体用法?Java MidiFileWriter.getMidiFileTypes怎么用?Java MidiFileWriter.getMidiFileTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.sound.midi.spi.MidiFileWriter的用法示例。


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

示例1: getMidiFileTypes

import javax.sound.midi.spi.MidiFileWriter; //导入方法依赖的package包/类
/**
 * Obtains the set of MIDI file types for which file writing support is
 * provided by the system.
 * @return array of unique file types.  If no file types are supported,
 * an array of length 0 is returned.
 */
public static int[] getMidiFileTypes() {

    List providers = getMidiFileWriters();
    Set allTypes = new HashSet();

    // gather from all the providers

    for (int i = 0; i < providers.size(); i++ ) {
        MidiFileWriter writer = (MidiFileWriter) providers.get(i);
        int[] types = writer.getMidiFileTypes();
        for (int j = 0; j < types.length; j++ ) {
            allTypes.add(new Integer(types[j]));
        }
    }
    int resultTypes[] = new int[allTypes.size()];
    int index = 0;
    Iterator iterator = allTypes.iterator();
    while (iterator.hasNext()) {
        Integer integer = (Integer) iterator.next();
        resultTypes[index++] = integer.intValue();
    }
    return resultTypes;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:MidiSystem.java

示例2: getMidiFileTypes

import javax.sound.midi.spi.MidiFileWriter; //导入方法依赖的package包/类
/**
 * Obtains the set of MIDI file types for which file writing support is
 * provided by the system.
 *
 * @return array of unique file types. If no file types are supported, an
 *         array of length 0 is returned.
 */
public static int[] getMidiFileTypes() {

    List<MidiFileWriter> providers = getMidiFileWriters();
    Set<Integer> allTypes = new HashSet<>();

    // gather from all the providers

    for (int i = 0; i < providers.size(); i++ ) {
        MidiFileWriter writer = providers.get(i);
        int[] types = writer.getMidiFileTypes();
        for (int j = 0; j < types.length; j++ ) {
            allTypes.add(types[j]);
        }
    }
    int resultTypes[] = new int[allTypes.size()];
    int index = 0;
    Iterator<Integer> iterator = allTypes.iterator();
    while (iterator.hasNext()) {
        Integer integer = iterator.next();
        resultTypes[index++] = integer.intValue();
    }
    return resultTypes;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:MidiSystem.java

示例3: getMidiFileTypes

import javax.sound.midi.spi.MidiFileWriter; //导入方法依赖的package包/类
/**
 * Return an array of supported MIDI file types on this system.
 *
 * @return the array of supported MIDI file types
 */
public static int[] getMidiFileTypes()
{
  // We only support a max of 3 MIDI file types.
  boolean supported[] = new boolean[3];
  // The number of supported formats.
  int count = 0;
  Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
  while (writers.hasNext())
  {
    MidiFileWriter fw = (MidiFileWriter) writers.next();
    int types[] = fw.getMidiFileTypes();
    for (int i = types.length; i > 0;)
    {
      int type = types[--i];
      if (supported[type] == false)
      {
        count++;
        supported[type] = true;
      }
    }
  }
  int result[] = new int[count];
  for (int i = supported.length; i > 0;)
  {
    if (supported[--i])
      result[--count] = i;
  }
  return result;
}
 
开发者ID:vilie,项目名称:javify,代码行数:35,代码来源:MidiSystem.java

示例4: getMidiFileTypes

import javax.sound.midi.spi.MidiFileWriter; //导入方法依赖的package包/类
/**
 * Return an array of supported MIDI file types on this system.
 * 
 * @return the array of supported MIDI file types
 */
public static int[] getMidiFileTypes()
{
  // We only support a max of 3 MIDI file types.
  boolean supported[] = new boolean[3];
  // The number of supported formats.
  int count = 0;
  Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);
  while (writers.hasNext())
  {
    MidiFileWriter fw = (MidiFileWriter) writers.next();
    int types[] = fw.getMidiFileTypes();
    for (int i = types.length; i > 0;)
    {
      int type = types[--i];
      if (supported[type] == false)
      {
        count++;
        supported[type] = true;
      }
    }
  }
  int result[] = new int[count];
  for (int i = supported.length; i > 0;)
  {
    if (supported[--i])
      result[--count] = i;
  }
  return result;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:35,代码来源:MidiSystem.java

示例5: getMidiFileTypes

import javax.sound.midi.spi.MidiFileWriter; //导入方法依赖的package包/类
/**
 * Return an array of supported MIDI file types on this system.
 *
 * @return the array of supported MIDI file types
 */
public static int[] getMidiFileTypes()
{
  // We only support a max of 3 MIDI file types.
  boolean supported[] = new boolean[3];
  // The number of supported formats.
  int count = 0;
  Iterator<MidiFileWriter> writers =
    ServiceFactory.lookupProviders(MidiFileWriter.class);
  while (writers.hasNext())
  {
    MidiFileWriter fw = writers.next();
    int types[] = fw.getMidiFileTypes();
    for (int i = types.length; i > 0;)
    {
      int type = types[--i];
      if (supported[type] == false)
      {
        count++;
        supported[type] = true;
      }
    }
  }
  int result[] = new int[count];
  for (int i = supported.length; i > 0;)
  {
    if (supported[--i])
      result[--count] = i;
  }
  return result;
}
 
开发者ID:cfriedt,项目名称:classpath,代码行数:36,代码来源:MidiSystem.java


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