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
140 changes: 70 additions & 70 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require("path");
const isDev = require("electron-is-dev");
let notRelease = process.env.NOT_RELEASE || false;
const { TCPConnection } = require("../src/Socket/socket.js");
const {autoUpdater} = require("electron-updater");
const { autoUpdater } = require("electron-updater");
const log = require('electron-log');
const localIpAddress = require("local-ip-address")

Expand Down Expand Up @@ -48,8 +48,8 @@ const createWindow = () => {
// load the index.html of the app. (or localhost on port 3000 if you're in development)
const startURL = isDev || notRelease
? "http://localhost:3000/app"
: `file://${path.join(__dirname, '../build/index.html')}`;
: `file://${path.join(__dirname, '../build/index.html')}`;


mainWindow.loadURL(startURL)

Expand All @@ -72,7 +72,7 @@ ipcMain.on("getLocalIP", (event, _) => {
return true;
});

ipcMain.on("getAllMics", (event, arg) => {
ipcMain.on("/microphones/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand Down Expand Up @@ -105,7 +105,7 @@ ipcMain.on("getAllMics", (event, arg) => {
}
});

ipcMain.on("getAllScenes", (event, arg) => {
ipcMain.on("/scenes/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand Down Expand Up @@ -134,7 +134,7 @@ ipcMain.on("getAllScenes", (event, arg) => {
}
});

ipcMain.on("getActReactCouples", (event, arg) => {
ipcMain.on("/areas/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand All @@ -146,60 +146,60 @@ ipcMain.on("getActReactCouples", (event, arg) => {
actReactId: 1,
isActive: true,
action: {
actionId: 1,
type: "WORD_DETECT",
params: {
words: ['bouloubouga']
}
actionId: 1,
type: "WORD_DETECT",
params: {
words: ['bouloubouga']
}
},
reaction: {
name: "Changement de scene sur la scene 2",
reactionId: 1,
type: "SCENE_SWITCH",
params: {
scene: "Scene 2",
uuid: "4f712d61-094a-4b7b-9905-4fa928329de4"
}
name: "Changement de scene sur la scene 2",
reactionId: 1,
type: "SCENE_SWITCH",
params: {
scene: "Scene 2",
uuid: "4f712d61-094a-4b7b-9905-4fa928329de4"
}
}
},
{
{
actReactId: 2,
isActive: true,
action: {
actionId: 2,
type: "KEY_PRESSED",
params: {
key: "m"
}
actionId: 2,
type: "KEY_PRESSED",
params: {
key: "m"
}
},
reaction: {
name: "Changement de scene sur la scene 3",
reactionId: 4,
type: "SCENE_SWITCH",
params: {
scene: "Scene qui n'existe pas",
uuid: "2772a187-cc04-4058-9148-beaaba7a2145"
}
name: "Changement de scene sur la scene 3",
reactionId: 4,
type: "SCENE_SWITCH",
params: {
scene: "Scene qui n'existe pas",
uuid: "2772a187-cc04-4058-9148-beaaba7a2145"
}
}
},
{
{
actReactId: 3,
isActive: true,
action: {
actionId: 3,
type: "APP_LAUNCH",
params: {
app_name: "discord"
}
actionId: 3,
type: "APP_LAUNCH",
params: {
app_name: "discord"
}
},
reaction: {
name: "Changement de scene sur la scene 3",
reactionId: 4,
type: "SCENE_SWITCH",
params: {
scene: "Scene qui n'existe pas",
uuid: "2772a187-cc04-4058-9148-beaaba7a2145"
}
name: "Changement de scene sur la scene 3",
reactionId: 4,
type: "SCENE_SWITCH",
params: {
scene: "Scene qui n'existe pas",
uuid: "2772a187-cc04-4058-9148-beaaba7a2145"
}
}
},
],
Expand All @@ -215,7 +215,7 @@ ipcMain.on("getActReactCouples", (event, arg) => {
}
});

ipcMain.on("getSubtitlesSettings", (event, arg) => {
ipcMain.on("/subtitles/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand Down Expand Up @@ -246,7 +246,7 @@ ipcMain.on("getSubtitlesSettings", (event, arg) => {
}
});

ipcMain.on("getAllTextFields", (event, arg) => {
ipcMain.on("/text-fields/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand Down Expand Up @@ -282,7 +282,7 @@ ipcMain.on("getAllTextFields", (event, arg) => {
}
});

ipcMain.on("getAllDisplaySources", (event, arg) => {
ipcMain.on("/display-sources/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand Down Expand Up @@ -318,7 +318,7 @@ ipcMain.on("getAllDisplaySources", (event, arg) => {
}
});

ipcMain.on("getAllLinksMicsToVideoSource", (event, arg) => {
ipcMain.on("/mtdsis/get", (event, arg) => {
if (isDev) {
let res = {
statusCode: 200,
Expand Down Expand Up @@ -347,7 +347,7 @@ ipcMain.on("getAllLinksMicsToVideoSource", (event, arg) => {
}
});

ipcMain.on("setCompressorLevel", (event, arg) => {
ipcMain.on("/microphones/auto-leveler/set", (event, arg) => {
if (isDev) {
let res = {
message: "OK",
Expand All @@ -363,7 +363,7 @@ ipcMain.on("setCompressorLevel", (event, arg) => {
}
});

ipcMain.on("setSubtitles", (event, arg) => {
ipcMain.on("/subtitles/set", (event, arg) => {
if (isDev) {
let res = {
message: "OK",
Expand All @@ -379,7 +379,7 @@ ipcMain.on("setSubtitles", (event, arg) => {
}
});

ipcMain.on("setActionReaction", (event, arg) => {
ipcMain.on("/areas/create", (event, arg) => {
if (isDev) {
let res = {
message: "OK",
Expand All @@ -400,7 +400,7 @@ ipcMain.on("setActionReaction", (event, arg) => {
}
});

ipcMain.on("linkMicToVideoSource", (event, arg) => {
ipcMain.on("/mtdsis/create", (event, arg) => {
if (isDev) {
let res = {
message: "OK",
Expand All @@ -416,7 +416,7 @@ ipcMain.on("linkMicToVideoSource", (event, arg) => {
}
});

ipcMain.on("removeActReact", (event, arg) => {
ipcMain.on("/areas/remove", (event, arg) => {
if (isDev) {
console.log("removeActReact")
let res = {
Expand All @@ -437,7 +437,7 @@ ipcMain.on("removeActReact", (event, arg) => {
});

ipcMain.on("compressor-level-updated", (evt, arg) => { // Get from socket broadcast
mainWindow.webContents.send('compressor-level-updated'); // To renderer
mainWindow.webContents.send('compressor-level-updated'); // To renderer
});

ipcMain.on("scenes-updated", (evt, arg) => { // Get from socket broadcast
Expand Down Expand Up @@ -479,23 +479,23 @@ const createLoadingScreen = () => {
.then((res) => {
clearInterval(refreshIntervalId);
boadcastConn.connectBroadcast()
.then((broadcast_res) => {
console.log("TCPConnection and Broadcast is connected");
launchingApplication();
clearInterval(refreshIntervalId);
return res;
}).catch((err) => {
tcpConn.disconnectSocket()
if (isDev) {
console.log("DEV MODE");
.then((broadcast_res) => {
console.log("TCPConnection and Broadcast is connected");
launchingApplication();
clearInterval(refreshIntervalId);
return null;
} else {
console.log("Can't locate the server", err);
setInterval(refreshIntervalId, 5000)
return null;
}
})
return res;
}).catch((err) => {
tcpConn.disconnectSocket()
if (isDev) {
console.log("DEV MODE");
clearInterval(refreshIntervalId);
return null;
} else {
console.log("Can't locate the server", err);
setInterval(refreshIntervalId, 5000)
return null;
}
})
}).catch((err) => {
if (isDev) {
console.log("DEV MODE");
Expand Down
36 changes: 19 additions & 17 deletions src/Components/ActionsReactions/ActionsReactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const ActionsReactions = () => {
*/
const getActionReactionFromServer = (): Promise<getActReactCouplesFormat> => {
return new Promise(async (resolve, reject) => {
const result: getActReactCouplesFormat = await ipcRenderer.sendSync("getActReactCouples", "ping");
const result: getActReactCouplesFormat = await ipcRenderer.sendSync("/areas/get", "ping");
resolve(result);
});
};
Expand All @@ -88,7 +88,7 @@ export const ActionsReactions = () => {
*/
const removeActionReactionFromServer = (actionReactionId: number): Promise<removeActReactAnswer> => {
return new Promise(async (resolve, reject) => {
const result: removeActReactAnswer = await ipcRenderer.sendSync("removeActReact", {
const result: removeActReactAnswer = await ipcRenderer.sendSync("/areas/remove", {
actReactId: actionReactionId,
});
resolve(result);
Expand Down Expand Up @@ -270,7 +270,7 @@ export const ActionsReactions = () => {
*/
const getAllScenes = (): Promise<AllScenes> => {
return new Promise(async (resolve, reject) => {
const result: AllScenes = await ipcRenderer.sendSync("getAllScenes", "ping");
const result: AllScenes = await ipcRenderer.sendSync("/scenes/get", "ping");
resolve(result);
});
};
Expand Down Expand Up @@ -321,17 +321,21 @@ export const ActionsReactions = () => {
<div className="item-container action-reaction-cards non-dragable">
{actionsReactionsList.map((item: any, index: any) => {
return (
<Card key={index} className="card-event non-dragable" sx={{
backgroundColor: "#565d68",
border: "2px solid orange",
borderRadius: "10px",
color: "white",
height: "100%",
display: "inline-table",
alignItems: "center",
justifyContent: "center",
width: "85%"
}}>
<Card
key={index}
className="card-event non-dragable"
sx={{
backgroundColor: "#565d68",
border: "2px solid orange",
borderRadius: "10px",
color: "white",
height: "100%",
display: "inline-table",
alignItems: "center",
justifyContent: "center",
width: "85%",
}}
>
<CardContent>
<Typography sx={{ fontSize: 14 }} gutterBottom>
# {index + 1}
Expand All @@ -351,9 +355,7 @@ export const ActionsReactions = () => {
<CardActions disableSpacing className="rightAlignItem">
{warningMessageDisplaySceneMissing(item) === true ? (
<Tooltip title="The scene that is registered in the reaction of this Action/Reaction isn't available anymore. Please delete this Action/Reaction.">
<IconButton
className="full-orange"
>
<IconButton className="full-orange">
<BsFillExclamationTriangleFill />
</IconButton>
</Tooltip>
Expand Down
6 changes: 3 additions & 3 deletions src/Components/ActionsReactions/AppLaunch/AppLaunch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const AppLaunch = (props: any) => {
*/
const getActionReactionFromServer = (): Promise<getActReactCouplesFormat> => {
return new Promise(async (resolve, reject) => {
const result: getActReactCouplesFormat = await ipcRenderer.sendSync("getActReactCouples", "ping");
const result: getActReactCouplesFormat = await ipcRenderer.sendSync("/areas/get", "ping");
resolve(result);
});
};
Expand All @@ -133,7 +133,7 @@ export const AppLaunch = (props: any) => {
*/
const sendActionReactionToServer = (newActionReaction: action_reaction): Promise<actionReactionFormat> => {
return new Promise(async (resolve, reject) => {
const result: actionReactionFormat = await ipcRenderer.sendSync("setActionReaction", newActionReaction);
const result: actionReactionFormat = await ipcRenderer.sendSync("/areas/create", newActionReaction);
resolve(result);
});
};
Expand Down Expand Up @@ -196,7 +196,7 @@ export const AppLaunch = (props: any) => {
*/
const removeAndUpdateActReaction = (params: any, eventArr: any) => {
return new Promise(async (resolve, reject) => {
const result: removeActReactAnswer = await ipcRenderer.sendSync("removeActReact", params);
const result: removeActReactAnswer = await ipcRenderer.sendSync("/areas/remove", params);
if (result.statusCode === 200) {
console.log("Remove ActReaction", result.data.actReactId);
updateActionReactionArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const CreateReactions = () => {
*/
const getAllScenes = (): Promise<AllScenes> => {
return new Promise(async (resolve, reject) => {
const result: AllScenes = await ipcRenderer.sendSync("getAllScenes", "ping");
const result: AllScenes = await ipcRenderer.sendSync("/scenes/get", "ping");
resolve(result);
});
};
Expand Down
Loading