Author Topic: Spriggsy's API Collection  (Read 2940 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #60 on: October 26, 2020, 04:00:33 PM »
Updated 03:52 PM on 10/26/2020

Added XInputGetState, XInputSetState, and XInputGetBatteryInformation from XInput1_4 WinAPI DLL. The functions are located in "XInputControllerTest - Merged.bas". The demo is an InForm application. Rather than try to bundle all the files into another folder I've opted to just combine them all into one file. CONST declarations are located at the top of the program.

« Last Edit: October 26, 2020, 04:12:34 PM by SpriggsySpriggs »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #61 on: October 26, 2020, 04:14:09 PM »
Updated 4:13 PM on 10/26/2020

Added pipecom from my pipecom library which pipes console output to QB64. It is a cross-platform library that works on Windows, Macintosh, and Linux.

See here for a post with more detail: https://www.qb64.org/forum/index.php?topic=3168.msg124345#msg124345

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #62 on: November 01, 2020, 05:50:00 PM »
Updated 11/01/2020 at 5:49 PM

Updated pipecom library code with WinAPI calls to simulate popen without a console window appearing.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #63 on: November 03, 2020, 04:17:30 PM »
Updated 04:17 PM on 11/03/2020

Fixed bug in pipecom which caused duplication of data between calls in Windows due to the buffer not being cleared.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #64 on: November 05, 2020, 11:17:12 AM »
Updated 11:15 AM on 11/05/2020

Updated pipecom library and added CryptBinaryToString and CryptStringToBinary from Crypt32 WinAPI DLL. The code is found in "Base64 Multiplatform.bas". The code also contains usage for the built-in base64 command for Mac and Linux.

See here for a dedicated post on the library: https://www.qb64.org/forum/index.php?topic=3214.0
« Last Edit: November 05, 2020, 11:27:13 AM by SpriggsySpriggs »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #65 on: November 17, 2020, 06:20:31 PM »
Updated 06:17 PM on 11/17/2020

Added a huge FTP library using WinAPI's Wininet DLL. Took me several days to make it this complete. Probably one of my most complex and certainly my largest library so far. This library has functions for downloading, uploading, directory listing, changing directory, deleting files, deleting directories, and making directories. It's a big one and one that will be updated as time goes on. Since this one uses functions from a previous FTP example in my 7-zip folder I have removed the previous example and replaced it with this. The file is named "FTP WinAPI.bas". Below are some screenshots showing an example FTP listing generated with the library:

 
 
« Last Edit: November 17, 2020, 06:25:38 PM by SpriggsySpriggs »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #66 on: November 18, 2020, 02:50:27 AM »
Updated the "dir" style listing as well as added a new function. Both accept a file extension filter.

Screenshot of the filtered listing:

 

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #67 on: November 28, 2020, 08:24:10 AM »
08:23 AM 11/28/2020

Updated the XInput library to show pressure on the triggers of the gamepad.

See video for demonstration:

« Last Edit: November 28, 2020, 08:57:58 AM by SpriggsySpriggs »

Online FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2495
  • LET IT = BE
    • QB64.org
Re: Spriggsy's API Collection
« Reply #68 on: November 28, 2020, 08:25:34 AM »
❤️

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2936
    • Steve’s QB64 Archive Forum
Re: Spriggsy's API Collection
« Reply #69 on: November 28, 2020, 10:16:12 AM »
Is there some requirement for XINPUT to work properly for us?  I ran the test code in your API bundle last night, and the program would never detect my joystick at all.  I even went in and swapped it to check for all 4 of the available channels (0 to 3), wondering if perhaps mine was on something other than the default 0, but it was all no good.  _DEVICES found and identified the gamepad properly, but the XINPUT application didn't.

Does this require DirectX9?  DirectX11?  Some other version?  As this PC is new, I don't think it has anything except DirectX12 installed on it.  Are older packages required for this to work properly?

Edit:  Reading on the XInput information gives this info:

Quote
XInput Limitations
XInput only supports "next generation" controllers. This limits it basically to controllers for the Xbox 360 that also have Windows drivers. Legacy Windows controllers, joysticks and generalized haptic feedback devices are not supported.

I'm guessing that my poor old gamepad is probably not one of the "next generation" models.  Looks like testing this code will have to wait as well, for me to get a new controller. 

« Last Edit: November 28, 2020, 10:33:38 AM by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #70 on: November 28, 2020, 01:13:30 PM »
@SMcNeill
Yeah, I wasn't sure what sort of drivers your controller used so I couldn't be sure if it would work or not. It would be neat if your new one did!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #71 on: Yesterday at 01:05:57 AM »
1:01 AM 11/29/2020

Updated UUID Creation library by making it cleaner; e.g., getting rid of unnecessary CONST values, breaking some repetitive actions into new functions and subs, and adding the ability to compare two GUID/UUID values to check if they are greater, less, or equal using UuidCompare. If UUID1 is greater than UUID2 then the return is -1. 0 for equal and 1 for UUID1 less than UUID2.
« Last Edit: Yesterday at 01:44:07 AM by SpriggsySpriggs »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 554
  • If you're API and you know it clap your hands
    • My GitHub
Re: Spriggsy's API Collection
« Reply #72 on: Yesterday at 02:07:01 AM »
2:05 AM 11/29/2020

Fixed bug in the FTP library that would cause print statements after FTPUpload and FTPDownload to not appear because of the usage of _DISPLAY in the download loop. _AUTODISPLAY has been added after the loop execution so that printing can resume normally.