Main Page · Modules · All Classes · Class Hierarchy
MAAudio.hpp
1 /*
2  * This file is part of the AiBO+ project
3  *
4  * Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5  *
6  * AiBO+ is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * AiBO+ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #pragma once
23 
24 #include "core/MANum.hpp"
25 #include "MARobotStateUpdater.hpp"
26 
27 #include <MCTypes.hpp>
28 
34 namespace MA
35 {
37 typedef enum
38 {
39  UnknownSoundEvent = 0,
40  AmbientNoise = 1,
41  BabyCry = 2,
42  Bell = 3,
43  CatMeow = 4,
44  Cicada = 5,
45  DogBark = 6,
46  Fart = 7,
47  Guitar = 8,
48  Laugh = 9,
49  Parrot = 10,
50  Piano = 11,
51  Speech = 12,
52  Traffic = 13,
53  VacuumCleaner = 14,
54  MaxSoundEvents = VacuumCleaner,
55 } SoundEventType;
56 
57 extern const MC::StringList SoundEventTypeStrs;
58 }
59 
64 {
66  MAAudio();
67 
68 private:
69  // Update the sensor indicators
70  virtual void UpdateRobotState(MARobotState& state) override;
71 
72 public:
73  /*
74  * The speaker volume
75  * 0 - muted 1 - low 2 - normal 3 - high
76  */
77  MANum<int> SpeakerVolume;
78  /*
79  * The remaining audio duration being played
80  * 0 - No audio >0 - The remaining playback duration in msec
81  */
82  MANum<int> RemainingPlaybackTime;
83  /*
84  * Volume control type
85  * 0 - Adaptive volume control 1 - Full volume
86  */
87  MANum<int> FullVolume;
97  MANum<int> SoundEventVotes[MA::MaxSoundEvents+1];
98  /*
99  * Deafness support
100  * 0 - No deafness 1 - Any of the ears is deaf
101  */
102  MANum<int> Deafness;
105 };
106 
MANum< int > CurrentSoundEvent
The current sound event.
Definition: MAAudio.hpp:95
MANum< int > BackgroundSoundPower
The background sound power.
Definition: MAAudio.hpp:93
MANum< int > EffectsPlayed
Whether only effects are being played back.
Definition: MAAudio.hpp:104
Audio input/output state.
Definition: MAAudio.hpp:63
MANum< int > RightMicrophonePower
The power of the right microphone channel.
Definition: MAAudio.hpp:91
Robot state updater base class.
MANum< int > LeftMicrophonePower
The power of the left microphone channel.
Definition: MAAudio.hpp:89
Robot state.