Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] List of function signature issues #21

Open
AntoineBalaine opened this issue Jul 6, 2023 · 2 comments
Open

[BUG] List of function signature issues #21

AntoineBalaine opened this issue Jul 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@AntoineBalaine
Copy link

Hello,

Here's the update with the issues I could find from the built types.
I assume that functions with repeatedly the same problem are due to logic issues in the docs enginee and that one-offs are just a data-input issue.

All of these can be seen from the website (I hope - I checked as many of them as I could…).
Sorry if I'm giving you the function definitions from my lua types, instead of from your docs directly.

I hope this helps, keep me posted if you need any help with anything.

Uneven position of argument «optional» in pattern

Lots the functions will have <optional> <type> <identifier> whilst others will have <type> <optional> <identifier>. This shouldn't be a priority issue, though - it's going to be fairly easy for me to address this with logic in the lua types.

Functions with untyped params

function gfx.blitext() end

Functions that list identifier as a data type

There's hundreds of these. A little sample:

---@return identifier retval, boolean inlineEditor, integer noteRow, integer ccLane, integer ccLaneVal, integer ccLaneId
function reaper.BR_GetMouseCursorContext_MIDI() end
---@param midiEditor identifier
---@param laneId integer
---@return boolean retval
function reaper.BR_MIDI_CCLaneRemove(midiEditor, laneId) end
---@param midiEditor identifier
---@param laneId integer
---@param newCC integer
---@return boolean retval
function reaper.BR_MIDI_CCLaneReplace(midiEditor, laneId, newCC) end

Untyped return values

---@return takename 
function reaper.GetTakeName(take) end

Functions with typos in params (typically, adding quotes around the param name)

function gfx.init("name", width, height, dockstate, xpos, ypos) end

Functions that have first retval optional and not the second

---@return MediaTrack|nil tr, string info
function reaper.GetThingFromPoint(screen_x, screen_y) end

Functions that have two identifiers as return values (typically: Lua: number startTime retval, number endTime = reaper.BR_GetArrangeView(ReaProject proj)). The expectation for parsing the docs is that there would be only one identifier per value.

---@return number|nil retval, number outputLatency
function reaper.GetInputOutputLatency() end

---@return integer|nil retval, integer regionidx
function reaper.GetLastMarkerAndCurRegion(proj, time) end

---@return number|nil retval, number endTime
function reaper.BR_GetArrangeView(proj) end

Functions that have identifier as a return type

---@return identifier retval, boolean inlineEditor, integer noteRow, integer ccLane, integer ccLaneVal, integer ccLaneId
function reaper.BR_GetMouseCursorContext_MIDI() end

---@return identifier font
function reaper.JS_GDI_CreateFillBrush(color) end

---@return identifier font
function reaper.JS_GDI_CreateFont(height, weight, angle, italic, underline, strike, fontName) end

---@return identifier pen
function reaper.JS_GDI_CreatePen(width, color) end

---@return identifier device_context
function reaper.JS_GDI_GetClientDC(windowHWND) end

---@return identifier device_context
function reaper.JS_GDI_GetScreenDC() end

---@return identifier device_context
function reaper.JS_GDI_GetWindowDC(windowHWND) end

---@return identifier object
function reaper.JS_GDI_SelectObject(deviceHDC, GDIObject) end

---@return identifier bitmap
function reaper.JS_LICE_CreateBitmap(isSysBitmap, width, height) end

---@return identifier font
function reaper.JS_LICE_CreateFont() end

---@return identifier device_context
function reaper.JS_LICE_GetDC(bitmap) end

---@return identifier image
function reaper.JS_LICE_LoadJPG(filename) end

---@return identifier image
function reaper.JS_LICE_LoadJPGFromMemory(buffer, bufsize) end

---@return identifier bitmap
function reaper.JS_LICE_LoadPNG(filename) end

---@return identifier bitmap
function reaper.JS_LICE_LoadPNGFromMemory(buffer, bufsize) end

---@return identifier memory
function reaper.JS_Mem_Alloc(sizeBytes) end

---@return identifier mouse_cursor
function reaper.JS_Mouse_GetCursor() end

---@return identifier mouse_cursor
function reaper.JS_Mouse_LoadCursor(cursorNumber) end

---@return identifier mouse_cursor
function reaper.JS_Mouse_LoadCursorFromFile(pathAndFileName, boolean) end

---@return identifier ptr
function reaper.JS_PtrFromStr(s) end

---@return identifier HWND
function reaper.JS_Window_AttachTopmostPin(windowHWND) end

---@return identifier retval, optional string
function reaper.JS_Window_Create(title, className, x, y, w, h, string, ownerHWND) end

---@return identifier hwnd
function reaper.JS_Window_Find(title, exact) end

---@return identifier hwnd
function reaper.JS_Window_FindChild(parentHWND, title, exact) end

---@return identifier HWND
function reaper.JS_Window_FindChildByID(parentHWND, ID) end

---@return identifier HWND
function reaper.JS_Window_FindEx(parentHWND, childHWND, className, title) end

---@return identifier hwnd
function reaper.JS_Window_FindTop(title, exact) end

---@return identifier hwnd
function reaper.JS_Window_FromPoint(x, y) end

---@return identifier hwnd
function reaper.JS_Window_GetFocus() end

---@return identifier hwnd
function reaper.JS_Window_GetForeground() end

---@return identifier long_ptr
function reaper.JS_Window_GetLongPtr(windowHWND, info) end

---@return identifier hwnd
function reaper.JS_Window_GetParent(windowHWND) end

---@return identifier hwnd
function reaper.JS_Window_GetRelated(windowHWND, relation) end

---@return identifier hwnd
function reaper.JS_Window_HandleFromAddress(address) end

---@return identifier hwnd
function reaper.JS_Window_SetParent(childHWND, parentHWND) end

---@return identifier retval, integer retval
function reaper.JS_Zip_Open(zipFile, mode, compressionLevel) end

---@return identifier index
function reaper.JS_ListView_GetHeader(listviewHWND) end

---@return identifier hwnd
function reaper.BR_Win32_FindWindowEx(hwndParent, hwndChildAfter, className, windowName, searchClass, searchName) end

---@return identifier hwnd_focus
function reaper.BR_Win32_GetFocus() end

---@return identifier hwnd_foreground
function reaper.BR_Win32_GetForegroundWindow() end

---@return identifier hwnd_main
function reaper.BR_Win32_GetMainHwnd() end

---@return identifier retval, boolean isDocked
function reaper.BR_Win32_GetMixerHwnd() end

---@return identifier hwnd_parent
function reaper.BR_Win32_GetParent(hwnd) end

---@return identifier hwnd
function reaper.BR_Win32_GetWindow(hwnd, cmd) end

---@return identifier hwnd_active_midi_ed
function reaper.BR_Win32_MIDIEditor_GetActive() end

---@return identifier hwnd_focus
function reaper.BR_Win32_SetFocus(hwnd) end

---@return identifier hwnd
function reaper.BR_Win32_StringToHwnd(string) end

---@return identifier hwnd_point
function reaper.BR_Win32_WindowFromPoint(x, y) end
@AntoineBalaine AntoineBalaine added the bug Something isn't working label Jul 6, 2023
@iainhallam
Copy link

ultraschall.CreateNewRenderTable also claims to have Normalize_Method twice, though one instance is actually Normalize_Only_Files_Too_Loud.

@mespotine
Copy link
Collaborator

@iainhallam Thanks for reporting. It's a bug in the docs. Will be fixed in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants