root/trunk/libfreebob/src/libfreebobavc/avc_function_block.h

Revision 375, 8.0 kB (checked in by wagi, 17 years ago)

AVCCommand: All AVC commants take a reference instead a pointer to 1394 service
BeBoB::AvDevice?: PreSonus? FIREBOX id added

De/Serialize all AvPlugs? through AvPlugManager?
AvPlugManager? can't be a member because of serialization

Line 
1 /* avc_function_block.h
2  * Copyright (C) 2006 by Daniel Wagner
3  *
4  * This file is part of FreeBoB.
5  *
6  * FreeBoB 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  * FreeBoB is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FreeBoB; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA.
19  */
20
21 #ifndef AVCFUNCTIONBLOCK_H
22 #define AVCFUNCTIONBLOCK_H
23
24 #include "avc_extended_cmd_generic.h"
25 #include "avc_generic.h"
26
27 #include <libavc1394/avc1394.h>
28
29 class FunctionBlockFeatureVolume: public IBusData
30 {
31 public:
32     FunctionBlockFeatureVolume();
33     FunctionBlockFeatureVolume( const FunctionBlockFeatureVolume& rhs );
34     virtual ~FunctionBlockFeatureVolume();
35
36     virtual bool serialize( IOSSerialize& se );
37     virtual bool deserialize( IISDeserialize& de );
38     virtual FunctionBlockFeatureVolume* clone() const;
39
40     control_selector_t     m_controlSelector;
41     control_data_length_t  m_controlDataLength;
42     u_int16_t              m_volume;
43 };
44
45 ///////////////////////////////////////////
46
47 class FunctionBlockProcessingMixer: public IBusData
48 {
49 public:
50     FunctionBlockProcessingMixer();
51     FunctionBlockProcessingMixer( const FunctionBlockProcessingMixer& rhs );
52     virtual ~FunctionBlockProcessingMixer();
53
54     virtual bool serialize( IOSSerialize& se );
55     virtual bool deserialize( IISDeserialize& de );
56     virtual FunctionBlockProcessingMixer* clone() const;
57
58     control_selector_t m_controlSelector;
59 };
60
61 ///////////////////////////////////////////
62
63 class FunctionBlockProcessingEnhancedMixer: public IBusData
64 {
65 public:
66     enum EStatusSelector {
67         eSS_ProgramableState = 0x00,
68         eSS_Level            = 0x01,
69     };
70
71     FunctionBlockProcessingEnhancedMixer();
72     FunctionBlockProcessingEnhancedMixer(
73         const FunctionBlockProcessingEnhancedMixer& rhs );
74     virtual ~FunctionBlockProcessingEnhancedMixer();
75
76     virtual bool serialize( IOSSerialize& se );
77     virtual bool deserialize( IISDeserialize& de );
78     virtual FunctionBlockProcessingEnhancedMixer* clone() const;
79
80     control_selector_t m_controlSelector;
81     status_selector_t  m_statusSelector;
82 };
83
84 ///////////////////////////////////////////
85 ///////////////////////////////////////////
86
87 class FunctionBlockSelector: public IBusData
88 {
89 // untested
90 public:
91     // Control selector encoding
92     enum EControlSelectorEncoding {
93         eCSE_Selector_Selector          = 0x01,
94     };
95
96     FunctionBlockSelector();
97     FunctionBlockSelector( const FunctionBlockSelector& rhs );
98     virtual ~FunctionBlockSelector();
99
100     virtual bool serialize( IOSSerialize& se );
101     virtual bool deserialize( IISDeserialize& de );
102     virtual FunctionBlockSelector* clone() const;
103
104     selector_length_t      m_selectorLength;
105     input_fb_plug_number_t m_inputFbPlugNumber;
106     control_selector_t     m_controlSelector;
107 };
108
109 ///////////////////////////////////////////
110
111 class FunctionBlockFeature: public IBusData
112 {
113 // no complete implementation
114 public:
115     // Control selector encoding
116     enum EControlSelectorEncoding {
117         eCSE_Feature_Mute               = 0x01,
118         eCSE_Feature_Volume             = 0x02,
119         eCSE_Feature_LRBalance          = 0x03,
120         eCSE_Feature_FRBalance          = 0x04,
121         eCSE_Feature_Bass               = 0x05,
122         eCSE_Feature_Mid                = 0x06,
123         eCSE_Feature_Treble             = 0x07,
124         eCSE_Feature_GEQ                = 0x08,
125         eCSE_Feature_AGC                = 0x09,
126         eCSE_Feature_Delay              = 0x0a,
127         eCSE_Feature_BassBoost          = 0x0b,
128         eCSE_Feature_Loudness           = 0x0c,
129     };
130
131     FunctionBlockFeature();
132     FunctionBlockFeature( const FunctionBlockFeature& rhs );
133     virtual ~FunctionBlockFeature();
134
135     virtual bool serialize( IOSSerialize& se );
136     virtual bool deserialize( IISDeserialize& de );
137     virtual FunctionBlockFeature* clone() const;
138
139     selector_length_t      m_selectorLength;
140     audio_channel_number_t m_audioChannelNumber;
141
142     FunctionBlockFeatureVolume*     m_pVolume;
143 };
144
145 ///////////////////////////////////////////
146
147 class FunctionBlockProcessing: public IBusData
148 {
149 // no complete implementation
150 public:
151     // Function block selector
152     enum EProcessingTypeEncoding {
153         ePTE_Mixer                      = 0x01,
154         ePTE_Generic                    = 0x02,
155         ePTE_UpDown                     = 0x03,
156         ePTE_DolbyProLogic              = 0x04,
157         ePTE_3dStereoExtender           = 0x05,
158         ePTE_Reverberation              = 0x06,
159         ePTE_Chorus                     = 0x07,
160         ePTE_DynamicRangeCompression    = 0x08,
161     };
162
163     // Control selector encoding
164     enum EControlSelectorEncoding {
165         eCSE_Processing_Enable          = 0x01,
166         eCSE_Processing_Mode            = 0x02,
167         eCSE_Processing_Mixer           = 0x03,
168         eCSE_Processing_EnhancedMixer   = 0xf1,
169
170         // lots of definition missing
171
172     };
173
174     FunctionBlockProcessing();
175     FunctionBlockProcessing( const FunctionBlockProcessing& rhs );
176     virtual ~FunctionBlockProcessing();
177
178     virtual bool serialize( IOSSerialize& se );
179     virtual bool deserialize( IISDeserialize& de );
180     virtual FunctionBlockProcessing* clone() const;
181
182     selector_length_t             m_selectorLength;
183     input_fb_plug_number_t        m_fbInputPlugNumber;
184     input_audio_channel_number_t  m_inputAudioChannelNumber;
185     output_audio_channel_number_t m_outputAudioChannelNumber;
186
187     FunctionBlockProcessingMixer*         m_pMixer;
188     FunctionBlockProcessingEnhancedMixer* m_pEnhancedMixer;
189 };
190
191 ///////////////////////////////////////////
192
193 class FunctionBlockCodec: public IBusData
194 {
195 // dummy implementation
196 public:
197     // CODEC type endcoding
198     enum ECodecTypeEncoding {
199         eCTE_Ac3Decoder                 = 0x01,
200         eCTE_MpegDecoder                = 0x02,
201         eCTE_DtsDecoder                 = 0x03,
202     };
203
204     FunctionBlockCodec();
205     FunctionBlockCodec( const FunctionBlockCodec& rhs );
206     virtual ~FunctionBlockCodec();
207
208     virtual bool serialize( IOSSerialize& se );
209     virtual bool deserialize( IISDeserialize& de );
210     virtual FunctionBlockCodec* clone() const;
211 };
212
213 ///////////////////////////////////////////
214 ///////////////////////////////////////////
215
216 #define AVC1394_FUNCTION_BLOCK_CMD 0xB8
217
218 class FunctionBlockCmd: public AVCCommand
219 {
220 public:
221     enum EFunctionBlockType {
222         eFBT_Selector   = 0x80,
223         eFBT_Feature    = 0x81,
224         eFBT_Processing = 0x82,
225         eFBT_Codec      = 0x83,
226     };
227
228     enum EControlAttribute {
229         eCA_Resolution = 0x01,
230         eCA_Minimum    = 0x02,
231         eCA_Maximum    = 0x03,
232         eCA_Default    = 0x04,
233         eCA_Duration   = 0x08,
234         eCA_Current    = 0x10,
235         eCA_Move       = 0x18,
236         eCA_Delta      = 0x19,
237     };
238
239     FunctionBlockCmd( Ieee1394Service& ieee1394service,
240                       EFunctionBlockType eType,
241                       function_block_id_t id,
242                       EControlAttribute eCtrlAttrib );
243     FunctionBlockCmd( const FunctionBlockCmd& rhs );
244     virtual ~FunctionBlockCmd();
245
246     virtual bool serialize( IOSSerialize& se );
247     virtual bool deserialize( IISDeserialize& de );
248     virtual FunctionBlockCmd* clone() const;
249
250     virtual const char* getCmdName() const
251         { return "FunctionBlockCmd"; }
252
253     function_block_type_t m_functionBlockType;
254     function_block_id_t   m_functionBlockId;
255     control_attribute_t   m_controlAttribute;
256
257     FunctionBlockSelector*      m_pFBSelector;
258     FunctionBlockFeature*       m_pFBFeature;
259     FunctionBlockProcessing*    m_pFBProcessing;
260     FunctionBlockCodec*         m_pFBCodec;
261 };
262
263 #endif
Note: See TracBrowser for help on using the browser.