Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Commit

Permalink
add vrmanifest, fix profile parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
I5UCC committed Sep 9, 2023
1 parent 488dd5e commit 652077a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/app.vrmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"source": "builtin",
"applications": [
{
"app_key": "i5ucc.VRCVoiceMeeterControl",
"app_key": "i5ucc.VRCMeeter",
"launch_type": "binary",
"binary_path_windows": "./VRCVoiceMeeterControl_NoConsole.exe",
"binary_path_windows": "./VRCMeeter_NoConsole.exe",
"is_dashboard_overlay": true,

"strings": {
"en_us": {
"name": "VRCVoiceMeeterControl",
"name": "VRCMeeter",
"description": "Lets you control Voicemeeter from within VRChat over OSC"
}
}
Expand Down
12 changes: 9 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from psutil import process_iter
from threading import Thread, Timer
import logging
import openvr


class RepeatedTimer(object):
Expand Down Expand Up @@ -174,6 +175,7 @@ def exit():
PARAMETER_RESTART = "/avatar/parameters/vm_restart"
PARAMETER_PREFIX_IN = "/avatar/parameters/vm_in_"
PARAMETER_PREFIX_OUT = "/avatar/parameters/vm_out_"
PARAMETER_PREFIX_PROFILE = "/avatar/parameters/vm_profile_"

if OSC_SERVER_PORT != 9001:
logging.info("OSC Server port is not default, testing port availability and advertising OSCQuery endpoints")
Expand All @@ -185,8 +187,12 @@ def exit():
logging.info("OSC Server port is default.")

try:
application = openvr.init(openvr.VRApplication_Utility)
openvr.VRApplications().addApplicationManifest(get_absolute_path("app.vrmanifest"))
logging.info("Added VRManifest.")
vmr = voicemeeter.remote(KIND)
vmr.login()
logging.info("Logged in to Voicemeeter.")
if conf["startup_profile"] is not None and conf["startup_profile"] != "":
set_profile(conf["startup_profile"], None)
except Exception as e:
Expand Down Expand Up @@ -220,8 +226,8 @@ def exit():
disp.map(PARAMETER_RESTART, lambda addr, value: vmr.restart())
logging.info(f"Bound restart to {PARAMETER_RESTART}")
for i in range(len(PROFILES)):
disp.map(f"{PARAMETER_PREFIX_IN}profile_{i}", lambda addr, value: set_profile(int(addr.split('_')[-1]), value))
logging.info(f"Bound profile {PROFILES[i]} to {PARAMETER_PREFIX_IN}profile_{i}")
disp.map(f"{PARAMETER_PREFIX_PROFILE}{i}", lambda addr, value: set_profile(int(addr.split('_')[-1]), value))
logging.info(f"Bound profile {PROFILES[i]} to {PARAMETER_PREFIX_PROFILE}{i}")

for strip in STRIPS_IN:
disp.map(f"{PARAMETER_PREFIX_IN}gain_{strip}", set_gain_variable)
Expand All @@ -244,7 +250,7 @@ def exit():
oscqs.advertise_endpoint(AVATAR_CHANGE_PARAMETER, access="readwrite")
oscqs.advertise_endpoint(PARAMETER_RESTART, access="readwrite")
for i in range(len(PROFILES)):
oscqs.advertise_endpoint(f"{PARAMETER_PREFIX_IN}profile_{i}", access="readwrite")
oscqs.advertise_endpoint(f"{PARAMETER_PREFIX_PROFILE}{i}", access="readwrite")

for strip in STRIPS_IN:
oscqs.advertise_endpoint(f"{PARAMETER_PREFIX_IN}gain_{strip}", access="readwrite")
Expand Down
3 changes: 2 additions & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ python_osc
zeroconf
requests
psutil
toml
toml
openvr

0 comments on commit 652077a

Please sign in to comment.