Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ class MeetingViewModel(
.audio(
HMSAudioTrackSettings.Builder()
.setUseHardwareAcousticEchoCanceler(settings.enableHardwareAEC)
.useStereoOutput(settings.stereoOutput)
.useStereoInput(settings.stereoInput)
.initialState(getAudioTrackState())
.build()
)
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/live/hms/app2/ui/settings/SettingsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,18 @@ class SettingsFragment : Fragment() {
forceSoftwareDecoder
) { commitHelper.setForceSoftwareDecoder(it) }

initSwitch(
EnumSet.of(SettingsMode.HOME),
settings.stereoOutput,
stereoOutput
) { commitHelper.setStereoOutput(it) }

initSwitch(
EnumSet.of(SettingsMode.HOME),
settings.stereoInput,
stereoInput
) { commitHelper.setStereoInput(it) }


initSwitch(
EnumSet.of(SettingsMode.HOME),
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/live/hms/app2/ui/settings/SettingsStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class SettingsStore(context: Context) {
const val SHOW_STATS = "show-video-stats"
const val DISABLE_AUTO_RESIZE = "disable-auto-resize"
const val FORCE_SOFTWARE_DECODER = "force-software-decoder"
const val STEREO_OUTPUT = "stereo-output"
const val STEREO_INPUT = "stereo-input"

val APPLY_CONSTRAINTS_KEYS = arrayOf(
VIDEO_FRAME_RATE,
Expand Down Expand Up @@ -134,6 +136,14 @@ class SettingsStore(context: Context) {
get() = sharedPreferences.getBoolean(FORCE_SOFTWARE_DECODER, false)
set(value) = putBoolean(FORCE_SOFTWARE_DECODER, value)

var stereoInput: Boolean
get() = sharedPreferences.getBoolean(STEREO_INPUT, false)
set(value) = putBoolean(STEREO_INPUT, value)

var stereoOutput: Boolean
get() = sharedPreferences.getBoolean(STEREO_OUTPUT, false)
set(value) = putBoolean(STEREO_OUTPUT, value)

var publishVideo: Boolean
get() = sharedPreferences.getBoolean(PUBLISH_VIDEO, true)
set(value) = putBoolean(PUBLISH_VIDEO, value)
Expand Down Expand Up @@ -316,6 +326,8 @@ class SettingsStore(context: Context) {
fun setShowStats(value: Boolean) = apply { editor.putBoolean(SHOW_STATS, value) }
fun setDisableAutoResize(value: Boolean) = apply { editor.putBoolean(DISABLE_AUTO_RESIZE, value) }
fun setForceSoftwareDecoder(value: Boolean) = apply { editor.putBoolean(FORCE_SOFTWARE_DECODER, value) }
fun setStereoOutput(value: Boolean) = apply { editor.putBoolean(STEREO_OUTPUT, value) }
fun setStereoInput(value: Boolean) = apply { editor.putBoolean(STEREO_INPUT, value) }


fun commit() {
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,22 @@
android:text="@string/force_software_decoder"
android:visibility="visible" />

<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/stereo_output"
style="@style/MaterialSwitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/stereo_output"
android:visibility="visible" />

<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/stereo_input"
style="@style/MaterialSwitch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/stereo_input"
android:visibility="visible" />



<com.google.android.material.switchmaterial.SwitchMaterial
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
<string name="show_stats">Show stats</string>
<string name="disable_auto_resize">Disable Auto Resize</string>
<string name="force_software_decoder">Force Software Decoder</string>
<string name="stereo_output">Stereo Output</string>
<string name="stereo_input">Stereo Input</string>
<string name="raise_hand">✋ Raise Hand</string>
<string name="pip_mode">PIP mode</string>
<string name="lower_hand">Lower Hand</string>
Expand Down