Class AligningAudioPlayer

  • java.lang.Object
    • at.ofai.music.match.AligningAudioPlayer
  • All Implemented Interfaces:
    java.lang.Runnable, java.util.EventListener, javax.swing.event.ChangeListener


    public class AligningAudioPlayer
    extends java.lang.Object
    implements javax.swing.event.ChangeListener, java.lang.Runnable
    • Field Detail

      • audioLength

        protected long audioLength
      • audioOut

        protected javax.sound.sampled.SourceDataLine audioOut
      • currentFile

        protected AudioFile currentFile
      • currentPosition

        protected long currentPosition
      • defaultOutputBufferSize

        protected static final int defaultOutputBufferSize
        See Also:
        Constant Field Values
      • files

        protected java.util.LinkedList<AudioFile> files
      • gui

        protected GUI gui
      • jfc

        protected javax.swing.JFileChooser jfc
      • marks

        protected java.util.LinkedList<java.lang.Long> marks
      • matcher

        protected at.ofai.music.match.AligningAudioPlayer.Matcher matcher
      • matchThread

        protected java.lang.Thread matchThread
      • outputBufferSize

        protected int outputBufferSize
      • playFromMark

        protected boolean playFromMark
      • playing

        protected boolean playing
      • readBuffer

        protected byte[] readBuffer
      • readBuffer2

        protected byte[] readBuffer2
      • requestedFile

        protected AudioFile requestedFile
      • requestedPosition

        protected long requestedPosition
      • sm

        protected at.ofai.music.match.ScrollingMatrix sm
      • stopRequested

        protected boolean stopRequested
    • Method Detail

      • getFileCount

        public int getFileCount()
      • play

        public void play()
      • pause

        public void pause()
      • stop

        public void stop()
      • togglePlay

        public void togglePlay()
      • setMode

        public void setMode(boolean fromMark)
      • setPosition

        protected void setPosition(long positionRequested)
      • updateGUI

        protected void updateGUI()
      • skipToNextMark

        public void skipToNextMark()
      • skipToPreviousMark

        public void skipToPreviousMark()
      • addMark

        public void addMark()
      • correctedPosition

        public long correctedPosition()
      • getMarkListIterator

        public java.util.ListIterator<java.lang.Long> getMarkListIterator()
      • getCurrentFileLength

        public long getCurrentFileLength()
      • save

        public void save()
      • load

        public void load()
      • checkString

        public static java.lang.String checkString(java.lang.String in,
                                                   java.lang.String prefix)
      • checkString

        public static java.lang.String checkString(java.lang.String in,
                                                   java.lang.String prefix,
                                                   boolean exc)
      • load

        public void load(java.lang.String fileName)
      • clearFiles

        protected void clearFiles()
      • addFile

        public void addFile(java.lang.String fileName,
                            at.ofai.music.match.GUI.FileNameSelection selector)
      • setCurrentFile

        public void setCurrentFile(int index)
      • setCurrentFile

        public void setCurrentFile(at.ofai.music.match.GUI.FileNameSelection selector)
      • setCurrentFile

        public void setCurrentFile(AudioFile newFile)
      • previousFile

        public void previousFile()
      • nextFile

        public void nextFile()
      • run

        public void run()
        Code for audio playback thread. Implements Runnable interface.
        Specified by:
        run in interface java.lang.Runnable
      • stateChanged

        public void stateChanged(javax.swing.event.ChangeEvent e)
        Implements ChangeListener interface
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener