-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from jlw4049/electron
Rebuilt the app from the ground up with electron
- Loading branch information
Showing
54 changed files
with
8,814 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
# HDR10Plus-Tool-Gui | ||
|
||
![](hdr-multi-tool-gui.v1.3.png) | ||
![image](https://github.com/jlw4049/HDR-Multi-Tool-Gui/assets/48299282/6f8920d0-64c2-408c-bc1f-0decb6783a45) | ||
|
||
A basic GUI to parse MKV, TS, MP4, and HEVC HDR10/10+ and Dolby Vision dynamic metadata for use with video encoding | ||
A modern GUI to parse HDR10+ and Dolby Vision dynamic metadata for use with video encoding. | ||
|
||
Program only supports the above formats for now, I will add support for more if I come across any. | ||
Supports **MKV, TS, MP4, and HEVC** as inputs right now. Please open an issue if there is any inputs that are not accepted that should be. | ||
|
||
Feel free to put an issue on the tracker here if the program should but doesn't support an input extension type | ||
Supports drag and drop in the input area. | ||
|
||
In the menu at the top, you can select 'Automatic' or 'Debug': | ||
If you open a file that has both HDR10+ and Dolby Vision you will see dual option panels. Choose which you would | ||
like to extract and configure the settings. Everything else is handled for you. | ||
|
||
'Progress Bars' spawns new windows with progress bars and a read out | ||
At the moment the only configurable options there is under options is to automatically start the job queue upon | ||
adding a job. | ||
|
||
'CMD Shell (Debug)' will spawn a CMD shell and leave it open in order to read errors in the event you have one | ||
#### Supported Operating Systems | ||
|
||
As of **v2.0** the app only **officially** supports **Windows** operating systems. I plan to add support for mac/linux in coming updates when I have time to test the configuration fully. | ||
|
||
#### Note | ||
|
||
As of **v2.0** the tkinter version of the app has been dropped. I have no plans to update/maintain that version of the app. However, I will leave it on the repository in the "tkinter" folder. |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const path = require("path"); | ||
const { app } = require("electron"); | ||
|
||
let rootDir; | ||
|
||
// determine root directory (where main.js would be) | ||
if (app.isPackaged) { | ||
// bundled app | ||
rootDir = path.dirname(process.execPath); | ||
} else { | ||
// development | ||
rootDir = path.resolve(__dirname, "../../"); | ||
} | ||
|
||
module.exports = rootDir; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const electronStore = require("electron-store"); | ||
const path = require("path"); | ||
const baseDirectory = require("../../app/main/baseDirectory"); | ||
|
||
// set config default options | ||
const defaultOptions = { | ||
autoStart: false, | ||
}; | ||
|
||
// Define a function that initializes and returns the store instance | ||
function createConfigStore() { | ||
return new electronStore({ | ||
cwd: path.resolve(baseDirectory, "app_config"), | ||
defaults: defaultOptions, | ||
}); | ||
} | ||
|
||
module.exports = createConfigStore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const path = require("path"); | ||
const fs = require("fs").promises; | ||
const { dialog } = require("electron"); | ||
const baseDirectory = require("../../app/main/baseDirectory"); | ||
|
||
async function createLogDir() { | ||
const logDirectory = path.join(baseDirectory, "logs"); | ||
|
||
try { | ||
await fs.mkdir(logDirectory, { recursive: true }); | ||
return logDirectory; | ||
} catch (error) { | ||
if (error.code === "EEXIST") { | ||
return logDirectory; | ||
} else { | ||
// Only show an error dialog for unexpected errors | ||
if (error.code !== "ENOENT") { | ||
dialog.showErrorBox( | ||
"Error Creating Directory", | ||
`Error creating directory: ${error.message}` | ||
); | ||
} | ||
return null; | ||
} | ||
} | ||
} | ||
|
||
module.exports = createLogDir; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
const { app, Menu } = require("electron"); | ||
const { | ||
showOpenDialog, | ||
} = require("../../app/main/ipc_handlers/ipcFileHandlers"); | ||
const createConfigStore = require("../../app/main/configUtils.js"); | ||
|
||
async function updateAutoStart(store, toggle) { | ||
store.set("autoStart", toggle); | ||
} | ||
|
||
module.exports = (root) => { | ||
const store = createConfigStore(); | ||
|
||
const template = [ | ||
{ | ||
label: "File", | ||
submenu: [ | ||
{ | ||
label: "Open", | ||
accelerator: "CmdOrCtrl+O", | ||
click: async () => { | ||
const fileInput = await showOpenDialog(root); | ||
root.webContents.send("return-open-dialog", fileInput.filePaths); | ||
}, | ||
}, | ||
{ | ||
type: "separator", | ||
}, | ||
{ | ||
label: "Quit", | ||
accelerator: "CmdOrCtrl+Q", | ||
click: () => { | ||
app.quit(); | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Options", | ||
submenu: [ | ||
{ | ||
label: "Auto Start Queue", | ||
submenu: [ | ||
{ | ||
label: "On", | ||
type: "radio", | ||
checked: store.get("autoStart") ? true : false, | ||
click: async () => { | ||
await updateAutoStart(store, true); | ||
}, | ||
}, | ||
{ | ||
label: "Off", | ||
type: "radio", | ||
checked: store.get("autoStart") ? false : true, | ||
click: async () => { | ||
await updateAutoStart(store, false); | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Help", | ||
submenu: [ | ||
{ | ||
label: "About", | ||
click: async () => { | ||
root.webContents.send("open-about"); | ||
}, | ||
}, | ||
], | ||
}, | ||
// Add more menu items and submenus as needed | ||
]; | ||
|
||
const menu = Menu.buildFromTemplate(template); | ||
Menu.setApplicationMenu(menu); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const fs = require("fs"); | ||
const which = require("which"); | ||
const curPlatform = require("os").platform(); | ||
const path = require("path"); | ||
|
||
// tool paths (attempt to detect on PATH) | ||
let doviToolPath = { | ||
name: "dovi_tool", | ||
path: which.sync("dovi_tool", { nothrow: true }), | ||
}; | ||
let hdrToolPath = { | ||
name: "hdr10plus_tool", | ||
path: which.sync("hdr10plus", { nothrow: true }), | ||
}; | ||
let ffmpegToolPath = { | ||
name: "FFMPEG", | ||
path: which.sync("ffmpeg", { nothrow: true }), | ||
}; | ||
|
||
if (curPlatform === "win32") { | ||
if (!doviToolPath.path) { | ||
doviToolPath.path = path.resolve("apps/dovi_tool.exe"); | ||
} | ||
if (!hdrToolPath.path) { | ||
hdrToolPath.path = path.resolve("apps/hdr10plus_tool.exe"); | ||
} | ||
if (!ffmpegToolPath.path) { | ||
ffmpegToolPath.path = path.resolve("apps/ffmpeg.exe"); | ||
} | ||
} else { | ||
if (!doviToolPath.path) { | ||
doviToolPath.path = path.resolve("apps/dovi_tool"); | ||
} | ||
if (!hdrToolPath.path) { | ||
hdrToolPath.path = path.resolve("apps/hdr10plus_tool"); | ||
} | ||
if (!ffmpegToolPath.path) { | ||
ffmpegToolPath.path = path.resolve("apps/ffmpeg"); | ||
} | ||
} | ||
|
||
const toolPathObject = { | ||
doviToolPath: doviToolPath.path, | ||
hdrToolPath: hdrToolPath.path, | ||
ffmpegToolPath: ffmpegToolPath.path, | ||
}; | ||
|
||
async function checkDependencies() { | ||
for (const toolPath of [doviToolPath, hdrToolPath, ffmpegToolPath]) { | ||
const detectFile = fs.existsSync(toolPath.path); | ||
if (!detectFile) { | ||
const fileName = toolPath.name; | ||
return { | ||
success: false, | ||
message: `"${fileName}" is not detected.\n\nWe will be unable to process files without having "${fileName}" installed.\n\nInstall "${fileName}" on your system path or in the "apps" folder and relaunch`, | ||
}; | ||
} | ||
} | ||
return { success: true }; | ||
} | ||
|
||
module.exports = { checkDependencies, toolPathObject }; |
Oops, something went wrong.