mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Increase max duration to 10 days; Closes #25
This commit is contained in:
parent
3345ee6eb8
commit
41af9004a2
@ -144,6 +144,7 @@ data class LastRecording(
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class AudioRecorderSettings(
|
data class AudioRecorderSettings(
|
||||||
|
// 30 minutes
|
||||||
val maxDuration: Long = 30 * 60 * 1000L,
|
val maxDuration: Long = 30 * 60 * 1000L,
|
||||||
// 60 seconds
|
// 60 seconds
|
||||||
val intervalDuration: Long = 60 * 1000L,
|
val intervalDuration: Long = 60 * 1000L,
|
||||||
@ -266,8 +267,8 @@ data class AudioRecorderSettings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun setMaxDuration(duration: Long): AudioRecorderSettings {
|
fun setMaxDuration(duration: Long): AudioRecorderSettings {
|
||||||
if (duration < 60 * 1000L || duration > 24 * 60 * 60 * 1000L) {
|
if (duration < 60 * 1000L || duration > 10 * 24 * 60 * 60 * 1000L) {
|
||||||
throw Exception("Max duration must be between 1 minute and 1 hour")
|
throw Exception("Max duration must be between 1 minute and 10 days")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (duration < intervalDuration) {
|
if (duration < intervalDuration) {
|
||||||
|
@ -65,10 +65,10 @@ fun MaxDurationTile() {
|
|||||||
updateValue(newTimeInSeconds * 1000L)
|
updateValue(newTimeInSeconds * 1000L)
|
||||||
},
|
},
|
||||||
config = DurationConfig(
|
config = DurationConfig(
|
||||||
timeFormat = DurationFormat.MM_SS,
|
timeFormat = DurationFormat.HH_MM,
|
||||||
currentTime = settings.audioRecorderSettings.maxDuration / 1000,
|
currentTime = settings.audioRecorderSettings.maxDuration / 1000,
|
||||||
minTime = 60,
|
minTime = 60,
|
||||||
maxTime = 24 * 60 * 60,
|
maxTime = 10 * 24 * 60 * 60,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
SettingsTile(
|
SettingsTile(
|
||||||
@ -95,7 +95,7 @@ fun MaxDurationTile() {
|
|||||||
ExampleListRoulette(
|
ExampleListRoulette(
|
||||||
items = AudioRecorderSettings.EXAMPLE_MAX_DURATIONS,
|
items = AudioRecorderSettings.EXAMPLE_MAX_DURATIONS,
|
||||||
onItemSelected = ::updateValue,
|
onItemSelected = ::updateValue,
|
||||||
) {maxDuration ->
|
) { maxDuration ->
|
||||||
Text(formatDuration(maxDuration))
|
Text(formatDuration(maxDuration))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user