Add project files.

This commit is contained in:
onyx-and-iris 2023-05-27 19:16:48 +01:00
commit ba89a58ece
30 changed files with 7717 additions and 0 deletions

63
.gitattributes vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

363
.gitignore vendored Normal file
View File

@ -0,0 +1,363 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

23
INSTALL.md Normal file
View File

@ -0,0 +1,23 @@
# Step by step
These instructions should work for both Debug/Release builds. In this case we target Release x64.
![Release][release]
Open up project properties.<br>
![Properties][properties]
In advanced properties ensure `Character Set` is set to `Not Set`
![Character Set][char_set]
Check that `_CRT_SECURE_NO_DEPRECATE` and if targeting an x64 build `VB_X64` are in the preprocessor definitions.
![Preprocessor Definitions][pp_def]
Ensure `Ws2_32.lib` is included as an additional dependency.
![Linker dependencies][linker]
[release]: vmr_streamer/img/vm1-inst.png
[properties]: vmr_streamer/img/vm2-inst.png
[char_set]: vmr_streamer/img/vm3-inst.png
[pp_def]: vmr_streamer/img/vm4-inst.png
[linker]: vmr_streamer/img/vm5-inst.png

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
MIT License (with one restriction)
Copyright (c) 2021 Vincent Burel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software and the created Software Application
must interact with the VoicemeeterRemote API.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

14
README.md Normal file
View File

