raffaeletani / ambiplayer

GNU Lesser General Public License v3.0
3 stars 0 forks source link

code does not persist between interactions. #1

Closed chuckdelcamp closed 1 week ago

chuckdelcamp commented 1 week ago

Wonderful GUI and Functionality, thanks.

Using the GUI, I am able to "start" an item. Watching the console, I'm able to watch the GET request to start it. image

[GIN] 2024/06/22 - 18:17:43 | 200 |      93.029µs |       127.0.0.1 | GET      "/api/v1/start?code=f58585c59f6eeed4e4dfa9f5442ec9e9"
Playing sound: 01 - Key of A Pads.mp3

Using the GUI again, I can press STOP or FADE out for the individual item: image

The CODE remains consistent for the START calls (consistent with the code displayed in the GUI), however the STOP and FADEOUTSTOP calls use a different code each time. Screenshot from 2024-06-22 18-14-54

If I attempt to use the "consistent" code in to issue a stop call, the program crashes with a memory address error: image

As a REST API user it would be great to be able to make a call to stop a specific media. I might be missing something in how the "code" is intended to be used.

raffaeletani commented 1 week ago

Each time you start a library item, the resulting active playback item gets created with a new code. I did this because you can start an lib item multiple times and have them play simultaneously and still be able to control the active playbacks individually.

We could return the active playbacks code after a start call via api, or store the codes of a lib items active playback in the lib and lookup this list on a stop call to the lib item.

As i only use the fadeoutstopall via api, this remained unfinished

raffaeletani commented 1 week ago

calling the actions play, pause, stop, fadeoutstop with the library items code, applies them to all spawned instances (active playbacks) of that library item, whereas the stopall, playall, pauseall and fadeoutstopall still apply for all active playbacks

chuckdelcamp commented 1 week ago

Works like a charm. Thanks!