// Path: app/src/main/java/om/sstvencoder/ModeInterfaces/IMode.java
// public interface IMode {
//     void init();
// 
//     int getProcessCount();
// 
//     boolean process();
// 
//     void finish(boolean cancel);
// }
// 
// Path: app/src/main/java/om/sstvencoder/Output/IOutput.java
// public interface IOutput {
//     double getSampleRate();
// 
//     void init(int samples);
// 
//     void write(double value);
// 
//     void finish(boolean cancel);
// }


import android.graphics.Bitmap;
import om.sstvencoder.ModeInterfaces.IMode;
import om.sstvencoder.Output.IOutput;
    protected abstract int getTransmissionSamples();

    private void writeCalibrationHeader() {
        int leaderToneSamples = convertMsToSamples(300.0);
        double leaderToneFrequency = 1900.0;

        int breakSamples = convertMsToSamples(10.0);
        double breakFrequency = 1200.0;

        int visBitSamples = convertMsToSamples(30.0);
        double visBitSSFrequency = 1200.0;
        double[] visBitFrequency = new double[]{1300.0, 1100.0};

        for (int i = 0; i < leaderToneSamples; ++i)
            setTone(leaderToneFrequency);

        for (int i = 0; i < breakSamples; ++i)
            setTone(breakFrequency);

        for (int i = 0; i < leaderToneSamples; ++i)
            setTone(leaderToneFrequency);

        for (int i = 0; i < visBitSamples; ++i)
            setTone(visBitSSFrequency);

        int parity = 0;
        for (int pos = 0; pos < 7; ++pos) {
            int bit = (mVISCode >> pos) & 1;
            parity ^= bit;
            for (int i = 0; i < visBitSamples; ++i)
// Path: app/src/main/java/om/sstvencoder/ModeInterfaces/IMode.java
// public interface IMode {
//     void init();
// 
//     int getProcessCount();
// 
//     boolean process();
// 
//     void finish(boolean cancel);
// }
// 
// Path: app/src/main/java/om/sstvencoder/Output/IOutput.java
// public interface IOutput {
//     double getSampleRate();
// 
//     void init(int samples);
// 
//     void write(double value);
// 
//     void finish(boolean cancel);
// }


// Path: app/src/main/java/om/sstvencoder/Modes/Mode.java
import android.graphics.Bitmap;
import om.sstvencoder.ModeInterfaces.IMode;
import om.sstvencoder.Output.IOutput;

    protected abstract int getTransmissionSamples();

    private void writeCalibrationHeader() {
        int leaderToneSamples = convertMsToSamples(300.0);
        double leaderToneFrequency = 1900.0;

        int breakSamples = convertMsToSamples(10.0);
        double breakFrequency = 1200.0;

        int visBitSamples = convertMsToSamples(30.0);
        double visBitSSFrequency = 1200.0;
        double[] visBitFrequency = new double[]{1300.0, 1100.0};

        for (int i = 0; i < leaderToneSamples; ++i)
            setTone(leaderToneFrequency);

        for (int i = 0; i < breakSamples; ++i)
            setTone(breakFrequency);

        for (int i = 0; i < leaderToneSamples; ++i)
            setTone(leaderToneFrequency);

        for (int i = 0; i < visBitSamples; ++i)
            setTone(visBitSSFrequency);

        int parity = 0;
        for (int pos = 0; pos < 7; ++pos) {
            int bit = (mVISCode >> pos) & 1;
            parity ^= bit;
            for (int i = 0; i < visBitSamples; ++i)
                setTone(visBitFrequency[bit]);