let filename = path.join(workspacePath, `ODAS_${id}_${new Date().toLocaleString()}.wav`)
this.writer = new wav.FileWriter(filename,{channels:1, sampleRate:sampleRate, bitDepth:bitNumber})
+ odasStudio.recordingsWindow.webContents.send('fuzzy-recording', filename)
}
}
const info = require('wav-file-info')
const dialog = require('electron').remote.dialog
+// Fuzzy recording class
+class FuzzyRecording {
+ constructor(fullPath) {
+
+ this.filename = path.basename(fullPath)
+ this.path = fullPath
+ this.timestamp = new Date()
+ }
+}
+
// Single recording class
class Recording {
el: '#recordings-table',
data: {
recordings: [],
+ fuzzyRecordings: [],
workspacePath: localStorage.workspacePath,
recordingEnabled: false
},
ipcRenderer.on('add-recording', (event, filename) => {
RecordingsModel.recordings.unshift(new Recording(filename))
+ RecordingsModel.fuzzyRecordings = RecordingsModel.fuzzyRecordings.filter((recording) => {
+ return recording.path !== filename
+ })
+})
+
+ipcRenderer.on('fuzzy-recording', (event, filename) => {
+
+ RecordingsModel.fuzzyRecordings.unshift(new FuzzyRecording(filename))
})
// Close window and stop recording
</tr>
</thead>
<tbody>
+ <tr v-for = "recording in fuzzyRecordings">
+ <td><span class="glyphicon glyphicon-record text-danger"></span></td>
+ <td>{{recording.timestamp.toLocaleString()}}</td>
+ <td></td>
+ <td>{{recording.filename}}</td>
+ <td></td>
+ </tr>
<tr v-for = "recording in recordings" v-on:mouseleave = "recording.deleting = 'hidden'">
<td>
<span v-if="!recording.isPlaying" class="control glyphicon glyphicon-play" v-on:click = "recording.play()"></span>