diff --git a/src/main/factories/ipcs/pipeline.ts b/src/main/factories/ipcs/pipeline.ts
index e39811e..bfe64fe 100644
--- a/src/main/factories/ipcs/pipeline.ts
+++ b/src/main/factories/ipcs/pipeline.ts
@@ -1,5 +1,5 @@
import { app, ipcMain, dialog } from 'electron'
-import { resolve, delimiter, relative } from 'path'
+import path, { resolve, delimiter, relative } from 'path'
import {
Webservice,
PipelineStatus,
@@ -26,6 +26,7 @@ import {
setStatus,
useWebservice,
} from 'shared/data/slices/pipeline'
+import fs from 'fs-extra'
/**
* Local DAISY Pipeline 2 management class
@@ -365,7 +366,6 @@ Then close the program using the port and restart this application.`,
'-Dorg.daisy.pipeline.ws.port=' + this.props.webservice.port
)
}
-
if (
!existsSync(this.props.appDataFolder) &&
mkdirSync(this.props.appDataFolder, { recursive: true })
@@ -387,6 +387,33 @@ Then close the program using the port and restart this application.`,
`Using existing ${this.props.logsFolder} for pipeline logs`
)
}
+ // this file would contain TTS settings to pass to the pipeline on startup
+ // e.g. it could contain credentials for cloud-based TTS engines, without which the voices
+ // for that engine wouldn't be listed as available to the user
+ // additional TTS settings are passed in with jobs (e.g. voice selection but currently not engine properties)
+ let ttsEnginePropertiesFilepath = path.join(
+ this.props.appDataFolder,
+ 'tts-engine-properties.json'
+ )
+ // if this TTS config file exists, then add its properties to SystemProps
+ if (existsSync(ttsEnginePropertiesFilepath)) {
+ try {
+ let f = fs.readFileSync(ttsEnginePropertiesFilepath)
+ let ttsEngineProperties = JSON.parse(f.toString())
+ // @ts-ignore
+ ttsEngineProperties.map((property) =>
+ SystemProps.push(`-D${property.key}=${property.value}`)
+ )
+ } catch (err) {
+ this.pushMessage(
+ `Could not set TTS engine properties on startup from file ${ttsEnginePropertiesFilepath}`
+ )
+ }
+ } else {
+ this.pushMessage(
+ `File not found for additional TTS engine properties (checking default location: ${ttsEnginePropertiesFilepath})`
+ )
+ }
// avoid using bat to control the runner ?
// Spawn pipeline process
let command = resolve(this.props.jrePath, 'bin', 'java')
diff --git a/src/renderer/components/JobDetailsPane/Results.tsx b/src/renderer/components/JobDetailsPane/Results.tsx
index dc6e715..2ba2a95 100644
--- a/src/renderer/components/JobDetailsPane/Results.tsx
+++ b/src/renderer/components/JobDetailsPane/Results.tsx
@@ -1,5 +1,8 @@
import { Job } from 'shared/types'
import { FileLink } from '../FileLink'
+import remarkGfm from 'remark-gfm'
+import { externalLinkClick } from 'renderer/utils'
+import Markdown from 'react-markdown'
export function Results({ job }: { job: Job }) {
return (
@@ -9,7 +12,28 @@ export function Results({ job }: { job: Job }) {
No voices found{' '} - {searchString != '' ? ( + {searchString != '' || enginesChecked.length == 0 ? ( > )} ++ {preferredVoices.length} selected:{' '} + {preferredVoices.map((v) => v.name).join(', ')} + > ) } diff --git a/src/renderer/style/settings.scss b/src/renderer/style/settings.scss index f993bdd..949ca08 100644 --- a/src/renderer/style/settings.scss +++ b/src/renderer/style/settings.scss @@ -79,6 +79,9 @@ $engineColWidth: 8rem; justify-self: flex-end; } +.fields:has(.tts-config) { + gap: 0; +} .tts-config { display: flex; flex-direction: column; @@ -115,19 +118,32 @@ $engineColWidth: 8rem; border-radius: 10px; } #voice-table-controls { - display: flex; - flex-direction: row; + // display: flex; + // flex-direction: row; gap: var(--pad); align-items: center; input { width: 80%; } + + .includeEngines, .includeEngines ul, .includeEngines li { + display: flex; + flex-direction: row; + align-items: center; + border: none; + + label { + font-weight: normal; + width: min-content; + white-space: nowrap; + } + } } /* the table scrolling container */ div[role="region"][aria-labelledby][tabindex] { overflow: auto; - max-height: $fieldHeight - 15vh; + max-height: $fieldHeight - 28vh; } table { @@ -172,6 +188,11 @@ $engineColWidth: 8rem; content: '▼'; } } + + .selection-summary { + font-size: smaller; + font-style: italic; + } } pre { diff --git a/src/renderer/style/style.scss b/src/renderer/style/style.scss index 741c87d..f86371c 100644 --- a/src/renderer/style/style.scss +++ b/src/renderer/style/style.scss @@ -70,6 +70,11 @@ select { .description { font-style: italic; font-size: smaller; + + // the markdown descriptions coming from the scripts can use paragraph tags, this lines them up at the top + p:first-child { + margin-top: 0 !important; + } } .filelink { color: var(--fg); diff --git a/src/shared/data/slices/pipeline.ts b/src/shared/data/slices/pipeline.ts index 18b739a..62a21b4 100644 --- a/src/shared/data/slices/pipeline.ts +++ b/src/shared/data/slices/pipeline.ts @@ -14,6 +14,7 @@ import { Datatype, JobStatus, Alive, + Voice, } from 'shared/types' import { RootState } from 'shared/types/store' |
---|