summaryrefslogtreecommitdiffstats
path: root/components/audio_modem/public/modem.h
blob: 09ab399d5b40f151a0e8848a8fa4f9d5dc42d4c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_AUDIO_MODEM_PUBLIC_MODEM_H_
#define COMPONENTS_AUDIO_MODEM_PUBLIC_MODEM_H_

#include <string>

#include "base/memory/scoped_ptr.h"
#include "components/audio_modem/public/audio_modem_types.h"

namespace audio_modem {

class WhispernetClient;

class Modem {
 public:
  virtual ~Modem() {}

  // Initializes the object. Do not use this object before calling this method.
  virtual void Initialize(WhispernetClient* client,
                          const TokensCallback& tokens_cb) = 0;

  virtual void StartPlaying(AudioType type) = 0;
  virtual void StopPlaying(AudioType type) = 0;

  virtual void StartRecording(AudioType type) = 0;
  virtual void StopRecording(AudioType type) = 0;

  virtual void SetToken(AudioType type,
                        const std::string& url_safe_token) = 0;

  virtual const std::string GetToken(AudioType type) const = 0;

  virtual bool IsPlayingTokenHeard(AudioType type) const = 0;

  virtual void SetTokenParams(AudioType type,
                              const TokenParameters& params) = 0;

  static scoped_ptr<Modem> Create();
};

}  // namespace audio_modem

#endif  // COMPONENTS_AUDIO_MODEM_PUBLIC_MODEM_H_