Пример #1
0
        /** This reads chunks from parentInput's input stream until the next
         * NIFF time slice or no more bytesRemaining in the input,
         * adding the chunks to the timeSlice's music symbol list.  If a music
         * symbol is not recognized, this skips it.
         * This stops at either a measure start or an event time slice.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         * @param timeSlice  the TimeSlice to which MusicSymbol objects are added.
         * @see MusicSymbol
         */
        public static void addMusicSymbols(Riff parentInput, TimeSlice timeSlice)
        {
            while (parentInput.getBytesRemaining() > 0) {
            if (parentInput.peekFOURCC().Equals(RIFF_ID))
              // encoutered the next time slice, so quit
              // Note that this stops at either a measure start or an event time slice.
              return;

            MusicSymbol musicSymbol = maybeNewAnyMusicSymbol(parentInput);
            if (musicSymbol != null)
              timeSlice.addMusicSymbol(musicSymbol);
            else
              // Did not recognize the music symbol, so skip
              parentInput.skipChunk();
              }
        }
Пример #2
0
        /** This reads chunks from parentInput's input stream until the next
         * NIFF time slice or no more bytesRemaining in the input,
         * adding the chunks to the timeSlice's music symbol list.  If a music
         * symbol is not recognized, this skips it.
         * This stops at either a measure start or an event time slice.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         * @param timeSlice  the TimeSlice to which MusicSymbol objects are added.
         * @see MusicSymbol
         */
        static public void addMusicSymbols(Riff parentInput, TimeSlice timeSlice)
        {
            while (parentInput.getBytesRemaining() > 0)
            {
                if (parentInput.peekFOURCC().Equals(RIFF_ID))
                {
                    // encoutered the next time slice, so quit
                    // Note that this stops at either a measure start or an event time slice.
                    return;
                }

                MusicSymbol musicSymbol = maybeNewAnyMusicSymbol(parentInput);
                if (musicSymbol != null)
                {
                    timeSlice.addMusicSymbol(musicSymbol);
                }
                else
                {
                    // Did not recognize the music symbol, so skip
                    parentInput.skipChunk();
                }
            }
        }