@ -0,0 +1,14 @@
# Voicemeeter Streamer View App
Source files for [Voicemeeter Streamer View App][streamer_view_app] which can be found in the [applications SDK](https://github.com/vburel2018/Voicemeeter-SDK).
### Build
For a step-by-step follow [these instructions][install].
### Special Thanks
Vincent Burel for creating Voicemeeter, its SDK and the various apps released as part of it.
[install]: INSTALL.md
[streamer_view_app]: https://voicemeeter.com/the-voicemeeter-streamer-view-app-overview/

31
vmr_streamer.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33723.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmr_streamer", "vmr_streamer\vmr_streamer.vcxproj", "{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Debug|x64.ActiveCfg = Debug|x64
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Debug|x64.Build.0 = Debug|x64
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Debug|x86.ActiveCfg = Debug|Win32
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Debug|x86.Build.0 = Debug|Win32
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Release|x64.ActiveCfg = Release|x64
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Release|x64.Build.0 = Release|x64
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Release|x86.ActiveCfg = Release|Win32
{CB959FDD-2AA4-4ECD-8A50-41777BF38EEA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {00B208A7-9AA5-482F-9929-0DE2CB5EA336}
EndGlobalSection
EndGlobal

30
vmr_streamer/Resource.h Normal file
View File

@ -0,0 +1,30 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by vmr_streamer.rc
#define IDS_APP_TITLE 103
#define IDR_MAINFRAME 128
#define IDD_VMRSTREAMER_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_VMRSTREAMER 107
#define IDI_SMALL 108
#define IDC_VMRSTREAMER 109
#define IDC_MYICON 2
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

15
vmr_streamer/framework.h Normal file
View File

@ -0,0 +1,15 @@
// header.h : include file for standard system include files,
// or project specific include files
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
vmr_streamer/small.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

View File

@ -0,0 +1,974 @@
/******************************************************************************/
/* Voicemeeter Remote API. V.Burel©2015-2021 */
/******************************************************************************/
/* This Library allows communication with Voicemeeter applications */
/* 4 Client Applications can be connected to remote Voicemeeter. */
/* it also allows communication with MacroButtons application. */
/******************************************************************************/
/* */
/* OFFICIAL LINK : WWW.VOICEMEETER.COM */
/* */
/******************************************************************************/
/* COPYRIGHT: Vincent Burel(c)2015-2021 All Rights Reserved */
/******************************************************************************/
/* */
/* LICENSING: VoicemeeterRemote.dll usage is driven by a license agreement */
/* given in VoicemeeterRemoteAPI.pdf or readme.txt */
/* */
/******************************************************************************/
/* long = 32 bit integer */
/******************************************************************************/
#ifndef __VOICEMEETER_REMOTE_H__
#define __VOICEMEETER_REMOTE_H__
#ifdef __cplusplus
extern "C" {
#endif
#define VBVMR_RESULT_OK 0
/******************************************************************************/
/* */
/* Login */
/* */
/******************************************************************************/
/** @name Communication Login / logout
* @{ */
/**
@brief Open Communication Pipe With Voicemeeter (typically called on software startup).
@return : 0: OK (no error).
1: OK but Voicemeeter Application not launched.
-1: cannot get client (unexpected)
-2: unexpected login (logout was expected before).
*/
long __stdcall VBVMR_Login(void);
/**
@brief Close Communication Pipe With Voicemeeter (typically called on software end).
@return : 0 if ok.
*/
long __stdcall VBVMR_Logout(void);
/**
@brief Run Voicemeeter Application (get installation directory and run Voicemeeter Application).
@param vType : Voicemeeter type (1 = Voicemeeter, 2= Voicemeeter Banana, 3= Voicemeeter Potato, 6 = Potato x64 bits).
@return : 0: Ok.
-1: not installed (UninstallString not found in registry).
-2: unknown vType number
*/
long __stdcall VBVMR_RunVoicemeeter(long vType);
/** @} */
/******************************************************************************/
/* */
/* General Information */
/* */
/******************************************************************************/
/** @name General Information
* @{ */
/**
@brief Get Voicemeeter Type
@param pType : Pointer on 32bit long receiving the type (1 = Voicemeeter, 2= Voicemeeter Banana, 3 Potato).
VOICEMEETER STRIP/BUS INDEX ASSIGNMENT
| Strip 1 | Strip 2 |Virtual Input| BUS A | BUS B |
+---------+---------+-------------+---------+---------+
| 0 | 1 | 2 | 0 | 1 |
VOICEMEETER BANANA STRIP/BUS INDEX ASSIGNMENT
| Strip 1 | Strip 2 | Strip 2 |Virtual Input|Virtual AUX|BUS A1|BUS A2|BUS A3|BUS B1|BUS B2|
+---------+---------+---------+-------------+-----------+------+------+------+------+------+
| 0 | 1 | 2 | 3 | 4 | 0 | 1 | 2 | 3 | 4 |
VOICEMEETER POTATO STRIP/BUS INDEX ASSIGNMENT
| Strip 1 | Strip 2 | Strip 2 | Strip 2 | Strip 2 |Virtual Input|Virtual AUX| VAIO3 |BUS A1|BUS A2|BUS A3|BUS A4|BUS A5|BUS B1|BUS B2|BUS B3|
+---------+---------+---------+---------+---------+-------------+-----------+-----------+------+------+------+------+------+------+------+------+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
@return : 0: OK (no error).
-1: cannot get client (unexpected)
-2: no server.
*/
long __stdcall VBVMR_GetVoicemeeterType(long * pType);
/**
@brief Get Voicemeeter Version
@param pType : Pointer on 32bit integer receiving the version (v1.v2.v3.v4)
v1 = (version & 0xFF000000)>>24;
v2 = (version & 0x00FF0000)>>16;
v3 = (version & 0x0000FF00)>>8;
v4 = version & 0x000000FF;
@return : 0: OK (no error).
-1: cannot get client (unexpected)
-2: no server.
*/
long __stdcall VBVMR_GetVoicemeeterVersion(long * pVersion);
/** @} */
/******************************************************************************/
/* */
/* Get parameters */
/* */
/******************************************************************************/
/** @name Getting Parameters
* @{ */
/**
@brief Check if parameters have changed.
Call this function periodically (typically every 10 or 20ms).
(this function must be called from one thread only)
@return: 0: no new paramters.
1: New parameters -> update your display.
-1: error (unexpected)
-2: no server.
*/
long __stdcall VBVMR_IsParametersDirty(void);
/**
@brief get parameter value.
@param szParamName : Null Terminal ASCII String giving the name of the parameter (see parameters name table)
@param pValue : Pointer on float (32bit float by reference) receiving the wanted value.
@return : 0: OK (no error).
-1: error
-2: no server.
-3: unknown parameter
-5: structure mismatch
*/
long __stdcall VBVMR_GetParameterFloat(char * szParamName, float * pValue);
/**
@brief get parameter value.
@param szParamName : Null Terminal ASCII String giving the name of the parameter (see parameters name table)
@param pValue : Pointer on String (512 char or wchar) receiving the wanted value.
@return : 0: OK (no error).
-1: error
-2: no server.
-3: unknown parameter
-5: structure mismatch
*/
long __stdcall VBVMR_GetParameterStringA(char * szParamName, char * szString);
long __stdcall VBVMR_GetParameterStringW(char * szParamName, unsigned short * wszString);
/** @} */
/******************************************************************************/
/* */
/* Get levels */
/* */
/******************************************************************************/
/** @name Getting RT Data
* @{ */
/**
@brief Get Current levels.
(this function must be called from one thread only)
@param nType: 0= pre fader input levels.
1= post fader input levels.
2= post Mute input levels.
3= output levels.
@param nuChannel: audio channel zero based index
for input 0 = in#1 left, 1= in#1 Right, etc...
for output 0 = busA ch1, 1 = busA ch2...
VOICEMEETER CHANNEL ASSIGNMENT
| Strip 1 | Strip 2 | Virtual Input |
+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 |
| Output A1 / A2 | Virtual Output |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 |
VOICEMEETER BANANA CHANNEL ASSIGNMENT
| Strip 1 | Strip 2 | Strip 3 | Virtual Input | Virtual Input AUX |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| Output A1 | Output A2 | Output A3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| Virtual Output B1 | Virtual Output B2 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
VOICEMEETER POTATO CHANNEL ASSIGNMENT
| Strip 1 | Strip 2 | Strip 3 | Strip 4 | Strip 5 | Virtual Input | Virtual Input AUX | VAIO3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
| Output A1 | Output A2 | Output A3 | Output A4 | Output A5 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
| Virtual Output B1 | Virtual Output B2 | Virtual Output B3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
@return : 0: OK (no error).
-1: error
-2: no server.
-3: no level available
-4: out of range
*/
long __stdcall VBVMR_GetLevel(long nType, long nuChannel, float * pValue);
/**
@brief Get MIDI message from M.I.D.I. input device used by Voicemeeter M.I.D.I. mapping.
(this function must be called from one thread only)
@param pMIDIBuffer: pointer on MIDI Buffer. Expected message size is below 4 bytes,
but it's recommended to use 1024 Bytes local buffer to receive
possible multiple M.I.D.I. event message in optimal way:
unsigned char pBuffer[1024];
@return : >0: number of bytes placed in buffer (2 or 3 byte for usual M.I.D.I. message)
-1: error
-2: no server.
-5: no MIDI data
-6: no MIDI data
*/
long __stdcall VBVMR_GetMidiMessage(unsigned char *pMIDIBuffer, long nbByteMax);
/** @} */
/******************************************************************************/
/* */
/* Set Parameters */
/* */
/******************************************************************************/
/** @name Setting Parameters
* @{ */
/**
@brief Set a single float 32 bits parameters .
@param szParamName : Null Terminal ASCII String giving the name of the parameter (see parameters name table)
example:
Strip[1].gain
Strip[0].mute
Bus[0].gain
Bus[0].eq.channel[0].cell[0].gain
@param pValue : float 32bit containing the new value.
@return : 0: OK (no error).
-1: error
-2: no server.
-3: unknown parameter
*/
long __stdcall VBVMR_SetParameterFloat(char * szParamName, float Value);
/**
@brief Set a single string parameters .
@param szParamName : Null Terminal ASCII String giving the name of the parameter (see parameters name table)
example:
Strip[1].name
Strip[0].device.mme
Bus[0].device.asio
@param szString : zero terminal string.
@return : 0: OK (no error).
-1: error
-2: no server.
-3: unknown parameter
*/
long __stdcall VBVMR_SetParameterStringA(char * szParamName, char * szString);
long __stdcall VBVMR_SetParameterStringW(char * szParamName, unsigned short * wszString);
/**
@brief Set one or several parameters by a script ( < 48 kB ).
@param szParamName : Null Terminal ASCII String giving the script
(script allows to change several parameters in the same time - SYNCHRO).
Possible Instuction separators: ',' ';' or '\n'(CR)
EXAMPLE:
"Strip[0].gain = -6.0
Strip[0].A1 = 0
Strip[0].B1 = 1
Strip[1].gain = -6.0
Strip[2].gain = 0.0
Strip[3].name = "Skype Caller" "
@return : 0: OK (no error).
>0: number of line causing script error.
-1: error
-2: no server.
-3: unexpected error
-4: unexpected error
*/
long __stdcall VBVMR_SetParameters(char * szParamScript);
long __stdcall VBVMR_SetParametersW(unsigned short * szParamScript);
/** @} */
/******************************************************************************/
/* DEVICES ENUMERATOR */
/******************************************************************************/
/** @name Device Enumeration Functions
* @{ */
#define VBVMR_DEVTYPE_MME 1
#define VBVMR_DEVTYPE_WDM 3
#define VBVMR_DEVTYPE_KS 4
#define VBVMR_DEVTYPE_ASIO 5
/**
@brief Get number of Audio Output Device available on the system
@return : return number of device found.
*/
long __stdcall VBVMR_Output_GetDeviceNumber(void);
/**
@brief Return pointer on Output Device Descriptor according index
@param zindex : zero based index
@param nType : Pointer on 32bit long receiving the type (pointer can be NULL).
@param szName : Pointer on string (256 char min) receiving the device name (pointer can be NULL).
@param szHardwareId : Pointer on string (256 char min) receiving the hardware ID (pointer can be NULL).
@return : 0: OK (no error).
*/
long __stdcall VBVMR_Output_GetDeviceDescA(long zindex, long * nType, char * szDeviceName, char * szHardwareId);
long __stdcall VBVMR_Output_GetDeviceDescW(long zindex, long * nType, unsigned short * wszDeviceName, unsigned short * wszHardwareId);
/**
@brief Get number of Audio Input Device available on the system
@return : return number of device found.
*/
long __stdcall VBVMR_Input_GetDeviceNumber(void);
/**
@brief Return pointer on Input Device Descriptor according index
@param zindex : zero based index
@param nType : Pointer on 32bit long receiving the type (pointer can be NULL).
@param szName : Pointer on string (256 char min) receiving the device name (pointer can be NULL).
@param szHardwareId : Pointer on string (256 char min) receiving the hardware ID (pointer can be NULL).
@return : 0: OK (no error).
*/
long __stdcall VBVMR_Input_GetDeviceDescA(long zindex, long * nType, char * szDeviceName, char * szHardwareId);
long __stdcall VBVMR_Input_GetDeviceDescW(long zindex, long * nType, unsigned short * wszDeviceName, unsigned short * wszHardwareId);
/** @} */
/******************************************************************************/
/* VB-AUDIO CALLBACK */
/******************************************************************************/
/* 4x Functions to process all voicemeeter audio input and output channels */
/* */
/* VBVMR_AudioCallbackRegister :to register your audio callback(s) */
/* VBVMR_AudioCallbackStart :to start the audio stream */
/* VBVMR_AudioCallbackStop :to stop the audio stream */
/* VBVMR_AudioCallbackUnregister :to unregister / Release callback(s) */
/******************************************************************************/
/** @name VB-Audio Callback Functions
* @{ */
typedef struct tagVBVMR_AUDIOINFO
{
long samplerate;
long nbSamplePerFrame;
} VBVMR_T_AUDIOINFO, *VBVMR_PT_AUDIOINFO, *VBVMR_LPT_AUDIOINFO;
typedef struct tagVBVMR_AUDIOBUFFER
{
long audiobuffer_sr; //Sampling Rate
long audiobuffer_nbs; //number of sample per frame
long audiobuffer_nbi; //number of inputs
long audiobuffer_nbo; //number of outputs
float * audiobuffer_r[128]; //nbi input pointers containing frame of nbs sample (of 32bits float)
float * audiobuffer_w[128]; //nbo output pointers containing frame of nbs sample (of 32bits float)
} VBVMR_T_AUDIOBUFFER, *VBVMR_PT_AUDIOBUFFER, *VBVMR_LPT_AUDIOBUFFER;
/**
@brief VB-AUDIO Callback is called for different task to Initialize, perform and end your process.
VB-AUDIO Callback is part of single TIME CRITICAL Thread.
VB-AUDIO Callback is non re-entrant (cannot be called while in process)
VB-AUDIO Callback is supposed to be REAL TIME when called to process buffer.
(it means that the process has to be performed as fast as possible, waiting cycles are forbidden.
do not use O/S synchronization object, even Critical_Section can generate waiting cycle. Do not use
system functions that can generate waiting cycle like display, disk or communication functions for example).
@param lpUser: User pointer given on callback registration.
@param ncommand: reason why the callback is called.
@param lpData: pointer on structure, pending on nCommand.
@param nnn: additional data, unused
@return : 0: always 0 (unused).
*/
typedef long (__stdcall *T_VBVMR_VBAUDIOCALLBACK)(void * lpUser, long nCommand, void * lpData, long nnn);
#define VBVMR_CBCOMMAND_STARTING 1 //command to initialize data according SR and buffer size
//info = (VBVMR_LPT_AUDIOINFO)lpData
#define VBVMR_CBCOMMAND_ENDING 2 //command to release data
#define VBVMR_CBCOMMAND_CHANGE 3 //If change in audio stream, you will have to restart audio
#define VBVMR_CBCOMMAND_BUFFER_IN 10 //input insert
#define VBVMR_CBCOMMAND_BUFFER_OUT 11 //bus output insert
#define VBVMR_CBCOMMAND_BUFFER_MAIN 20 //all i/o
//audiobuffer = (VBVMR_LPT_AUDIOBUFFER)lpData
//nnn = synchro = 1 if synchro with Voicemeeter
/*
-----------------------------------------------------
AUDIO BUFFER for VBVMR_CBCOMMAND_BUFFER_IN
-----------------------------------------------------
VOICEMEETER
| Strip 1 | Strip 2 | Virtual Input |
+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 |
VOICEMEETER BANANA
| Strip 1 | Strip 2 | Strip 3 | Virtual Input | Virtual Input AUX |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
VOICEMEETER 8
| Strip 1 | Strip 2 | Strip 3 | Strip 4 | Strip 5 | Virtual Input | Virtual Input AUX | Virtual Input 8 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
-----------------------------------------------------
AUDIO BUFFER for VBVMR_CBCOMMAND_BUFFER_OUT
-----------------------------------------------------
VOICEMEETER
| Output A1 / A2 | Virtual Output |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 |
VOICEMEETER BANANA
| Output A1 | Output A2 | Output A3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| Virtual Output B1 | Virtual Output B2 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
VOICEMEETER 8
| Output A1 | Output A2 | Output A3 | Output A4 | Output A5 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
| Virtual Output B1 | Virtual Output B2 | Virtual Output B3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
-----------------------------------------------------
AUDIO BUFFER for VBVMR_CBCOMMAND_BUFFER_MAIN
-----------------------------------------------------
VOICEMEETER
| Strip 1 | Strip 2 | Virtual Input |
+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 |
| Output A1 / A2 | Virtual Output |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
Output buffer provides outputs only:
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 |
VOICEMEETER BANANA
| Strip 1 | Strip 2 | Strip 3 | Virtual Input | Virtual Input AUX |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| Output A1 | Output A2 | Output A3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
Output buffer provides outputs only:
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| Virtual Output B1 | Virtual Output B2 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
Output buffer provides outputs only:
| 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
VOICEMEETER 8
| Strip 1 | Strip 2 | Strip 3 | Strip 4 | Strip 5 | Virtual Input | Virtual Input AUX | Virtual Input 8 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
| Output A1 | Output A2 | Output A3 | Output A4 | Output A5 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
Output buffer provides outputs only:
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
| Virtual Output B1 | Virtual Output B2 | Virtual Output B3 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
Output buffer provides outputs only:
| 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
*/
/**
@brief register your audio callback function to receive real time audio buffer
it's possible to register up to 3x different Audio Callback in the same application or in
3x different applications. In the same application, this is possible because Voicemeeter
provides 3 kind of audio Streams:
- AUDIO INPUT INSERT (to process all Voicemeeter inputs as insert)
- AUDIO OUTPUT INSERT (to process all Voicemeeter BUS outputs as insert)
- ALL AUDIO I/O (to process all Voicemeeter i/o).
Note: a single callback can be used to receive the 3 possible audio streams.
@param mode : callback type (main, input or bus output) see define below
@param pCallback : Pointer on your callback function.
@param lpUser : user pointer (pointer that will be passed in callback first argument).
@param szClientName[64]: IN: Name of the application registering the Callback.
OUT: Name of the application already registered.
@return : 0: OK (no error).
-1: error
1: callback already registered (by another application).
*/
long __stdcall VBVMR_AudioCallbackRegister(long mode, T_VBVMR_VBAUDIOCALLBACK pCallback, void * lpUser, char szClientName[64]);
#define VBVMR_AUDIOCALLBACK_IN 0x00000001 //to process input insert
#define VBVMR_AUDIOCALLBACK_OUT 0x00000002 //to process output bus insert
#define VBVMR_AUDIOCALLBACK_MAIN 0x00000004 //to receive all i/o
/**
@brief Start / Stop Audio processing
he Callback will be called with
@return : 0: OK (no error).
-1: error
-2: no callback registred.
*/
long __stdcall VBVMR_AudioCallbackStart(void);
long __stdcall VBVMR_AudioCallbackStop(void);
/**
@brief unregister your callback to release voicemeeter virtual driver
(this function will automatically call VBVMR_AudioCallbackStop() function)
@param pCallback : Pointer on your callback function.
@return : 0: OK (no error).
-1: error
1: callback already unregistered.
*/
long __stdcall VBVMR_AudioCallbackUnregister(void);
/** @} */
/******************************************************************************/
/* */
/* Macro Buttons */
/* */
/******************************************************************************/
/** @name Macro Buttons functions
* @{ */
/**
@brief Check if Macro Buttons states changed.
Call this function periodically (typically every 50 or 500ms) to know if something happen on MacroButton states .
(this function must be called from one thread only)
@return: 0: no new status.
>0: last nu logical button status changed.
-1: error (unexpected)
-2: no server.
*/
long __stdcall VBVMR_MacroButton_IsDirty(void);
/**
@brief get current status of a given button.
@param nuLogicalButton : button index: 0 to 79)
@param pValue : Pointer on float (32bit float by reference) receiving the wanted value (0.0 = OFF / 1.0 = ON).
@param bitmode: define what kind of value you want to read (see MACROBUTTON_MODE below)
@return : 0: OK (no error).
-1: error
-2: no server.
-3: unknown parameter
-5: structure mismatch
*/
long __stdcall VBVMR_MacroButton_GetStatus(long nuLogicalButton, float * pValue, long bitmode);
/**
@brief set current button value.
@param nuLogicalButton : button index: 0 to 79)
@param fValue : float 32 bit value giving the status (0.0 = OFF / 1.0 = ON).
@param bitmode: define what kind of value you want to write/modify (see MACROBUTTON_MODE below)
@return : 0: OK (no error).
-1: error
-2: no server.
-3: unknown parameter
-5: structure mismatch
*/
long __stdcall VBVMR_MacroButton_SetStatus(long nuLogicalButton, float fValue, long bitmode);
#define VBVMR_MACROBUTTON_MODE_DEFAULT 0x00000000 //PUSH or RELEASE button
#define VBVMR_MACROBUTTON_MODE_STATEONLY 0x00000002 //change Displayed State only
#define VBVMR_MACROBUTTON_MODE_TRIGGER 0x00000003 //change Trigger State
/** @} */
/******************************************************************************/
/* 'C' STRUCTURED INTERFACE */
/******************************************************************************/
typedef long (__stdcall *T_VBVMR_Login)(void);
typedef long (__stdcall *T_VBVMR_Logout)(void);
typedef long (__stdcall *T_VBVMR_RunVoicemeeter)(long vType);
typedef long (__stdcall *T_VBVMR_GetVoicemeeterType)(long * pType);
typedef long (__stdcall *T_VBVMR_GetVoicemeeterVersion)(long * pVersion);
typedef long (__stdcall *T_VBVMR_IsParametersDirty)(void);
typedef long (__stdcall *T_VBVMR_GetParameterFloat)(char * szParamName, float * pValue);
typedef long (__stdcall *T_VBVMR_GetParameterStringA)(char * szParamName, char * szString);
typedef long (__stdcall *T_VBVMR_GetParameterStringW)(char * szParamName, unsigned short * wszString);
typedef long (__stdcall *T_VBVMR_GetLevel)(long nType, long nuChannel, float * pValue);
typedef long (__stdcall *T_VBVMR_GetMidiMessage)(unsigned char *pMIDIBuffer, long nbByteMax);
typedef long (__stdcall *T_VBVMR_SetParameterFloat)(char * szParamName, float Value);
typedef long (__stdcall *T_VBVMR_SetParameters)(char * szParamScript);
typedef long (__stdcall *T_VBVMR_SetParametersW)(unsigned short * szParamScript);
typedef long (__stdcall *T_VBVMR_SetParameterStringA)(char * szParamName, char * szString);
typedef long (__stdcall *T_VBVMR_SetParameterStringW)(char * szParamName, unsigned short * wszString);
typedef long (__stdcall *T_VBVMR_Output_GetDeviceNumber)(void);
typedef long (__stdcall *T_VBVMR_Output_GetDeviceDescA)(long zindex, long * nType, char * szDeviceName, char * szHardwareId);
typedef long (__stdcall *T_VBVMR_Output_GetDeviceDescW)(long zindex, long * nType, unsigned short * wszDeviceName, unsigned short * wszHardwareId);
typedef long (__stdcall *T_VBVMR_Input_GetDeviceNumber)(void);
typedef long (__stdcall *T_VBVMR_Input_GetDeviceDescA)(long zindex, long * nType, char * szDeviceName, char * szHardwareId);
typedef long (__stdcall *T_VBVMR_Input_GetDeviceDescW)(long zindex, long * nType, unsigned short * wszDeviceName, unsigned short * wszHardwareId);
typedef long (__stdcall *T_VBVMR_AudioCallbackRegister)(long mode, T_VBVMR_VBAUDIOCALLBACK pCallback, void * lpUser, char szClientName[64]);
typedef long (__stdcall *T_VBVMR_AudioCallbackStart)(void);
typedef long (__stdcall *T_VBVMR_AudioCallbackStop)(void);
typedef long (__stdcall *T_VBVMR_AudioCallbackUnregister)(void);
typedef long (__stdcall *T_VBVMR_MacroButton_IsDirty)(void);
typedef long (__stdcall *T_VBVMR_MacroButton_GetStatus)(long nuLogicalButton, float * pValue, long bitmode);
typedef long (__stdcall *T_VBVMR_MacroButton_SetStatus)(long nuLogicalButton, float fValue, long bitmode);
typedef struct tagVBVMR_INTERFACE
{
T_VBVMR_Login VBVMR_Login;
T_VBVMR_Logout VBVMR_Logout;
T_VBVMR_RunVoicemeeter VBVMR_RunVoicemeeter;
T_VBVMR_GetVoicemeeterType VBVMR_GetVoicemeeterType;
T_VBVMR_GetVoicemeeterVersion VBVMR_GetVoicemeeterVersion;
T_VBVMR_IsParametersDirty VBVMR_IsParametersDirty;
T_VBVMR_GetParameterFloat VBVMR_GetParameterFloat;
T_VBVMR_GetParameterStringA VBVMR_GetParameterStringA;
T_VBVMR_GetParameterStringW VBVMR_GetParameterStringW;
T_VBVMR_GetLevel VBVMR_GetLevel;
T_VBVMR_GetMidiMessage VBVMR_GetMidiMessage;
T_VBVMR_SetParameterFloat VBVMR_SetParameterFloat;
T_VBVMR_SetParameters VBVMR_SetParameters;
T_VBVMR_SetParametersW VBVMR_SetParametersW;
T_VBVMR_SetParameterStringA VBVMR_SetParameterStringA;
T_VBVMR_SetParameterStringW VBVMR_SetParameterStringW;
T_VBVMR_Output_GetDeviceNumber VBVMR_Output_GetDeviceNumber;
T_VBVMR_Output_GetDeviceDescA VBVMR_Output_GetDeviceDescA;
T_VBVMR_Output_GetDeviceDescW VBVMR_Output_GetDeviceDescW;
T_VBVMR_Input_GetDeviceNumber VBVMR_Input_GetDeviceNumber;
T_VBVMR_Input_GetDeviceDescA VBVMR_Input_GetDeviceDescA;
T_VBVMR_Input_GetDeviceDescW VBVMR_Input_GetDeviceDescW;
T_VBVMR_AudioCallbackRegister VBVMR_AudioCallbackRegister;
T_VBVMR_AudioCallbackStart VBVMR_AudioCallbackStart;
T_VBVMR_AudioCallbackStop VBVMR_AudioCallbackStop;
T_VBVMR_AudioCallbackUnregister VBVMR_AudioCallbackUnregister;
T_VBVMR_MacroButton_IsDirty VBVMR_MacroButton_IsDirty;
T_VBVMR_MacroButton_GetStatus VBVMR_MacroButton_GetStatus;
T_VBVMR_MacroButton_SetStatus VBVMR_MacroButton_SetStatus;
} T_VBVMR_INTERFACE, *PT_VBVMR_INTERFACE, *LPT_VBVMR_INTERFACE;
#ifdef VBUSE_LOCALLIB
// internal used (not public)
void __stdcall VBVMR_SetHinstance(HINSTANCE hinst);
#endif
/******************************************************************************/
/* VBAN RT PACKET */
/******************************************************************************/
#pragma pack(1)
// COMPATIBILITY: defined structure cannot be changed.
// some field could be added at the end of the structure to keep the compatibility in the time.
typedef struct tagVBAN_VMRT_PACKET
{
unsigned char voicemeeterType; // 1 = Voicemeeter, 2= Voicemeeter Banana, 3 Potato
unsigned char reserved; // unused
unsigned short buffersize; // main stream buffer size
unsigned long voicemeeterVersion; // version like for VBVMR_GetVoicemeeterVersion() functino
unsigned long optionBits; // unused
unsigned long samplerate; // main stream samplerate
short inputLeveldB100[34]; // pre fader input peak level in dB * 100
short outputLeveldB100[64]; // bus output peak level in dB * 100
unsigned long TransportBit; // Transport Status
unsigned long stripState[8]; // Strip Buttons Status (see MODE bits below)
unsigned long busState[8]; // Bus Buttons Status (see MODE bits below)
short stripGaindB100Layer1[8]; // Strip Gain in dB * 100
short stripGaindB100Layer2[8];
short stripGaindB100Layer3[8];
short stripGaindB100Layer4[8];
short stripGaindB100Layer5[8];
short stripGaindB100Layer6[8];
short stripGaindB100Layer7[8];
short stripGaindB100Layer8[8];
short busGaindB100[8]; // Bus Gain in dB * 100
char stripLabelUTF8c60[8][60]; // Strip Label
char busLabelUTF8c60[8][60]; // Bus Label
} T_VBAN_VMRT_PACKET, *PT_VBAN_VMRT_PACKET, *LPT_VBAN_VMRT_PACKET;
#define expected_size_T_VBAN_VMRT_PACKET 1384 //1436 max
#pragma pack()
#define VMRTSTATE_MODE_MUTE 0x00000001
#define VMRTSTATE_MODE_SOLO 0x00000002
#define VMRTSTATE_MODE_MONO 0x00000004
#define VMRTSTATE_MODE_MUTEC 0x00000008
#define VMRTSTATE_MODE_MIXDOWN 0x00000010
#define VMRTSTATE_MODE_REPEAT 0x00000020
#define VMRTSTATE_MODE_MIXDOWNB 0x00000030
#define VMRTSTATE_MODE_COMPOSITE 0x00000040
#define VMRTSTATE_MODE_UPMIXTV 0x00000050
#define VMRTSTATE_MODE_UPMIX2 0x00000060
#define VMRTSTATE_MODE_UPMIX4 0x00000070
#define VMRTSTATE_MODE_UPMIX6 0x00000080
#define VMRTSTATE_MODE_CENTER 0x00000090
#define VMRTSTATE_MODE_LFE 0x000000A0
#define VMRTSTATE_MODE_REAR 0x000000B0
#define VMRTSTATE_MODE_MASK 0x000000F0
#define VMRTSTATE_MODE_EQ 0x00000100
#define VMRTSTATE_MODE_CROSS 0x00000200
#define VMRTSTATE_MODE_EQB 0x00000800
#define VMRTSTATE_MODE_BUSA 0x00001000
#define VMRTSTATE_MODE_BUSA1 0x00001000
#define VMRTSTATE_MODE_BUSA2 0x00002000
#define VMRTSTATE_MODE_BUSA3 0x00004000
#define VMRTSTATE_MODE_BUSA4 0x00008000
#define VMRTSTATE_MODE_BUSA5 0x00080000
#define VMRTSTATE_MODE_BUSB 0x00010000
#define VMRTSTATE_MODE_BUSB1 0x00010000
#define VMRTSTATE_MODE_BUSB2 0x00020000
#define VMRTSTATE_MODE_BUSB3 0x00040000
#define VMRTSTATE_MODE_PAN0 0x00000000
#define VMRTSTATE_MODE_PANCOLOR 0x00100000
#define VMRTSTATE_MODE_PANMOD 0x00200000
#define VMRTSTATE_MODE_PANMASK 0x00F00000
#define VMRTSTATE_MODE_POSTFX_R 0x01000000
#define VMRTSTATE_MODE_POSTFX_D 0x02000000
#define VMRTSTATE_MODE_POSTFX1 0x04000000
#define VMRTSTATE_MODE_POSTFX2 0x08000000
#define VMRTSTATE_MODE_SEL 0x10000000
#define VMRTSTATE_MODE_MONITOR 0x20000000
/******************************************************************************/
/* LOCAL FUNCTIONS */
/******************************************************************************/
long VBVMR_LocalInit(void);
long VBVMR_LocalEnd(void);
void * VBVMR_GetRequestVB0STREAMPTR(void);
long VBVMR_SetParametersWEx(unsigned short * szParamScript, long fCopyToClient);
long VBVMR_LoginEx(long properties);
long VBVMR_MB_PushSettings(void * lpParam);
#ifdef __cplusplus
}
#endif
#endif /*__VOICEMEETER_REMOTE_H__*/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,199 @@
/**********************************************************************************/
/* VMSCTL V.Burel */
/**********************************************************************************/
/* Contains our custom windows control for vmr_streamer project */
/*--------------------------------------------------------------------------------*/
/* */
/* COMPILATION DIRECTIVES: */
/* */
/* To compile With Microsoft VC2005 or higher, you need to create an */
/* empty Win32 project with the following options: */
/* - Configuration Properties / General : Char Set = NOT SET */
/* - Configuration Properties / C/C++ / Preprocessor : _CRT_SECURE_NO_DEPRECATE */
/* */
/* This source code can be compiled for 32bit or 64 bits targets as well */
/* WARNING: FOR 64x COMPILATION, ADD PREPROCESSOR DEFINE: VB_X64 */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* LICENSING: VoicemeeterRemote.dll usage is driven by a license agreement */
/* given in VoicemeeterRemoteAPI.pdf or readme.txt */
/* This Source Code can be used only in a program using Voicemeeter */
/* Remote API anyway */
/* */
/*--------------------------------------------------------------------------------*/
#ifndef __VMSCTL_H__
#define __VMSCTL_H__
#ifdef __cplusplus
extern "C" {
#endif
// if compiling for x64 target define this
//#define VB_X64
#define VMSCTL_MAX_NBSTRIP 8
#define VMSCTL_MAX_NBBUS 8
#define VMSCTL_CLASSNAME_STRIP "VMStreamerCtrl_Strip"
#define VMSCTL_CLASSNAME_BUS "VMStreamerCtrl_BUS"
//Initialize library
long VMSCTL_InitLib(HINSTANCE hinst);
void VMSCTL_EndLib(void);
typedef struct tagVMSCTL_RT_DATA
{
float dbLevel[8];
} T_VMSCTL_RT_DATA, *PT_VMSCTL_RT_DATA, *LPT_VMSCTL_RT_DATA;
/*---------------------------------------------------------------*/
/* STRIP CTL */
/*---------------------------------------------------------------*/
typedef void (__stdcall *VMSCTL_LPT_SBCALLBACK)(void * lpuser,long Ident, long ICtl, float value);
#define VMSCTL_STRIP_ID_MUTE 100
#define VMSCTL_STRIP_ID_NAME 101
#define VMSCTL_STRIP_ID_METER 102
#define VMSCTL_STRIP_ID_GAIN 132
#define VMSCTL_STRIP_ID_ASSIGN 148
typedef struct tagVMSCTL_STRIPPARAM
{
HFONT font0;
HFONT font1;
HFONT font2;
float vmin,vmax;
HBRUSH bkg0_brush;
HBRUSH bkg1_brush;
HPEN assignbus_pen;
COLORREF assignbus_color;
COLORREF name_color;
HPEN slider_pen_green;
HPEN slider_pen_red;
HBRUSH slider_brush_green;
HBRUSH slider_brush_red;
HBRUSH meter_brush1;
HBRUSH meter_brush2;
HBRUSH meter_brush3;
COLORREF mutered_color;
HPEN mutered_pen;
COLORREF assigned_color;
HPEN assigned_pen;
VMSCTL_LPT_SBCALLBACK lpCallback;
void * lpuser;
} T_VMSCTL_STRIPPARAM, *PT_VMSCTL_STRIPPARAM, *LPT_VMSCTL_STRIPPARAM;
HWND VMSCTL_CreateSTRIP(HWND hParent, long Ident, long x0,long y0, LPT_VMSCTL_STRIPPARAM lpparam);
long VMSCTL_PositionSTRIP(HWND hw, long x0,long y0, long dx, long dy, long fShow);
typedef struct tagVMSCTL_STRIP_DATA
{
WCHAR strip_namew[64];
char strip_nickname[8];
float strip_gain[VMSCTL_MAX_NBBUS];
long strip_mute;
char strip_assignmentbit[VMSCTL_MAX_NBBUS]; //0x10 bus activated / 0x01 bus assigned
long strip_nbBusDisplayed;
long strip_fMultiLayer;
char ** strip_pBUSNameList;
} T_VMSCTL_STRIP_DATA, *PT_VMSCTL_STRIP_DATA, *LPT_VMSCTL_STRIP_DATA;
long VMSCTL_SetDataSTRIP(HWND hw, LPT_VMSCTL_STRIP_DATA pData, long fUpdateAll);
long VMSCTL_ResetDataSTRIP(HWND hw);
long VMSCTL_SetRTDataSTRIP(HWND hw, LPT_VMSCTL_RT_DATA pRTData);
long VMSCTL_GetIndexSTRIP(HWND hw,long nuVisibleSlider);
/*---------------------------------------------------------------*/
/* BUS CTL */
/*---------------------------------------------------------------*/
#define VMSCTL_BUS_ID_MUTE 200
#define VMSCTL_BUS_ID_NAME 201
#define VMSCTL_BUS_ID_METER 202
#define VMSCTL_BUS_ID_GAIN 203
#define VMSCTL_BUS_ID_MONITOR 204
typedef struct tagVMSCTL_BUSPARAM
{
HFONT font0;
HFONT font1;
HFONT font2;
float vmin,vmax;
HBRUSH bkg0_brush;
HBRUSH bkg1_brush;
HPEN assignbus_pen;
COLORREF assignbus_color;
COLORREF name_color;
HPEN slider_pen_green;
HPEN slider_pen_red;
HBRUSH slider_brush_green;
HBRUSH slider_brush_red;
HBRUSH meter_brush1;
HBRUSH meter_brush2;
HBRUSH meter_brush3;
COLORREF mutered_color;
HPEN mutered_pen;
HBRUSH monitor_brush;
HPEN monitor_pen;
VMSCTL_LPT_SBCALLBACK lpCallback;
void * lpuser;
} T_VMSCTL_BUSPARAM, *PT_VMSCTL_BUSPARAM, *LPT_VMSCTL_BUSPARAM;
HWND VMSCTL_CreateBUS(HWND hParent, long Ident, long x0,long y0, LPT_VMSCTL_BUSPARAM lpparam);
long VMSCTL_PositionBUS(HWND hw, long x0,long y0, long dx, long dy, long fShow);
typedef struct tagVMSCTL_BUS_DATA
{
WCHAR bus_namew[64];
char bus_nickname[8];
float bus_gain;
long bus_mute;
long bus_monitor;
long bus_fMonitorSupport;
} T_VMSCTL_BUS_DATA, *PT_VMSCTL_BUS_DATA, *LPT_VMSCTL_BUS_DATA;
long VMSCTL_SetDataBUS(HWND hw, LPT_VMSCTL_BUS_DATA pData, long fUpdateAll);
long VMSCTL_ResetDataBUS(HWND hw);
long VMSCTL_SetRTDataBUS(HWND hw, LPT_VMSCTL_RT_DATA pRTData);
//End Of Header.
#ifdef __cplusplus
}
#endif
#endif /*__VMSCTL_H__*/

View File

@ -0,0 +1,600 @@
/**********************************************************************************/
/* VBAN COMMAND V.Burel(c)2015-2021 */
/**********************************************************************************/
/* */
/* THIS PROGRAM PROVIDES A MINIMAL VBAN-SERVICE */
/* PROVIDES A FUNCTION TO SEND VBAN-TEXT REQUEST */
/* PROVIDES A METHOD TO MANAGE VBAN RT-PACKET */
/* */
/* This program example shows */
/* - How to use Windows Socket */
/* - How to send and recieve VBAN request */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* COMPILATION DIRECTIVES: */
/* */
/* To compile With Microsoft VC2005 or higher, you need to create an */
/* empty Win32 project with the following options: */
/* - Configuration Properties / General : Char Set = NOT SET */
/* - Configuration Properties / C/C++ / Preprocessor : _CRT_SECURE_NO_DEPRECATE */
/* */
/* LINKER: Ws2_32.lib */
/* */
/* This source code can be compiled for 32bit or 64 bits targets as well */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* LICENSING: VoicemeeterRemote.dll usage is driven by a license agreement */
/* given in VoicemeeterRemoteAPI.pdf or readme.txt */
/* THIS SOURCE CODE CAN BE USED ONLY IN A PROGRAM USING VOICEMEETER */
/* REMOTE API */
/* */
/*--------------------------------------------------------------------------------*/
#ifndef __cplusplus
#ifndef STRICT
#define STRICT
#endif
#endif
#include <stdio.h>
//#include <math.h>
#include <windows.h>
//#include <tchar.h>
#include <winsock.h>
#include "vban_cmd.h"
#include "VoicemeeterRemote.h"
typedef struct tagVBANCMD_CONTEXT
{
long mode;
BOOL ThreadStarted, finitlib;
HANDLE Thread_handle;
DWORD Thread_ident;
BOOL Thread_flagOK;
long WSAStartupReply;
WSADATA WSAData;
SOCKET vban_socket;
unsigned long IPv4Address;
unsigned short UDPport;
long fPortUsedByOtherApplication;
CRITICAL_SECTION ctc_section;
T_VBAN_VMRT_PACKET CurrentRTPPacket;
long CurrentRTPPacket_dirtyflag;
DWORD CurrentRTPPacket_counter;
T_VBAN_VMRT_PACKET PublicRTPPacket;
unsigned char last_voicemeeterType;
T_VBAN_HEADER VBANHeader;
} T_VBANCMD_CONTEXT, * PT_VBANCMD_CONTEXT, * LPT_VBANCMD_CONTEXT;
static T_VBANCMD_CONTEXT G_vban_ctx = { 0, 0, 0, NULL };
long VBANCMD_GetIncomingRequestCounter(void)
{
return G_vban_ctx.CurrentRTPPacket_counter;
}
/******************************************************************************/
/* SOCKET TOOL */
/******************************************************************************/
static long VBAN_CloseSocket(SOCKET* psocket)
{
long rep;
if (*psocket != INVALID_SOCKET)
{
shutdown(*psocket, 2);
rep = closesocket(*psocket);
*psocket = INVALID_SOCKET;
}
return 0;
}
static long VBAN_SetSocketNonblocking(SOCKET socket)
{
u_long flags;
flags = 1;
return ioctlsocket(socket, FIONBIO, &flags);
}
static long VBAN_InitSocket(LPT_VBANCMD_CONTEXT lpctx, SOCKET* psocket, unsigned short nuPort, long SocketBufferSize)
{
SOCKADDR_IN local_sin;
long rep, nnn;
long nsize, nbByte;
long nError;
*psocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (*psocket == INVALID_SOCKET) return -1;
//set non blocking socket
rep = VBAN_SetSocketNonblocking(*psocket);
if (rep != 0)
{
closesocket(*psocket);
*psocket = INVALID_SOCKET;
return -2;
}
//disable debug mode
nsize = sizeof(rep);
nnn = getsockopt(*psocket, SOL_SOCKET, SO_DEBUG, (char*)&(rep), &nsize);
if (nnn == 0)
{
if (rep != 0)
{
rep = 0;
nsize = sizeof(rep);
setsockopt(*psocket, SOL_SOCKET, SO_DEBUG, (char*)&rep, nsize);
}
}
//set Time Out = ZERO.
rep = 0;
nsize = sizeof(rep);
setsockopt(*psocket, SOL_SOCKET, SO_SNDTIMEO, (char*)&rep, nsize);
setsockopt(*psocket, SOL_SOCKET, SO_RCVTIMEO, (char*)&rep, nsize);
//set Socket buffer size
nsize = sizeof(SocketBufferSize);
setsockopt(*psocket, SOL_SOCKET, SO_RCVBUF, (char*)&SocketBufferSize, nsize);
//128 kB buffer is senough to send VBAN-TEXT request
nbByte = 1024 * 128;
nsize = sizeof(nbByte);
setsockopt(*psocket, SOL_SOCKET, SO_SNDBUF, (char*)&nbByte, nsize);
//define socket port and ipaddress to
memset(&local_sin, 0, sizeof(SOCKADDR_IN));
local_sin.sin_family = AF_INET;
local_sin.sin_port = htons((unsigned short)nuPort);
local_sin.sin_addr.s_addr = htonl(INADDR_ANY);
lpctx->fPortUsedByOtherApplication = 0;
if (bind(*psocket, (struct sockaddr*)&(local_sin), sizeof(local_sin)) == SOCKET_ERROR)
{
nError = WSAGetLastError();
if (nError == WSAEADDRINUSE)
{
lpctx->fPortUsedByOtherApplication = 1;
}
closesocket(*psocket);
*psocket = INVALID_SOCKET;
return -5;
}
return 0;
}
/******************************************************************************/
/* FUNCTIONS REQUEST */
/******************************************************************************/
long VBANCMD_SendRequest_String(char* pString)
{
SOCKADDR_IN dest;
LPT_VBAN_HEADER lpHeader;
char Buffer[2048];
long rep, nbByte;
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if (lpctx->ThreadStarted == 0) return -9;
if (pString == NULL) return -10;
lpHeader = (LPT_VBAN_HEADER)Buffer;
// build VBAN Header from our current VBAN Header
*lpHeader = lpctx->VBANHeader;
lpctx->VBANHeader.nuFrame++;
strcpy((char*)(lpHeader + 1), pString);
//send request
memset(&dest, 0, sizeof(SOCKADDR_IN));
dest.sin_family = AF_INET;
dest.sin_port = htons(lpctx->UDPport);
dest.sin_addr.s_addr = lpctx->IPv4Address;
nbByte = sizeof(T_VBAN_HEADER) + (long)strlen(pString);
rep = sendto(lpctx->vban_socket, Buffer, nbByte, 0, (struct sockaddr*)&dest, sizeof(dest));
if (rep == SOCKET_ERROR) return -20;
return 0;
}
long VBANCMD_SendRequest_Float(char* szParam, float value)
{
char String[512];
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if (szParam == NULL) return -1;
if (szParam[0] == 0) return -2;
sprintf(String, "%s = %f;", szParam, value);
return VBANCMD_SendRequest_String(String);
}
long VBANCMD_SendRequest_RegisterRTPacket(unsigned char sTimeOut, char* szVBANStreamName)
{
SOCKADDR_IN dest;
T_VBAN_HEADER Header;
long rep, nbByte;
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if (lpctx->ThreadStarted == 0) return -9;
Header.vban = 'NABV';
Header.format_SR = 0x60;
Header.format_nbs = 0;
Header.format_nbc = VBAN_SERVICE_RTPACKETREGISTER;
Header.format_bit = sTimeOut & 0x000000FF;
if (szVBANStreamName != NULL) strcpy(Header.streamname, "Register RTP");
else strncpy(Header.streamname, szVBANStreamName, 16);
Header.nuFrame = 0;
//send request
memset(&dest, 0, sizeof(SOCKADDR_IN));
dest.sin_family = AF_INET;
dest.sin_port = htons(lpctx->UDPport);
dest.sin_addr.s_addr = lpctx->IPv4Address;
nbByte = sizeof(T_VBAN_HEADER);
rep = sendto(lpctx->vban_socket, (char*)&Header, nbByte, 0, (struct sockaddr*)&dest, sizeof(dest));
if (rep == SOCKET_ERROR) return -20;
return 0;
}
/******************************************************************************/
/* CURRENT PARAMETERS FUNCTIONS */
/******************************************************************************/
long VBANCMD_IsParameterDirty(void)
{
unsigned char vmType;
long reply;
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
reply = lpctx->CurrentRTPPacket_dirtyflag;
if (reply != 0)
{
// if dirty we copy our buffer in public structure
EnterCriticalSection(&(lpctx->ctc_section));
lpctx->PublicRTPPacket = lpctx->CurrentRTPPacket;
LeaveCriticalSection(&(lpctx->ctc_section));
}
// to fit the same behavior than the remote API function
vmType = lpctx->PublicRTPPacket.voicemeeterType;
if (vmType == 0) reply = -1;
if (lpctx->last_voicemeeterType != vmType) reply = -2;
lpctx->last_voicemeeterType = vmType;
return reply;
}
// then all information will come directly from our public RTPacket structure
long VBANCMD_GetVoicemeeterType(unsigned long* pType)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
*pType = (unsigned long)(lpctx->PublicRTPPacket.voicemeeterType);
return 0;
}
long VBANCMD_GetVoicemeeterVersion(unsigned long* pVersion)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
*pVersion = lpctx->PublicRTPPacket.voicemeeterVersion;
return 0;
}
void TOOL_ConvertUTF8ToWCHAR(char* UTF8_String, WCHAR* wString, long nbCharMax)
{
if (UTF8_String[0] == 0)
{
wString[0] = 0;
return;
}
memset(wString, 0, nbCharMax * sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)UTF8_String, (int)strlen(UTF8_String), wString, nbCharMax);
wString[nbCharMax - 1] = 0;
}
long VBANCMD_GetBusLabel(long index, WCHAR* pwsz)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
TOOL_ConvertUTF8ToWCHAR(lpctx->PublicRTPPacket.busLabelUTF8c60[index], pwsz, 64);
return 0;
}
long VBANCMD_GetBusGain(long index, float* pValue)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
*pValue = ((float)lpctx->PublicRTPPacket.busGaindB100[index]) * 0.01f;
return 0;
}
long VBANCMD_GetBusSel(long index, float* pValue)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if ((lpctx->PublicRTPPacket.busState[index] & VMRTSTATE_MODE_SEL) != 0) *pValue = 1.0f;
else *pValue = 0.0f;
return 0;
}
long VBANCMD_GetBusMute(long index, float* pValue)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if ((lpctx->PublicRTPPacket.busState[index] & VMRTSTATE_MODE_MUTE) != 0) *pValue = 1.0f;
else *pValue = 0.0f;
return 0;
}
long VBANCMD_GetBusMonitor(long index, float* pValue)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if ((lpctx->PublicRTPPacket.busState[index] & VMRTSTATE_MODE_MONITOR) != 0) *pValue = 1.0f;
else *pValue = 0.0f;
return 0;
}
long VBANCMD_GetStripLabel(long index, WCHAR* pwsz)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
TOOL_ConvertUTF8ToWCHAR(lpctx->PublicRTPPacket.stripLabelUTF8c60[index], pwsz, 64);
return 0;
}
long VBANCMD_GetStripGain(long index, float* pValue)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
*pValue = ((float)lpctx->PublicRTPPacket.stripGaindB100Layer1[index]) * 0.01f;
return 0;
}
long VBANCMD_GetStripGainLayer(long index, long layer, float* pValue)
{
short* pGain;
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
pGain = lpctx->PublicRTPPacket.stripGaindB100Layer1;
pGain = pGain + (layer * 8);
*pValue = ((float)pGain[index]) * 0.01f;
return 0;
}
long VBANCMD_GetStripMute(long index, float* pValue)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if ((lpctx->PublicRTPPacket.stripState[index] & VMRTSTATE_MODE_MUTE) != 0) *pValue = 1.0f;
else *pValue = 0.0f;
return 0;
}
static long G_MaskBusAssign_v1[8] = { VMRTSTATE_MODE_BUSA1, VMRTSTATE_MODE_BUSB1, 0, 0, 0, 0, 0, 0 };
static long G_MaskBusAssign_v2[8] = { VMRTSTATE_MODE_BUSA1, VMRTSTATE_MODE_BUSA2, VMRTSTATE_MODE_BUSA3, VMRTSTATE_MODE_BUSB1, VMRTSTATE_MODE_BUSB2, 0, 0, 0 };
static long G_MaskBusAssign_v3[8] = { VMRTSTATE_MODE_BUSA1, VMRTSTATE_MODE_BUSA2, VMRTSTATE_MODE_BUSA3, VMRTSTATE_MODE_BUSA4, VMRTSTATE_MODE_BUSA5, VMRTSTATE_MODE_BUSB1, VMRTSTATE_MODE_BUSB2, VMRTSTATE_MODE_BUSB3 };
long VBANCMD_GetStripAssignation(long index, long nBus, float* pValue)
{
long* pMask;
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
pMask = NULL;
if (lpctx->PublicRTPPacket.voicemeeterType == 1) pMask = G_MaskBusAssign_v1;
if (lpctx->PublicRTPPacket.voicemeeterType == 2) pMask = G_MaskBusAssign_v2;
if (lpctx->PublicRTPPacket.voicemeeterType == 3) pMask = G_MaskBusAssign_v3;
if ((lpctx->PublicRTPPacket.stripState[index] & pMask[nBus]) != 0) *pValue = 1.0f;
else *pValue = 0.0f;
return 0;
}
long VBANCMD_GetLevel(long index, long nuChannel, float* pLevelDB)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
switch (index)
{
case 0:
*pLevelDB = ((float)lpctx->PublicRTPPacket.inputLeveldB100[nuChannel]) * 0.01f;
return 0;
case 3:
*pLevelDB = ((float)lpctx->PublicRTPPacket.outputLeveldB100[nuChannel]) * 0.01f;
return 0;
default:
*pLevelDB = -100.0f;
break;
}
return -1;
}
/******************************************************************************/
/* START / STOP VBAN CLIENT */
/******************************************************************************/
static DWORD WINAPI VBANCMD_Thread(LPT_VBANCMD_CONTEXT lpctx)
{
SOCKADDR_IN from;
LPT_VBAN_HEADER lpHeader;
long rep, datasize, nbByte, mstemp, fromlen;
char Buffer[2048];
unsigned char protocol;
DWORD current_ipv4;
HANDLE h_t;
h_t = GetCurrentThread();
SetThreadPriority(h_t, THREAD_PRIORITY_HIGHEST);
CloseHandle(h_t);
lpHeader = (LPT_VBAN_HEADER)Buffer;
current_ipv4 = lpctx->IPv4Address;
while (lpctx->Thread_flagOK == TRUE)
{
mstemp = 1;
fromlen = sizeof(SOCKADDR_IN);
rep = recvfrom(lpctx->vban_socket, Buffer, 2048, 0, (struct sockaddr*)&from, &fromlen);
if (rep != SOCKET_ERROR)
{
mstemp = 0;
// if we recieve something
datasize = rep;
if ((datasize > sizeof(T_VBAN_HEADER)) && (from.sin_addr.S_un.S_addr == current_ipv4))
{
// if it's a VBAN packet
if (lpHeader->vban == 'NABV')
{
protocol = lpHeader->format_SR & VBAN_PROTOCOL_MASK;
// if it's a VBAN-SERVICE packet
if (protocol == VBAN_PROTOCOL_SERVICE)
{
if (lpHeader->format_nbc == VBAN_SERVICE_RTPACKET)
{
// if it's a RTPacket
nbByte = datasize - sizeof(T_VBAN_HEADER);
if (nbByte >= sizeof(T_VBAN_VMRT_PACKET))
{
// just copy it into our context structure and set dirty flag
EnterCriticalSection(&(lpctx->ctc_section));
memcpy(&(lpctx->CurrentRTPPacket), lpHeader + 1, sizeof(T_VBAN_VMRT_PACKET));
lpctx->CurrentRTPPacket_dirtyflag = 1;
lpctx->CurrentRTPPacket_counter++;
LeaveCriticalSection(&(lpctx->ctc_section));
}
}
}
}
}
}
// if we did nothing we wait for 1 ms, otherwise we wait for next O/S scheduler cycle
Sleep(mstemp);
}
return 0;
}
long VBANCMD_StopThread(void)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if (lpctx->finitlib == 0) return -1;
lpctx->ThreadStarted = 0;
// Stop Thread
lpctx->Thread_flagOK = FALSE;
if (lpctx->Thread_handle != NULL)
{
WaitForSingleObject(lpctx->Thread_handle, INFINITE);
CloseHandle(lpctx->Thread_handle);
lpctx->Thread_handle = NULL;
}
// Close Soccket
VBAN_CloseSocket(&(lpctx->vban_socket));
memset(&(lpctx->CurrentRTPPacket), 0, sizeof(T_VBAN_VMRT_PACKET));
memset(&(lpctx->PublicRTPPacket), 0, sizeof(T_VBAN_VMRT_PACKET));
lpctx->CurrentRTPPacket_dirtyflag = 1;
return 0;
}
long VBANCMD_StartThread(char* szVBANStreamName, char* szIPAddressTo, unsigned short UDPport)
{
long rep, reply = 0;
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if (lpctx->finitlib == 0) return -1;
VBANCMD_StopThread();
// build our header to send VBAN-TEXT request
lpctx->VBANHeader.vban = 'NABV';
lpctx->VBANHeader.format_SR = 0x52;
lpctx->VBANHeader.format_nbs = 0;
lpctx->VBANHeader.format_nbc = 0;
lpctx->VBANHeader.format_bit = 0x10;
if (szVBANStreamName == NULL) strcpy(lpctx->VBANHeader.streamname, "Command1");
else strncpy(lpctx->VBANHeader.streamname, szVBANStreamName, 16);
lpctx->VBANHeader.nuFrame = 0;
// Init Socket with 2 MB on RCV buffer
lpctx->IPv4Address = inet_addr(szIPAddressTo);
lpctx->UDPport = UDPport;
rep = VBAN_InitSocket(lpctx, &(lpctx->vban_socket), UDPport, 1024 * 1024 * 2);
if (rep != 0) return -2;
// Start Thread
lpctx->Thread_flagOK = TRUE;
lpctx->Thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)VBANCMD_Thread, (void*)lpctx, 0, &(lpctx->Thread_ident));
if (lpctx->Thread_handle == NULL)
{
reply = -100;
}
// we set STARTED flag only if all is good.
lpctx->ThreadStarted = 1;
return reply;
}
/******************************************************************************/
/* INIT / END LIB */
/******************************************************************************/
long VBANCMD_EndLib(void)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
if (lpctx->finitlib == 0) return 0;
VBANCMD_StopThread();
DeleteCriticalSection(&(lpctx->ctc_section));
memset(lpctx, 0, sizeof(T_VBANCMD_CONTEXT));
return 0;
}
long VBANCMD_InitLib(long mode)
{
LPT_VBANCMD_CONTEXT lpctx;
lpctx = &G_vban_ctx;
memset(lpctx, 0, sizeof(T_VBANCMD_CONTEXT));
lpctx->mode = mode;
lpctx->finitlib = 1;
lpctx->WSAStartupReply = WSAStartup(MAKEWORD(1, 1), &(lpctx->WSAData));
InitializeCriticalSection(&(lpctx->ctc_section));
lpctx->vban_socket = INVALID_SOCKET;
return 0;
}

