|
|
|
|
@ -27,6 +27,7 @@ const EmojiType={ |
|
|
|
|
chat_end: '🤖', |
|
|
|
|
user_input: '💬', |
|
|
|
|
announce: '📢', |
|
|
|
|
debug: '🐞', |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const ChatStatus={ |
|
|
|
|
@ -145,6 +146,9 @@ export function FreeFlow(){ |
|
|
|
|
onStop(); |
|
|
|
|
resetData(); |
|
|
|
|
break; |
|
|
|
|
case OSC_ADDRESS.TEST_EXPORT: |
|
|
|
|
exportFile(true); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Handle OSC messages here |
|
|
|
|
@ -475,7 +479,7 @@ export function FreeFlow(){ |
|
|
|
|
switch(cue.callback){ |
|
|
|
|
case 'exportFile': |
|
|
|
|
sendOsc(OSC_ADDRESS.HINT,''); |
|
|
|
|
exportFile(); |
|
|
|
|
exportFile(cue.type=='debug'); |
|
|
|
|
break; |
|
|
|
|
// case 'fadeout': |
|
|
|
|
// fadeOutAudio(); |
|
|
|
|
@ -599,11 +603,20 @@ export function FreeFlow(){ |
|
|
|
|
setPadInput(()=>mess); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function exportFile(){ |
|
|
|
|
function exportFile(isTest=false){ |
|
|
|
|
const user_input = history.find(msg => msg.role === 'user' && msg.content!='...'); |
|
|
|
|
const default_image=!(user_input && user_input.content.trim() !== ''); |
|
|
|
|
|
|
|
|
|
sendOsc(OSC_ADDRESS.EXPORT, `${getUploadFolder()}#${getDataId()}#${summary||''}#${getFileId(padInput)}#${choice||''}#${default_image?'default':'generated'}`); // Send OSC export message |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
if(isTest) { |
|
|
|
|
sendOsc(OSC_ADDRESS.EXPORT, `${getUploadFolder()}#${getDataId()}#${summary||''}#${getFileId(padInput)}#${choice||''}#generated`); // Send OSC export message |
|
|
|
|
}else{ |
|
|
|
|
sendOsc(OSC_ADDRESS.EXPORT, `${getUploadFolder()}#${getDataId()}#${summary||''}#${getFileId(padInput)}#${choice||''}#${default_image?'default':'generated'}`); // Send OSC export message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, Math.random()*5000+500); // random delay between 0.5s to 5.5s |
|
|
|
|
|
|
|
|
|
writeSheet(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -656,6 +669,9 @@ export function FreeFlow(){ |
|
|
|
|
onStop(); |
|
|
|
|
resetData(); |
|
|
|
|
break; |
|
|
|
|
case OSC_ADDRESS.TEST_EXPORT: |
|
|
|
|
exportFile(true); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
},[lastOsc]); |
|
|
|
|
|