package net.osdn.gokigen.gr2control.camera.fuji_x.wrapper;
import android.app.Activity;
-import android.content.SharedPreferences;
import android.util.Log;
import androidx.annotation.NonNull;
-import androidx.preference.PreferenceManager;
import net.osdn.gokigen.gr2control.camera.ICameraButtonControl;
import net.osdn.gokigen.gr2control.camera.ICameraConnection;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXCommandPublisher;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.command.IFujiXCommunication;
import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.connection.FujiXConnection;
+import net.osdn.gokigen.gr2control.camera.fuji_x.wrapper.playback.FujiXPlaybackControl;
import net.osdn.gokigen.gr2control.camera.playback.IPlaybackControl;
import net.osdn.gokigen.gr2control.liveview.IAutoFocusFrameDisplay;
-import net.osdn.gokigen.gr2control.liveview.ICameraStatusUpdateNotify;
import net.osdn.gokigen.gr2control.liveview.IIndicatorControl;
import net.osdn.gokigen.gr2control.liveview.liveviewlistener.ILiveViewListener;
-import net.osdn.gokigen.gr2control.preference.IPreferencePropertyAccessor;
public class FujiXInterfaceProvider implements IFujiXInterfaceProvider, IDisplayInjector
{
private static final String CAMERA_IP = "192.168.0.1";
private final Activity activity;
- //private final ICameraStatusReceiver provider;
private final FujiXCommandPublisher commandPublisher;
private final FujiXLiveViewControl liveViewControl;
private final FujiXAsyncResponseReceiver asyncReceiver;
*/
public FujiXInterfaceProvider(@NonNull Activity context, @NonNull ICameraStatusReceiver provider)
{
- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
- int communicationTimeoutMs = 5000; // デフォルトは 5000ms とする
- try
- {
- communicationTimeoutMs = Integer.parseInt(preferences.getString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE)) * 1000;
- if (communicationTimeoutMs < 5000)
- {
- communicationTimeoutMs = 5000; // 最小値は 5000msとする。
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
this.activity = context;
- //this.provider = provider;
this.commandPublisher = new FujiXCommandPublisher(CAMERA_IP, CONTROL_PORT);
fujiXConnection = new FujiXConnection(context, provider, this);
liveViewControl = new FujiXLiveViewControl(context, CAMERA_IP, STREAM_PORT);
asyncReceiver = new FujiXAsyncResponseReceiver(CAMERA_IP, ASYNC_RESPONSE_PORT);
zoomControl = new FujiXZoomControl();
buttonControl = new FujiXButtonControl();
- statusChecker = new FujiXStatusChecker(500);
- playbackControl = new FujiXPlaybackControl(communicationTimeoutMs);
+ statusChecker = new FujiXStatusChecker(context, commandPublisher);
+ playbackControl = new FujiXPlaybackControl(context, this);
hardwareStatus = new FujiXHardwareStatus();
- runMode = new FujiXRunMode();
+ runMode = new FujiXRunMode(this, statusChecker);
}
public void prepare()
@Override
public void injectDisplay(IAutoFocusFrameDisplay frameDisplayer, IIndicatorControl indicator, IFocusingModeNotify focusingModeNotify)
{
- Log.v(TAG, "injectDisplay()");
+ Log.v(TAG, " injectDisplay()");
focusControl = new FujiXFocusingControl(activity, commandPublisher, frameDisplayer, indicator);
captureControl = new FujiXCaptureControl(commandPublisher, frameDisplayer);
}
@Override
public IFujiXCommunication getLiveviewCommunication() {
- return null;
+ return (liveViewControl);
}
@Override
public IFujiXCommunication getAsyncEventCommunication() {
- return null;
+ return (asyncReceiver);
}
@Override
public IFujiXCommunication getCommandCommunication()
{
- return (null);
- }
-
- @Override
- public IFujiXCommandCallback getStatusHolder()
- {
- return null;
- }
-
- @Override
- public ICameraStatusUpdateNotify getStatusListener()
- {
- return null;
+ return (commandPublisher);
}
@Override