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 __AlsaMixerElements_h 00030 #define __AlsaMixerElements_h 00031 00032 #if HAVE_CONFIG_H 00033 #include "config.h" 00034 #endif 00035 00036 #include "AlsaSoundCardInterface.hpp" 00037 #include "AlsaEvent.hpp" 00038 00040 // Namespace 00042 00043 namespace Gizmod { 00044 00046 // Typedefs 00048 00050 // AlsaMixerElements Class Definition 00052 00057 class AlsaMixerElements { 00058 public: 00059 // public member variables 00060 bool IsActive; 00061 bool HasCommonVolume; 00062 bool HasPlaybackVolume; 00063 bool HasPlaybackVolumeJoined; 00064 bool HasCaptureVolume; 00065 bool HasCaptureVolumeJoined; 00066 bool HasCommonSwitch; 00067 bool HasPlaybackSwitch; 00068 bool HasPlaybackSwitchJoined; 00069 bool HasCaptureSwitch; 00070 bool HasCaptureSwitchJoined; 00071 bool HasCaptureSwitchExclusive; 00072 00073 long VolumePlayback; 00074 long VolumePlaybackMin; 00075 long VolumePlaybackMax; 00076 float VolumePlaybackPercent; 00077 00078 long VolumeCapture; 00079 long VolumeCaptureMin; 00080 long VolumeCaptureMax; 00081 float VolumeCapturePercent; 00082 00083 bool SwitchPlayback; 00084 bool SwitchCapture; 00085 00086 // construction / deconstruction 00087 AlsaMixerElements(); 00088 AlsaMixerElements(AlsaMixerElements const & Init); 00089 virtual ~AlsaMixerElements(); 00090 00091 // static public functions 00092 void buildEventFromMixerStates(AlsaEvent & Event, AlsaMixerElements const & OldElements, AlsaMixerElements const & NewElements); 00093 00094 private: 00095 // private functions 00096 00097 // private member variables 00098 00099 private: 00100 // serialization 00101 friend class boost::serialization::access; 00102 template<class Archive> 00103 void serialize(Archive & ar, const unsigned int version) { 00104 ar & IsActive; 00105 ar & HasCommonVolume; 00106 ar & HasPlaybackVolume; 00107 ar & HasPlaybackVolumeJoined; 00108 ar & HasCaptureVolume; 00109 ar & HasCaptureVolumeJoined; 00110 ar & HasCommonSwitch; 00111 ar & HasPlaybackSwitch; 00112 ar & HasPlaybackSwitchJoined; 00113 ar & HasCaptureSwitch; 00114 ar & HasCaptureSwitchJoined; 00115 ar & HasCaptureSwitchExclusive; 00116 ar & VolumePlayback; 00117 ar & VolumePlaybackMin; 00118 ar & VolumePlaybackMax; 00119 ar & VolumePlaybackPercent; 00120 ar & VolumeCapture; 00121 ar & VolumeCaptureMin; 00122 ar & VolumeCaptureMax; 00123 ar & VolumeCapturePercent; 00124 ar & SwitchPlayback; 00125 ar & SwitchCapture; 00126 } 00127 }; 00128 00130 00131 } // Gizmod namespace 00132 00133 #endif // __AlsaMixerElements_h