mirror of
https://github.com/DevL0rd/SkyNX
synced 2025-02-16 17:28:23 +00:00
Auto isntall drivers at first start. fixed quality label
This commit is contained in:
parent
7016e1593d
commit
419ba04b26
7 changed files with 53 additions and 24 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,3 +11,4 @@ SkyNX-Streamer/SkyNXStreamer-win32-x64
|
|||
SkyNX-Streamer/SkyNXStreamer-win32-x64.zip
|
||||
SkyNX/source
|
||||
SkyNX/SkyNX.zip
|
||||
SkyNX-Streamer/settings.json
|
||||
|
|
Binary file not shown.
4
SkyNX-Streamer/NxStreamingService/testAudio.bat
Normal file
4
SkyNX-Streamer/NxStreamingService/testAudio.bat
Normal file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
cd lib
|
||||
ffmpeg.exe -y -f dshow -i audio=virtual-audio-capturer -af equalizer=f=100:t=h:width=200:g=-64 -f s16le -ar 16000 -ac 2 -c:a pcm_s16le outTest.mp3
|
||||
pause
|
|
@ -36,7 +36,7 @@
|
|||
<input id="ipInput" type="text" class="form-control" placeholder="Switch IP">
|
||||
</div>
|
||||
<form class="form-group">
|
||||
<label id="qualityLabel" for="qualitySlider">Quality: 5M</label>
|
||||
<label id="qualityLabel" for="qualitySlider">Quality: 5Mbps</label>
|
||||
<input id="qualitySlider" type="range" class="custom-range" min="1" max="80" value="5" />
|
||||
</form>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ $('#startBtn').click(function () {
|
|||
});
|
||||
var qualityChangeTimeout;
|
||||
$(document).on('input', '#qualitySlider', function () {
|
||||
$('#qualityLabel').html("Quality: " + $(this).val() + "M");
|
||||
$('#qualityLabel').html("Quality: " + $(this).val() + "Mbps");
|
||||
clientSettings.quality = $(this).val();
|
||||
saveClientSettings();
|
||||
if (running) {
|
||||
|
|
|
@ -1,23 +1,11 @@
|
|||
|
||||
var debug = true;
|
||||
var clientSettings = {
|
||||
"debug": false,
|
||||
"accentColor": {
|
||||
"r": 50,
|
||||
"g": 50,
|
||||
"b": 50,
|
||||
"a": 0.9
|
||||
},
|
||||
"rainbowEnabled": true,
|
||||
"devToolsOnStartup": false,
|
||||
"ip": "172.16.0.10",
|
||||
"quality": 5
|
||||
};
|
||||
var clientSettings = {};
|
||||
var clientSettingsPath = "./settings.json";
|
||||
if (fs.existsSync(clientSettingsPath)) {
|
||||
loadClientSettings();
|
||||
} else {
|
||||
DB.save(clientSettingsPath, clientSettings)
|
||||
DB.save(clientSettingsPath, {}); //init file
|
||||
}
|
||||
var saveSettingsTO
|
||||
function saveClientSettingsTimeout() {
|
||||
|
@ -33,19 +21,46 @@ function verifySettings() {
|
|||
}
|
||||
function loadClientSettings() {
|
||||
clientSettings = DB.load(clientSettingsPath)
|
||||
if (clientSettings.debug == undefined) {
|
||||
clientSettings.debug = false;
|
||||
}
|
||||
if (clientSettings.accentColor == undefined) {
|
||||
clientSettings.accentColor = {
|
||||
"r": 50,
|
||||
"g": 50,
|
||||
"b": 50,
|
||||
"a": 0.9
|
||||
};
|
||||
}
|
||||
if (clientSettings.rainbowEnabled == undefined) {
|
||||
clientSettings.rainbowEnabled = true;
|
||||
}
|
||||
if (clientSettings.devToolsOnStartup == undefined) {
|
||||
clientSettings.devToolsOnStartup = false;
|
||||
}
|
||||
if (clientSettings.devToolsOnStartup == undefined) {
|
||||
clientSettings.devToolsOnStartup = false;
|
||||
}
|
||||
if (clientSettings.ip == undefined) {
|
||||
clientSettings.ip = "0.0.0.0";
|
||||
}
|
||||
if (clientSettings.quality == undefined) {
|
||||
clientSettings.quality = 5;
|
||||
}
|
||||
if (clientSettings.firstInstall == undefined) {
|
||||
clientSettings.firstInstall = false;
|
||||
}
|
||||
|
||||
applyClientSettings();
|
||||
}
|
||||
|
||||
function applyClientSettings() {
|
||||
$("#debugEnabled").prop("checked", clientSettings.debug);
|
||||
$("#rainbowEnabled").prop("checked", clientSettings.rainbowEnabled);
|
||||
$("#devToolsOnStartup").prop("checked", clientSettings.devToolsOnStartup);
|
||||
$("#qualitySlider").val(clientSettings.quality);
|
||||
$('#qualityLabel').html("Quality: " + clientSettings.quality + "M");
|
||||
$("#ipInput").val(clientSettings.ip);
|
||||
applyClientSettings();
|
||||
if (clientSettings.devToolsOnStartup) {
|
||||
openDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
function applyClientSettings() {
|
||||
if (clientSettings.debug) {
|
||||
$("#dev-btn").fadeIn(400);
|
||||
$("#rld-btn").fadeIn(400);
|
||||
|
@ -58,6 +73,15 @@ function applyClientSettings() {
|
|||
} else {
|
||||
setAccentColor(clientSettings.accentColor.r, clientSettings.accentColor.g, clientSettings.accentColor.b, clientSettings.accentColor.a);
|
||||
}
|
||||
if (clientSettings.devToolsOnStartup) {
|
||||
openDevTools();
|
||||
}
|
||||
if (!clientSettings.firstInstall) {
|
||||
ipcRenderer.send('installScpVBus');
|
||||
ipcRenderer.send('installAudioDriver');
|
||||
clientSettings.firstInstall = true;
|
||||
saveClientSettings();
|
||||
}
|
||||
}
|
||||
$("#rainbowEnabled").on('change', function () {
|
||||
clientSettings.rainbowEnabled = $("#rainbowEnabled").prop("checked");
|
||||
|
|
|
@ -115,7 +115,7 @@ ipcMain.on('installScpVBus', (event, arg) => {
|
|||
if (error) {
|
||||
console.log("driver install error: " + error);
|
||||
} else {
|
||||
console.log("Driver install success!");
|
||||
console.log("Driver installed!");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue