本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}