| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <math.h> | 5 #include <math.h> |
| 6 #include <memory> | 6 #include <memory> |
| 7 | 7 |
| 8 #include "mojo/public/c/system/main.h" | 8 #include "mojo/public/c/system/main.h" |
| 9 #include "mojo/public/cpp/application/application_delegate.h" | 9 #include "mojo/public/cpp/application/application_delegate.h" |
| 10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 void PlayToneApp::Quit() { | 65 void PlayToneApp::Quit() { |
| 66 rate_control_.reset(); | 66 rate_control_.reset(); |
| 67 audio_pipe_.reset(); | 67 audio_pipe_.reset(); |
| 68 audio_track_.reset(); | 68 audio_track_.reset(); |
| 69 audio_server_.reset(); | 69 audio_server_.reset(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PlayToneApp::Initialize(ApplicationImpl* app) { | 72 void PlayToneApp::Initialize(ApplicationImpl* app) { |
| 73 app->ConnectToService("mojo:audio_server", &audio_server_); | 73 app->ConnectToServiceDeprecated("mojo:audio_server", &audio_server_); |
| 74 audio_server_.set_connection_error_handler([this]() { | 74 audio_server_.set_connection_error_handler([this]() { |
| 75 OnConnectionError("audio_server"); | 75 OnConnectionError("audio_server"); |
| 76 }); | 76 }); |
| 77 | 77 |
| 78 audio_server_->CreateTrack(GetProxy(&audio_track_)); | 78 audio_server_->CreateTrack(GetProxy(&audio_track_)); |
| 79 audio_track_.set_connection_error_handler([this]() { | 79 audio_track_.set_connection_error_handler([this]() { |
| 80 OnConnectionError("audio_track"); | 80 OnConnectionError("audio_track"); |
| 81 }); | 81 }); |
| 82 | 82 |
| 83 // Query the sink's format capabilities. | 83 // Query the sink's format capabilities. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 } // namespace audio | 247 } // namespace audio |
| 248 } // namespace media | 248 } // namespace media |
| 249 } // namespace mojo | 249 } // namespace mojo |
| 250 | 250 |
| 251 MojoResult MojoMain(MojoHandle app_request) { | 251 MojoResult MojoMain(MojoHandle app_request) { |
| 252 mojo::ApplicationRunner runner( | 252 mojo::ApplicationRunner runner( |
| 253 std::unique_ptr<mojo::media::audio::examples::PlayToneApp>( | 253 std::unique_ptr<mojo::media::audio::examples::PlayToneApp>( |
| 254 new mojo::media::audio::examples::PlayToneApp())); | 254 new mojo::media::audio::examples::PlayToneApp())); |
| 255 return runner.Run(app_request); | 255 return runner.Run(app_request); |
| 256 } | 256 } |
| OLD | NEW |