| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ | 5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ |
| 6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ | 6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/copresence/mediums/audio/audio_manager.h" | 10 #include "components/audio_modem/public/whispernet_client.h" |
| 11 #include "components/copresence/public/copresence_constants.h" | |
| 12 | 11 |
| 13 namespace copresence { | 12 namespace copresence { |
| 14 | 13 |
| 15 class Directive; | 14 class Directive; |
| 16 class WhispernetClient; | |
| 17 | 15 |
| 18 // The AudioDirectiveHandler handles audio transmit and receive instructions. | 16 // The AudioDirectiveHandler handles audio transmit and receive instructions. |
| 19 class AudioDirectiveHandler { | 17 class AudioDirectiveHandler { |
| 20 public: | 18 public: |
| 21 virtual ~AudioDirectiveHandler() {} | 19 virtual ~AudioDirectiveHandler() {} |
| 22 | 20 |
| 23 // Do not use this class before calling this. | 21 // Do not use this class before calling this. |
| 24 virtual void Initialize(WhispernetClient* whispernet_client, | 22 virtual void Initialize(audio_modem::WhispernetClient* whispernet_client, |
| 25 const TokensCallback& tokens_cb) = 0; | 23 const audio_modem::TokensCallback& tokens_cb) = 0; |
| 26 | 24 |
| 27 // Adds an instruction to our handler. The instruction will execute and be | 25 // Adds an instruction to our handler. The instruction will execute and be |
| 28 // removed after the ttl expires. | 26 // removed after the ttl expires. |
| 29 virtual void AddInstruction(const Directive& directive, | 27 virtual void AddInstruction(const Directive& directive, |
| 30 const std::string& op_id) = 0; | 28 const std::string& op_id) = 0; |
| 31 | 29 |
| 32 // Removes all instructions associated with this operation id. | 30 // Removes all instructions associated with this operation id. |
| 33 virtual void RemoveInstructions(const std::string& op_id) = 0; | 31 virtual void RemoveInstructions(const std::string& op_id) = 0; |
| 34 | 32 |
| 35 // Returns the currently playing token. | 33 // Returns the currently playing token. |
| 36 virtual const std::string PlayingToken(AudioType type) const = 0; | 34 virtual const std::string PlayingToken(audio_modem::AudioType type) const = 0; |
| 37 | 35 |
| 38 // Returns if we have heard the currently playing audio token. | 36 // Returns if we have heard the currently playing audio token. |
| 39 virtual bool IsPlayingTokenHeard(AudioType type) const = 0; | 37 virtual bool IsPlayingTokenHeard(audio_modem::AudioType type) const = 0; |
| 40 }; | 38 }; |
| 41 | 39 |
| 42 } // namespace copresence | 40 } // namespace copresence |
| 43 | 41 |
| 44 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ | 42 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ |
| OLD | NEW |