Skip to content

Commit

Permalink
Port VMR to AHK v2 (#23)
Browse files Browse the repository at this point in the history
* Port VBVMR to ahk v2

* Add doc comments in VBVMR + Fix VMRError message

* Update comments

* Fix VBVMR.FUNC member access

* Format comments

* Add VMRBus

* Add returnCode field in VMRError

* Add VMRDevice

* Add VMRStrip

* Add VMR.ahk

* Add VMRConsts + Add VMR Login/Sync

* Add VMR.On/Off

* Refactor code

* Implement VMR.Sync method

* Add VMR._InitializeComponents

* Refactor code

* Fix VMRDevice Set/GetParameter

* Remove unnecessary Bus/Strip properties

* Implement VMR Exec/UpdateDevices + Refactor code

* Add DevicesUpdated event + Refactor code

* Refactor code + jsdoc

* Fix VBVMR bug + Refactor code

* Update VMR Get*Device to use a a default driver

* Fix VMR bug

* Update docs links

* Fix VMR.Sync

* Add GainPercentage property to VMRAudioIO

* Fix VMRUtils bug

* Add VMRAudioIO.Increment + Fix GainPercentage

* Update docs

* Add Build script + Add vscode settings

* Fix include paths and update version

* Fix build script

* Add properties for string bus/strip parameters

* Update examples + README for v2

* Refactor code + Update VMR methods to use one-based indices

* Add VMRAsyncOp + Update example

* Update examples

* Fix VMRAsyncOp not resolving inner op correctly

* Update AppGain/Appmute to throw on physical strips + Refactor code

* Fix AppGain/Mute bug + Refactor code

* Move EQ property to VMRAudioIO + Refactor code

* Add VMR Commands

* Add VMRControllerBase + Add Fx, Option, Patch properties

* Refactor code

* Add VMRMacroButton

* Refactor code

* Add VMRRecorder

* Add VMRVBAN

* Fix VMRControllerBase bug

* Update example

* Add VMR.Version

* Fix VMRAudioIO case sensitivity bug + Refactor code

* Remove Get*Device methods from VMR

* Refactor code

* Add VMRAudioIO.Type + Add UI example

* Add support for string RecallPreset command + Update README

* Fix ui_example bug

* Build v2 rc

* Update docs

* Update docsify settings

* Fix jsdoc comments

* Update docs

* Fix docs style

* Release v2.0.0
  • Loading branch information
SaifAqqad authored Mar 9, 2024
1 parent f83bc61 commit 86c7925
Show file tree
Hide file tree
Showing 63 changed files with 6,143 additions and 2,315 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*.exe
_site
.jekyll-cache
.vscode
.vscode/launch.json
src/v1
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"thqby.vscode-autohotkey2-lsp",
"zero-plusplus.vscode-autohotkey-debug"
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"AutoHotkey2.ActionWhenV1IsDetected": "Warn",
"AutoHotkey2.AutoLibInclude": "Local",
"AutoHotkey2.CompleteFunctionParens": true,
"AutoHotkey2.Files.ScanMaxDepth": 3,
"AutoHotkey2.FormatOptions": {
"brace_style": "One True Brace Variant",
"keep_array_indentation": true,
"keyword_start_with_uppercase": false,
"max_preserve_newlines": 3,
"preserve_newlines": true,
"space_after_double_colon": true,
"switch_case_alignment": false,
"symbol_with_same_case": true
},
"AutoHotkey2.Warn.CallWithoutParentheses": "On",
"AutoHotkey2.Warn.LocalSameAsGlobal": true,
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build VMR",
"type": "process",
"command": "${config:AutoHotkey2.InterpreterPath}",
"options": {
"cwd": "${workspaceFolder}"
},
"args": [
{
"value": ".\\src\\Build.ahk",
"quoting": "strong"
},
{
"value": ".\\src\\VMR.ahk",
"quoting": "strong"
},
{
"value": ".\\dist\\VMR.ahk",
"quoting": "strong"
},
{
"value": "${input:buildVersion}",
"quoting": "strong"
}
],
"problemMatcher": [],
}
],
"inputs": [
{
"id": "buildVersion",
"description": "Please enter the build version",
"type": "promptString",
"default": "ahkpm"
}
],
}
52 changes: 0 additions & 52 deletions Build.ahk

