root/branches/echoaudio/src/bebob/bebob_avdevice_subunit.h

Revision 524, 3.9 kB (checked in by ppalmers, 17 years ago)

echo discovery works, audio I/O works, still some issues with midi and channel naming

Line 
1 /*
2  * Copyright (C) 2005-2007 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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
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
67 protected:
68     bool discoverFunctionBlocks();
69     bool discoverFunctionBlocksDo(
70         AVC::ExtendedSubunitInfoCmd::EFunctionBlockType fbType );
71     bool createFunctionBlock(
72         AVC::ExtendedSubunitInfoCmd::EFunctionBlockType fbType,
73         AVC::ExtendedSubunitInfoPageData& data );
74
75     FunctionBlock::ESpecialPurpose convertSpecialPurpose(
76         AVC::function_block_special_purpose_t specialPurpose );
77
78     virtual bool serializeChild( Glib::ustring basePath,
79                                  Util::IOSerialize& ser ) const;
80     virtual bool deserializeChild( Glib::ustring basePath,
81                                    Util::IODeserialize& deser,
82                                    AVC::Unit& unit );
83
84 };
85
86 /////////////////////////////
87
88 class SubunitMusic : public AVC::SubunitMusic
89 {
90  public:
91     SubunitMusic( AVC::Unit& avDevice,
92               AVC::subunit_t id );
93     SubunitMusic();
94     virtual ~SubunitMusic();
95
96     virtual bool discover();
97    
98     virtual AVC::Plug *createPlug( AVC::Unit* unit,
99                                    AVC::Subunit* subunit,
100                                    AVC::function_block_type_t functionBlockType,
101                                    AVC::function_block_type_t functionBlockId,
102                                    AVC::Plug::EPlugAddressType plugAddressType,
103                                    AVC::Plug::EPlugDirection plugDirection,
104                                    AVC::plug_id_t plugId );
105
106     virtual const char* getName();
107
108 protected:
109     virtual bool serializeChild( Glib::ustring basePath,
110                                  Util::IOSerialize& ser ) const;
111     virtual bool deserializeChild( Glib::ustring basePath,
112                                    Util::IODeserialize& deser,
113                                    AVC::Unit& unit );
114
115 };
116
117 }
118
119 #endif
Note: See TracBrowser for help on using the browser.