Skip to content

Commit 174854f

Browse files
committed
Release
1 parent 168f0c2 commit 174854f

File tree

8 files changed

+147
-0
lines changed

8 files changed

+147
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- .github/workflows/*
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
env:
16+
python_ver: 3.11
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ env.python_ver }}
25+
26+
- name: Get version from plugin.json
27+
id: version
28+
uses: notiz-dev/github-action-json-property@release
29+
with:
30+
path: 'plugin.json'
31+
prop_path: 'Version'
32+
33+
- name: Generate unique release tag
34+
id: generate_tag
35+
run: |
36+
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
37+
VERSION="${{ steps.version.outputs.prop }}"
38+
UNIQUE_TAG="v${VERSION}-${TIMESTAMP}"
39+
echo "tag=${UNIQUE_TAG}" >> $GITHUB_OUTPUT
40+
41+
- name: Install dependencies and create zip
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install -r ./requirements.txt -t ./lib
45+
zip -r Flow.Launcher.Plugin.VoiceMeeter.zip . -x '*.git*'
46+
47+
- name: Create Release
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: 'Flow.Launcher.Plugin.VoiceMeeter.zip'
51+
tag_name: "${{ steps.generate_tag.outputs.tag }}"
52+
generate_release_notes: true

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# FlowVoiceMeeter
2+
Searches available WDM devices in VoiceMeeter for selection.
3+
4+
To install download release - make a new folder in AppData\Roaming\FlowLauncher\Plugins\ and extract zip there and restart FlowLauncher
5+
6+
Make sure plugin is enabled after restarting, keyword to start the script is **vm**.

assets/device.png

12.7 KB
Loading

assets/error.png

11.6 KB
Loading

assets/icon.png

23.4 KB
Loading

main.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import sys,os
2+
parent_folder_path = os.path.abspath(os.path.dirname(__file__))
3+
sys.path.append(parent_folder_path)
4+
sys.path.append(os.path.join(parent_folder_path, 'lib'))
5+
from flowlauncher import FlowLauncher
6+
import voicemeeterlib
7+
8+
class VoicemeeterDevices(FlowLauncher):
9+
def __init__(self):
10+
self.vm = None
11+
super().__init__()
12+
13+
def connect_voicemeeter(self):
14+
try:
15+
if self.vm is None:
16+
self.vm = voicemeeterlib.api("potato")
17+
self.vm.login()
18+
return True
19+
except:
20+
return False
21+
22+
def list_wdm_devices(self):
23+
try:
24+
if not self.connect_voicemeeter():
25+
return []
26+
27+
wdm_devices = []
28+
for i in range(self.vm.device.outs):
29+
device_info = self.vm.device.output(i)
30+
if device_info["type"].lower() == "wdm":
31+
wdm_devices.append(device_info["name"])
32+
33+
if not wdm_devices:
34+
return [{
35+
"Title": "No WDM output devices detected",
36+
"SubTitle": "Ensure WDM output devices are active in Voicemeeter.",
37+
"IcoPath": "assets/error.png"
38+
}]
39+
40+
return [
41+
{
42+
"Title": device,
43+
"SubTitle": f"Set A1 Bus to {device}",
44+
"IcoPath": "assets/device.png",
45+
"JsonRPCAction": {
46+
"method": "select_wdm_device",
47+
"parameters": [device],
48+
"dontHideAfterAction": False
49+
}
50+
}
51+
for device in wdm_devices
52+
]
53+
54+
except:
55+
return [{"Title": "Error", "SubTitle": "Failed to list WDM devices.", "IcoPath": "assets/error.png"}]
56+
57+
def select_wdm_device(self, device_name):
58+
try:
59+
if not self.connect_voicemeeter():
60+
return False
61+
62+
self.vm.bus[0].device.wdm = device_name
63+
return [{
64+
"Title": "Success!",
65+
"SubTitle": f"Device '{device_name}' set for A1 Bus (WDM).",
66+
}]
67+
68+
except:
69+
return [{"Title": "Error", "SubTitle": "Failed to set WDM device.", "IcoPath": "assets/error.png"}]
70+
71+
def query(self, query):
72+
return self.list_wdm_devices()
73+
74+
if __name__ == "__main__":
75+
VoicemeeterDevices()

plugin.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"ID": "a85a40da-62f5-4c99-a250-e99076a12803",
3+
"ActionKeyword": "vm",
4+
"Name": "FlowVoiceMeeter",
5+
"Description": "Hooks VoiceMeeter to select an output device",
6+
"Author": "Rex",
7+
"Version": "1.0.0",
8+
"Language": "python",
9+
"Website": "",
10+
"IcoPath": "assets\\icon.png",
11+
"ExecuteFileName": "main.py"
12+
}

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FlowLauncher==0.2.0
2+
Voicemeeter-api==2.6.0

0 commit comments

Comments
 (0)