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

Unified Diff: components/copresence/public/copresence_constants.h

Issue 764673003: Adding CopresenceState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: components/copresence/public/copresence_constants.h
diff --git a/components/copresence/public/copresence_constants.h b/components/copresence/public/copresence_constants.h
index 68f8a907d6a11b3eb76410ee85ede30067d1e622..ae75f77d8f5597e7e0c24d10a4a2430e5d2d4571 100644
--- a/components/copresence/public/copresence_constants.h
+++ b/components/copresence/public/copresence_constants.h
@@ -10,6 +10,7 @@
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
+#include "components/copresence/tokens.h"
#include "media/base/channel_layout.h"
namespace media {
@@ -18,6 +19,8 @@ class AudioBusRefCounted;
namespace copresence {
+class Directive;
+
// Audio constants. Currently used from the AudioPlayer/AudioRecorder.
// TODO(rkc): Make these values configurable then remove them from here.
// Number of repetitions of the audio token in one sequence of samples.
@@ -36,6 +39,7 @@ extern const float kDefaultCarrierFrequency;
extern const int kDefaultChannels;
extern const media::ChannelLayout kDefaultChannelLayout;
+
// These constants are used from everywhere.
// Particularly, these are used to index the directive lists in the
// audio manager, so do not change these enums without changing
@@ -47,12 +51,6 @@ enum AudioType {
AUDIO_TYPE_UNKNOWN = 3,
};
-struct AudioToken {
- AudioToken(const std::string& token, bool audible)
- : token(token), audible(audible) {}
- std::string token;
- bool audible;
-};
// These callbacks are used from various places in Copresence.
@@ -60,8 +58,6 @@ struct AudioToken {
using SuccessCallback = base::Callback<void(bool)>;
// Callback to pass around found tokens.
-// Arguments:
-// const std::vector<AudioToken>& tokens - List of found tokens.
using TokensCallback = base::Callback<void(const std::vector<AudioToken>&)>;
// Callback to receive encoded samples from Whispernet.
@@ -72,6 +68,10 @@ using SamplesCallback =
base::Callback<void(AudioType,
const std::string&,
const scoped_refptr<media::AudioBusRefCounted>&)>;
+
+// Callback to pass a list of directives back to CopresenceState.
+using DirectivesCallback = base::Callback<void(const std::vector<Directive>&)>;
+
} // namespace copresence
#endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_
« no previous file with comments | « components/copresence/handlers/directive_handler_unittest.cc ('k') | components/copresence/public/copresence_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698