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.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;
- 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);
@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 ICameraStatusUpdateNotify getStatusListener()
- {
- return statusChecker.getStatusListener();
- }
-
- @Override
public IFujiXCommandPublisher getCommandPublisher()
{
return (commandPublisher);