Added full support for many apps!
This commit is contained in:
parent
ff1b66e740
commit
87ee26e8ed
15 changed files with 612 additions and 65 deletions
|
@ -3,7 +3,7 @@ n
|
||||||
}
|
}
|
||||||
|
|
||||||
PORTFOLIO_LINK:{
|
PORTFOLIO_LINK:{
|
||||||
HAHA NOT REAL LINK
|
djkato.net
|
||||||
}
|
}
|
||||||
|
|
||||||
EXCLUDE_CHARACTERS_LIST:{
|
EXCLUDE_CHARACTERS_LIST:{
|
||||||
|
|
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -7,6 +7,7 @@ name = "DRP_Creative"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"discord-rich-presence",
|
"discord-rich-presence",
|
||||||
|
"lazy_static",
|
||||||
"regex",
|
"regex",
|
||||||
"tray-item",
|
"tray-item",
|
||||||
"windows",
|
"windows",
|
||||||
|
@ -509,6 +510,12 @@ version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
|
checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lazy_static"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libappindicator"
|
name = "libappindicator"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
|
|
|
@ -10,6 +10,7 @@ author = "https://djkato.net"
|
||||||
discord-rich-presence = "0.2.2"
|
discord-rich-presence = "0.2.2"
|
||||||
regex = "1.6.0"
|
regex = "1.6.0"
|
||||||
tray-item = "0.7.0"
|
tray-item = "0.7.0"
|
||||||
|
lazy_static = "1.4.0"
|
||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.39.0"
|
version = "0.39.0"
|
||||||
|
@ -20,5 +21,6 @@ features = [
|
||||||
"Win32_System_Threading",
|
"Win32_System_Threading",
|
||||||
"Win32_UI_WindowsAndMessaging",
|
"Win32_UI_WindowsAndMessaging",
|
||||||
]
|
]
|
||||||
|
|
||||||
[target.'cfg(windows)'.build-dependencies]
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
windres = "0.2.2"
|
windres = "0.2.2"
|
20
README.md
20
README.md
|
@ -20,16 +20,22 @@ If you want to revert these settings, you can go to the folder you put the exe i
|
||||||
**Full support:**
|
**Full support:**
|
||||||
- Cinema 4D
|
- Cinema 4D
|
||||||
- Adobe After Effects
|
- Adobe After Effects
|
||||||
|
- Adobe Illustrator
|
||||||
|
- Adobe Photoshop
|
||||||
|
- Adobe Premiere Pro
|
||||||
- Autodesk Maya
|
- Autodesk Maya
|
||||||
|
- Autodesk 3Ds Max
|
||||||
**Partial support:** *(meaning it shows up on Discord, but doesn't display the project name)*
|
|
||||||
- Davinci Resolve
|
- Davinci Resolve
|
||||||
- Illustrator
|
|
||||||
- Photoshop
|
|
||||||
- Isotropix Clarisse
|
- Isotropix Clarisse
|
||||||
- Marvelous Designer
|
|
||||||
- Calvary
|
- Calvary
|
||||||
- Ableton
|
- Ableton
|
||||||
- FL Studio
|
- FL Studio
|
||||||
- Autodesk 3Ds Max
|
- Blender
|
||||||
- Adobe Premiere Pro
|
|
||||||
|
**Partial support:** *(meaning it shows up on Discord, but doesn't display the project name)*
|
||||||
|
- Marvelous Designer ¹*
|
||||||
|
- Substance Designer ¹*
|
||||||
|
- Substance Painter ¹*
|
||||||
|
- Adobe Audition ¹*
|
||||||
|
|
||||||
|
¹*sadly not doable, project name not in proces window title. They will show up though, just with default project name*
|
BIN
processes.txt
BIN
processes.txt
Binary file not shown.
26
program icons/Audition.svg
Normal file
26
program icons/Audition.svg
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 256.4 256.4" style="enable-background:new 0 0 256.4 256.4;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#00005B;}
|
||||||
|
.st1{fill:#9999FF;}
|
||||||
|
</style>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M65.9,34.1h124.7c18.9,0,34.2,15.3,34.2,34.2v119.9c0,18.9-15.3,34.2-34.2,34.2H65.9
|
||||||
|
c-18.9,0-34.2-15.3-34.2-34.2V68.3C31.7,49.4,47,34.1,65.9,34.1z"/>
|
||||||
|
<g>
|
||||||
|
<path class="st1" d="M107.5,146.7H77.6l-6.1,19c-0.2,0.8-0.8,1.2-1.5,1.1H54.9c-0.9,0-1.1-0.5-0.9-1.4L79.9,91
|
||||||
|
c0.2-0.8,0.5-1.7,0.8-2.6c0.4-1.7,0.7-3.4,0.7-5.1c-0.1-0.4,0.2-0.8,0.7-0.9c0.1,0,0.2,0,0.2,0h20.6c0.5,0,1,0.2,1.1,0.7
|
||||||
|
l29.2,82.5c0.2,0.9,0,1.3-0.8,1.3h-16.8c-0.5,0.1-1.1-0.3-1.3-0.9L107.5,146.7z M82.3,130.7h20.4c-0.5-1.7-1.1-3.7-1.9-5.8
|
||||||
|
c-0.8-2.2-1.4-4.5-2.2-6.9c-0.8-2.5-1.5-4.9-2.3-7.4s-1.5-4.8-2.2-7.2c-0.7-2.3-1.2-4.4-1.8-6.2h-0.2c-0.8,3.5-1.6,6.9-2.7,10.4
|
||||||
|
c-1.2,3.8-2.4,7.9-3.7,11.9C84.8,123.5,83.5,127.3,82.3,130.7L82.3,130.7z"/>
|
||||||
|
<path class="st1" d="M194.8,103.4v49.3c0,2.2,0,4.1,0.1,5.8c0.1,1.7,0.2,3.2,0.2,4.4c0.2,1.3,0.2,2,0.3,2.9
|
||||||
|
c0.1,0.8-0.2,1.1-0.9,1.1h-13.8c-0.7,0.1-1.3-0.3-1.5-0.9c-0.2-0.7-0.3-1.4-0.5-2c-0.2-0.5-0.2-1.1-0.2-1.7c-2.6,2.3-5.7,4-9.1,5
|
||||||
|
c-2.9,0.8-5.9,1.2-9,1.2s-5.9-0.4-8.7-1.4c-2.6-0.9-5-2.4-6.9-4.4c-2.1-2.3-3.6-4.9-4.5-7.8c-1.1-3.7-1.7-7.5-1.6-11.4v-39.9
|
||||||
|
c-0.1-0.5,0.2-1,0.8-1.1c0.1,0,0.2,0,0.2,0h15.4c0.5-0.1,1,0.2,1.1,0.8c0,0.1,0,0.2,0,0.2v37.8c0,3.5,0.8,6.3,2.3,8.4
|
||||||
|
c1.5,2,4.7,3.1,8.3,3.1c1.9,0,3.7-0.3,5.5-1c1.9-0.7,3.5-1.5,5-2.6v-45.7c0-0.5,0.4-0.9,1.1-0.9H194c0.4-0.1,0.9,0.2,0.9,0.7
|
||||||
|
C194.8,103.3,194.8,103.4,194.8,103.4z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
BIN
program icons/Audition@3x.png
Normal file
BIN
program icons/Audition@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
program icons/Blender@3x.png
Normal file
BIN
program icons/Blender@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
326
program icons/Blender_logo_no_text.ai
Normal file
326
program icons/Blender_logo_no_text.ai
Normal file
File diff suppressed because one or more lines are too long
BIN
program icons/Vegas_Pro_15.0.png
Normal file
BIN
program icons/Vegas_Pro_15.0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
program icons/substance_designer.png
Normal file
BIN
program icons/substance_designer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
program icons/substance_painter.png
Normal file
BIN
program icons/substance_painter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
274
src/app.rs
274
src/app.rs
|
@ -1,10 +1,13 @@
|
||||||
|
use crate::program_status::get_running_windows_titles;
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
use regex::Regex;
|
||||||
|
extern crate lazy_static;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct App {
|
pub struct App {
|
||||||
pub kind: AppKind,
|
pub kind: AppKind,
|
||||||
pub default_project_name: String,
|
pub default_project_name: String,
|
||||||
pub drp_client_id: String,
|
pub drp_client_id: String,
|
||||||
pub process_search_string: String,
|
pub process_search_string: String,
|
||||||
pub config_search_string: String,
|
|
||||||
}
|
}
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum AppKind {
|
pub enum AppKind {
|
||||||
|
@ -19,9 +22,14 @@ pub enum AppKind {
|
||||||
DavinciResolve,
|
DavinciResolve,
|
||||||
Clarisse,
|
Clarisse,
|
||||||
Marvelous,
|
Marvelous,
|
||||||
Calvary,
|
Cavalry,
|
||||||
Ableton,
|
Ableton,
|
||||||
FL,
|
FL,
|
||||||
|
Blender,
|
||||||
|
Audition,
|
||||||
|
SubstancePainter,
|
||||||
|
SubstanceDesigner,
|
||||||
|
Vegas,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Apps {
|
pub struct Apps {
|
||||||
|
@ -36,13 +44,18 @@ pub struct Apps {
|
||||||
DavinciResolve: App,
|
DavinciResolve: App,
|
||||||
Clarisse: App,
|
Clarisse: App,
|
||||||
Marvelous: App,
|
Marvelous: App,
|
||||||
Calvary: App,
|
Cavalry: App,
|
||||||
Ableton: App,
|
Ableton: App,
|
||||||
FL: App,
|
FL: App,
|
||||||
|
Blender: App,
|
||||||
|
Audition: App,
|
||||||
|
SubstancePainter: App,
|
||||||
|
SubstanceDesigner: App,
|
||||||
|
Vegas: App,
|
||||||
}
|
}
|
||||||
impl Apps {
|
impl Apps {
|
||||||
pub fn as_iter(&self) -> [&App; 14] {
|
pub fn as_iter(&self) -> [&App; 19] {
|
||||||
let APPS: [&App; 14] = [
|
let APPS: [&App; 19] = [
|
||||||
&self.C4d,
|
&self.C4d,
|
||||||
&self.Maya,
|
&self.Maya,
|
||||||
&self.ThreeDsMax,
|
&self.ThreeDsMax,
|
||||||
|
@ -54,16 +67,21 @@ impl Apps {
|
||||||
&self.DavinciResolve,
|
&self.DavinciResolve,
|
||||||
&self.Clarisse,
|
&self.Clarisse,
|
||||||
&self.Marvelous,
|
&self.Marvelous,
|
||||||
&self.Calvary,
|
&self.Cavalry,
|
||||||
&self.Ableton,
|
&self.Ableton,
|
||||||
&self.FL,
|
&self.FL,
|
||||||
|
&self.Blender,
|
||||||
|
&self.Audition,
|
||||||
|
&self.SubstancePainter,
|
||||||
|
&self.SubstanceDesigner,
|
||||||
|
&self.Vegas,
|
||||||
];
|
];
|
||||||
APPS
|
APPS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl AppKind {
|
impl AppKind {
|
||||||
pub fn as_iter() -> [AppKind; 14] {
|
pub fn as_iter() -> [AppKind; 19] {
|
||||||
let APPKINDS: [AppKind; 14] = [
|
let APPKINDS: [AppKind; 19] = [
|
||||||
AppKind::C4d,
|
AppKind::C4d,
|
||||||
AppKind::Maya,
|
AppKind::Maya,
|
||||||
AppKind::ThreeDsMax,
|
AppKind::ThreeDsMax,
|
||||||
|
@ -75,9 +93,14 @@ impl AppKind {
|
||||||
AppKind::DavinciResolve,
|
AppKind::DavinciResolve,
|
||||||
AppKind::Clarisse,
|
AppKind::Clarisse,
|
||||||
AppKind::Marvelous,
|
AppKind::Marvelous,
|
||||||
AppKind::Calvary,
|
AppKind::Cavalry,
|
||||||
AppKind::Ableton,
|
AppKind::Ableton,
|
||||||
AppKind::FL,
|
AppKind::FL,
|
||||||
|
AppKind::Blender,
|
||||||
|
AppKind::Audition,
|
||||||
|
AppKind::SubstancePainter,
|
||||||
|
AppKind::SubstanceDesigner,
|
||||||
|
AppKind::Vegas,
|
||||||
];
|
];
|
||||||
APPKINDS
|
APPKINDS
|
||||||
}
|
}
|
||||||
|
@ -89,100 +112,116 @@ impl Apps {
|
||||||
default_project_name: "Cinema 4D Project".to_string(),
|
default_project_name: "Cinema 4D Project".to_string(),
|
||||||
drp_client_id: "936296341250904065".to_string(),
|
drp_client_id: "936296341250904065".to_string(),
|
||||||
process_search_string: "Cinema 4D R".to_string(),
|
process_search_string: "Cinema 4D R".to_string(),
|
||||||
config_search_string: "c4d".to_string(),
|
|
||||||
kind: AppKind::C4d,
|
kind: AppKind::C4d,
|
||||||
},
|
},
|
||||||
Maya: App {
|
Maya: App {
|
||||||
default_project_name: "Autodesk Maya Project".to_string(),
|
default_project_name: "Autodesk Maya Project".to_string(),
|
||||||
drp_client_id: "1016369550276694106".to_string(),
|
drp_client_id: "1016369550276694106".to_string(),
|
||||||
process_search_string: "Autodesk Maya".to_string(),
|
process_search_string: "Autodesk Maya".to_string(),
|
||||||
config_search_string: "maya".to_string(),
|
|
||||||
kind: AppKind::Maya,
|
kind: AppKind::Maya,
|
||||||
},
|
},
|
||||||
ThreeDsMax: App {
|
ThreeDsMax: App {
|
||||||
default_project_name: "3ds Max Project".to_string(),
|
default_project_name: "3ds Max Project".to_string(),
|
||||||
drp_client_id: "1016395801402036315".to_string(),
|
drp_client_id: "1016395801402036315".to_string(),
|
||||||
process_search_string: " Autodesk 3ds Max".to_string(),
|
process_search_string: " Autodesk 3ds Max".to_string(),
|
||||||
config_search_string: "threedsmax".to_string(),
|
|
||||||
kind: AppKind::ThreeDsMax,
|
kind: AppKind::ThreeDsMax,
|
||||||
},
|
},
|
||||||
AfterEffects: App {
|
AfterEffects: App {
|
||||||
default_project_name: "After Effects Project".to_string(),
|
default_project_name: "After Effects Project".to_string(),
|
||||||
drp_client_id: "1016395319522623539".to_string(),
|
drp_client_id: "1016395319522623539".to_string(),
|
||||||
process_search_string: "Adobe After Effects".to_string(),
|
process_search_string: "Adobe After Effects".to_string(),
|
||||||
config_search_string: "after_effects".to_string(),
|
|
||||||
kind: AppKind::AfterEffects,
|
kind: AppKind::AfterEffects,
|
||||||
},
|
},
|
||||||
PremierePro: App {
|
PremierePro: App {
|
||||||
default_project_name: "Premiere Pro Project".to_string(),
|
default_project_name: "Premiere Pro Project".to_string(),
|
||||||
drp_client_id: "1016396017832300555".to_string(),
|
drp_client_id: "1016396017832300555".to_string(),
|
||||||
process_search_string: "Adobe Premiere Pro".to_string(),
|
process_search_string: "Adobe Premiere Pro".to_string(),
|
||||||
config_search_string: "premiere_pro".to_string(),
|
|
||||||
kind: AppKind::PremierePro,
|
kind: AppKind::PremierePro,
|
||||||
},
|
},
|
||||||
Illustrator: App {
|
Illustrator: App {
|
||||||
default_project_name: "Illustrator Project".to_string(),
|
default_project_name: "Illustrator Project".to_string(),
|
||||||
drp_client_id: "1017491707819991071".to_string(),
|
drp_client_id: "1017491707819991071".to_string(),
|
||||||
process_search_string: "Adobe Illustrator".to_string(),
|
process_search_string: "Illustrator.exe".to_string(),
|
||||||
config_search_string: "illustrator".to_string(),
|
|
||||||
kind: AppKind::Illustrator,
|
kind: AppKind::Illustrator,
|
||||||
},
|
},
|
||||||
Photoshop: App {
|
Photoshop: App {
|
||||||
default_project_name: "Photoshop Project".to_string(),
|
default_project_name: "Photoshop Project".to_string(),
|
||||||
drp_client_id: "1017493347415371917".to_string(),
|
drp_client_id: "1017493347415371917".to_string(),
|
||||||
process_search_string: "Photoshop".to_string(),
|
process_search_string: "Photoshop.exe".to_string(),
|
||||||
config_search_string: "photoshop".to_string(),
|
|
||||||
kind: AppKind::Photoshop,
|
kind: AppKind::Photoshop,
|
||||||
},
|
},
|
||||||
Indesign: App {
|
Indesign: App {
|
||||||
default_project_name: "Indesign Project".to_string(),
|
default_project_name: "Indesign Project".to_string(),
|
||||||
drp_client_id: "1017493794456862781".to_string(),
|
drp_client_id: "1017493794456862781".to_string(),
|
||||||
process_search_string: "Indesign".to_string(),
|
process_search_string: "Indesign".to_string(),
|
||||||
config_search_string: "indesign".to_string(),
|
|
||||||
kind: AppKind::Indesign,
|
kind: AppKind::Indesign,
|
||||||
},
|
},
|
||||||
DavinciResolve: App {
|
DavinciResolve: App {
|
||||||
default_project_name: "Davinci Resolve Project".to_string(),
|
default_project_name: "Davinci Resolve Project".to_string(),
|
||||||
drp_client_id: "1016371757722128516".to_string(),
|
drp_client_id: "1016371757722128516".to_string(),
|
||||||
process_search_string: "Davinci Resolve".to_string(),
|
process_search_string: "DaVinci Resolve - ".to_string(),
|
||||||
config_search_string: "davinci_resolve".to_string(),
|
|
||||||
kind: AppKind::DavinciResolve,
|
kind: AppKind::DavinciResolve,
|
||||||
},
|
},
|
||||||
Clarisse: App {
|
Clarisse: App {
|
||||||
default_project_name: "Isotropix Clarisse Project".to_string(),
|
default_project_name: "Isotropix Clarisse Project".to_string(),
|
||||||
drp_client_id: "1016372248128532500".to_string(),
|
drp_client_id: "1016372248128532500".to_string(),
|
||||||
process_search_string: "Isotropix Clarisse".to_string(),
|
process_search_string: "Isotropix Clarisse".to_string(),
|
||||||
config_search_string: "clarisse".to_string(),
|
|
||||||
kind: AppKind::Clarisse,
|
kind: AppKind::Clarisse,
|
||||||
},
|
},
|
||||||
Marvelous: App {
|
Marvelous: App {
|
||||||
default_project_name: "Marvelous Designer Project".to_string(),
|
default_project_name: "Marvelous Designer Project".to_string(),
|
||||||
drp_client_id: "1016372646046351423".to_string(),
|
drp_client_id: "1016372646046351423".to_string(),
|
||||||
process_search_string: "Marvelous Designer".to_string(),
|
process_search_string: "Marvelous Designer".to_string(),
|
||||||
config_search_string: "marvelous".to_string(),
|
|
||||||
kind: AppKind::Marvelous,
|
kind: AppKind::Marvelous,
|
||||||
},
|
},
|
||||||
Calvary: App {
|
Cavalry: App {
|
||||||
default_project_name: "Cavalry Project".to_string(),
|
default_project_name: "Cavalry Project".to_string(),
|
||||||
drp_client_id: "1016374130037243974".to_string(),
|
drp_client_id: "1016374130037243974".to_string(),
|
||||||
process_search_string: "calvary.exe".to_string(),
|
process_search_string: "Cavalry.exe".to_string(),
|
||||||
config_search_string: "calvary".to_string(),
|
kind: AppKind::Cavalry,
|
||||||
kind: AppKind::Calvary,
|
|
||||||
},
|
},
|
||||||
Ableton: App {
|
Ableton: App {
|
||||||
default_project_name: "Ableton Project".to_string(),
|
default_project_name: "Ableton Project".to_string(),
|
||||||
drp_client_id: "1016375030227161150".to_string(),
|
drp_client_id: "1016375030227161150".to_string(),
|
||||||
process_search_string: "Ableton Live".to_string(),
|
process_search_string: "Ableton Live".to_string(),
|
||||||
config_search_string: "ableton".to_string(),
|
|
||||||
kind: AppKind::Ableton,
|
kind: AppKind::Ableton,
|
||||||
},
|
},
|
||||||
FL: App {
|
FL: App {
|
||||||
default_project_name: "FL Studio Project".to_string(),
|
default_project_name: "FL Studio Project".to_string(),
|
||||||
drp_client_id: "1016393561140375712".to_string(),
|
drp_client_id: "1016393561140375712".to_string(),
|
||||||
process_search_string: "FL Studio".to_string(),
|
process_search_string: "FL Studio".to_string(),
|
||||||
config_search_string: "fl".to_string(),
|
|
||||||
kind: AppKind::FL,
|
kind: AppKind::FL,
|
||||||
},
|
},
|
||||||
|
Blender: App {
|
||||||
|
kind: AppKind::Blender,
|
||||||
|
default_project_name: "Blender Project".to_string(),
|
||||||
|
drp_client_id: "1017878734746963978".to_string(),
|
||||||
|
process_search_string: "BlenderGLEW".to_string(),
|
||||||
|
},
|
||||||
|
Audition: App {
|
||||||
|
kind: AppKind::Audition,
|
||||||
|
default_project_name: "Audition Project".to_string(),
|
||||||
|
drp_client_id: "1017879756282286153".to_string(),
|
||||||
|
process_search_string: "Adobe Audition.exe".to_string(),
|
||||||
|
},
|
||||||
|
SubstancePainter: App {
|
||||||
|
kind: AppKind::SubstancePainter,
|
||||||
|
default_project_name: "Substance Painter Project".to_string(),
|
||||||
|
drp_client_id: "1017881633296232578".to_string(),
|
||||||
|
process_search_string: "Substance 3D Painter".to_string(),
|
||||||
|
},
|
||||||
|
SubstanceDesigner: App {
|
||||||
|
kind: AppKind::SubstanceDesigner,
|
||||||
|
default_project_name: "Substance Designer Project".to_string(),
|
||||||
|
drp_client_id: "1017881386583080971".to_string(),
|
||||||
|
process_search_string: "Substance Designer".to_string(),
|
||||||
|
},
|
||||||
|
Vegas: App {
|
||||||
|
kind: AppKind::Vegas,
|
||||||
|
default_project_name: "Vegas Project".to_string(),
|
||||||
|
drp_client_id: "1017882355723153448".to_string(),
|
||||||
|
process_search_string: "Vegas Pro".to_string(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,14 +235,6 @@ impl Apps {
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
pub fn find_config_app(&self, str: &str) -> Option<&App> {
|
|
||||||
for app in self.as_iter() {
|
|
||||||
if str == app.config_search_string {
|
|
||||||
return Some(app);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl App {
|
impl App {
|
||||||
|
@ -218,8 +249,8 @@ impl App {
|
||||||
match window_title.find(".c4d]") {
|
match window_title.find(".c4d]") {
|
||||||
Some(i) => end_i = i as usize,
|
Some(i) => end_i = i as usize,
|
||||||
None => match window_title.find(" - Main") {
|
None => match window_title.find(" - Main") {
|
||||||
Some(i) => end_i = i as usize - 1,
|
Some(i) => end_i = i as usize,
|
||||||
None => end_i = window_title.len() - 1,
|
None => end_i = window_title.len(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -228,11 +259,11 @@ impl App {
|
||||||
}
|
}
|
||||||
AppKind::Maya => {
|
AppKind::Maya => {
|
||||||
let match_index = match window_title.as_str().find(".mb* - Autodesk Maya") {
|
let match_index = match window_title.as_str().find(".mb* - Autodesk Maya") {
|
||||||
Some(i) => i,
|
Some(i) => i + 5,
|
||||||
None => match window_title.as_str().find(".mb - Autodesk Maya") {
|
None => match window_title.as_str().find(".mb - Autodesk Maya") {
|
||||||
Some(i) => i + 4,
|
Some(i) => i + 4,
|
||||||
None => {
|
None => {
|
||||||
return String::from("Autodesk Maya Project");
|
return self.default_project_name.clone();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -253,17 +284,160 @@ impl App {
|
||||||
}
|
}
|
||||||
proj_name
|
proj_name
|
||||||
}
|
}
|
||||||
AppKind::ThreeDsMax => self.default_project_name.clone(),
|
AppKind::ThreeDsMax => {
|
||||||
AppKind::PremierePro => self.default_project_name.clone(),
|
let match_index = match window_title.as_str().find(".max* - Autodesk 3ds Max") {
|
||||||
AppKind::Illustrator => self.default_project_name.clone(),
|
Some(i) => i + 5,
|
||||||
AppKind::Photoshop => self.default_project_name.clone(),
|
None => match window_title.as_str().find(".max - Autodesk 3ds Max") {
|
||||||
|
Some(i) => i + 4,
|
||||||
|
None => {
|
||||||
|
return self.default_project_name.clone();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return window_title[..match_index as usize].to_string();
|
||||||
|
}
|
||||||
|
AppKind::DavinciResolve => {
|
||||||
|
let match_index = match window_title.as_str().find("DaVinci Resolve -") {
|
||||||
|
Some(i) => 17 as usize,
|
||||||
|
None => 0 as usize,
|
||||||
|
};
|
||||||
|
let mut with_project_extention = window_title.clone();
|
||||||
|
with_project_extention.push_str(".drp");
|
||||||
|
return with_project_extention[match_index as usize..].to_string();
|
||||||
|
}
|
||||||
|
AppKind::PremierePro => {
|
||||||
|
let mut proj_name = String::new();
|
||||||
|
for i in (0..window_title.len() - 2).rev() {
|
||||||
|
if window_title.chars().nth(i).unwrap() == '\\' {
|
||||||
|
for char in window_title.chars().skip(i + 1) {
|
||||||
|
proj_name.push(char);
|
||||||
|
}
|
||||||
|
return proj_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if proj_name == "" {
|
||||||
|
proj_name = window_title.clone();
|
||||||
|
}
|
||||||
|
proj_name
|
||||||
|
}
|
||||||
|
AppKind::Illustrator => {
|
||||||
|
let running_windows_titles = unsafe { get_running_windows_titles() };
|
||||||
|
lazy_static! {
|
||||||
|
static ref REG_AI: Regex =
|
||||||
|
Regex::new(r".{0,} @ (\d{0,}\.\d{0,}|\d{0,}) % \(\w{3,4}\W\w{0,}\b\)")
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
let mut match_index = self.default_project_name.len();
|
||||||
|
let mut matching_title = self.default_project_name.clone();
|
||||||
|
|
||||||
|
for titles in running_windows_titles {
|
||||||
|
if REG_AI.is_match(&titles) {
|
||||||
|
if let Some(i) = titles.find("@") {
|
||||||
|
matching_title = titles.clone();
|
||||||
|
match_index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let out_string = matching_title[..match_index].to_string();
|
||||||
|
out_string
|
||||||
|
}
|
||||||
|
AppKind::Photoshop => {
|
||||||
|
let running_windows_titles = unsafe { get_running_windows_titles() };
|
||||||
|
lazy_static! {
|
||||||
|
static ref REG_PSD: Regex =
|
||||||
|
Regex::new(r".{0,}@ (\d{0,}|\d{0,}.\d{0,})% \(.{0,}, \w{0,}\W.{0,}\)")
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
let mut match_index = self.default_project_name.len();
|
||||||
|
let mut matching_title = self.default_project_name.clone();
|
||||||
|
|
||||||
|
for titles in running_windows_titles {
|
||||||
|
if REG_PSD.is_match(&titles) {
|
||||||
|
if let Some(i) = titles.find("@") {
|
||||||
|
matching_title = titles.clone();
|
||||||
|
match_index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let out_string = matching_title[..match_index].to_string();
|
||||||
|
out_string
|
||||||
|
}
|
||||||
AppKind::Indesign => self.default_project_name.clone(),
|
AppKind::Indesign => self.default_project_name.clone(),
|
||||||
AppKind::DavinciResolve => self.default_project_name.clone(),
|
AppKind::Clarisse => {
|
||||||
AppKind::Clarisse => self.default_project_name.clone(),
|
let match_index = match window_title.as_str().find(".ple* - Isotropix Clarisse") {
|
||||||
|
Some(i) => i + 5,
|
||||||
|
None => match window_title.as_str().find(".ple - Isotropix Clarisse") {
|
||||||
|
Some(i) => i + 4,
|
||||||
|
None => match window_title.as_str().find(" - Isotropix Clarisse") {
|
||||||
|
Some(i) => i,
|
||||||
|
None => {
|
||||||
|
return self.default_project_name.clone();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return window_title[..match_index as usize].to_string();
|
||||||
|
}
|
||||||
AppKind::Marvelous => self.default_project_name.clone(),
|
AppKind::Marvelous => self.default_project_name.clone(),
|
||||||
AppKind::Calvary => self.default_project_name.clone(),
|
AppKind::Cavalry => {
|
||||||
AppKind::Ableton => self.default_project_name.clone(),
|
let running_windows_titles = unsafe { get_running_windows_titles() };
|
||||||
AppKind::FL => self.default_project_name.clone(),
|
lazy_static! {
|
||||||
|
static ref REG_CV: Regex =
|
||||||
|
Regex::new(r"Project: .{0,}Scene: .{0,}\.cv ").unwrap();
|
||||||
|
}
|
||||||
|
let mut match_index = 0;
|
||||||
|
let mut matching_title = self.default_project_name.clone();
|
||||||
|
|
||||||
|
for titles in running_windows_titles {
|
||||||
|
if REG_CV.is_match(&titles) {
|
||||||
|
if let Some(i) = titles.rfind(r"/") {
|
||||||
|
matching_title = titles.clone();
|
||||||
|
match_index = i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let out_string = matching_title[match_index..].to_string();
|
||||||
|
out_string
|
||||||
|
}
|
||||||
|
AppKind::Ableton => {
|
||||||
|
let match_index = match window_title.as_str().find(" - Ableton Live") {
|
||||||
|
Some(i) => i,
|
||||||
|
None => return self.default_project_name.clone(),
|
||||||
|
};
|
||||||
|
return window_title[..match_index as usize].to_string();
|
||||||
|
}
|
||||||
|
AppKind::FL => {
|
||||||
|
let match_index = match window_title.as_str().find(" - FL Studio") {
|
||||||
|
Some(i) => i,
|
||||||
|
None => return self.default_project_name.clone(),
|
||||||
|
};
|
||||||
|
return window_title[..match_index as usize].to_string();
|
||||||
|
}
|
||||||
|
AppKind::Blender => {
|
||||||
|
let running_windows_titles = unsafe { get_running_windows_titles() };
|
||||||
|
lazy_static! {
|
||||||
|
static ref REG_BL: Regex =
|
||||||
|
Regex::new(r"Blender \[.{0,}\\\w{0,}\.blend]").unwrap();
|
||||||
|
}
|
||||||
|
let mut match_index = 0;
|
||||||
|
let mut matching_title = self.default_project_name.clone();
|
||||||
|
|
||||||
|
for titles in running_windows_titles {
|
||||||
|
if REG_BL.is_match(&titles) {
|
||||||
|
if let Some(i) = titles.rfind(r"\") {
|
||||||
|
matching_title = titles.clone();
|
||||||
|
match_index = i + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let end_i = matching_title.len();
|
||||||
|
let out_string = matching_title[match_index..end_i - 1].to_string();
|
||||||
|
out_string
|
||||||
|
}
|
||||||
|
AppKind::Audition => self.default_project_name.clone(),
|
||||||
|
AppKind::SubstancePainter => self.default_project_name.clone(),
|
||||||
|
AppKind::SubstanceDesigner => self.default_project_name.clone(),
|
||||||
|
AppKind::Vegas => self.default_project_name.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![windows_subsystem = "windows"]
|
//#![windows_subsystem = "windows"] //UNCOMMENT ONLY WHEN BUILDING FOR RELEASE TO NOT SHOW TERMINAL WINDOW!
|
||||||
pub mod app;
|
pub mod app;
|
||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod program_status;
|
pub mod program_status;
|
||||||
|
|
|
@ -5,10 +5,13 @@ use windows::Win32::{
|
||||||
};
|
};
|
||||||
pub fn get_running_program(apps: &Apps) -> Option<(&App, String)> {
|
pub fn get_running_program(apps: &Apps) -> Option<(&App, String)> {
|
||||||
let running_window_names = unsafe { get_running_windows_titles() };
|
let running_window_names = unsafe { get_running_windows_titles() };
|
||||||
|
|
||||||
for window_name in running_window_names {
|
for window_name in running_window_names {
|
||||||
|
dbg!(&window_name);
|
||||||
if let Some(app) = apps.find_app(&window_name) {
|
if let Some(app) = apps.find_app(&window_name) {
|
||||||
return Some((&app, app.parse(&window_name)));
|
if !window_name.contains("- Google Chrome") {
|
||||||
|
//So googling it won't affect the DRP lol
|
||||||
|
//return Some((&app, app.parse(&window_name)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return None;
|
return None;
|
||||||
|
@ -17,15 +20,17 @@ pub fn is_program_still_running(app: &App) -> Option<String> {
|
||||||
let running_window_names = unsafe { get_running_windows_titles() };
|
let running_window_names = unsafe { get_running_windows_titles() };
|
||||||
|
|
||||||
for window_name in running_window_names {
|
for window_name in running_window_names {
|
||||||
//dbg!(&window_name);
|
|
||||||
if window_name.contains(&app.process_search_string) {
|
if window_name.contains(&app.process_search_string) {
|
||||||
|
if !window_name.contains("- Google Chrome") {
|
||||||
|
//So googling it won't affect the DRP lol
|
||||||
return Some(app.parse(&window_name));
|
return Some(app.parse(&window_name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn get_running_windows_titles() -> Vec<String> {
|
pub unsafe fn get_running_windows_titles() -> Vec<String> {
|
||||||
let mut running_windows_names: Vec<String> = Vec::new();
|
let mut running_windows_names: Vec<String> = Vec::new();
|
||||||
unsafe extern "system" fn processhwd(hwnd: HWND, lparam: LPARAM) -> BOOL {
|
unsafe extern "system" fn processhwd(hwnd: HWND, lparam: LPARAM) -> BOOL {
|
||||||
// Get the length of the window text
|
// Get the length of the window text
|
||||||
|
@ -46,7 +51,8 @@ unsafe fn get_running_windows_titles() -> Vec<String> {
|
||||||
for char in window_text_buffer {
|
for char in window_text_buffer {
|
||||||
window_text.push(char as char);
|
window_text.push(char as char);
|
||||||
}
|
}
|
||||||
//turn characters into strings
|
//turn characters into strings, but exclude last weird escape null char "\0"
|
||||||
|
window_text.pop();
|
||||||
let window_text = String::from_iter(window_text.iter());
|
let window_text = String::from_iter(window_text.iter());
|
||||||
|
|
||||||
//turn vector into pointer and push window_texts to it
|
//turn vector into pointer and push window_texts to it
|
||||||
|
|
Loading…
Reference in a new issue