Main Page · Modules · All Classes · Class Hierarchy
MASkit.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 "MALedSkit.hpp"
25 #include "MAMotionSkit.hpp"
26 
27 class MCBinaryData;
28 class MASkit;
29 
35 namespace MA
36 {
38 typedef boost::shared_ptr<MASkit> SkitSPtr;
39 }
40 
44 class MASkit
45 {
46  MASkit();
47 
48 public:
59  MASkit(const std::string& name, MA::MotionSkitSPtr motion, MA::LedSkitSPtr led,
60  MC::BinaryDataSPtr sound);
61 
69  std::string GetName() const;
70 
78  int GetAudioStart() const;
79 
87  int GetAudioDuration() const;
88 
96  int GetDuration() const;
97 
103  void Dump() const;
104 
112  MA::MotionSkitSPtr GetMotionSkit();
113 
121  MA::LedSkitSPtr GetLedSkit();
122 
130  MC::BinaryDataSPtr GetSoundData();
131 
141  MA::SkitSPtr CloneMirrored(const std::string& mirrored_name);
142 
152  static MCBinaryData* EncodeMtnToAibFormat(const MCBinaryData& motion_data);
153 
163  static MASkit* DecodeAibData(const MCBinaryData& binary_data);
164 
165 private:
166 
176  static int GetAudioStartFromSkitterInfo(const MCBinaryData& binary_data);
177 
178 private:
180  std::string Name;
182  MA::MotionSkitSPtr MotionSkit;
184  MA::LedSkitSPtr LedSkit;
186  MC::BinaryDataSPtr SoundData;
189 };
190 
MA::LedSkitSPtr LedSkit
Led skit.
Definition: MASkit.hpp:184
Binary data class.
std::string Name
Skit name.
Definition: MASkit.hpp:180
MA::MotionSkitSPtr MotionSkit
Motion skit.
Definition: MASkit.hpp:182
int AudioStart
Audio start time in msec.
Definition: MASkit.hpp:188
Skit class to decode aib format.
Definition: MASkit.hpp:44
MC::BinaryDataSPtr SoundData
Sound skit binary data.
Definition: MASkit.hpp:186