// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/detection/PitchDetector.java
// public interface PitchDetector {
// 
//     /**
//      * Retrieves a pitch frequency (note) using the provided array of values representing a sound
//      * wave. Note that this method operates on the calling Thread. The calling Thread should be off
//      * the main Thread.
//      *
//      * @param wave The array of 16 bit values representing the sound wave to be processed.
//      * @return A double value representing the detected pitch.
//      */
//     double detect(float[] wave);
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/MutableNote.java
// public class MutableNote implements NoteMutator {
// 
//     private String name;
//     private double frequency;
//     private float percentOffset;
// 
//     public MutableNote() {
//         // Default constructor
//     }
// 
//     MutableNote(final String name, final double frequency, final float percentOffset) {
//         this.name = name;
//         this.frequency = frequency;
//         this.percentOffset = percentOffset;
// 
//     }
// 
//     @Override
//     public String getName() {
//         return name;
//     }
// 
//     @Override
//     public double getFrequency() {
//         return frequency;
//     }
// 
//     @Override
//     public float getPercentOffset() {
//         return percentOffset;
//     }
// 
//     @Override
//     public void setName(final String name) {
//         this.name = name;
//     }
// 
//     @Override
//     public void setFrequency(final double frequency) {
//         this.frequency = frequency;
//     }
// 
//     @Override
//     public void setPercentOffset(final float percentOffset) {
//         this.percentOffset = percentOffset;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         MutableNote note = (MutableNote) o;
//         return Double.compare(note.frequency, frequency) == 0 &&
//                 Float.compare(note.percentOffset, percentOffset) == 0 &&
//                 Objects.equals(name, note.name);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(name, frequency, percentOffset);
//     }
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/Note.java
// public interface Note {
// 
//     /**
//      * Retrieves the name of the note.
//      *
//      * @return A String representing the name of the note.
//      */
//     String getName();
// 
//     /**
//      * Retrieves the frequency value of the closest found note.
//      *
//      * @return A double value representing the frequency of the closest note.
//      */
//     double getFrequency();
// 
//     /**
//      * Retrieves the percent offset from the closest found note and the actual found frequency.
//      *
//      * @return A float value representing the percent offset from the note.
//      */
//     float getPercentOffset();
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/NoteFinder.java
// public interface NoteFinder {
// 
//     /**
//      * Sets the frequency of the note. This method must be called before calling the other methods.
//      * Failure to do so may result in unspecified behavior.
//      *
//      * @param frequency The frequency of the note.
//      */
//     void setFrequency(double frequency);
// 
//     /**
//      * Retrieves a String representation of the closest note to the provided frequency.
//      *
//      * @return The String note name.
//      */
//     String getNoteName();
// 
//     /**
//      * Retrieves the percent difference between the closest found note and the provided frequency.
//      * It is an offset in percentage between the closest note and the second closest note. A
//      * negative value will indicate it is a lower pitch than the closest found note and a positive
//      * value will indicate it is a higher pitch than the closest found note.
//      *
//      * @return The percent offset from the closest note.
//      */
//     float getPercentageDifference();
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/recorder/AudioRecorder.java
// public interface AudioRecorder {
// 
//     /**
//      * Starts listening to audio data and prepares for a call to the {@link #readNext()} method.
//      * Note that this method should be called before calling the {@link #readNext()} method to
//      * prepare the recorder.
//      */
//     void startRecording();
// 
//     /**
//      * Stops listening to audio data and cleans up any underlying resources used by the
//      * implementation. Note that {@link #readNext()} should not be called after this method is
//      * called without calling {@link #startRecording()} again.
//      */
//     void stopRecording();
// 
//     /**
//      * Reads audio data into an array buffer and returns it. Note that the returned array may be
//      * mutable depending on the implementation to provide better performance.
//      *
//      * @return A float array of audio data.
//      */
//     float[] readNext();
// }


import com.chrynan.android_guitar_tuner.tuner.detection.PitchDetector;
import com.chrynan.android_guitar_tuner.tuner.note.MutableNote;
import com.chrynan.android_guitar_tuner.tuner.note.Note;
import com.chrynan.android_guitar_tuner.tuner.note.NoteFinder;
import com.chrynan.android_guitar_tuner.tuner.recorder.AudioRecorder;
import io.reactivex.Observable;
package com.chrynan.android_guitar_tuner.tuner;



/**
 * An implementation of the {@link Tuner} interface.
 */
public class GuitarTuner implements Tuner {

