Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / copresence / mediums / audio / audio_player.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_PLAYER_H_
6 #define COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_PLAYER_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12
13 namespace media {
14 class AudioBusRefCounted;
15 }
16
17 namespace copresence {
18
19 // The AudioPlayerImpl class will play a set of samples till it is told to stop.
20 class AudioPlayer {
21  public:
22   // Initializes the object. Do not use this object before calling this method.
23   virtual void Initialize() = 0;
24
25   // Play the given samples. These samples will keep on being played in a loop
26   // till we explicitly tell the player to stop playing.
27   virtual void Play(
28       const scoped_refptr<media::AudioBusRefCounted>& samples) = 0;
29
30   // Stop playing.
31   virtual void Stop() = 0;
32
33   // Cleans up and deletes this object. Do not use object after this call.
34   virtual void Finalize() = 0;
35
36   virtual bool IsPlaying() = 0;
37
38  protected:
39   virtual ~AudioPlayer() {}
40 };
41
42 }  // namespace copresence
43
44 #endif  // COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_PLAYER_H_