Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Components/Slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function CustomizedSlider(props: any) {
props.sendData(val);
}}
aria-label="Micro"
defaultValue={props.value}
value={ props.value ?? 0}
marks={marks}
valueLabelDisplay="on"
/>
Expand Down
31 changes: 22 additions & 9 deletions src/Socket/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,31 @@ class TCPConnection {
});
this.socket.on('data', (data) => {
try {
data = data.toString().replace('\t','').replace('\r','').replace('\n','').replace(/\0/g, ''); // Remove all useless characters
const payload = JSON.parse(data);
console.log("BEFORE toString", data)
data = data.toString()
data = data.replace('\t','').replace('\r','').replace(/\0/g, ''); // Remove all useless characters

if (payload.message === 'BROADCAST') {
let type = payload.data.type
// Split the data by newline character
const jsonStrings = data.split('\n');

// Add the JSON strings to the queue
jsonStrings.forEach((jsonString) => {
if (jsonString.trim() !== '') {

if (type === 'audioSourceCreated' || type === 'audioSourceRemoved' || type === 'audioSourceNameChanged' || type === 'micLevelChanged') {
this.ipcMain.emit('compressor-level-updated')
} else if (type === 'sceneCreated' || type === 'sceneRemoved' || type === 'sceneNameChanged') {
this.ipcMain.emit('scenes-updated')
let payload = JSON.parse(jsonString);

if (payload.message === 'BROADCAST') {
let type = payload.data.type

if (type === 'audioSourceCreated' || type === 'audioSourceRemoved' || type === 'audioSourceNameChanged' || type === 'micLevelChanged') {
this.ipcMain.emit('compressor-level-updated')
} else if (type === 'sceneCreated' || type === 'sceneRemoved' || type === 'sceneNameChanged') {
this.ipcMain.emit('scenes-updated')
}
}
}
}
});

} catch (error) {
console.error(error)
}
Expand Down