mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Fixed the change speaker feature. every step till the point where its send to the main functions now
This commit is contained in:
@@ -129,7 +129,6 @@
|
|||||||
<div class="speakerView" id="speakerView">
|
<div class="speakerView" id="speakerView">
|
||||||
<label id="labelSpeaker">Select Speaker:</label>
|
<label id="labelSpeaker">Select Speaker:</label>
|
||||||
<select name="cur_speaker" id="cur_speaker">
|
<select name="cur_speaker" id="cur_speaker">
|
||||||
<options>Stefan</options>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="speakerAudio" id="speakerAutio">
|
<div class="speakerAudio" id="speakerAutio">
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ try {
|
|||||||
speakerAudios: (callback) => ipcRenderer.on('speakerAudios', callback)
|
speakerAudios: (callback) => ipcRenderer.on('speakerAudios', callback)
|
||||||
})
|
})
|
||||||
contextBridge.exposeInMainWorld("submitSpeaker", {
|
contextBridge.exposeInMainWorld("submitSpeaker", {
|
||||||
submitSpeaker: (speaker_names) => {ipcRenderer.send("speaker_submit", speaker_names)}
|
speaker_submit: (speaker_names) => {ipcRenderer.send("speaker_submit", speaker_names)}
|
||||||
})
|
})
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld("download", {
|
contextBridge.exposeInMainWorld("download", {
|
||||||
|
|||||||
@@ -176,8 +176,8 @@ cur_speaker.addEventListener("change", (e) =>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
window.audios.speakerAudios((event, arg) => {
|
window.audios.speakerAudios((event, arg) => {
|
||||||
loadSpeakerOptions(arg);
|
loadSpeakerOptions(arg);
|
||||||
setSpeakerAudiosValue(arg);
|
setSpeakerAudiosValue(arg);
|
||||||
});
|
});
|
||||||
|
|
||||||
window.electron.progress((event, arg) => {
|
window.electron.progress((event, arg) => {
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ function loadLanguageOptions(){
|
|||||||
function loadSpeakerOptions(options){
|
function loadSpeakerOptions(options){
|
||||||
try {
|
try {
|
||||||
var menu = document.getElementById('cur_speaker');
|
var menu = document.getElementById('cur_speaker');
|
||||||
var l = document.getElementById("cur_speaker").options.length -1;
|
var l = document.getElementById('cur_speaker').options.length -1;
|
||||||
for(i = l; i >= 0; i--){
|
for(i = l; i >= 0; i--){
|
||||||
menu.remove(i);
|
menu.remove(i);
|
||||||
}
|
}
|
||||||
@@ -222,9 +222,10 @@ function loadSpeakerOptions(options){
|
|||||||
for(i = 0; i < object_holdy.length; i++){
|
for(i = 0; i < object_holdy.length; i++){
|
||||||
choice = document.createElement('option');
|
choice = document.createElement('option');
|
||||||
choice.textContent = options[object_holdy[i]].name;
|
choice.textContent = options[object_holdy[i]].name;
|
||||||
choice.value = options[object_holdy[i]].name;
|
choice.value = object_holdy[i];
|
||||||
menu.appendChild(choice);
|
menu.appendChild(choice);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in script.js loadSpeakerOptions function");
|
console.log("Error in script.js loadSpeakerOptions function");
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -316,15 +317,15 @@ function rewriteSpeakerName(){
|
|||||||
try {
|
try {
|
||||||
var tempy = document.getElementById("cur_speaker").value;
|
var tempy = document.getElementById("cur_speaker").value;
|
||||||
speakerAudios[tempy].name = document.getElementById("newSpeaker").value;
|
speakerAudios[tempy].name = document.getElementById("newSpeaker").value;
|
||||||
setSpeakerAudiosValue(speakerAudios);
|
loadSpeakerOptions(speakerAudios);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("\n\n\n" + error + "\n\n\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendSpeakerPackages(){
|
function sendSpeakerPackages(){
|
||||||
try {
|
try {
|
||||||
window.sendSpeakerPackages(speakerAudios);
|
window.submitSpeaker.speaker_submit(speakerAudios);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,8 +209,7 @@ electron.ipcMain.on("file_submit", async (event, args) => {
|
|||||||
|
|
||||||
|
|
||||||
await mapFunctions.get("extract-speaker-snippets").function({audioPath: audiopath, jsonPath: transcriptpath }).then(resp => {
|
await mapFunctions.get("extract-speaker-snippets").function({audioPath: audiopath, jsonPath: transcriptpath }).then(resp => {
|
||||||
mainWindow.webContents.send("submitSpeaker", resp)
|
mainWindow.webContents.send("speakerAudios", resp)
|
||||||
console.log(resp)
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
mainWindow.webContents.send("error", err)
|
mainWindow.webContents.send("error", err)
|
||||||
return
|
return
|
||||||
@@ -224,6 +223,9 @@ electron.ipcMain.on("file_download", async() => {
|
|||||||
await mapFunctions.get("htmlDocumentConverter").convert({inputPath:globalFinalHtmlPath, format: globalArgs.document.outputType, showDialog: true});
|
await mapFunctions.get("htmlDocumentConverter").convert({inputPath:globalFinalHtmlPath, format: globalArgs.document.outputType, showDialog: true});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
electron.ipcMain.on("speaker_submit", async() => {
|
||||||
|
console.log("\n\n\nJa also hier kam was an \n\n\n");
|
||||||
|
})
|
||||||
|
|
||||||
let q =
|
let q =
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user