mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
Userland: Add --loop option for aplay
A tiny feature, useful when listening to your favorite song.
This commit is contained in:
parent
3039c36836
commit
7b481a2c73
Notes:
sideshowbarker
2024-07-19 01:53:53 +09:00
Author: https://github.com/nooga Commit: https://github.com/SerenityOS/serenity/commit/7b481a2c730 Pull-request: https://github.com/SerenityOS/serenity/pull/3768
1 changed files with 4 additions and 0 deletions
|
@ -34,9 +34,11 @@
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
const char* path = nullptr;
|
||||
bool should_loop = false;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(path, "Path to WAV file", "path");
|
||||
args_parser.add_option(should_loop, "Loop playback", "loop", 'l');
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
Core::EventLoop loop;
|
||||
|
@ -62,6 +64,8 @@ int main(int argc, char** argv)
|
|||
printf("%d/%d", loader.loaded_samples(), loader.total_samples());
|
||||
fflush(stdout);
|
||||
audio_client->enqueue(*samples);
|
||||
} else if (should_loop) {
|
||||
loader.reset();
|
||||
} else if (audio_client->get_remaining_samples()) {
|
||||
sleep(1);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue