mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Add save current audio recording without stopping it (wip)
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
fe24f3473f
commit
dad8439d3d
@ -35,7 +35,7 @@ abstract class IntervalRecorderService<I, B : BatchesFolder> :
|
||||
// Unlocks and deletes the files that were locked using `lockFiles`.
|
||||
fun unlockFiles(cleanupFiles: Boolean = false) {
|
||||
if (cleanupFiles) {
|
||||
batchesFolder.deleteRecordings(0..lockedIndex!!)
|
||||
batchesFolder.deleteRecordings(0..<lockedIndex!!)
|
||||
}
|
||||
|
||||
lockedIndex = null
|
||||
|
@ -108,9 +108,7 @@ fun RecordingControl(
|
||||
) {
|
||||
SaveButton(
|
||||
onSave = onSaveAndStop,
|
||||
onLongClick = {
|
||||
println("onLongClick")
|
||||
},
|
||||
onLongClick = onSaveCurrent,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
@ -176,9 +174,7 @@ fun RecordingControl(
|
||||
) {
|
||||
SaveButton(
|
||||
onSave = onSaveAndStop,
|
||||
onLongClick = {
|
||||
println("onLongClick")
|
||||
},
|
||||
onLongClick = onSaveCurrent,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -152,13 +152,19 @@ fun _PrimitiveControls(audioRecorder: AudioRecorderModel) {
|
||||
it.saveLastRecording(audioRecorder as RecorderModel)
|
||||
}
|
||||
|
||||
audioRecorder.onRecordingSave(false)
|
||||
audioRecorder.onRecordingSave(false).join()
|
||||
|
||||
runCatching {
|
||||
audioRecorder.destroyService(context)
|
||||
}
|
||||
}
|
||||
},
|
||||
onSaveCurrent = {},
|
||||
onSaveCurrent = {
|
||||
scope.launch {
|
||||
audioRecorder.recorderService!!.startNewCycle()
|
||||
|
||||
audioRecorder.onRecordingSave(true).join()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user