Skip to content

Commit

Permalink
make buttons smaller, add a hackish lower vbitrate button when connec…
Browse files Browse the repository at this point in the history
…tions are really bad
  • Loading branch information
zoff99 committed Jan 1, 2024
1 parent 67177a7 commit 21cab8e
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import androidx.compose.material.icons.filled.QrCode2
import androidx.compose.material.icons.filled.RawOff
import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material.icons.filled.Send
import androidx.compose.material.icons.filled.SignalCellular4Bar
import androidx.compose.material.icons.filled.Videocam
import androidx.compose.material.rememberScaffoldState
import androidx.compose.material3.CenterAlignedTopAppBar
Expand Down Expand Up @@ -517,7 +518,7 @@ fun App()
maxLines = 1)
}
Column {
Icon(modifier = Modifier.padding(5.dp)
Icon(modifier = Modifier.padding(start = 5.dp, end = 5.dp, top = 2.dp).size(19.dp)
.combinedClickable(onClick = {
if (video_in_box_small)
{
Expand All @@ -538,7 +539,7 @@ fun App()
contentDescription = "toggle large incoming video size"
)
var audio_filter_current_value by remember { mutableStateOf(PREF__audio_input_filter) }
Icon(modifier = Modifier.padding(5.dp).combinedClickable(
Icon(modifier = Modifier.padding(start = 5.dp, end = 5.dp, top = 2.dp).size(19.dp).combinedClickable(
onClick = {
if (PREF__audio_input_filter == 0)
{
Expand All @@ -554,7 +555,7 @@ fun App()
contentDescription = "enable Noise Suppresion on audio capture",
tint = if (audio_filter_current_value == 1) Color.Red else Color.DarkGray)
var video_force_mjpeg_value by remember { mutableStateOf(PREF__v4l2_capture_force_mjpeg) }
Icon(modifier = Modifier.padding(5.dp).combinedClickable(
Icon(modifier = Modifier.padding(start = 5.dp, end = 5.dp, top = 2.dp).size(19.dp).combinedClickable(
onClick = {
if (PREF__v4l2_capture_force_mjpeg == 0)
{
Expand All @@ -569,8 +570,41 @@ fun App()
contentDescription = "force MJPEG on video capture",
tint = if (video_force_mjpeg_value == 1) Color.Red else Color.DarkGray)

var video_low_bitrate by remember { mutableStateOf(false) }
Icon(modifier = Modifier.padding(start = 5.dp, end = 5.dp, top = 2.dp).size(19.dp).combinedClickable(
onClick = {
try
{
if (!savepathstore.isEnabled())
{
val friendnum = tox_friend_by_public_key(avstatestore.state.call_with_friend_pubkey_get())
if (avstatestore.state.call_with_friend_pubkey_get() != null)
{
video_low_bitrate = !video_low_bitrate
if (video_low_bitrate)
{
MainActivity.toxav_option_set(friendnum,
ToxVars.TOXAV_OPTIONS_OPTION.TOXAV_ENCODER_VIDEO_MAX_BITRATE.value.toLong(),
TRIFAGlobals.LOWER_GLOBAL_VIDEO_BITRATE.toLong())
} else
{
MainActivity.toxav_option_set(friendnum,
ToxVars.TOXAV_OPTIONS_OPTION.TOXAV_ENCODER_VIDEO_MAX_BITRATE.value.toLong(),
TRIFAGlobals.NORMAL_GLOBAL_VIDEO_BITRATE.toLong())
}
}
}
}
catch (_: java.lang.Exception)
{
}
}),
imageVector = Icons.Default.SignalCellular4Bar,
contentDescription = "force lower video bitrate",
tint = if (video_low_bitrate) Color.Red else Color.DarkGray)

var video_super_hq_value by remember { mutableStateOf(PREF__video_super_hq) }
Icon(modifier = Modifier.padding(5.dp).combinedClickable(
Icon(modifier = Modifier.padding(start = 5.dp, end = 5.dp, top = 2.dp).size(19.dp).combinedClickable(
onClick = {
if (PREF__video_super_hq == 0)
{
Expand Down

0 comments on commit 21cab8e

Please sign in to comment.