com.sun.media.sound.ModelDirectedPlayer Java Examples

The following examples show how to use com.sun.media.sound.ModelDirectedPlayer. 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: ModelStandardIndexedDirectorTest.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #2
Source File: ModelStandardIndexedDirectorTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #3
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #4
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #5
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #6
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #7
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #8
Source File: ModelStandardIndexedDirectorTest.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #9
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #10
Source File: ModelStandardIndexedDirectorTest.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #11
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #12
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #13
Source File: ModelStandardIndexedDirectorTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testDirector(ModelPerformer[] performers) throws Exception
{
    final TreeSet<Integer> played = new TreeSet<Integer>();
    ModelDirectedPlayer player = new ModelDirectedPlayer()
    {
        public void play(int performerIndex,
                ModelConnectionBlock[] connectionBlocks) {
            played.add(performerIndex);
        }
    };
    ModelStandardIndexedDirector idirector =
        new ModelStandardIndexedDirector(performers, player);
    ModelStandardDirector director =
        new ModelStandardDirector(performers, player);

    for (int n = 0; n < 128; n++)
    {
        for (int v = 0; v < 128; v++)
        {
            director.noteOn(n, v);
            String p1 = treeToString(played);
            played.clear();
            idirector.noteOn(n, v);
            String p2 = treeToString(played);
            played.clear();
            if(!p1.equals(p2))
                throw new Exception(
                        "Note = " + n + ", Vel = " + v + " failed");
        }
    }
}
 
Example #14
Source File: SoftInstrument.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public ModelDirector getDirector(MidiChannel channel,
        ModelDirectedPlayer player) {
    return ins.getDirector(modelperformers, channel, player);
}