]> git.alsa-project.org Git - tinycompress.git/commit
utils: cplay: Add support for pause/resume
authorLaurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Fri, 26 Aug 2022 09:23:45 +0000 (12:23 +0300)
committerVinod Koul <3178504+vinodkoul@users.noreply.github.com>
Mon, 19 Sep 2022 08:56:18 +0000 (14:26 +0530)
commit7dc18a725646f2662042aa17a5a181739f0c8021
tree85101579d33334b201fdb51605b25d01f9da1446
parentf9fe0e3e0cc21b9550d30850fb06f68aeabc9337
utils: cplay: Add support for pause/resume

We want to be able to pause and resume the stream
just like the ALSA utilitary aplay does.

In order to do so, we first need to mark the read operations
on stdin as nonblocking and then enable the noncanonical mode
for the terminal. What this does is it makes the read operations
nonblocking and it makes the input available immediately.

After doing so, we can check if we receive a SPACE or ENTER
character from user and do pause/resume depending on current
stream state (and by this I mean if the stream is currently
paused and we receive a SPACE or ENTER then we resume it
and vice-versa)

Signed-off-by: Maurine Creton <maurine.creton@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
src/utils/cplay.c