rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
sound.h
Go to the documentation of this file.
1 #ifndef _RAPID_SOUND_SOUND_H_
2 #define _RAPID_SOUND_SOUND_H_
3 
4 #include <string>
5 
6 #include "gmock/gmock.h"
7 #include "sound_play/sound_play.h"
8 
9 namespace rapid {
10 namespace sound {
12  public:
13  virtual ~SoundInterface(){};
14  virtual void Say(const std::string& text) = 0;
15 };
16 
17 // Implements SoundInterface using sound_play.
18 class SoundPlay : public SoundInterface {
19  public:
20  explicit SoundPlay(const std::string& voice = "voice_kal_diphone");
21  virtual void Say(const std::string& text);
22 
23  private:
24  sound_play::SoundClient client_;
25  std::string voice_;
26 };
27 
28 // Mock version for testing.
29 class MockSound : public SoundInterface {
30  public:
31  MockSound() {}
32  MOCK_METHOD1(Say, void(const std::string& text));
33 };
34 };
35 };
36 #endif // _RAPID_SOUND_SOUND_H_
virtual ~SoundInterface()
Definition: sound.h:13
SoundPlay(const std::string &voice="voice_kal_diphone")
MOCK_METHOD1(Say, void(const std::string &text))
virtual void Say(const std::string &text)
virtual void Say(const std::string &text)=0