Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
013ab40
remove updates setCompressorLevel
Mitix-EPI May 12, 2023
549a32c
add debug print
Mitix-EPI May 12, 2023
788603a
modify socket.once to socket.on
Mitix-EPI May 12, 2023
d1ff1dd
add print debug
Mitix-EPI May 12, 2023
9932f15
pas mal les bzez
Mitix-EPI May 12, 2023
adcf70e
chunk remove \t \r \n
Mitix-EPI May 12, 2023
10f57dd
feat(): add broadcast socket + fix crash window + decrease loading time
Mitix-EPI May 12, 2023
ae26ad3
add debug logs
Mitix-EPI May 12, 2023
af9ed5f
fix type recognition broadcast socket
Mitix-EPI May 12, 2023
d1e4980
fix date to data la con de tes morts
Mitix-EPI May 12, 2023
b2e5126
fix context socket.on
Mitix-EPI May 12, 2023
32987e7
fix(): remove useless logs
Mitix-EPI May 12, 2023
2243f09
fix(compressor): change name request
Mitix-EPI May 20, 2023
6853e62
Update build.yml
Mitix-EPI May 20, 2023
5e3da20
Try to fix apt-key deprecation
Mitix-EPI May 20, 2023
f2331e8
Install wine latest method
Mitix-EPI May 20, 2023
5bdf0ec
Change distrib WineHQ
Mitix-EPI May 20, 2023
b795e91
Remove install winehq-stable to let winehq-devel
Mitix-EPI May 20, 2023
8afc151
remove emulator
Mitix-EPI May 20, 2023
55ee3ac
J'en peux plus
Mitix-EPI May 20, 2023
d053e84
Following tutorial
Mitix-EPI May 20, 2023
21220e7
Following another tutorial
Mitix-EPI May 20, 2023
cd5cfbf
Ubuntu22 + install wine-stable-i286
Mitix-EPI May 20, 2023
dae72bd
Install ubuntu-desktop missing dependencies
Mitix-EPI May 20, 2023
e61fb14
Downgrade to ubuntu20
Mitix-EPI May 20, 2023
1516b6f
remove failed download
Mitix-EPI May 20, 2023
6e1d6ec
no idea
Mitix-EPI May 20, 2023
a8f6180
Custom old version
Mitix-EPI May 20, 2023
a778608
focal instead of bionic
Mitix-EPI May 20, 2023
1ec29cf
J'ai perdu foi en l'humanité
Mitix-EPI May 20, 2023
76a00b3
test Old deprecated version
Mitix-EPI May 20, 2023
1cef7f2
je test puis après je vais manger
Mitix-EPI May 20, 2023
270467e
install upgrade
Mitix-EPI May 20, 2023
f422cd5
fix write
Mitix-EPI May 20, 2023
8cb09ed
blop
Mitix-EPI May 20, 2023
2b22273
sudo apt-get dist-upgrade
Mitix-EPI May 20, 2023
57992d4
blop
Mitix-EPI May 20, 2023
2500aba
sudooooo
Mitix-EPI May 20, 2023
14f971b
opensuse
Mitix-EPI May 20, 2023
862a8bc
old opensuse
Mitix-EPI May 20, 2023
a3ea37e
New tutorial
Mitix-EPI May 20, 2023
ba362ff
test version docket electron-builder
Mitix-EPI May 20, 2023
eb5a635
upgrade xUbuntu_20.04
Mitix-EPI May 20, 2023
ae86e57
try another wine stable
Mitix-EPI May 20, 2023
979611b
try to fix dependencies
Mitix-EPI May 20, 2023
a7799c3
add -y flags
Mitix-EPI May 20, 2023
3a64d62
final test
Mitix-EPI May 20, 2023
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
43 changes: 33 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,46 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: 16
- name: Install windows dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends software-properties-common

sudo dpkg --add-architecture i386
sudo apt update
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo apt install software-properties-common
sudo apt-add-repository 'deb http://dl.winehq.org/wine-builds/ubuntu/ bionic main'
wget -qO- https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -
sudo sh -c 'echo "deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./" > /etc/apt/sources.list.d/obs.list'
sudo apt update
sudo apt-get install -y --install-recommends winehq-devel

curl -L https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04/Release.key > winehq.key
sudo apt-key add winehq.key

sudo apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04/ ./'
sudo apt-get update -y

sudo apt-get -y purge software-properties-common libdbus-glib-1-2 python3-dbus python3-gi python3-pycurl python3-software-properties

sudo apt-get install aptitude
sudo aptitude install -y libglib2.0-0:i386
sudo aptitude install -y libgphoto2-6:i386
sudo aptitude install -y libgstreamer-plugins-base1.0-0:i386
sudo aptitude install -y libgstreamer1.0-0:i386
sudo aptitude install -y libsane:i386
sudo aptitude install -y libodbc1:i386

