root/trunk/libffado/src/bebob/bebob_avdevice_subunit.h

Revision 864, 4.0 kB (checked in by ppalmers, 15 years ago)

update license to GPLv2 or GPLv3 instead of GPLv2 or any later version. Update copyrights to reflect the new year

Line 
1 /*
2  * Copyright (C) 2005-2008 by Daniel Wagner
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 2 of the License, or
12  * (at your option) version 3 of the License.
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 #ifndef BEBOB_AVDEVICESUBUNIT_H
25 #define BEBOB_AVDEVICESUBUNIT_H
26
27 #include "bebob/bebob_avplug.h"
28 #include "bebob/bebob_functionblock.h"
29
30 #include "debugmodule/debugmodule.h"
31 #include "libavc/general/avc_extended_subunit_info.h"
32 #include "libavc/avc_definitions.h"
33 #include "libavc/general/avc_generic.h"
34
35 #include <vector>
36
37 #include "libavc/general/avc_subunit.h"
38 #include "libavc/musicsubunit/avc_musicsubunit.h"
39 #include "libavc/audiosubunit/avc_audiosubunit.h"
40 #include "libavc/general/avc_plug.h"
41
42 namespace BeBoB {
43
44 /////////////////////////////
45
46 class SubunitAudio : public AVC::SubunitAudio
47 {
48 public:
49     SubunitAudio( AVC::Unit& avDevice,
50                   AVC::subunit_t id );
51     SubunitAudio();
52     virtual ~SubunitAudio();
53
54     virtual bool discover();
55     virtual bool discoverConnections();
56
57     virtual AVC::Plug *createPlug( AVC::Unit* unit,
58                                    AVC::Subunit* subunit,
59                                    AVC::function_block_type_t functionBlockType,
60                                    AVC::function_block_type_t functionBlockId,
61                                    AVC::Plug::EPlugAddressType plugAddressType,
62                                    AVC::Plug::EPlugDirection plugDirection,
63                                    AVC::plug_id_t plugId );
64
65     virtual const char* getName();
66     virtual FunctionBlockVector getFunctionBlocks() { return m_functions; };
67
68 protected:
69     bool discoverFunctionBlocks();
70     bool discoverFunctionBlocksDo(
71         AVC::ExtendedSubunitInfoCmd::EFunctionBlockType fbType );
72     bool createFunctionBlock(
73         AVC::ExtendedSubunitInfoCmd::EFunctionBlockType fbType,
74         AVC::ExtendedSubunitInfoPageData& data );
75
76     FunctionBlock::ESpecialPurpose convertSpecialPurpose(
77         AVC::function_block_special_purpose_t specialPurpose );
78
79     virtual bool serializeChild( Glib::ustring basePath,
80                                  Util::IOSerialize& ser ) const;
81     virtual bool deserializeChild( Glib::ustring basePath,
82                                    Util::IODeserialize& deser,
83                                    AVC::Unit& unit );
84
85 protected:
86      FunctionBlockVector m_functions;
87 };
88
89 /////////////////////////////
90
91 class SubunitMusic : public AVC::SubunitMusic
92 {
93  public:
94     SubunitMusic( AVC::Unit& avDevice,
95               AVC::subunit_t id );
96     SubunitMusic();
97     virtual ~SubunitMusic();
98
99     virtual bool discover();
100    
101     virtual AVC::Plug *createPlug( AVC::Unit* unit,
102                                    AVC::Subunit* subunit,
103                                    AVC::function_block_type_t functionBlockType,
104                                    AVC::function_block_type_t functionBlockId,
105                                    AVC::Plug::EPlugAddressType plugAddressType,
106                                    AVC::Plug::EPlugDirection plugDirection,
107                                    AVC::plug_id_t plugId );
108
109     virtual const char* getName();
110
111 protected:
112     virtual bool serializeChild( Glib::ustring basePath,
113                                  Util::IOSerialize& ser ) const;
114     virtual bool deserializeChild( Glib::ustring basePath,
115                                    Util::IODeserialize& deser,
116                                    AVC::Unit& unit );
117
118 };
119
120 }
121
122 #endif
Note: See TracBrowser for help on using the browser.