// Path: app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/device/input/InputDevice.java
// public abstract class InputDevice extends Device {
//     public static final String TYPE = Constants.ID_DEVICE_INPUT;
//     public final static int INP_LOW = 0;
//     public final static int INP_HIGH = 1;
//     public final static int INP_TRIGGER = 2;
//     private InputDeviceListener mListener;
// 
//     public InputDevice(Context context) {
//         super(context);
//         this.deviceType = TYPE;
//     }
// 
//     public final void setListener(InputDeviceListener listener) {
//         this.mListener = listener;
//     }
// 
//     public final boolean setInputEvent(InputEvent event) {
//         if (this.isEnabled) {
//             return this.setEvent(event);
//         }
//         return false;
//     }
// 
//     protected abstract boolean setEvent(InputEvent event);
// 
//     public abstract void getStatusRequest();
// 
//     protected final void updateCurrentSignal(int signal) {
//         if (this.mListener != null) {
//             this.mListener.onValueChanged(this.deviceType, signal);
//         }
//     }
// }
// 
// Path: app/src/main/java/in/blogspot/anselmbros/torchie/utils/Constants.java
// public class Constants {
//     public final static String ID_DEVICE = "0";
// 
//     public final static String ID_DEVICE_OUTPUT = "1";
//     public final static String ID_DEVICE_OUTPUT_TORCH = "10";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH = "11";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_LEGACY = "12";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_NEW = "13";
//     public final static String ID_DEVICE_OUTPUT_TORCH_SCREEN = "14";
//     public final static String ID_DEVICE_OUTPUT_VIBRATOR = "15";
// 
//     public final static String ID_DEVICE_INPUT = "2";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY = "20";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_NATIVE = "21";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_ROCKER = "22";
//     public final static String ID_DEVICE_INPUT_PROXIMITY = "23";
// 
//     public final static String PLAY_URI = "https://play.google.com/store/apps/details?id=in.blogspot.anselmbros.torchie";
//     public final static String WEB_URI = "https://torchieapp.wordpress.com";
//     public final static String ABOUTANSELM_URI = "https://anselm.in";
//     public final static String FACEBOOK_URI = "https://facebook.com/torchieapp";
//     public final static String WEB_DONATE_URI = "https://torchieapp.wordpress.com/donate/";
// }


import android.content.Context;
import in.blogspot.anselmbros.torchie.main.manager.device.input.InputDevice;
import in.blogspot.anselmbros.torchie.utils.Constants;
/*
 *     Copyright (C) 2016  Merbin J Anselm <merbinjanselm@gmail.com>
 *
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation; either version 2 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License along
 *     with this program; if not, write to the Free Software Foundation, Inc.,
 *     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

package in.blogspot.anselmbros.torchie.main.manager.device.input.key.volume;



/**
 * Created by Merbin J Anselm on 05-Feb-17.
 */

public abstract class VolumeKeyDevice extends InputDevice {
    public static final String TYPE = Constants.ID_DEVICE_INPUT_VOLUMEKEY;

    public static final int MODE_VOLUME_COMBO = 0;

    private int mMode;

    public VolumeKeyDevice(Context context) {
        super(context);
        this.mMode = MODE_VOLUME_COMBO;
        this.deviceType = TYPE;
    }

    public final int getMode() {
        return this.mMode;
    }

    public final void setMode(int mode) {
        this.mMode = mode;
    }

    @Override
    public void getStatusRequest() {
        this.isActionModePerformed();
    }

    protected final boolean isActionModePerformed() {
        switch (this.mMode) {
            case MODE_VOLUME_COMBO:
                return this.isKeyComboPerformed();
            default:
// Path: app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/device/input/InputDevice.java
// public abstract class InputDevice extends Device {
//     public static final String TYPE = Constants.ID_DEVICE_INPUT;
//     public final static int INP_LOW = 0;
//     public final static int INP_HIGH = 1;
//     public final static int INP_TRIGGER = 2;
//     private InputDeviceListener mListener;
// 
//     public InputDevice(Context context) {
//         super(context);
//         this.deviceType = TYPE;
//     }
// 
//     public final void setListener(InputDeviceListener listener) {
//         this.mListener = listener;
//     }
// 
//     public final boolean setInputEvent(InputEvent event) {
//         if (this.isEnabled) {
//             return this.setEvent(event);
//         }
//         return false;
//     }
// 
//     protected abstract boolean setEvent(InputEvent event);
// 
//     public abstract void getStatusRequest();
// 
//     protected final void updateCurrentSignal(int signal) {
//         if (this.mListener != null) {
//             this.mListener.onValueChanged(this.deviceType, signal);
//         }
//     }
// }
// 
// Path: app/src/main/java/in/blogspot/anselmbros/torchie/utils/Constants.java
// public class Constants {
//     public final static String ID_DEVICE = "0";
// 
//     public final static String ID_DEVICE_OUTPUT = "1";
//     public final static String ID_DEVICE_OUTPUT_TORCH = "10";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH = "11";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_LEGACY = "12";
//     public final static String ID_DEVICE_OUTPUT_TORCH_FLASH_NEW = "13";
//     public final static String ID_DEVICE_OUTPUT_TORCH_SCREEN = "14";
//     public final static String ID_DEVICE_OUTPUT_VIBRATOR = "15";
// 
//     public final static String ID_DEVICE_INPUT = "2";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY = "20";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_NATIVE = "21";
//     public final static String ID_DEVICE_INPUT_VOLUMEKEY_ROCKER = "22";
//     public final static String ID_DEVICE_INPUT_PROXIMITY = "23";
// 
//     public final static String PLAY_URI = "https://play.google.com/store/apps/details?id=in.blogspot.anselmbros.torchie";
//     public final static String WEB_URI = "https://torchieapp.wordpress.com";
//     public final static String ABOUTANSELM_URI = "https://anselm.in";
//     public final static String FACEBOOK_URI = "https://facebook.com/torchieapp";
//     public final static String WEB_DONATE_URI = "https://torchieapp.wordpress.com/donate/";
// }


// Path: app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/device/input/key/volume/VolumeKeyDevice.java
import android.content.Context;
import in.blogspot.anselmbros.torchie.main.manager.device.input.InputDevice;
import in.blogspot.anselmbros.torchie.utils.Constants;

/*
 *     Copyright (C) 2016  Merbin J Anselm <merbinjanselm@gmail.com>
 *
 *     This program is free software; you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation; either version 2 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License along
 *     with this program; if not, write to the Free Software Foundation, Inc.,
 *     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

package in.blogspot.anselmbros.torchie.main.manager.device.input.key.volume;



/**
 * Created by Merbin J Anselm on 05-Feb-17.
 */

public abstract class VolumeKeyDevice extends InputDevice {
    public static final String TYPE = Constants.ID_DEVICE_INPUT_VOLUMEKEY;

    public static final int MODE_VOLUME_COMBO = 0;

    private int mMode;

    public VolumeKeyDevice(Context context) {
        super(context);
        this.mMode = MODE_VOLUME_COMBO;
        this.deviceType = TYPE;
    }

    public final int getMode() {
        return this.mMode;
    }

    public final void setMode(int mode) {
        this.mMode = mode;
    }

    @Override
    public void getStatusRequest() {
        this.isActionModePerformed();
    }

    protected final boolean isActionModePerformed() {
        switch (this.mMode) {
            case MODE_VOLUME_COMBO:
                return this.isKeyComboPerformed();
            default:
                return this.isKeyComboPerformed();