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