Leaderboard
Popular Content
Showing content with the highest reputation on 04/30/2024 in all areas
-
Midi Example Scripts
argumentum reacted to MattyD for a topic
Hi folks, I wanted to keep a degree of seperation between this and the main Midi library, mainly for QA reasons. So this will be a space for me to throw some up semi-presentable things I've been messing around with. So far we have: CC Inspector. This is useful to figure out what CC controls do what on a device, particularly when documentation is lacking. Drum Machine. 4 bar drum looper. The midi UDF can be found here: https://www.autoitscript.com/forum/topic/208116-midi-udf/ If you rather not use the "installer" script - you'll need to grab the 4 dependancies out of the zip file: midi.au3 midiConstants.au3 midiAPI.au3 midiAPIConstants.au3 MidiPlayround_1.1.zip1 point -
1 point
-
PixelGetColor and Coordinates
ioa747 reacted to thepopol777 for a topic
FOUND IT ! It was not a coord issue, I forget to add Hex($color) 😠Found it by re-reading my 2nd script.... Sorry for the non-epic ending1 point -
Const keyword in function parameters indicates that the value of the parameter will not change during the execution of the function.1 point
-
1 point
-
PixelGetColor and Coordinates
thepopol777 reacted to ioa747 for a topic
put this at the top of the script, maybe it will help you #include <WinAPISys.au3> ;*** ConsoleWrite(_WinAPI_GetSystemMetrics(78) & " x " & _WinAPI_GetSystemMetrics(79) & @CRLF) ;*** If @AutoItX64 Then Exit MsgBox(262144 + 64, StringTrimRight(@ScriptName, 4), "Please run as 32bit", 60) DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", "int", -4) ; -4=PerMonitorAwareV2 ConsoleWrite(_WinAPI_GetSystemMetrics(78) & " x " & _WinAPI_GetSystemMetrics(79) & @CRLF) ;*** The ;΄*** are not needed, they are just for information1 point -
PixelGetColor and Coordinates
thepopol777 reacted to Nine for a topic
Use au3info tool (mouse tab) to find/confirm position and pixel color ps : make sure Opt (mouse/pixel coord) are in line with au3info1 point -
1. System menu / close 2. click "X" in the top rigth corner 3. filemenu/exit 4. click Exit button in gui 5. right-click for context menu / exit 6. ALT-F4 7. ESC1 point
-
Fastest Way to Delete Empty Records in 1d Array
AspirinJunkie reacted to Andreik for a topic
#include <Array.au3> Local $aArray[] = [" ", " This ", " ", "is ", " my test ", " "] $aArray1 = _Deye_ArrayDelEmptyRows($aArray, Chr(32)) _ArrayDisplay($aArray1) ; <<<--- trimed all spaces $aArray2 = _Deye_ArrayDelEmptyRows($aArray, Chr(34)) _ArrayDisplay($aArray2) ; <<<--- no empty spaces removed Func _Deye_ArrayDelEmptyRows(ByRef $aArray, $sDelim = Chr(32), $bUBound = False) Local $iArrayColumns = UBound($aArray, 2) If $iArrayColumns >= 1 Then Local $iCopyTo_Index = 0 For $i = 0 To UBound($aArray) - 1 For $j = 0 To $iArrayColumns - 1 ;~ If StringStripWS($aArray[$i][$j], 8) Then ExitLoop If $aArray[$i][$j] Then ExitLoop If $j = $iArrayColumns - 1 Then ContinueLoop 2 Next If $i <> $iCopyTo_Index Then For $j = 0 To $iArrayColumns - 1 $aArray[$iCopyTo_Index][$j] = $aArray[$i][$j] Next EndIf $iCopyTo_Index += 1 Next If UBound($aArray) > $iCopyTo_Index Then ReDim $aArray[$iCopyTo_Index][$iArrayColumns] If $bUBound Then _ArrayInsert($aArray, 0, UBound($aArray)) Return ($aArray) Else Return StringSplit(StringTrimLeft(StringRegExpReplace(StringRegExpReplace($sDelim & _ArrayToString($aArray, $sDelim), $sDelim & "[" & $sDelim & "]*[" & $sDelim & "]", $sDelim), $sDelim & "$", ""), 1), $sDelim, $bUBound ? "" : 3) EndIf EndFunc How is this a solve for OP's question?1 point -
Fixed in Beta since 13-10-2021: * 21.316.1639.6 Fixed getting error for missing include when in commentblock1 point
-
Sort a 2D array on using strings and characters
benners reacted to AspirinJunkie for a topic
In principle, you can sort everything if you only have the right comparison function. However, this is a bit tricky in your case. I have created a corresponding function from your specifications. Now you just need a sort function that accepts a user-defined comparison function. I have used the one from my >>ArrayPlus UDF<< for this and can use it to generate your desired result: #include "ArrayPlus.au3" ; Read the section from the INI file Local $aLines = IniReadSection(@ScriptDir & '\quicklaunch - Copy.ini', 'usermenu') _ArrayDisplay($aLines, "before") _ArraySortFlexible($aLines, __comp_benners, 1) _ArrayDisplay($aLines, "sorted") ; comparison function, which decide which element of two elements of your data is bigger or lesser then the other Func __comp_benners(ByRef $A, ByRef $B) Local $aSplitA = _regex_split($A[0], '^\d+\K\s*|>') Local $aSplitB = _regex_split($B[0], '^\d+\K\s*|>') Local $nA = UBound($aSplitA), $nB = UBound($aSplitB) Local $nMin = $nA > $nB ? $nB : $nA Local $bComp For $i = 0 To $nMin - 2 $bComp = StringCompare($aSplitA[$i], $aSplitB[$i]) If $bComp <> 0 Then Return $bComp Next Return $nA = $nB ? StringCompare($aSplitA[$i], $aSplitB[$i]) : $nA > $nB ? -1 : 1 EndFunc ; like StringSplit - but with regex to choose the delimiter Func _regex_split($sString, Const $sSplitPattern, Const $dFlag = 3) Return StringSplit( _ StringRegExpReplace($sString, $sSplitPattern, Chr(0)), _ Chr(0), $dFlag) EndFunc1 point -
Push the power button? .. or is your question about something else?1 point
-
Hi all, here is release 1.7 of the UDF The main focus of this release was to bring in some MSC support, which is mainly used with lighting consoles. MSC can also (potentially) control things like fireworks, and flys/trusses etc. So in the unlikely event anyone is trying to do that, dont! (i.e. read the disclaimer in the helpfile) Changelog: - Added some Midi Show Control (MSC) support - Fixed issue where _midi_CloseOutput failed to close non-stream handles. - Fixed example scripts for sequence functions. - Updated reference list links in the helpfile. The midi.org site has been updated, which broke hyperlinks. - Modified internals for _midi_PackSize1 point
-
#include <Array.au3> ; Required only for _ArrayDisplay(). #include <GUIConstantsEx.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> #include <_GUICtrlListView_CreateArray.au3> Example() Func Example() Local $iWidth = 600, $iHeight = 400, $iListView Local $hGUI = GUICreate('_GUICtrlListView_CreateArray()', $iWidth, $iHeight, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) _CreateListView($hGUI, $iListView) Local $iGetArray = GUICtrlCreateButton('Get Array', $iWidth - 120, $iHeight - 28, 115, 27) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKSIZE + $GUI_DOCKBOTTOM) Local $iRefresh = GUICtrlCreateButton('Refresh', $iWidth - 240, $iHeight - 28, 115, 27) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKSIZE + $GUI_DOCKBOTTOM) GUISetState(@SW_SHOW, $hGUI) Local $aReturn = 0, $aStringSplit = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iGetArray $aReturn = _GUICtrlListView_CreateArray($iListView, Default) ; Use | as the default delimeter. _ArrayDisplay($aReturn, '_GUICtrlListView_CreateArray() array.') $aStringSplit = StringSplit($aReturn[0][2], '|') _ArrayDisplay($aStringSplit, 'StringSplit() to retrieve column names.') Case $iRefresh GUICtrlDelete($iListView) _CreateListView($hGUI, $iListView) EndSwitch WEnd GUIDelete($hGUI) EndFunc Func _CreateListView($hGUI, ByRef $iListView) $ClientSize = WinGetClientSize($hGUI) $iListView = GUICtrlCreateListView('', 0, 0, $ClientSize[0], $ClientSize[1] - 30) GUICtrlSetResizing($iListView, $GUI_DOCKBORDERS) Sleep(250) $iCol = Random(1, 5, 1) __ListViewFill($iListView, $iCol, Random(25, 100, 1)) ; Fill the ListView with Random data. For $i = 0 To $iCol GUICtrlSendMsg($iListView, $LVM_SETCOLUMNWIDTH, $i, -1) GUICtrlSendMsg($iListView, $LVM_SETCOLUMNWIDTH, $i, -2) Next EndFunc Func __ListViewFill($hListView, $iColumns, $iRows) ; Required only for the Example. If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) EndIf Local $fIsCheckboxesStyle = (BitAND(_GUICtrlListView_GetExtendedListViewStyle($hListView), $LVS_EX_CHECKBOXES) = $LVS_EX_CHECKBOXES) _GUICtrlListView_BeginUpdate($hListView) For $i = 0 To $iColumns - 1 _GUICtrlListView_InsertColumn($hListView, $i, 'Column ' & $i + 1, 50) _GUICtrlListView_SetColumnWidth($hListView, $i - 1, -2) Next For $i = 0 To $iRows - 1 _GUICtrlListView_AddItem($hListView, 'Row ' & $i + 1 & ': Col 1', $i) If Random(0, 1, 1) And $fIsCheckboxesStyle Then _GUICtrlListView_SetItemChecked($hListView, $i) EndIf For $j = 1 To $iColumns _GUICtrlListView_AddSubItem($hListView, $i, 'Row ' & $i + 1 & ': Col ' & $j + 1, $j) Next Next _GUICtrlListView_EndUpdate($hListView) EndFunc1 point
-
Fastest Way to Delete Empty Records in 1d Array
AspirinJunkie reacted to Deye for a topic
apologies, but in order to try your hand at this function fairly , you must pass the correct arguments, especially the delimiter being used. like so, _Deye_ArrayDelEmptyRows($aArray, Chr(34)) or _Deye_ArrayDelEmptyRows($aArray, '"')0 points