Downloading an image from the internet?

Hi everyone! Theoretically, is it possible for a module to download content from the internet, such as a .jpg? I’m brainstorming ways to support textured panel backgrounds while keeping my core plugin size small. It would be interesting to make a context menu item where the user can specify a URL to a .jpg that would be used for a background texture.

Thanks,
Bret (Voxglitch)

Let your user do the downloading and just provide a way yo load a file. That will be much simpler, and less subject to issues like loading a patch for a performance where you don’t have internet available, (not to mention potential security problems).

4 Likes

Oh yeah… that’s a very good point. Thanks for the idea!

The user initiated approach is indeed probably better for this case. But with surge Andrew asked us to make the wave table content an extra content download. The way we did it was (1) prompt the user. No un initiated connection. The. (2) surge-rack/src/VCO.cpp at 852bb5b950f9a756c1850b91627afb543cb6b0ec · surge-synthesizer/surge-rack · GitHub that code to do the download. If that helps

6 Likes

I like this solution a lot because it’s user-initiated, and the user doesn’t have to go through the process of…

  1. Visit website
  2. Download asset
  3. Locate where it should go
  4. Copy it into place

Instead, the user just selects a menu item and maybe confirms the download. Interesting. @baconpaul , thanks for the code sample. That’s very helpful.