    private final MutableNote note = new MutableNote();

// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/detection/PitchDetector.java
// public interface PitchDetector {
// 
//     /**
//      * Retrieves a pitch frequency (note) using the provided array of values representing a sound
//      * wave. Note that this method operates on the calling Thread. The calling Thread should be off
//      * the main Thread.
//      *
//      * @param wave The array of 16 bit values representing the sound wave to be processed.
//      * @return A double value representing the detected pitch.
//      */
//     double detect(float[] wave);
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/MutableNote.java
// public class MutableNote implements NoteMutator {
// 
//     private String name;
//     private double frequency;
//     private float percentOffset;
// 
//     public MutableNote() {
//         // Default constructor
//     }
// 
//     MutableNote(final String name, final double frequency, final float percentOffset) {
//         this.name = name;
//         this.frequency = frequency;
//         this.percentOffset = percentOffset;
// 
//     }
// 
//     @Override
//     public String getName() {
//         return name;
//     }
// 
//     @Override
//     public double getFrequency() {
//         return frequency;
//     }
// 
//     @Override
//     public float getPercentOffset() {
//         return percentOffset;
//     }
// 
//     @Override
//     public void setName(final String name) {
//         this.name = name;
//     }
// 
//     @Override
//     public void setFrequency(final double frequency) {
//         this.frequency = frequency;
//     }
// 
//     @Override
//     public void setPercentOffset(final float percentOffset) {
//         this.percentOffset = percentOffset;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         MutableNote note = (MutableNote) o;
//         return Double.compare(note.frequency, frequency) == 0 &&
//                 Float.compare(note.percentOffset, percentOffset) == 0 &&
//                 Objects.equals(name, note.name);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(name, frequency, percentOffset);
//     }
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/Note.java
// public interface Note {
// 
//     /**
//      * Retrieves the name of the note.
//      *
//      * @return A String representing the name of the note.
//      */
//     String getName();
// 
//     /**
//      * Retrieves the frequency value of the closest found note.
//      *
//      * @return A double value representing the frequency of the closest note.
//      */
//     double getFrequency();
// 
//     /**
//      * Retrieves the percent offset from the closest found note and the actual found frequency.
//      *
//      * @return A float value representing the percent offset from the note.
//      */
//     float getPercentOffset();
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/NoteFinder.java
// public interface NoteFinder {
// 
//     /**
//      * Sets the frequency of the note. This method must be called before calling the other methods.
//      * Failure to do so may result in unspecified behavior.
//      *
//      * @param frequency The frequency of the note.
//      */
//     void setFrequency(double frequency);
// 
//     /**
//      * Retrieves a String representation of the closest note to the provided frequency.
//      *
//      * @return The String note name.
//      */
//     String getNoteName();
// 
//     /**
//      * Retrieves the percent difference between the closest found note and the provided frequency.
//      * It is an offset in percentage between the closest note and the second closest note. A
//      * negative value will indicate it is a lower pitch than the closest found note and a positive
//      * value will indicate it is a higher pitch than the closest found note.
//      *
//      * @return The percent offset from the closest note.
//      */
//     float getPercentageDifference();
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/recorder/AudioRecorder.java
// public interface AudioRecorder {
// 
//     /**
//      * Starts listening to audio data and prepares for a call to the {@link #readNext()} method.
//      * Note that this method should be called before calling the {@link #readNext()} method to
//      * prepare the recorder.
//      */
//     void startRecording();
// 
//     /**
//      * Stops listening to audio data and cleans up any underlying resources used by the
//      * implementation. Note that {@link #readNext()} should not be called after this method is
//      * called without calling {@link #startRecording()} again.
//      */
//     void stopRecording();
// 
//     /**
//      * Reads audio data into an array buffer and returns it. Note that the returned array may be
//      * mutable depending on the implementation to provide better performance.
//      *
//      * @return A float array of audio data.
//      */
//     float[] readNext();
// }


// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/GuitarTuner.java
import com.chrynan.android_guitar_tuner.tuner.detection.PitchDetector;
import com.chrynan.android_guitar_tuner.tuner.note.MutableNote;
import com.chrynan.android_guitar_tuner.tuner.note.Note;
import com.chrynan.android_guitar_tuner.tuner.note.NoteFinder;
import com.chrynan.android_guitar_tuner.tuner.recorder.AudioRecorder;
import io.reactivex.Observable;

package com.chrynan.android_guitar_tuner.tuner;



/**
 * An implementation of the {@link Tuner} interface.
 */
public class GuitarTuner implements Tuner {

    private final MutableNote note = new MutableNote();

    private final Observable<Note> observable;