Jump to content

gritts

Active Members
  • Posts

    57
  • Joined

  • Last visited

Recent Profile Visitors

275 profile views

gritts's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. Appreciate all the help... I'm posting my messy learning script here for others that might need an assist. I have a number of other ideas for improvement I want to put in place. Now I just need to time fairy to come by. 😁 I'm using .INI to save the settings currently. Might change that as I go... voicemeeter_test_4.au3
  2. That is a fair statement 😄. I took what you provided and came up with the code below to return the current version. Func VBVMR_GetVoicemeeterVersion($apiDLL) Local $aResult, $dBinary Local $sVMVer="" $aResult = DllCall($apiDLL,"long","VBVMR_GetVoicemeeterVersion","long*",0) If @error Then ConsoleWriteError('Error VBVMR_GetVoicemeeterVersion: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ConsoleWrite("$aResult[1]: "& $aResult[1] &@CRLF) ConsoleWrite("Binary: "&Binary($aResult[1]) &@CRLF) ConsoleWrite("BinaryMid: " & String(Dec(Int(BinaryMid($aResult[1],4,1)))) &@CRLF) For $i = 4 To 1 Step -1 If $i > 1 Then $sVMVer &= String(Dec(Int(BinaryMid($aResult[1],$i,1)))) & "." Else $sVMVer &= String(Dec(Int(BinaryMid($aResult[1],$i,1)))) EndIf Next ConsoleWrite("Derived version: " & $sVMVer & @CRLF) EndFunc It's a little busy but I left my learning / testing there... The console writes return this: $aResult[1]: 50332162 Binary: 0x02020003 BinaryMid: 3 Derived version: 3.0.2.2 The reason I went with reversing the resulting binary numbers is the version of Potato I have, reports as 3.0.2.2 I can see a use for this function elsewhere in one form or another. This has given me quite a bit to build on. I appreciate the help! I will go and clean up the spaghetti code and make it more presentable.
  3. After taking a look at your additional example and plinking around with my own code, I came up with the following tweak to my login function: Func VBVMR_Login($apiDLL) ; Login to the DLL Local $aResult $aResult = DllCall($apiDLL, "long", "VBVMR_Login") If @error Then Return SetError(-99, @error, -99.0) If $aResult[0] <> 0 Then Return SetError($aResult[0], 0, -99.0) Sleep(250) EndFunc ;==>VBVMR_Login Adding the Sleep function appears to have allowed the script to pause a little and then when I follow with the "VBVMR_GetParameterFloat" call, I get the values expected. I have tested this with the "A1" button and the "color" setting. Still tinkering but I suspect the more GetParamaterFloat calls I make between logout and login may require a longer sleep time. Learning as I go 😄. You mentioned... I attempted to pull the current version using "VBVMR_GetVoicemeeterVersion" using long as they type and "50332162" is what I get returned. I see in your example you appear to have converted the result you received into a decimal translation. Can you suggest a path I can take that might make sense? I appreciate all of the help you have provided so far and I was hoping I might figure this one out. My end goal for all of this is 2 fold. First is to learn about handling DLL files. Second is to create a smaller GUI (if at all) version of the VM Remote. I want to be able to capture the current settings, save them along with other versions then be able to call the settings on demand. (Like one for office Teams meeting, another for personal Discord, etc)
  4. Thank you @TheXman. My day time job had me busy so I haven't had a moment to reply. I will look at your post in detail today.
  5. Thank you @TheXman . You are right about the "Strip[1].A1". I will call it a face-palm moment. I was looking an a different script and forgot the numbering started at 0. Thank you very much for going into detail with how you use AutoIt with Voicemeeter Banana. Using what @Danyfirex provided ( DllCall($hDll,"long","VBVMR_GetParameterFloat","str","Strip[1].A1","float*",0) ) and changing the return types to "long", I got slightly different results. For a brief bit, executing the script would return the opposite status of "A1". So if it was enabled, I would see "0", disabled showed "1". This didn't make sense to me. I rebooted my PC on the off chance the testing left things in an odd state. That did not fix it. When I run the script after rebooting, it seems to be pot luck whether I get a correct status back. I have tried getting the state of "mono" and "B1" with minimal luck. I might get the correct state initially then after changing the setting. After that, no matter how often I change the setting or run the script, the same value is returned. For example, "A1" could be enabled but the script returns disabled. It's almost as if the DLL is not really connecting to Voicemeeter. I have adopted your function and error checking in the hopes of getting more detail. In this case, no errors are being reported with how my script is now. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #AutoIt3Wrapper_UseX64=y #Include <array.au3> #Include <Binary.au3> $aCall = 0 ; Open DLL Local $hDll = DllOpen("C:\Program Files (x86)\VB\Voicemeeter\VoicemeeterRemote64.dll") If @error Then ConsoleWriteError('Error DllOpen: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ; Login to the DLL $aResult = DllCall($hDll,"long","VBVMR_Login") If @error Then ConsoleWriteError('Error VBVMR_Login: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ;_ArrayDisplay($aResult) ; Check parameter status $aResult = DllCall($hDll,"long","VBVMR_IsParametersDirty") If @error Then ConsoleWriteError('Error VBVMR_IsParametersDirty: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ; Check option status $sParam = "Strip[1].A1" $fValue = VBVMR_GetParameterFloat($sParam) If @error Then MsgBox($MB_ICONWARNING + $MB_TOPMOST, "ERROR", _ "VBVMR_GetParameterFloat error occurred." & @LF & @LF & _ "@error = " & @error & @LF & _ "@extended = " & @extended) Exit EndIf ConsoleWrite("Results: " &$sParam&" - "&$fValue&@CRLF) ; Logout of DLL $aResult = DllCall($hDll, "long","VBVMR_Logout") If @error Then ConsoleWriteError('Error VBVMR_Logout: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ; Close DLL DllClose($hDll) Func VBVMR_GetParameterFloat($sParamName) Local $aResult ;Call API $aResult = DllCall($hDll, "long", "VBVMR_GetParameterFloat", _ "str" , $sParamName, _ "float*", 0) If @error Then Return SetError(-99, @error, -99.0) If $aResult[0] <> 0 Then Return SetError($aResult[0], 0, -99.0) Return $aResult[2] EndFunc
  6. I added a couple more ConsoleWrites to the code you provided yesterday. The DllStructCreate seems to be doing something... Below are 2 results, one as type "long" and the other as type "float". As type "long"... $aCall[0]: 0 $aCall[1]: Strip[1].A1 $aCall[2]: 0x000001F74AEA3AE0 $tFloat.value Output: 0 As type "float"... $aCall[0]: 0 $aCall[1]: Strip[1].A1 $aCall[2]: 0x000001F74AEA3AE0 $tFloat.value Output: 0 In both instances the "A1" control is set to active. ; adapted code Local $tFloat=DllStructCreate("float value") $aCall = DllCall($hDll,"float","VBVMR_GetParameterFloat","str","Strip[1].A1","ptr",DllStructGetPtr($tFloat)) ConsoleWrite("$aCall[0]: " & $aCall[0] & @CRLF & "$aCall[1]: " & $aCall[1] & @CRLF & "$aCall[2]: " & $aCall[2] & @CRLF) ConsoleWrite("$tFloat.value Output: " & $tFloat.value & @CRLF) (Face palm moment) I suppose attaching the RemoteAPI doc might help some as well? Link to product site: https://vb-audio.com/Voicemeeter/ VoicemeeterRemoteAPI.pdf
  7. I agree, the .h says it returns a float. I tried your snippet of code, replacing my previous attempt. I am still seeing "0" regardless if the control is selected or not. For grins, I changed "long" to "float" to test and received the same result.
  8. I included a screenshot of what I see. If the A1 "control" is active, I expect to have a numeric 1 returned and likewise if it is inactive I expect a numeric 0 returned. My code segment as it is now... $aCall = DllCall($hDll,"float","VBVMR_GetParameterFloat","str","Strip[1].A1","float*",0) If @error Then ConsoleWriteError('Error VBVMR_GetParameterFloat: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf $iParameterFloat=$aCall[2] MsgBox(0,"$iParameterFloa",$iParameterFloat) _ArrayDisplay($aCall) Thank you for assisting me... 😊
  9. This is producing much more promising results. I am able to use "_ArrayDisplay($aCall)" and see results. The status of the "A1" control isn't being displayed correctly. Looking at the other scripting tool, I see a function called "NumGet" is being used. The description of the function says "Returns the binary number stored at the specified address+offset." (ie Number := NumGet(VarOrAddress , Offset := 0, Type := "UPtr") ) I looked at the binary functions (BinaryToString) and the Binary UDF posted by @Ward in the past and either they are not what I need or I just don't understand well enough to follow.
  10. I agree the "APTR" type is not valid. When I change to "PTR", I receive this error when attempting to run " !>18:31:08 AutoIt3.exe ended.rc:-1073741819" As to the "Strip[1].A1" being invalid, that is how Voicemeeter references the first "control" button A1. That form of reference does work in another scripting language. I wanted to stick with AutoIt since I was a bit more familiar with it. Perhaps you can tell me what I missed to make that param incorrect? I have also modified it to "'Strip[1].A1'". From the other scripting language, this line works" "Result := DllCall("VoicemeeterRemote64\VBVMR_GetParameterFloat", "AStr", "Strip[1].A1", "Ptr", &str1stat, "Int")" Attached a screenshot for reference.
  11. I did give the ":cdecl" option a try on the line in question but still received the same results.. ; This line results in an Error code 1 even with the "cdecl" option DllCall($hDll,"STR:cdecl","VBVMR_GetParameterFloat","APTR","Strip[1].A1","INT",$str1stat) The other DLLCalls work without issue.
  12. I am working on a script that I hope expand on. Its end goal is a scaled down version of the Voicemeeter.Remote. Second benefit is to better learn DLLCalls. To say I am weak in this area is probably putting it mildly. Below is my current basic version of the script I am using to test / learn with. When the line with "VBVMR_GetParameterFloat" is executed, I get the error about being unable to use the DLL file. The other commands within the script work without error (though getting the type and version has unexpected results). I can see the API is being accessed as Voicemeeter has indicators when one is connected. #AutoIt3Wrapper_UseX64=y #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #Include <array.au3> Local $hDll = DllOpen("C:\Program Files (x86)\VB\Voicemeeter\VoicemeeterRemote64.dll") If @error Then ConsoleWriteError('Error DllOpen: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf $str1stat = 255 DllCall($hDll,"NONE","VBVMR_Login") If @error Then ConsoleWriteError('Error VBVMR_Login: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf DllCall($hDll,"NONE","VBVMR_IsParametersDirty") If @error Then ConsoleWriteError('Error VBVMR_IsParametersDirty: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ;~ DllCall($hDll,"STR","VBVMR_GetParameterFloat","APTR","Strip[1].A1","INT",$str1stat) If @error Then ConsoleWriteError('Error VBVMR_GetParameterFloat: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf ;~ ConsoleWrite("Error: " & @error & " Extended: " & @extended & @CRLF) ;~ ConsoleWrite($str1stat & @CRLF) $aVMType=DllCall($hDll,"LONG","VBVMR_GetVoicemeeterType") If @error Then ConsoleWriteError('Error VBVMR_GetVoicemeeterType: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf $aVMVer=DllCall($hDll,"LONG_PTR","VBVMR_GetVoicemeeterVersion") If @error Then ConsoleWriteError('Error VBVMR_GetVoicemeeterVersion: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf _ArrayDisplay($aVMType) _ArrayDisplay($aVMVer) DllCall($hDll, "NONE","VBVMR_Logout") If @error Then ConsoleWriteError('Error VBVMR_Logout: ' & ' Error: ' & @error & ' Extended: ' & @extended & @CR) EndIf DllClose($hDll) I have attached the current .h file for the version of Voicemeeter I am using as well. If I have tried different types (STR,INT,etc) within the DLL call. The script will either return an unknown "return type" or the DLL open will crash. (Sits for up to 30 seconds then errors). I have attempted to adopt this from other code I have seen on the internet but I suspect I just lack understanding when translating from the .h file to what is needed here. VoicemeeterRemote.h
  13. Thanks for the fast reply... After logging in, the URL address has changed from "https://intranetsiteaddress" to "https://intranetsiteaddress/listpage" The button object name "List Data" does not exist on the first page "https://intranetsiteaddress" so that error does make sense to me. It does exist on the new page that is opened "https://intranetsiteaddress/listpage". <div id="sidebar"> <form action="/listdata" method="get"> <input class="submit" type="submit" value="List Data"> </form> <form action="/logselect" method="get"> <input class="submit" type="submit" value="View Log"> </form> <form action="/logoff" method="get"> <input class="submit" type="submit" value="Logoff"> </form> </div> I'm not the creator of the the intranet site so I can't vouch for HTML coding weirdness...
  14. I realize this is almost a year old but this post comes the closest to my situation in my day of searching.... I am wondering what the solution was or perhaps the best approach for this... I'm including my script so far. I cannot include the actual site as it is an intranet site. #include <IE.au3> Local $oUser, $oPass, $oSubmit Local $sUser = "username" Local $sPass = "creativepassword" Local $url = "https://intranetsiteaddress" Local $oIE = _IECreate($url, 1) _IELoadWait($oIE) $oInputs = _IETagNameGetCollection($oIE, "input") for $oInput in $oInputs if $oInput.type = "text" And $oInput.name = "user" And $oInput.size = "20" Then $oUser = $oInput if $oInput.type = "password" And $oInput.name = "pwd" And $oInput.size = "20" Then $oPass = $oInput if $oInput.type = "submit" And $oInput.value = "Log In" Then $oSubmit = $oInput if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop Next $oUser.value = $sUser $oPass.value = $sPass _IEAction($oSubmit, "click") _IELoadWait($oIE) ; Attempt to connect to the new page after being redirected post site login ;$oIE1 = _IEAttach("Intranet - Page Title - Internet Explorer", "windowtitle") ;does not work ;$oIE1 = _IEAttach("Intranet - Page Title", "windowtitle") ;does not work ;$oIE1 = _IEAttach("Intranet - Page Title - Internet Explorer") ;does not work $oIE1 = _IEAttach("Intranet - Page Title") ;does not work _IELoadWait($oIE1) $oSubmit = _IEGetObjByName($oIE1, "List Data") _IEAction($oSubmit, "click") _IELoadWait($oIE1) ;After this will be code to retreive data from a list on the new page displayed My attempts return these messages... --> IE.au3 T3.0-2 Warning from function _IEAttach, $_IESTATUS_NoMatch --> IE.au3 T3.0-2 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: List Data, Index: 0) --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType Thanks...
  15. @jdelaney, thank you for your reply.... I like your approach of using enumerated variables. I hadn't thought of using them in the past. I am wondering how your ObjCreate("Microsoft.XMLDOM") acts different that that within the _XMLDOMWrapper.au3 UDF?
×
×
  • Create New...