X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fosdn%2Fgokigen%2Fgr2control%2Fcamera%2Fricohgr2%2Fwrapper%2FRicohGr2LiveViewControl.java;h=2f52eea214351585829595aed1fcba835bbc1297;hb=c29782b4da12d1680800e493c6d94453bda9434f;hp=c7c1651864a22ae1e95f336e01fc059b5fcb158f;hpb=6ca2277fb7a91a405b37af0db2d4b18f3f27ac01;p=gokigen%2FGr2Control.git diff --git a/app/src/main/java/net/osdn/gokigen/gr2control/camera/ricohgr2/wrapper/RicohGr2LiveViewControl.java b/app/src/main/java/net/osdn/gokigen/gr2control/camera/ricohgr2/wrapper/RicohGr2LiveViewControl.java index c7c1651..2f52eea 100644 --- a/app/src/main/java/net/osdn/gokigen/gr2control/camera/ricohgr2/wrapper/RicohGr2LiveViewControl.java +++ b/app/src/main/java/net/osdn/gokigen/gr2control/camera/ricohgr2/wrapper/RicohGr2LiveViewControl.java @@ -1,6 +1,5 @@ package net.osdn.gokigen.gr2control.camera.ricohgr2.wrapper; -import android.support.annotation.NonNull; import android.util.Log; import net.osdn.gokigen.gr2control.camera.ILiveViewControl; @@ -9,6 +8,8 @@ import net.osdn.gokigen.gr2control.camera.utils.SimpleLiveviewSlicer; import net.osdn.gokigen.gr2control.liveview.liveviewlistener.CameraLiveViewListenerImpl; import net.osdn.gokigen.gr2control.liveview.liveviewlistener.ILiveViewListener; +import androidx.annotation.NonNull; + /** * * @@ -17,7 +18,9 @@ public class RicohGr2LiveViewControl implements ILiveViewControl { private final String TAG = toString(); private final CameraLiveViewListenerImpl liveViewListener; - private String liveViewUrl = "http://192.168.0.1/v1/display"; + private final boolean useGrCommand; + private String cameraDisplayUrl = "http://192.168.0.1/v1/display"; // カメラの画面をコピーする場合... + private String liveViewUrl = "http://192.168.0.1/v1/liveview"; // 何も表示しない(ライブビューモード)の場合... private float cropScale = 1.0f; private boolean whileFetching = false; private static final int FETCH_ERROR_MAX = 30; @@ -26,15 +29,16 @@ public class RicohGr2LiveViewControl implements ILiveViewControl * * */ - RicohGr2LiveViewControl() + RicohGr2LiveViewControl(boolean useGrControl) { + this.useGrCommand = useGrControl; liveViewListener = new CameraLiveViewListenerImpl(); } /* public void setLiveViewAddress(@NonNull String address, @NonNull String page) { - liveViewUrl = "http://" + address + "/" + page; + cameraDisplayUrl = "http://" + address + "/" + page; } */ @@ -42,12 +46,12 @@ public class RicohGr2LiveViewControl implements ILiveViewControl public void changeLiveViewSize(String size) { // - } @Override - public void startLiveView() + public void startLiveView(final boolean useCameraScreen) { + final boolean isCameraScreen = useGrCommand && useCameraScreen; Log.v(TAG, "startLiveView()"); try { @@ -58,7 +62,14 @@ public class RicohGr2LiveViewControl implements ILiveViewControl { try { - start(liveViewUrl); + if (isCameraScreen) + { + start(cameraDisplayUrl); + } + else + { + start(liveViewUrl); + } } catch (Exception e) { @@ -78,7 +89,8 @@ public class RicohGr2LiveViewControl implements ILiveViewControl @Override public void stopLiveView() { - + Log.v(TAG, "stopLiveView()"); + whileFetching = false; }