Java Code Examples for javax.sound.midi.spi.MidiFileWriter#getMidiFileTypes()

The following examples show how to use javax.sound.midi.spi.MidiFileWriter#getMidiFileTypes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MidiSystem.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: MidiSystem.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: MidiSystem.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 4
Source File: MidiSystem.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 5
Source File: MidiSystem.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 6
Source File: MidiSystem.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 *
 * @param  sequence the sequence for which MIDI file type support is queried
 * @return the set of unique supported file types. If no file types are
 *         supported, returns an array of length 0.
 * @throws NullPointerException if {@code sequence} is {@code null}
 */
public static int[] getMidiFileTypes(final Sequence sequence) {
    Objects.requireNonNull(sequence);

    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(sequence);
        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;
}
 
Example 7
Source File: MidiSystem.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 8
Source File: MidiSystem.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 9
Source File: MidiSystem.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 10
Source File: MidiSystem.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 11
Source File: MidiSystem.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source File: MidiSystem.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 13
Source File: MidiSystem.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 14
Source File: MidiSystem.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 15
Source File: MidiSystem.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 16
Source File: MidiSystem.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Obtains the set of MIDI file types that the system can write from the
 * sequence specified.
 * @param sequence the sequence for which MIDI file type support
 * is queried
 * @return the set of unique supported file types.  If no file types are supported,
 * returns an array of length 0.
 */
public static int[] getMidiFileTypes(Sequence sequence) {

    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(sequence);
        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;
}
 
Example 17
Source File: MidiSystem.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 18
Source File: MidiSystem.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 19
Source File: MidiSystem.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 20
Source File: MidiSystem.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}