root/trunk/libffado/src/libavc/musicsubunit/avc_descriptor_music.h

Revision 742, 7.4 kB (checked in by ppalmers, 13 years ago)

- Remove some obsolete support files and dirs

- Clean up the license statements in the source files. Everything is

GPL version 3 now.

- Add license and copyright notices to scons scripts

- Clean up some other text files

Line 
1 /*
2  * Copyright (C) 2005-2007 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 /**
25  * Implements the AV/C Descriptors/InfoBlocks for the Music Subunit as in TA2004007
26  *
27  */
28
29 #ifndef AVCDESCRIPTORMUSIC_H
30 #define AVCDESCRIPTORMUSIC_H
31
32 #include "../descriptors/avc_descriptor.h"
33 #include "../avc_definitions.h"
34
35 #include "../general/avc_generic.h"
36 #include "../general/avc_plug.h"
37
38 #include "debugmodule/debugmodule.h"
39
40 #include <libavc1394/avc1394.h>
41
42 #include <vector>
43 #include <string>
44
45 class Ieee1394Service;
46
47 namespace AVC {
48
49
50 class Util::IOSSerialize;
51 class Util::IISDeserialize;
52
53 /**
54  * The info blocks
55  */
56 class AVCMusicGeneralStatusInfoBlock : public AVCInfoBlock
57 {
58 public:
59
60     virtual bool serialize( Util::IOSSerialize& se );
61     virtual bool deserialize( Util::IISDeserialize& de );
62
63     AVCMusicGeneralStatusInfoBlock( );
64     virtual ~AVCMusicGeneralStatusInfoBlock() {};
65     virtual const char* getInfoBlockName() const
66         {return "AVCMusicGeneralStatusInfoBlock";};
67
68     byte_t  m_current_transmit_capability;
69     byte_t  m_current_receive_capability;
70     quadlet_t m_current_latency_capability;
71    
72 protected:
73
74 private:
75
76 };
77
78 class AVCMusicOutputPlugStatusInfoBlock : public AVCInfoBlock
79 {
80 public:
81
82     virtual bool serialize( Util::IOSSerialize& se );
83     virtual bool deserialize( Util::IISDeserialize& de );
84
85     AVCMusicOutputPlugStatusInfoBlock( );
86     virtual ~AVCMusicOutputPlugStatusInfoBlock() {};
87     virtual const char* getInfoBlockName() const
88         {return "AVCMusicOutputPlugStatusInfoBlock";};
89
90 protected:
91
92 private:
93
94 };
95
96 class AVCMusicClusterInfoBlock : public AVCInfoBlock
97 {
98 public:
99
100     struct sSignalInfo {
101         uint16_t music_plug_id;
102         byte_t stream_position;
103         byte_t stream_location;
104     };
105     typedef std::vector<struct sSignalInfo> SignalInfoVector;
106     typedef std::vector<struct sSignalInfo>::iterator SignalInfoVectorIterator;
107
108     virtual bool serialize( Util::IOSSerialize& se );
109     virtual bool deserialize( Util::IISDeserialize& de );
110
111     virtual bool clear();
112    
113     std::string getName();
114
115     AVCMusicClusterInfoBlock( );
116     virtual ~AVCMusicClusterInfoBlock();
117     virtual const char* getInfoBlockName() const
118         {return "AVCMusicClusterInfoBlock";};
119
120     byte_t      m_stream_format;
121     byte_t      m_port_type;
122     byte_t      m_nb_signals;
123     SignalInfoVector m_SignalInfos;
124
125     AVCRawTextInfoBlock m_RawTextInfoBlock;
126     AVCNameInfoBlock    m_NameInfoBlock;
127 protected:
128
129 private:
130
131 };
132 typedef std::vector<AVCMusicClusterInfoBlock *> AVCMusicClusterInfoBlockVector;
133 typedef std::vector<AVCMusicClusterInfoBlock *>::iterator AVCMusicClusterInfoBlockVectorIterator;
134
135 class AVCMusicSubunitPlugInfoBlock : public AVCInfoBlock
136 {
137 public:
138     enum AVCMusicSubunitPlugInfoBlockPlugType {
139         ePT_IsoStream   = 0x0,
140         ePT_AsyncStream = 0x1,
141         ePT_Midi        = 0x2,
142         ePT_Sync        = 0x3,
143         ePT_Analog      = 0x4,
144         ePT_Digital     = 0x5,
145
146         ePT_Unknown     = 0xff,
147     };
148
149     virtual bool serialize( Util::IOSSerialize& se );
150     virtual bool deserialize( Util::IISDeserialize& de );
151
152     AVCMusicSubunitPlugInfoBlock( );
153     virtual ~AVCMusicSubunitPlugInfoBlock();
154     virtual const char* getInfoBlockName() const
155         {return "AVCMusicSubunitPlugInfoBlock";};
156        
157     virtual bool clear();
158    
159     std::string getName();
160    
161     byte_t      m_subunit_plug_id;
162     uint16_t    m_signal_format;
163     byte_t      m_plug_type;
164     uint16_t    m_nb_clusters;
165     uint16_t    m_nb_channels;
166
167     AVCMusicClusterInfoBlockVector m_Clusters;
168     AVCRawTextInfoBlock m_RawTextInfoBlock;
169     AVCNameInfoBlock    m_NameInfoBlock;
170
171 protected:
172
173 private:
174
175 };
176 typedef std::vector<AVCMusicSubunitPlugInfoBlock *> AVCMusicSubunitPlugInfoBlockVector;
177 typedef std::vector<AVCMusicSubunitPlugInfoBlock *>::iterator AVCMusicSubunitPlugInfoBlockVectorIterator;
178
179 class AVCMusicPlugInfoBlock : public AVCInfoBlock
180 {
181 public:
182
183     virtual bool serialize( Util::IOSSerialize& se );
184     virtual bool deserialize( Util::IISDeserialize& de );
185     virtual bool clear();
186
187     AVCMusicPlugInfoBlock( );
188     virtual ~AVCMusicPlugInfoBlock() {};
189     virtual const char* getInfoBlockName() const
190         {return "AVCMusicPlugInfoBlock";};
191
192     std::string getName();
193
194     byte_t      m_music_plug_type;
195     uint16_t    m_music_plug_id;
196     byte_t      m_routing_support;
197     byte_t      m_source_plug_function_type;
198     byte_t      m_source_plug_id;
199     byte_t      m_source_plug_function_block_id;
200     byte_t      m_source_stream_position;
201     byte_t      m_source_stream_location;
202     byte_t      m_dest_plug_function_type;
203     byte_t      m_dest_plug_id;
204     byte_t      m_dest_plug_function_block_id;
205     byte_t      m_dest_stream_position;
206     byte_t      m_dest_stream_location;
207    
208     AVCRawTextInfoBlock m_RawTextInfoBlock;
209     AVCNameInfoBlock    m_NameInfoBlock;
210    
211 protected:
212
213 private:
214
215 };
216 typedef std::vector<AVCMusicPlugInfoBlock *> AVCMusicPlugInfoBlockVector;
217 typedef std::vector<AVCMusicPlugInfoBlock *>::iterator AVCMusicPlugInfoBlockVectorIterator;
218
219 class AVCMusicRoutingStatusInfoBlock : public AVCInfoBlock
220 {
221 public:
222
223     virtual bool serialize( Util::IOSSerialize& se );
224     virtual bool deserialize( Util::IISDeserialize& de );
225
226     AVCMusicRoutingStatusInfoBlock( );
227     virtual ~AVCMusicRoutingStatusInfoBlock();
228     virtual const char* getInfoBlockName() const
229         {return "AVCMusicRoutingStatusInfoBlock";};
230
231     AVCMusicSubunitPlugInfoBlock *getSubunitPlugInfoBlock(Plug::EPlugDirection, plug_id_t);
232     AVCMusicPlugInfoBlock *getMusicPlugInfoBlock(plug_id_t);
233    
234     virtual bool clear();
235
236     byte_t      m_nb_dest_plugs;
237     byte_t      m_nb_source_plugs;
238     uint16_t    m_nb_music_plugs;
239    
240     AVCMusicSubunitPlugInfoBlockVector  mDestPlugInfoBlocks;
241     AVCMusicSubunitPlugInfoBlockVector  mSourcePlugInfoBlocks;
242     AVCMusicPlugInfoBlockVector         mMusicPlugInfoBlocks;
243
244 protected:
245
246 private:
247
248 };
249
250 /**
251  *
252  */
253 class AVCMusicStatusDescriptor : public AVCDescriptor
254 {
255
256 public:
257     virtual bool serialize( Util::IOSSerialize& se );
258     virtual bool deserialize( Util::IISDeserialize& de );
259    
260     AVCMusicStatusDescriptor( Unit* unit, Subunit* subunit );
261     virtual ~AVCMusicStatusDescriptor() {}
262    
263     virtual const char* getDescriptorName() const
264         {return "AVCMusicStatusDescriptor";};
265        
266     AVCMusicSubunitPlugInfoBlock *getSubunitPlugInfoBlock(Plug::EPlugDirection, plug_id_t);
267     AVCMusicPlugInfoBlock *getMusicPlugInfoBlock(plug_id_t);
268    
269 private:
270     // the child info blocks
271     AVCMusicGeneralStatusInfoBlock m_general_status_infoblock;
272     AVCMusicOutputPlugStatusInfoBlock m_output_plug_status_infoblock;
273     AVCMusicRoutingStatusInfoBlock m_routing_status_infoblock;
274    
275 };
276
277 }
278
279 #endif // AVCDESCRIPTORMUSIC_H
Note: See TracBrowser for help on using the browser.