Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: examples/audio_play_test/play_tone.cc

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « examples/apptest/example_apptest.cc ('k') | examples/audio_play_test/play_wav.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « examples/apptest/example_apptest.cc ('k') | examples/audio_play_test/play_wav.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698