| // Copyright 2017 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include <lib/async-loop/cpp/loop.h> |
| #include <lib/async/cpp/task.h> |
| |
| #include "garnet/examples/mediaplayer/audio_player/audio_player.h" |
| #include "garnet/examples/mediaplayer/audio_player/audio_player_params.h" |
| #include "lib/fxl/command_line.h" |
| |
| int main(int argc, const char** argv) { |
| auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); |
| examples::AudioPlayerParams params(command_line); |
| if (!params.is_valid()) { |
| return 1; |
| } |
| |
| async::Loop loop(&kAsyncLoopConfigAttachToThread); |
| |
| examples::AudioPlayer audio_player(params, [&loop]() { |
| async::PostTask(loop.dispatcher(), [&loop]() { loop.Quit(); }); |
| }); |
| |
| loop.Run(); |
| return 0; |
| } |