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`.
|
// Unlocks and deletes the files that were locked using `lockFiles`.
|
||||||
fun unlockFiles(cleanupFiles: Boolean = false) {
|
fun unlockFiles(cleanupFiles: Boolean = false) {
|
||||||
if (cleanupFiles) {
|
if (cleanupFiles) {
|
||||||
batchesFolder.deleteRecordings(0..lockedIndex!!)
|
batchesFolder.deleteRecordings(0..<lockedIndex!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
lockedIndex = null
|
lockedIndex = null
|
||||||
|
@ -108,9 +108,7 @@ fun RecordingControl(
|
|||||||
) {
|
) {
|
||||||
SaveButton(
|
SaveButton(
|
||||||
onSave = onSaveAndStop,
|
onSave = onSaveAndStop,
|
||||||
onLongClick = {
|
onLongClick = onSaveCurrent,
|
||||||
println("onLongClick")
|
|
||||||
},
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -176,9 +174,7 @@ fun RecordingControl(
|
|||||||
) {
|
) {
|
||||||
SaveButton(
|
SaveButton(
|
||||||
onSave = onSaveAndStop,
|
onSave = onSaveAndStop,
|
||||||
onLongClick = {
|
onLongClick = onSaveCurrent,
|
||||||
println("onLongClick")
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,13 +152,19 @@ fun _PrimitiveControls(audioRecorder: AudioRecorderModel) {
|
|||||||
it.saveLastRecording(audioRecorder as RecorderModel)
|
it.saveLastRecording(audioRecorder as RecorderModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
audioRecorder.onRecordingSave(false)
|
audioRecorder.onRecordingSave(false).join()
|
||||||
|
|
||||||
runCatching {
|
runCatching {
|
||||||
audioRecorder.destroyService(context)
|
audioRecorder.destroyService(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSaveCurrent = {},
|
onSaveCurrent = {
|
||||||
|
scope.launch {
|
||||||
|
audioRecorder.recorderService!!.startNewCycle()
|
||||||
|
|
||||||
|
audioRecorder.onRecordingSave(true).join()
|
||||||
|
}
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user