00001 00012 /* 00013 00014 Copyright (c) 2007, Tim Burrell 00015 Licensed under the Apache License, Version 2.0 (the "License"); 00016 you may not use this file except in compliance with the License. 00017 You may obtain a copy of the License at 00018 00019 http://www.apache.org/licenses/LICENSE-2.0 00020 00021 Unless required by applicable law or agreed to in writing, software 00022 distributed under the License is distributed on an "AS IS" BASIS, 00023 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00024 See the License for the specific language governing permissions and 00025 limitations under the License. 00026 00027 */ 00028 00029 #ifndef __GizmoEventSoundVisualization_h 00030 #define __GizmoEventSoundVisualization_h 00031 00032 #if HAVE_CONFIG_H 00033 #include "config.h" 00034 #endif 00035 00036 #include "GizmoEvent.hpp" 00037 #include <boost/archive/text_oarchive.hpp> 00038 #include <boost/archive/text_iarchive.hpp> 00039 #include <boost/serialization/base_object.hpp> 00040 00042 // Namespace 00044 00045 namespace Gizmod { 00046 00048 // Typedef, enum's 00050 00055 typedef enum { 00056 SOUNDVISUALIZATION_CONNECT, 00057 SOUNDVISUALIZATION_DISCONNECT, 00058 SOUNDVISUALIZATION_RENDER 00059 } SoundVisualizationEventType; 00060 00062 // Class Definition 00064 00071 class GizmoEventSoundVisualization : public GizmoEvent { 00072 public: 00073 // public member variables 00074 float getVULeft(); 00075 float getVURight(); 00076 float getVUCombined(); 00077 SoundVisualizationEventType getType(); 00078 00079 // public functions 00080 00081 // construction / deconstruction 00082 GizmoEventSoundVisualization(); 00083 GizmoEventSoundVisualization(SoundVisualizationEventType Type, bool IsRemote = false); 00084 GizmoEventSoundVisualization(float vuLeft, float vuRight, float vuCombined, bool IsRemote = false); 00085 virtual ~GizmoEventSoundVisualization(); 00086 00087 private: 00088 // private functions 00089 00090 // private member variables 00091 float mVULeft; 00092 float mVURight; 00093 float mVUCombined; 00094 SoundVisualizationEventType mType; 00095 00096 private: 00097 // serialization 00098 friend class boost::serialization::access; 00099 template<class Archive> 00100 void serialize(Archive & ar, const unsigned int version) { 00101 ar & boost::serialization::base_object<GizmoEvent>(*this); 00102 ar & mVULeft; 00103 ar & mVURight; 00104 ar & mVUCombined; 00105 ar & mType; 00106 } 00107 }; 00108 00110 00111 } // Gizmod namespace 00112 00113 #endif // __GizmoEventSoundVisualization_h