rodio icon indicating copy to clipboard operation
rodio copied to clipboard

add `Callback` source

Open goolord opened this issue 2 years ago • 2 comments

this lets you execute code when the sink is empty, when you've reached a certain position in the sink, etc. it's useful if you can't/don't want to poll constantly to see if the sink has emptied

goolord avatar Jul 05 '22 00:07 goolord

What is the status on this and could you provide an example of how to use it? I needed I can rebase it against master (looking at it it seems to be a trivial rebase).

ivakam avatar Sep 14 '22 22:09 ivakam

using it here https://github.com/goolord/tundra/blob/c3e4515ad60b86739638952d93d9a50031162527/src/source/callback.rs https://github.com/goolord/tundra/blob/aa85b23e6fccde69fa6cba4dd1b6225c3079b1b9/src/types/player.rs#L256

feels ready to merge

goolord avatar Sep 14 '22 22:09 goolord

bump, wasn't sure how useful this was but it appears that someone else has wanted it at least https://github.com/goolord/tundra/issues/3

goolord avatar Mar 08 '23 00:03 goolord

@goolord it can easily be confused with a source that invokes a callback to generate samples and it was my first idea when I read this PR. I think it would be better to rename it to EmptyCallback.

est31 avatar Mar 11 '23 19:03 est31