{
try
{
+/*
+ val optionGet = ThetaOptionGetControl(sessionIdProvider)
+ optionGet.getOptions("[\"previewFormat\", \"previewFormatSupport\"]", (sessionIdProvider.sessionId.isBlank()),
+ object : IOperationCallback { override fun operationExecuted(result: Int, resultStr: String?)
+ {
+ Log.v(TAG, " >>>>> optionGet.getOptions : $resultStr ")
+ }})
+*/
val optionSet = ThetaOptionSetControl(sessionIdProvider)
optionSet.setOptions("\"captureMode\" : \"image\"", (sessionIdProvider.sessionId.isBlank()),
object : IOperationCallback { override fun operationExecuted(result: Int, resultStr: String?)
optionSet.setOptions("\"previewFormat\" : $previewFormat", (sessionIdProvider.sessionId.isBlank()),
object : IOperationCallback { override fun operationExecuted(result: Int, resultStr: String?)
{
- Log.v(TAG, " optionSet.setOptions(live view) : $resultStr ")
+ Log.v(TAG, " optionSet.setOptions(live view) : $resultStr ($previewFormat)")
liveViewControl.startLiveView()
}})
}})
import android.content.Context
import android.opengl.GLUtils
import android.util.Log
+import androidx.preference.PreferenceManager
import jp.osdn.gokigen.thetaview.R
import jp.osdn.gokigen.thetaview.liveview.image.IImageProvider
+import jp.osdn.gokigen.thetaview.preference.IPreferencePropertyAccessor
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.FloatBuffer
import kotlin.math.cos
import kotlin.math.sin
-class EquirectangularDrawer(context: Context) : IGraphicsDrawer
+class EquirectangularDrawer(private val context: Context) : IGraphicsDrawer
{
private lateinit var imageProvider : IImageProvider
override fun prepareDrawer(gl: GL10?)
{
- Log.v(TAG, "prepareDrawer()")
- mDroidTextureID = mGlUtils.prepareTexture(gl, R.drawable.sample)
+ try
+ {
+ val previewFormat = PreferenceManager.getDefaultSharedPreferences(context).getString(IPreferencePropertyAccessor.LIVEVIEW_RESOLUTION, IPreferencePropertyAccessor.LIVEVIEW_RESOLUTION_DEFAULT_VALUE)
+ if (previewFormat != null)
+ {
+ mDroidTextureID = when {
+ previewFormat.contains("width:1920") -> {
+ mGlUtils.prepareTexture(gl, R.drawable.sample2)
+ }
+ previewFormat.contains("width:1024") -> {
+ mGlUtils.prepareTexture(gl, R.drawable.sample1)
+ }
+ else -> {
+ mGlUtils.prepareTexture(gl, R.drawable.sample)
+ }
+ }
+ }
+ else
+ {
+ // 取得できなかった場合は、640x320 にする
+ mDroidTextureID = mGlUtils.prepareTexture(gl, R.drawable.sample)
+ }
+ Log.v(TAG, "prepareDrawer() : $mDroidTextureID : $previewFormat")
+ }
+ catch (e : Exception)
+ {
+ e.printStackTrace()
+ mDroidTextureID = mGlUtils.prepareTexture(gl, R.drawable.sample)
+ }
}
override fun preprocessDraw(gl: GL10?)
--- /dev/null
+<resources>
+ <string name="app_name">Theta Thought ShutterS</string>
+ <string name="blank"> </string>
+ <string name="app_location">AirA01a</string>
+ <string name="action_refresh">再描画</string>
+ <string name="finish_refresh">再描画完了</string>
+
+ <string name="permission_not_granted">アプリの権限が許されていません。</string>
+
+ <string name="dialog_positive_execute">OK</string>
+ <string name="dialog_negative_cancel">Cancel</string>
+
+ <string name="capture_success">撮影完了: </string>
+
+ <string name="dialog_confirm_title_output_log">デバッグログの共有</string>
+ <string name="dialog_confirm_message_output_log">デバッグログを共有します。</string>
+
+ <string name="dialog_title_exit_application">アプリ終了</string>
+ <string name="dialog_message_exit_application">アプリケーションを終了します。</string>
+
+ <string name="pref_cat_application_control">アプリ制御</string>
+ <string name="pref_exit_power_off">アプリ終了</string>
+ <string name="pref_summary_exit_power_off"> </string>
+ <string name="pref_wifi_settings">WIFI設定</string>
+ <string name="pref_summary_wifi_settings"> </string>
+
+ <string name="pref_cat_application_settings">アプリ設定</string>
+ <string name="save_local_location">ローカル領域に保存</string>
+
+ <string name="pref_cat_camera">カメラ設定</string>
+ <string name="pref_capture_both_camera_and_live_view">ライブ画像を同時保存</string>
+ <string name="pref_summary_capture_both_live_view">撮影時にライブビュー画像を同時保存します</string>
+
+ <string name="pref_cat_eeg_settings">EEG設定</string>
+
+ <string name="pref_cat_gokigen">GOKIGEN</string>
+ <string name="pref_instruction_manual">操作説明</string>
+ <string name="pref_privacy_policy">プライバシーポリシー</string>
+ <string name="pref_degug_info">デバッグ情報</string>
+ <string name="pref_summary_debug_info">LogCat情報</string>
+
+ <string name="pref_use_camerax_preview">カメラプレビューの使用(要再起動)</string>
+
+ <string name="pref_liveview_resolution">ライブビュー形式(要再起動)</string>
+ <string name="pref_summary_liveview_resolution"> </string>
+
+ <string name="pref_show_camera_status">機器状態を画面に表示</string>
+ <string name="pref_summary_show_camera_status">機器の状態を画面表示します</string>
+
+ <string name="pref_use_mindwave_connection">Mindwave Mobile(EEGヘッドセット)を使用する</string>
+ <string name="pref_summary_use_mindwave_connection">EEGヘッドセットを使用する場合に設定してください</string>
+
+ <string name="pref_use_eeg_signal_type">脳波シャッタータイプ</string>
+ <string name="pref_summary_use_eeg_signal_type"> </string>
+
+ <string name="pref_show_eeg_wave_signal">脳波信号も画面表示</string>
+ <string name="pref_summary_show_eeg_wave_signal">「状態を画面に表示」のチェック時、脳波信号も画面表示します</string>
+
+ <string name="pref_record_eeg_wave_signal">脳波信号をCSVファイルに出力</string>
+ <string name="pref_summary_record_eeg_wave_signal">脳波信号をCSVファイルとしてDownloadフォルダに記録します</string>
+
+ <string name="shoot_camera">撮影しました!</string>
+
+ <string name="connect_start">開始</string>
+ <string name="connect_check_wifi">WIFI確認中</string>
+ <string name="connect_connect">接続</string>
+ <string name="connect_connecting">接続中…</string>
+ <string name="connect_connected">接続完了</string>
+ <string name="connect_change_run_mode">モード変更</string>
+ <string name="connect_restore_camera_settings">カメラ設定調整</string>
+
+ <string name="camera_not_found">Not Found…</string>
+ <string name="theta_connect_response_ng">カメラに接続できませんでした。</string>
+
+ <string name="dialog_title_connect_failed_theta">接続失敗(THETA)</string>
+ <string name="dialog_title_button_retry">再試行</string>
+ <string name="dialog_title_button_network_settings">WiFi設定</string>
+</resources>
</string-array>
<string-array name="preview_format_value">
- <item>{"width": 640, "height": 320, "framerate": 30}</item>
- <item>{"width": 640, "height": 320, "framerate": 8}</item>
- <item>{“width”: 1024, “height”: 512, “framerate”: 30}</item>
- <item>{“width”: 1024, “height”: 512, “framerate”: 8}</item>
- <item>{“width”: 1920, “height”: 960, “framerate”: 8}</item>
+ <item>{"framerate":30,"height":320,"width":640}</item>
+ <item>{"framerate":8,"height":320,"width":640}</item>
+ <item>{"framerate":30,"height":512,"width":1024}</item>
+ <item>{"framerate":8,"height":512,"width":1024}</item>
+ <item>{"framerate":8,"height":960,"width":1920}</item>
<!-- <item>{“width”: 640, “height”: 320, “framerate”: 10}</item> -->
</string-array>
<string name="pref_use_camerax_preview">Use Camera preview(need restart)</string>
- <string name="pref_liveview_resolution">Liveview Format</string>
+ <string name="pref_liveview_resolution">Liveview Format(need restart)</string>
<string name="pref_summary_liveview_resolution"> </string>
<string name="pref_show_camera_status">Show camera statuses</string>
<string name="pref_summary_show_eeg_wave_signal"> </string>
<string name="pref_record_eeg_wave_signal">Records EEG signals in a CSV file</string>
- <string name="pref_summary_record_eeg_wave_signal"> </string>
+ <string name="pref_summary_record_eeg_wave_signal">The file location is the Download folder. </string>
<string name="shoot_camera">Captured!</string>
android:summary="@string/pref_summary_wifi_settings" />
</PreferenceCategory>
-<!--
<PreferenceCategory
app:title="@string/pref_cat_application_settings">
-
+<!--
<SwitchPreferenceCompat
android:key="use_camera_x_preview"
android:title="@string/pref_use_camerax_preview"/>
<SwitchPreferenceCompat
android:key="save_local_location"
android:title="@string/save_local_location"/>
- </PreferenceCategory>
-->
+ <SwitchPreferenceCompat
+ android:key="capture_both_camera_and_live_view"
+ android:title="@string/pref_capture_both_camera_and_live_view"
+ android:summary="@string/pref_summary_capture_both_live_view"/>
+
+ <SwitchPreferenceCompat
+ android:key="show_camera_status"
+ android:title="@string/pref_show_camera_status"
+ android:summary="@string/pref_summary_show_camera_status"/>
+ </PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_cat_camera">
android:title="@string/pref_liveview_resolution"
android:summary="@string/pref_summary_liveview_resolution"
/>
-
- <SwitchPreferenceCompat
- android:key="capture_both_camera_and_live_view"
- android:title="@string/pref_capture_both_camera_and_live_view"
- android:summary="@string/pref_summary_capture_both_live_view"/>
-
- <SwitchPreferenceCompat
- android:key="show_camera_status"
- android:title="@string/pref_show_camera_status"
- android:summary="@string/pref_summary_show_camera_status"/>
-
</PreferenceCategory>
<PreferenceCategory