View File

@ -0,0 +1,121 @@
/**********************************************************************************/
/* VBAN COMMAND V.Burel(c)2015-2021 */
/**********************************************************************************/
/* */
/* THIS PROGRAM PROVIDES A MINIMAL VBAN-SERVICE */
/* PROVIDES A FUNCTION TO SEND VBAN-TEXT REQUEST */
/* PROVIDES A METHOD TO MANAGE VBAN RT-PACKET */
/* */
/* This program example shows */
/* - How to use Windows Socket */
/* - How to send and recieve VBAN request */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* COMPILATION DIRECTIVES: */
/* */
/* To compile With Microsoft VC2005 or higher, you need to create an */
/* empty Win32 project with the following options: */
/* - Configuration Properties / General : Char Set = NOT SET */
/* - Configuration Properties / C/C++ / Preprocessor : _CRT_SECURE_NO_DEPRECATE */
/* */
/* LINKER: Ws2_32.lib */
/* */
/* This source code can be compiled for 32bit or 64 bits targets as well */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* LICENSING: VoicemeeterRemote.dll usage is driven by a license agreement */
/* given in VoicemeeterRemoteAPI.pdf or readme.txt */
/* THIS SOURCE CODE CAN BE USED ONLY IN A PROGRAM USING VOICEMEETER */
/* REMOTE API */
/* */
/*--------------------------------------------------------------------------------*/
#ifndef __VBAN_CMD_H__
#define __VBAN_CMD_H__
#pragma pack(1)
struct tagVBAN_HEADER
{
unsigned long vban; // contains 'V' 'B', 'A', 'N'
unsigned char format_SR; // SR index (see SRList above)
unsigned char format_nbs; // nb sample per frame (1 to 256)
unsigned char format_nbc; // nb channel (1 to 256)
unsigned char format_bit; // mask = 0x07 (see DATATYPE table below)
char streamname[16]; // stream name
unsigned long nuFrame; // growing frame number
};
#pragma pack()
typedef struct tagVBAN_HEADER T_VBAN_HEADER;
typedef struct tagVBAN_HEADER* PT_VBAN_HEADER;
typedef struct tagVBAN_HEADER* LPT_VBAN_HEADER;
#define VBAN_PROTOCOL_MASK 0xE0
#define VBAN_PROTOCOL_SERVICE 0x60
#define VBAN_SERVICE_RTPACKETREGISTER 32
#define VBAN_SERVICE_RTPACKET 33
/******************************************************************************/
/* FUNCTIONS */
/******************************************************************************/
long VBANCMD_SendRequest_String(char* pString);
long VBANCMD_SendRequest_Float(char* szParam, float value);
long VBANCMD_SendRequest_RegisterRTPacket(unsigned char sTimeOut, char* szVBANStreamName);
// to check the VBAN connection works
long VBANCMD_GetIncomingRequestCounter(void);
/******************************************************************************/
/* CURRENT PARAMETERS FUNCTIONS */
/******************************************************************************/
// we provide same function than Voicemeeter Remote API to simplify the process
long VBANCMD_IsParameterDirty(void);
long VBANCMD_GetVoicemeeterType(unsigned long* pType);
long VBANCMD_GetVoicemeeterVersion(unsigned long* pVersion);
long VBANCMD_GetBusLabel(long index, WCHAR* pwsz);
long VBANCMD_GetBusGain(long index, float* pValue);
long VBANCMD_GetBusSel(long index, float* pValue);
long VBANCMD_GetBusMute(long index, float* pValue);
long VBANCMD_GetBusMonitor(long index, float* pValue);
long VBANCMD_GetStripLabel(long index, WCHAR* pwsz);
long VBANCMD_GetStripGain(long index, float* pValue);
long VBANCMD_GetStripGainLayer(long index, long layer, float* pValue);
long VBANCMD_GetStripMute(long index, float* pValue);
long VBANCMD_GetStripAssignation(long index, long nBus, float* pValue);
long VBANCMD_GetLevel(long index, long nuChannel, float* pLevelDB);
/******************************************************************************/
/* START / STOP THREAD */
/******************************************************************************/
long VBANCMD_StartThread(char* szVBANStreamName, char* szIPAddressTo, unsigned short UDPport);
long VBANCMD_StopThread(void);
/******************************************************************************/
/* INIT / END LIB */
/******************************************************************************/
long VBANCMD_EndLib(void);
long VBANCMD_InitLib(long mode);
#endif /* __VBAN_CMD_H__*/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
/*--------------------------------------------------------------------------------*/
/* VMR example: Voicemeeter Custom GUI for Streamers */
/*--------------------------------------------------------------------------------*/
/* 'C' Sample Code to make a Voicemeeter Custom GUI V.Burel (c)2016-2021 */
/* */
/* THIS PROGRAM PROVIDES A GUI TO CONTROL VOICEMEETER */
/* PROVIDES A SIMPLIFIED GUI WITH ONLY USED STRIP/BUS */
/* PROVIDES A RESIZABLE GRAPHIC USER INTERFACE */
/* */
/* This program example shows */
/* - How to link VoicemeeterRemote.dll */
/* - How to Login / logout */
/* - How to Manage regular parameters to make a custom controller. */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* COMPILATION DIRECTIVES: */
/* */
/* To compile With Microsoft VC2005 or higher, you need to create an */
/* empty Win32 project with the following options: */
/* - Configuration Properties / General : Char Set = NOT SET */
/* - Configuration Properties / C/C++ / Preprocessor : _CRT_SECURE_NO_DEPRECATE */
/* */
/* This source code can be compiled for 32bit or 64 bits targets as well */
/* WARNING: FOR 64x COMPILATION, ADD PREPROCESSOR DEFINE: VB_X64 */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* LICENSING: VoicemeeterRemote.dll usage is driven by a license agreement */
/* given in VoicemeeterRemoteAPI.pdf or readme.txt */
/* THIS SOURCE CODE CAN BE USED ONLY IN A PROGRAM USING VOICEMEETER */
/* REMOTE API */
/* */
/*--------------------------------------------------------------------------------*/
#ifndef __VMR_STREAMER_H__
#define __VMR_STREAMER_H__
//to prevent to launch the same application twice (single instance app)
#define APP_UNIQUEMUTEX "VB-AudioVMRStreamerViewExample_VoicemeeterCustomGUI"
//version information (for program)
#define SZPUBLICVERSION "1.0.0.2" //displayed version in about box
#define SZPUBLICNAME "VM-Streamer View (Voicemeeter Custom GUI Example)" //displayed title in main window
//Information for Main window
#define UI_WIN_DX 800
#define UI_WIN_DY 600
//version information (used in resource file)
#define __FILEVERSION__ 1,0,0,2
#define __PRODUCTVERSION__ 1,0,0,2
#define __SZFILEVERSION__ "1, 0, 0, 2\0"
#define __SZPRODUCTVERSION__ "1, 0, 0, 2\0"
#define __COMMENTS__ "Example of custom GUI mae for Voicemeeter with the Voicemeeter Remote API"
#define __COMPANYNAME__ "Audio Mechanic & Sound Breeder\0"
#define __FILEDESCRIPTION__ "Custom GUI for Streamers, Remoting Voicemeeter potato\0"
#define __INTERNALNAME__ "vmr_streamer"
#define __LEGALCOPYRIGHT__ "Copyright V.Burel©2015-2021\0"
#define __ORIGINALFILENAME__ "vmr_streamer.EXE\0"
#define __PRODUCTNAME__ "vmr_streamer\0"
//definitions for MENU
#define IDM_QUIT 100
#define IDM_ABOUT 101
#define IDM_UPDATE_ALL_CONTROL 200
#define IDMSYS_LINK_DIRECT 300
#define IDMSYS_LINK_VBAN1 301
#define IDMSYS_LINK_VBAN2 302
#define IDMSYS_LINK_VBAN3 303
#define IDMSYS_LINK_VBAN4 304
#define IDMSYS_VBAN_CONFIG 350
#endif /*__VMR_STREAMER_H__*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -0,0 +1,78 @@
/*--------------------------------------------------------------------------------*/
/* VMR example: Voicemeeter Custom GUI for Streamers */
/*--------------------------------------------------------------------------------*/
/* 'C' Sample Code to make a Voicemeeter Custom GUI V.Burel (c)2016-2021 */
/* */
/* THIS PROGRAM PROVIDES A GUI TO CONTROL VOICEMEETER */
/* PROVIDES A SIMPLIFIED GUI WITH ONLY USED STRIP/BUS */
/* PROVIDES A RESIZABLE GRAPHIC USER INTERFACE */
/* */
/* This program example shows */
/* - How to link VoicemeeterRemote.dll */
/* - How to Login / logout */
/* - How to Manage regular parameters to make a custom controller. */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* COMPILATION DIRECTIVES: */
/* */
/* To compile With Microsoft VC2005 or higher, you need to create an */
/* empty Win32 project with the following options: */
/* - Configuration Properties / General : Char Set = NOT SET */
/* - Configuration Properties / C/C++ / Preprocessor : _CRT_SECURE_NO_DEPRECATE */
/* */
/* This source code can be compiled for 32bit or 64 bits targets as well */
/* WARNING: FOR 64x COMPILATION, ADD PREPROCESSOR DEFINE: VB_X64 */
/* */
/*--------------------------------------------------------------------------------*/
/* */
/* LICENSING: VoicemeeterRemote.dll usage is driven by a license agreement */
/* given in VoicemeeterRemoteAPI.pdf or readme.txt */
/* */
/*--------------------------------------------------------------------------------*/
#include "vmr_streamer.h"
100 ICON "vmr_streamer.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
1 VERSIONINFO
FILEVERSION __FILEVERSION__
PRODUCTVERSION __PRODUCTVERSION__
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x0L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "Comments", __COMMENTS__
VALUE "CompanyName", __COMPANYNAME__
VALUE "FileDescription", __FILEDESCRIPTION__
VALUE "FileVersion", __SZFILEVERSION__
VALUE "InternalName", __INTERNALNAME__
VALUE "LegalCopyright", __LEGALCOPYRIGHT__
VALUE "OriginalFilename", __ORIGINALFILENAME__
VALUE "ProductName", __PRODUCTNAME__
VALUE "ProductVersion", __SZPRODUCTVERSION__
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END

