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_DIRECTIVE_HANDLER_ |
| 6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/copresence/handlers/audio/audio_directive_list.h" |
| 14 #include "components/copresence/mediums/audio/audio_recorder.h" |
| 15 |
| 16 namespace copresence { |
| 17 class Directive; |
| 18 } |
| 19 |
| 20 namespace copresence { |
| 21 |
| 22 class AudioDirectiveHandler; |
| 23 |
| 24 // The directive handler manages transmit and receive directives given to it |
| 25 // by the client. |
| 26 class DirectiveHandler { |
| 27 public: |
| 28 DirectiveHandler(const AudioRecorder::DecodeSamplesCallback& decode_cb, |
| 29 const AudioDirectiveList::EncodeTokenCallback& encode_cb); |
| 30 ~DirectiveHandler(); |
| 31 |
| 32 // Adds a directive to handle. |
| 33 void AddDirective(const copresence::Directive& directive); |
| 34 // Removes any directives associated with the given operation id. |
| 35 void RemoveDirectives(const std::string& op_id); |
| 36 |
| 37 private: |
| 38 // Audio: |
| 39 scoped_ptr<AudioDirectiveHandler> audio_handler_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(DirectiveHandler); |
| 42 }; |
| 43 |
| 44 } // namespace copresence |
| 45 |
| 46 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_ |
OLD | NEW |