This file was deleted.

50 changes: 31 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,43 @@ VMR.ahk
</p>

## Getting Started

To use `VMR.ahk` in your script, follow one of the following methods:

### A - ahkpm installation
1. Install and set up [ahkpm](https://github.com/joshuacc/ahkpm), then run `ahkpm install gh:SaifAqqad/VMR.ahk`
2. Run `ahkpm include -f my-script.ahk gh:SaifAqqad/VMR.ahk` to add an include directive in your script
###### Replace *my-script.ahk* with your script's path
### A. ahkpm installation

1. Install and set up [ahkpm](https://github.com/joshuacc/ahkpm)
2. Run `ahkpm install gh:SaifAqqad/VMR.ahk`
3. Include VMR in your script by running `ahkpm include gh:SaifAqqad/VMR.ahk -f myScript.ahk`
###### Replace *myScript.ahk* with your script's path

### B. Manual Installation

### B - Manual Installation
1. Download the latest pre-built version from the [`dist` folder](https://raw.githubusercontent.com/SaifAqqad/VMR.ahk/master/dist/VMR.ahk) or follow the build instructions below
1. Download the latest pre-built version from the [`dist` folder](https://raw.githubusercontent.com/SaifAqqad/VMR.ahk/master/dist/VMR.ahk) / [latest release](https://github.com/SaifAqqad/VMR.ahk/releases) or follow the build instructions below
2. Include it using `#Include VMR.ahk` or copy it to a [library folder](https://www.autohotkey.com/docs/v2/Scripts.htm#lib) and use `#Include <VMR>`

2. Include it using `#Include VMR.ahk` or copy it to a [library folder](https://www.autohotkey.com/docs/Functions.htm#lib) and use `#Include <VMR>`
> [!IMPORTANT]
> The current version of VMR ***only*** supports AHK v2, The AHK v1 version is still available on the [v1 branch](https://github.com/SaifAqqad/VMR.ahk/tree/v1) but will (probably) not receive any updates.
3. Create an instance of the VMR class and log in to the API:
```ahk
voicemeeter:= new VMR().login()
```
4. The `VMR` object will have two arrays (`bus` and`strip`), as well as other objects, that will allow you to control voicemeeter in AHK.
```ahk
voicemeeter.bus[1].mute:= true
voicemeeter.strip[4].gain++
```
## Basic usage
- Create an instance of the `VMR` class and log in to the API:
```ahk
voicemeeter := VMR().Login()
```
- The `VMR` instance will have two arrays (`Bus` and `Strip`), as well as other properties/methods that will allow you to control voicemeeter in AHK
```ahk
voicemeeter.Bus[1].mute := true
voicemeeter.Strip[4].gain++
```
##### For more info, check out the [documentation](https://saifaqqad.github.io/VMR.ahk/) and the [examples](./examples/)

## Build instructions
To build `VMR.ahk` yourself, run the build script:

To build `VMR.ahk`, either run the vscode task `Build VMR` or run the build script using ahkpm or manually:

```powershell
.\Build.ahk <version number>
# ahkpm
ahkpm run build
# Manually
Autohotkey.exe ".\Build.ahk" ".\VMR.ahk" "..\dist\VMR.ahk" "<version number>"
```
##### For more info, check out the [documentation](https://saifaqqad.github.io/VMR.ahk/)
7 changes: 5 additions & 2 deletions ahkpm.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.2.0",
"version": "2.0.0",
"description": "AutoHotkey wrapper class for Voicemeeter's Remote API",
"repository": "https://github.com/SaifAqqad/VMR.ahk",
"website": "https://saifaqqad.github.io/VMR.ahk",
Expand All @@ -11,5 +11,8 @@
"email": "",
"website": ""
},
"scripts": {
"build": "& .\\src\\Build.ahk '.\\src\\VMR.ahk' '.\\dist\\VMR.ahk' 'ahkpm'"
},
"dependencies": {}
}
}
Loading

0 comments on commit 86c7925

Please sign in to comment.