/*
 * Copyright (c) 2014 Mario Guggenberger <mg@protyposis.net>
 *
 * This file is part of MediaPlayer-Extended.
 *
 * MediaPlayer-Extended 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 3 of the License, or
 * (at your option) any later version.
 *
 * MediaPlayer-Extended 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 MediaPlayer-Extended.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.protyposis.android.spectaculum.effects;

import net.protyposis.android.spectaculum.gles.TextureFlipShaderProgram;
import net.protyposis.android.spectaculum.gles.TextureShaderProgram;

/**
 * Created by maguggen on 22.08.2014.
 */
public class FlipEffect extends ShaderEffect {

    private int mMode;

    @Override
    protected TextureShaderProgram initShaderProgram() {
        final TextureFlipShaderProgram flipShader = new TextureFlipShaderProgram();
        mMode = 1;

        flipShader.setMode(mMode);

        addParameter(new IntegerParameter("Mode", 0, 3, mMode, new IntegerParameter.Delegate() {
            @Override
            public void setValue(int value) {
                mMode = value;
                flipShader.setMode(mMode);
            }
        }));

        return flipShader;
    }
}

@@ -1074,16 +1074,111 @@
 fect %7B%0A%0A
+    public enum Mode %7B%0A        NONE,%0A        VERTICAL,%0A        HORIZONTAL,%0A        BOTH%0A    %7D%0A%0A
     priv
@@ -1181,19 +1181,20 @@
 private 
-int
+Mode
  mMode;%0A
@@ -1365,17 +1365,29 @@
 mMode = 
-1
+Mode.VERTICAL
 ;%0A%0A     
@@ -1413,16 +1413,26 @@
 de(mMode
+.ordinal()
 );%0A%0A    
@@ -1448,31 +1448,28 @@
 rameter(new 
-Integer
+Enum
 Parameter(%22M
@@ -1465,16 +1465,18 @@
 arameter
+%3C%3E
 (%22Mode%22,
@@ -1480,12 +1480,18 @@
 e%22, 
-0, 3
+Mode.class
 , mM
@@ -1503,15 +1503,12 @@
 new 
-Integer
+Enum
 Para
@@ -1521,16 +1521,22 @@
 Delegate
+%3CMode%3E
 () %7B%0A   
@@ -1591,11 +1591,12 @@
 lue(
-int
+Mode
  val
@@ -1672,16 +1672,26 @@
 de(mMode
+.ordinal()
 );%0A     

Change flip effect mode parameter to enum