// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/Tuner.java
// public interface Tuner {
// 
//     /**
//      * Subscribes to the tuner for notes found as a result of a pitch detection algorithm.
//      *
//      * @return An {@link Observable<Note>} providing all the found {@link Note}s for as long as subscribed.
//      */
//     Observable<Note> startListening();
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/FrequencyFinder.java
// public interface FrequencyFinder {
// 
//     /**
//      * Retrieves a frequency for the provided note name.
//      *
//      * @param name The name of the note whose frequency is being retrieved.
//      * @return The frequency representing the provided note name.
//      */
//     double getFrequency(NoteName name);
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/NoteName.java
// public enum NoteName {
// 
//     A("A"),
//     A_SHARP("A♯"),
//     B("B"),
//     C("C"),
//     C_SHARP("C♯"),
//     D("D"),
//     D_SHARP("D♯"),
//     E("E"),
//     F("F"),
//     F_SHARP("F♯"),
//     G("G"),
//     G_SHARP("G♯"),
//     UNDEFINED("Undefined");
// 
//     /**
//      * Retrieves a {@link NoteName} object represented by the provided String name.
//      *
//      * @param name The String name.
//      * @return A {@link NoteName} representing the provided String name.
//      */
//     public static NoteName forName(final String name) {
//         if (name != null) {
//             String updatedName = name.trim().toUpperCase().replace('#', '♯');
// 
//             try {
//                 for (NoteName noteName : values()) {
//                     if (noteName.getName().equals(updatedName)) {
//                         return noteName;
//                     }
//                 }
//             } catch (IllegalArgumentException e) {
//                 // No operation
//             }
//         }
// 
//         return UNDEFINED;
//     }
// 
//     private String name;
// 
//     NoteName(final String name) {
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/ui/view/TunerView.java
// public interface TunerView {
// 
//     void onShowNote(String noteName, double frequency, float percentOffset);
// 
//     void onPlayNote(String noteName, double frequency, float x, float y);
// }


import com.chrynan.android_guitar_tuner.tuner.Tuner;
import com.chrynan.android_guitar_tuner.tuner.note.FrequencyFinder;
import com.chrynan.android_guitar_tuner.tuner.note.NoteName;
import com.chrynan.android_guitar_tuner.ui.view.TunerView;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import timber.log.Timber;
package com.chrynan.android_guitar_tuner.presenter;



public class TunerPresenter implements Presenter {

    private final TunerView view;
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/Tuner.java
// public interface Tuner {
// 
//     /**
//      * Subscribes to the tuner for notes found as a result of a pitch detection algorithm.
//      *
//      * @return An {@link Observable<Note>} providing all the found {@link Note}s for as long as subscribed.
//      */
//     Observable<Note> startListening();
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/FrequencyFinder.java
// public interface FrequencyFinder {
// 
//     /**
//      * Retrieves a frequency for the provided note name.
//      *
//      * @param name The name of the note whose frequency is being retrieved.
//      * @return The frequency representing the provided note name.
//      */
//     double getFrequency(NoteName name);
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/tuner/note/NoteName.java
// public enum NoteName {
// 
//     A("A"),
//     A_SHARP("A♯"),
//     B("B"),
//     C("C"),
//     C_SHARP("C♯"),
//     D("D"),
//     D_SHARP("D♯"),
//     E("E"),
//     F("F"),
//     F_SHARP("F♯"),
//     G("G"),
//     G_SHARP("G♯"),
//     UNDEFINED("Undefined");
// 
//     /**
//      * Retrieves a {@link NoteName} object represented by the provided String name.
//      *
//      * @param name The String name.
//      * @return A {@link NoteName} representing the provided String name.
//      */
//     public static NoteName forName(final String name) {
//         if (name != null) {
//             String updatedName = name.trim().toUpperCase().replace('#', '♯');
// 
//             try {
//                 for (NoteName noteName : values()) {
//                     if (noteName.getName().equals(updatedName)) {
//                         return noteName;
//                     }
//                 }
//             } catch (IllegalArgumentException e) {
//                 // No operation
//             }
//         }
// 
//         return UNDEFINED;
//     }
// 
//     private String name;
// 
//     NoteName(final String name) {
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// }
// 
// Path: app/src/main/java/com/chrynan/android_guitar_tuner/ui/view/TunerView.java
// public interface TunerView {
// 
//     void onShowNote(String noteName, double frequency, float percentOffset);
// 
//     void onPlayNote(String noteName, double frequency, float x, float y);
// }


// Path: app/src/main/java/com/chrynan/android_guitar_tuner/presenter/TunerPresenter.java
import com.chrynan.android_guitar_tuner.tuner.Tuner;
import com.chrynan.android_guitar_tuner.tuner.note.FrequencyFinder;
import com.chrynan.android_guitar_tuner.tuner.note.NoteName;
import com.chrynan.android_guitar_tuner.ui.view.TunerView;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import timber.log.Timber;

package com.chrynan.android_guitar_tuner.presenter;



public class TunerPresenter implements Presenter {

    private final TunerView view;
    private final Tuner tuner;