Exemple #1
0
        /** Creates new KeySignature from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public KeySignature newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new KeySignature
                       (riffInput.readSIGNEDBYTE(), RiffTags.newInstance(riffInput)));
        }
Exemple #2
0
        /** Creates new PageHeader from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public PageHeader newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            // empty required part
            return(new PageHeader(RiffTags.newInstance(riffInput)));
        }
Exemple #3
0
        /** Creates new Stem from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Stem newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            // empty required part
            return(new Stem(RiffTags.newInstance(riffInput)));
        }
Exemple #4
0
        /** Creates new Beam from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Beam newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new Beam
                       (riffInput.readBYTE(), riffInput.readBYTE(),
                       RiffTags.newInstance(riffInput)));
        }
Exemple #5
0
        /** Creates new Accidental from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Accidental newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new Accidental
                       (convertShape(riffInput.readBYTE()),
                       RiffTags.newInstance(riffInput)));
        }
Exemple #6
0
        /** Creates new Rest from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Rest newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new Rest
                       (convertShape(riffInput.readBYTE()),
                       riffInput.readSIGNEDBYTE(),
                       new Rational(riffInput.readSHORT(), riffInput.readSHORT()),
                       RiffTags.newInstance(riffInput)));
        }
Exemple #7
0
        /** Creates a new Barline from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Barline newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new Barline
                       (convertType(riffInput.readBYTE()),
                       convertExtendsTo(riffInput.readBYTE()),
                       riffInput.readSHORT(),
                       RiffTags.newInstance(riffInput)));
        }
Exemple #8
0
        /** Creates a new Lyric from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Lyric newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            String text = RiffStringTable.decodeString
                              (RiffForNiff.getStringTable(parentInput), riffInput.readLONG());

            return(new Lyric
                       (text, riffInput.readBYTE(), RiffTags.newInstance(riffInput)));
        }
Exemple #9
0
        /** Creates new Clef from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Clef newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new Clef
                       (convertShape(riffInput.readBYTE()),
                       riffInput.readSIGNEDBYTE(),
                       convertOctaveNumber(riffInput.readBYTE()),
                       RiffTags.newInstance(riffInput)));
        }
        /** Creates new MeasureStartTimeSlice from the parentInput's input stream.
         * The next object in the input stream must be a time slice with type MEASURE_START.
         * After creating the MeasureStartTimeSlice, you can call addTimeSlices()
         * to store the event time slices for this measure start time slice.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         * @see #addTimeSlices
         */
        static public MeasureStartTimeSlice newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            int type = riffInput.readBYTE();

            if (type != MEASURE_START)
            {
                throw new RiffFormatException
                          ("Expected MEASURE_START for time slice type. Got " + type + ".");
            }

            return(new MeasureStartTimeSlice
                       (new Rational(riffInput.readSHORT(), riffInput.readSHORT()),
                       RiffTags.newInstance(riffInput)));
        }
Exemple #11
0
        /** Creates new TimeSlice from the parentInput's input stream.
         * The next object in the input stream must be a time slice with
         * a type any other than MEASURE_START (which means the type should
         * be EVENT).
         * After creating the TimeSlice, you can call addMusicSymbols()
         * to store the music symbols for this time slice.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         * @see #addMusicSymbols
         */
        static public TimeSlice newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            int type = riffInput.readBYTE();

            if (type == MEASURE_START)
            {
                throw new RiffFormatException
                          ("Did not expect a time slice with type MEASURE_START.");
            }
            else if (type != EVENT)
            {
                throw new RiffFormatException
                          ("Expected EVENT for time slice type. Got " + type + ".");
            }

            return(new TimeSlice
                       (new Rational(riffInput.readSHORT(), riffInput.readSHORT()),
                       RiffTags.newInstance(riffInput)));
        }
Exemple #12
0
        /** Creates new Tie from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public Tie newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new Tie(RiffTags.newInstance(riffInput)));
        }
Exemple #13
0
        /** Creates a new AugmentationDot from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        static public AugmentationDot newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, RIFF_ID);

            return(new AugmentationDot(RiffTags.newInstance(riffInput)));
        }