mirror of
				https://github.com/onyx-and-iris/vban-cmd-python.git
				synced 2025-11-03 23:11:48 +00:00 
			
		
		
		
	add sendtext(), update readme
add sendtext function for multi-parameter strings. Also gives option for settable delay.
This commit is contained in:
		
							parent
							
								
									2b569153b0
								
							
						
					
					
						commit
						ff412ca6ca
					
				
							
								
								
									
										13
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								README.md
									
									
									
									
									
								
							@ -31,11 +31,14 @@ pip install -e .['development']
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Connection:
 | 
			
		||||
For sending a text request (remote set) several configuration options are available:
 | 
			
		||||
For sending a text request (sendtext or set_rt) several configuration options are available:
 | 
			
		||||
- `ip`: remote address
 | 
			
		||||
- `streamname`: default 'Command1'
 | 
			
		||||
- `port`: default 6990
 | 
			
		||||
- `channel`: from 0 to 255
 | 
			
		||||
- `bps`: bitrate of stream, default 0 should be safe for most cases.
 | 
			
		||||
only applies to `sendtext`:
 | 
			
		||||
- `delay`: default 0.001
 | 
			
		||||
 | 
			
		||||
Pass these values as arguments to vban_cmd.connect() as show in the example below.
 | 
			
		||||
 | 
			
		||||
@ -98,7 +101,6 @@ Factory function for remotes.
 | 
			
		||||
### `VbanCmd` (higher level)
 | 
			
		||||
#### `vban.type`
 | 
			
		||||
The kind of the Voicemeeter instance.
 | 
			
		||||
 | 
			
		||||
#### `vban.version`
 | 
			
		||||
A tuple of the form `(v1, v2, v3, v4)`.
 | 
			
		||||
 | 
			
		||||
@ -107,6 +109,13 @@ An `InputStrip` tuple, containing both physical and virtual.
 | 
			
		||||
#### `vban.bus`
 | 
			
		||||
An `OutputBus` tuple, containing both physical and virtual.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### `vban.sendtext(cmd)`
 | 
			
		||||
Sends a TEXT command, for example:
 | 
			
		||||
```python
 | 
			
		||||
# Use ';' or ',' for delimiters.
 | 
			
		||||
vban.sendtext('Strip[0].Mute=1;Strip[3].A3=0;Bus[2].Mute=0;Bus[3].Eq.On=1')
 | 
			
		||||
```
 | 
			
		||||
#### `vban.show()`
 | 
			
		||||
Shows Voicemeeter if it's hide. No effect otherwise.
 | 
			
		||||
#### `vban.hide()`
 | 
			
		||||
 | 
			
		||||
@ -114,8 +114,8 @@ class VbanCmd(abc.ABC):
 | 
			
		||||
            return data
 | 
			
		||||
        return fget()
 | 
			
		||||
 | 
			
		||||
    def set_rt(self, id_, param, val):
 | 
			
		||||
        cmd = f'{id_}.{param}={val}'
 | 
			
		||||
    def set_rt(self, id_, param=None, val=None):
 | 
			
		||||
        cmd = id_ if not param and val else f'{id_}.{param}={val}'
 | 
			
		||||
        if self._sendrequest_string_socket in self.ready_to_write:
 | 
			
		||||
            self._sendrequest_string_socket.sendto(
 | 
			
		||||
                self._text_header.header + cmd.encode(), (socket.gethostbyname(self._ip), self._port)
 | 
			
		||||
@ -123,6 +123,10 @@ class VbanCmd(abc.ABC):
 | 
			
		||||
            count = int.from_bytes(self._text_header.framecounter, 'little') + 1
 | 
			
		||||
            self._text_header.framecounter = count.to_bytes(4, 'little')
 | 
			
		||||
 | 
			
		||||
    def sendtext(self, cmd):
 | 
			
		||||
        self.set_rt(cmd)
 | 
			
		||||
        sleep(self._delay)
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def type(self):
 | 
			
		||||
        return self.public_packet.voicemeetertype
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user