sudo rm -rvf /var/lib/apt/lists/*
sudo apt-get install -f
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

sudo apt-get install -y wine-stable-i386

sudo apt-get install -y --no-install-recommends winehq-stable

wine --version
sudo apt-get install -y fakeroot
- name: Install mono
run: |
Expand All @@ -39,4 +62,4 @@ jobs:
- name: build
run: yarn run dist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113 changes: 61 additions & 52 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ console.log("notRelease", notRelease)
let loadingScreen;
let mainWindow;
let tcpConn;
let boadcastConn;

const createWindow = () => {
// Create the browser window.
Expand Down Expand Up @@ -150,7 +151,7 @@ ipcMain.on("getActReactCouples", (event, arg) => {
}
});

ipcMain.on("setMicLevel", (event, arg) => {
ipcMain.on("setCompressorLevel", (event, arg) => {
if (isDev) {
let res = {
message: "OK",
Expand Down Expand Up @@ -203,22 +204,6 @@ ipcMain.on("setActionReaction", (event, arg) => {
}
});

ipcMain.on("setAutoAudioLeveler", (event, arg) => {
if (isDev) {
let res = {
message: "OK",
statusCode: 200,
};
event.returnValue = res;
return res;
} else {
return tcpConn.setAutoAudioLeveler(arg).then((res) => {
console.log("setAutoAudioLeveler : " + res);
event.returnValue = res;
});
}
});

ipcMain.on("removeActReact", (event, arg) => {
if (isDev) {
console.log("removeActReact")
Expand All @@ -239,15 +224,22 @@ ipcMain.on("removeActReact", (event, arg) => {
}
});

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

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

ipcMain.on("connection-server-lost", (evt, arg) => {
// Quit main app
if (mainWindow)
mainWindow.close();
tcpConn = null;
boadcastConn = null;

// Load Loading page
if (loadingScreen)
loadingScreen.close()
createLoadingScreen()
});

Expand All @@ -258,19 +250,33 @@ ipcMain.on("close-me", (evt, arg) => {
const createLoadingScreen = () => {

tcpConn = new TCPConnection("localhost", 47920, ipcMain);
boadcastConn = new TCPConnection("localhost", 47920, ipcMain)
// Try to connect every 5 seconds
let refreshIntervalId = setInterval(() => {

tcpConn
.connect()
.then((res) => {
console.log("TCPConnection is connected");
launchingApplication();
console.log("res", res);
clearInterval(refreshIntervalId);
return res;
})
.catch((err) => {
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");
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");
clearInterval(refreshIntervalId);
Expand All @@ -281,33 +287,35 @@ const createLoadingScreen = () => {
}
});

}, 5000);

/// create a browser window
loadingScreen = new BrowserWindow(
Object.assign({
/// define width and height for the window
width: 440,
height: 260,
title: "EasyStream",
icon: __dirname + '/icon.png',
/// remove the window frame, so it will become a frameless window
frame: false,
/// and set the transparency, to remove any window background color
transparent: true,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: isDev,
contextIsolation: false,
},
}),
);
loadingScreen.setResizable(false);
loadingScreen.loadURL(`file://${path.join(__dirname, "./loading.html")}`);
loadingScreen.on("closed", () => (loadingScreen = null));
loadingScreen.webContents.on("did-finish-load", () => {
loadingScreen.show();
});
}, 3000);

if (!loadingScreen) {
/// create a browser window
loadingScreen = new BrowserWindow(
Object.assign({
/// define width and height for the window
width: 440,
height: 260,
title: "EasyStream",
icon: __dirname + '/icon.png',
/// remove the window frame, so it will become a frameless window
frame: false,
/// and set the transparency, to remove any window background color
transparent: true,
webPreferences: {
nodeIntegration: true,
enableRemoteModule: isDev,
contextIsolation: false,
},
}),
);
loadingScreen.setResizable(false);
loadingScreen.loadURL(`file://${path.join(__dirname, "./loading.html")}`);
loadingScreen.on("closed", () => (loadingScreen = null));
loadingScreen.webContents.on("did-finish-load", () => {
loadingScreen.show();
});
}
};

const launchingApplication = () => {
Expand Down Expand Up @@ -375,6 +383,7 @@ app.on("window-all-closed", () => {

app.on("before-quit", () => {
tcpConn.disconnectSocket();
boadcastConn.disconnectSocket();
});

// In this file you can include the rest of your app's specific main process
Expand Down
25 changes: 12 additions & 13 deletions src/Components/CompressorLevel/CompressorLevel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,39 @@ export const CompressorLevel = () => {
const setVolumeToCompressor = (mic: Mic): Promise<resultFormat> => {
return new Promise(async (resolve, reject) => {
const result: resultFormat = await ipcRenderer.sendSync(
"setMicLevel",
"setCompressorLevel",
mic
);
console.log("setVolumeToCompressor invoke", result);
resolve(result);
});
};

const getData = (index: number, value: number) => {
const setCompressorValue = (index: number, value: number) => {
let copy = exampleCompressorArray.slice();
copy[index].level = value;
console.log("Value", copy[index]);
setExampleCompressorArray(copy);

// Update to server
clearTimeout(timeoutCommit);
timeoutCommit = setTimeout(() => {
setVolumeToCompressor(copy[index]);
}, 3000);
setVolumeToCompressor(copy[index]);
};

const setActive = (index: number, value: boolean) => {
let copy = exampleCompressorArray.slice();
copy[index].isActive = value;
setExampleCompressorArray(copy);

// Update to server
clearTimeout(timeoutCommit);
timeoutCommit = setTimeout(() => {
setVolumeToCompressor(copy[index]);
}, 3000);
setVolumeToCompressor(copy[index]);
};

useEffect(() => {
ipcRenderer.on('compressor-level-updated', (evt: any, message: any) => {
getAllCompressors().then((res) => {
if (res.statusCode === 200) {
setExampleCompressorArray(res.data.mics);
}
});
})
async function sleep(): Promise<boolean> {
return new Promise((resolve) => {
getAllCompressors().then((res) => {
Expand Down Expand Up @@ -145,7 +144,7 @@ export const CompressorLevel = () => {
isActive={item.isActive}
name={item.micName}
value={item.level}
sendData={(val: number) => getData(index, val)}
sendData={(val: number) => setCompressorValue(index, val)}
sendActive={(val: boolean) => setActive(index, val)}
/>
);
Expand Down
Loading