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

Side by Side Diff: earcon_manager.cc

Issue 6812006: Enable -Wall -Werror and fix 2 compile-errors it would introduce. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/speech_synthesis.git@master
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « Makefile ('k') | speech_synthesizer_service.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 (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "earcon_manager.h" 9 #include "earcon_manager.h"
10 #include "log.h" 10 #include "log.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 delete[] old_audio_data; 200 delete[] old_audio_data;
201 frames += new_frames; 201 frames += new_frames;
202 } 202 }
203 203
204 pos += chunk_bytes + 8; 204 pos += chunk_bytes + 8;
205 } 205 }
206 206
207 if (frames && channels && rate) { 207 if (frames && channels && rate) {
208 return LoadEarcon(frames, audio_data.get(), channels, rate, loop); 208 return LoadEarcon(frames, audio_data.get(), channels, rate, loop);
209 } 209 }
210 return -1;
210 } 211 }
211 212
212 void EarconManager::Play(int earcon_id) { 213 void EarconManager::Play(int earcon_id) {
213 earcons_[earcon_id].is_playing = true; 214 earcons_[earcon_id].is_playing = true;
214 earcons_[earcon_id].position = 0; 215 earcons_[earcon_id].position = 0;
215 } 216 }
216 217
217 void EarconManager::Stop(int earcon_id) { 218 void EarconManager::Stop(int earcon_id) {
218 earcons_[earcon_id].is_playing = false; 219 earcons_[earcon_id].is_playing = false;
219 } 220 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 data[j] = value; 257 data[j] = value;
257 } 258 }
258 259
259 earcons_[i].position += count; 260 earcons_[i].position += count;
260 if (earcons_[i].position == earcons_[i].frame_count) 261 if (earcons_[i].position == earcons_[i].frame_count)
261 earcons_[i].is_playing = false; 262 earcons_[i].is_playing = false;
262 } 263 }
263 } 264 }
264 265
265 } // namespace speech_synthesis 266 } // namespace speech_synthesis
OLDNEW
« no previous file with comments | « Makefile ('k') | speech_synthesizer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698