versão 2.0.2 - É possível gravar áudio do dispositivo

This commit is contained in:
JotaChina committed 2025-10-23 21:04:53 -03:00
1 parent b3f0d13b90
commit 1818932244
6 files changed
+632 -104

No files matched your search

+11
View File
@@ -2,6 +2,7 @@
import { appState, resetProjectState } from "./state.js";
import { addTrackToState, removeLastTrackFromState } from "./pattern/pattern_state.js";
// --- CORREÇÃO AQUI ---
import { toggleRecording } from "./recording.js";
import { addAudioTrackLane, removeAudioClip } from "./audio/audio_state.js";
import { updateTransportLoop } from "./audio/audio_audio.js";
import {
@@ -56,6 +57,7 @@ document.addEventListener("DOMContentLoaded", () => {
// --- NOVOS BOTÕES ---
const resizeToolTrimBtn = document.getElementById("resize-tool-trim");
const resizeToolStretchBtn = document.getElementById("resize-tool-stretch");
const recordBtn = document.getElementById("record-btn");
const mmpFileInput = document.getElementById("mmp-file-input");
const sampleFileInput = document.getElementById("sample-file-input");
@@ -68,6 +70,15 @@ document.addEventListener("DOMContentLoaded", () => {
const zoomOutBtn = document.getElementById("zoom-out-btn");
// --- LISTENERS ADICIONADOS (COM LÓGICA DE CONTROLLER) ---
// --- NOVO LISTENER PARA O BOTÃO DE GRAVAR ---
if (recordBtn) {
recordBtn.addEventListener("click", () => {
// Garante que o contexto de áudio foi iniciado por um gesto do usuário
initializeAudioContext();
toggleRecording();
});
}
// Listener para o botão "Excluir Clipe" no menu de contexto
const deleteClipBtn = document.getElementById('delete-clip');