blob: fcca01d83041b3c79eabc7fa4ee0ac0e19904eb8 [file] [log] [blame]
// 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-loop/default.h>
#include <lib/async/cpp/task.h>
#include "src/lib/fxl/command_line.h"
#include "src/media/playback/examples/audio_player/audio_player.h"
#include "src/media/playback/examples/audio_player/audio_player_params.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(&kAsyncLoopConfigAttachToCurrentThread);
examples::AudioPlayer audio_player(
params, [&loop]() { async::PostTask(loop.dispatcher(), [&loop]() { loop.Quit(); }); });
loop.Run();
return 0;
}