6
vmr_streamer/targetver.h Normal file
View File

@ -0,0 +1,6 @@
#pragma once
// // Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>

View File

@ -0,0 +1,180 @@
// vmr_streamer.cpp : Defines the entry point for the application.
//
#include "framework.h"
#include "vmr_streamer.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
WCHAR szTitle[MAX_LOADSTRING]; // The title bar text
WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
// Initialize global strings
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadStringW(hInstance, IDC_VMRSTREAMER, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_VMRSTREAMER));
MSG msg;
// Main message loop:
while (GetMessage(&msg, nullptr, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEXW wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_VMRSTREAMER));
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_VMRSTREAMER);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassExW(&wcex);
}
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // Store instance handle in our global variable
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
{
int wmId = LOWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code that uses hdc here...
EndPaint(hWnd, &ps);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}

View File

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{cb959fdd-2aa4-4ecd-8a50-41777bf38eea}</ProjectGuid>
<RootNamespace>vmrstreamer</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib ;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;VB_X64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="source\streamer_ctrl.h" />
<ClInclude Include="source\vban_cmd.h" />
<ClInclude Include="source\vmr_streamer.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="source\streamer_ctrl.c" />
<ClCompile Include="source\vban_cmd.c" />
<ClCompile Include="source\vmr_streamer.c" />
</ItemGroup>
<ItemGroup>
<Image Include="source\vmr_streamer.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="source\vmr_streamer.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="source\vban_cmd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="source\vmr_streamer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="source\streamer_ctrl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="source\streamer_ctrl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="source\vban_cmd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="source\vmr_streamer.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="source\vmr_streamer.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="source\vmr_streamer.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>