Very, very interesting and well done!
Effective for the intended purpose.
Thanks for sharing.
And now ... (huh, huh ... were you hoping to get away with it?) Million-dollar question ...
I noticed that, in addition to commanding the execution of the audio stream, you are also able to send get requests and obtain data in response:
$ plugin.get_web_audiostream_info ();
$ plugin.get_web_playlist_info ();
$ plugin.get_web_media_info ();
$ plugin.get_waveaudio_device_info ();All these requests are addressed in order to obtain objects with the characteristics required by the audio stream.
Would it be possible to write a "
universal" function that makes a "get" call to a website and gets json data or a text string in response, at the user's discretion?
Let me explain better with an example, for me, very current.
In the simulation program of the ISS I need to obtain the starting data for the calculation of the position and speed of the station.
Through the plugin I execute a command: system (" curl -s -o "+ Path +" iss2.txt
https://api.wheretheiss.at/v1/satellites/25544/tles ");
Basically I ask, through a system call, to the windows program curl.exe, to make a "get" call to the "wheretheiss.at" site and to write the answer in the "iss2.txt" file. Then I read the file through the plugin and transport the data that interests me "cleaned up" in the main program.
All this is extremely inelegant and, even if it achieves the intended purpose, it unnecessarily complicates the procedure.
Moreover, it causes the program to be interrupted for about a second, waiting for the answer and for the conclusion of the "system" call.
Unfortunately, I haven't found another more direct way.
The study of the routines that communicate with the Web in the Outerra API and the attempt to include the CURL project in the plugin have not been successful, due to my lack of knowledge of the C ++ language. Again I had to "get around" the problem with a trick.
A
universal "get" function would be very useful to anyone wishing to communicate with the Web from within Outerra and without consulting external programs.
Thank you for your attention.