mirror of
				https://github.com/onyx-and-iris/voicemeeter-api-python.git
				synced 2025-11-04 07:31:47 +00:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "e9d1e7ffa2d6a3464421fe5d2b4f49011fc98923" and "8c220eb491811d514f1ab9401a00f21713c88787" have entirely different histories.
		
	
	
		
			e9d1e7ffa2
			...
			8c220eb491
		
	
		
@ -1,6 +1,6 @@
 | 
			
		||||
[tool.poetry]
 | 
			
		||||
name = "voicemeeter-api"
 | 
			
		||||
version = "2.4.7"
 | 
			
		||||
version = "2.4.5"
 | 
			
		||||
description = "A Python wrapper for the Voiceemeter API"
 | 
			
		||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
 | 
			
		||||
license = "MIT"
 | 
			
		||||
@ -33,10 +33,7 @@ levels = "scripts:ex_levels"
 | 
			
		||||
midi = "scripts:ex_midi"
 | 
			
		||||
obs = "scripts:ex_obs"
 | 
			
		||||
observer = "scripts:ex_observer"
 | 
			
		||||
basic = "scripts:test_basic"
 | 
			
		||||
banana = "scripts:test_banana"
 | 
			
		||||
potato = "scripts:test_potato"
 | 
			
		||||
all = "scripts:test_all"
 | 
			
		||||
test = "scripts:test"
 | 
			
		||||
 | 
			
		||||
[tool.tox]
 | 
			
		||||
legacy_tox_ini = """
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19
									
								
								scripts.py
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								scripts.py
									
									
									
									
									
								
							@ -1,4 +1,3 @@
 | 
			
		||||
import os
 | 
			
		||||
import subprocess
 | 
			
		||||
import sys
 | 
			
		||||
from pathlib import Path
 | 
			
		||||
@ -39,21 +38,5 @@ def ex_observer():
 | 
			
		||||
    subprocess.run([sys.executable, str(scriptpath)])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_basic():
 | 
			
		||||
    os.environ["KIND"] = "basic"
 | 
			
		||||
def test():
 | 
			
		||||
    subprocess.run(["tox"])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_banana():
 | 
			
		||||
    os.environ["KIND"] = "banana"
 | 
			
		||||
    subprocess.run(["tox"])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_potato():
 | 
			
		||||
    os.environ["KIND"] = "potato"
 | 
			
		||||
    subprocess.run(["tox"])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_all():
 | 
			
		||||
    steps = [test_basic, test_banana, test_potato]
 | 
			
		||||
    [step() for step in steps]
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,3 @@
 | 
			
		||||
import os
 | 
			
		||||
import random
 | 
			
		||||
import sys
 | 
			
		||||
from dataclasses import dataclass
 | 
			
		||||
@ -31,10 +30,8 @@ class Data:
 | 
			
		||||
        return (2 * self.phys_in) + (8 * self.virt_in)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# get KIND_ID from env var, otherwise set to random
 | 
			
		||||
KIND_ID = os.environ.get(
 | 
			
		||||
    "KIND", random.choice(tuple(kind_id.name.lower() for kind_id in KindId))
 | 
			
		||||
)
 | 
			
		||||
# let's keep things random
 | 
			
		||||
KIND_ID = random.choice(tuple(kind_id.name.lower() for kind_id in KindId))
 | 
			
		||||
vm = voicemeeterlib.api(KIND_ID)
 | 
			
		||||
kind = kindmap(KIND_ID)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -25,11 +25,7 @@ Function Get-TimeStamp {
 | 
			
		||||
if ($MyInvocation.InvocationName -ne ".") {
 | 
			
		||||
    Invoke-Expression ".\.venv\Scripts\Activate.ps1"
 | 
			
		||||
 | 
			
		||||
    @("potato") | ForEach-Object {
 | 
			
		||||
        $env:KIND = $_
 | 
			
		||||
        RunTests        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    RunTests
 | 
			
		||||
 | 
			
		||||
    Invoke-Expression "deactivate"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -43,5 +43,5 @@ class TestErrors:
 | 
			
		||||
            "unknown-0": {"state": True},
 | 
			
		||||
            "vban-out-1": {"name": "streamname"},
 | 
			
		||||
        }
 | 
			
		||||
        with pytest.raises(ValueError, match="invalid config key 'unknown-0'"):
 | 
			
		||||
        with pytest.raises(ValueError, match="invalid config key 'unknown'"):
 | 
			
		||||
            vm.apply(CONFIG)
 | 
			
		||||
 | 
			
		||||
@ -300,19 +300,17 @@ class Remote(CBindings):
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
        def target(key):
 | 
			
		||||
            match key.split("-"):
 | 
			
		||||
                case ["strip" | "bus" | "button" as kls, index] if index.isnumeric():
 | 
			
		||||
            kls, m2, *rem = key.split("-")
 | 
			
		||||
            match kls:
 | 
			
		||||
                case "strip" | "bus" | "button":
 | 
			
		||||
                    index = m2
 | 
			
		||||
                    target = getattr(self, kls)
 | 
			
		||||
                case [
 | 
			
		||||
                    "vban",
 | 
			
		||||
                    "in" | "instream" | "out" | "outstream" as direction,
 | 
			
		||||
                    index,
 | 
			
		||||
                ] if index.isnumeric():
 | 
			
		||||
                    target = getattr(
 | 
			
		||||
                        self.vban, f"{direction.removesuffix('stream')}stream"
 | 
			
		||||
                    )
 | 
			
		||||
                case "vban":
 | 
			
		||||
                    dir = f"{m2.rstrip('stream')}stream"
 | 
			
		||||
                    index = rem[0]
 | 
			
		||||
                    target = getattr(self.vban, dir)
 | 
			
		||||
                case _:
 | 
			
		||||
                    ERR_MSG = f"invalid config key '{key}'"
 | 
			
		||||
                    ERR_MSG = f"invalid config key '{kls}'"
 | 
			
		||||
                    self.logger.error(ERR_MSG)
 | 
			
		||||
                    raise ValueError(ERR_MSG)
 | 
			
		||||
            return target[int(index)]
 | 
			
		||||
 | 
			
		||||
@ -172,8 +172,8 @@ class VbanMidiOutstream(VbanOutstream):
 | 
			
		||||
def _make_stream_pair(remote, kind):
 | 
			
		||||
    num_instream, num_outstream, num_midi, num_text = kind.vban
 | 
			
		||||
 | 
			
		||||
    def _make_cls(i, direction):
 | 
			
		||||
        match direction:
 | 
			
		||||
    def _make_cls(i, dir):
 | 
			
		||||
        match dir:
 | 
			
		||||
            case "in":
 | 
			
		||||
                if i < num_instream:
 | 
			
		||||
                    return VbanAudioInstream(remote, i)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user