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/general/avc_plug.h" |
---|
39 |
|
---|
40 |
namespace BeBoB { |
---|
41 |
|
---|
42 |
///////////////////////////// |
---|
43 |
|
---|
44 |
class SubunitAudio: public AVC::SubunitAudio { |
---|
45 |
public: |
---|
46 |
SubunitAudio( AVC::Unit& avDevice, |
---|
47 |
AVC::subunit_t id ); |
---|
48 |
SubunitAudio(); |
---|
49 |
virtual ~SubunitAudio(); |
---|
50 |
|
---|
51 |
virtual bool discover(); |
---|
52 |
virtual bool discoverConnections(); |
---|
53 |
|
---|
54 |
virtual const char* getName(); |
---|
55 |
|
---|
56 |
FunctionBlockVector getFunctionBlocks() { return m_functions; }; |
---|
57 |
|
---|
58 |
protected: |
---|
59 |
bool discoverFunctionBlocks(); |
---|
60 |
bool discoverFunctionBlocksDo( |
---|
61 |
AVC::ExtendedSubunitInfoCmd::EFunctionBlockType fbType ); |
---|
62 |
bool createFunctionBlock( |
---|
63 |
AVC::ExtendedSubunitInfoCmd::EFunctionBlockType fbType, |
---|
64 |
AVC::ExtendedSubunitInfoPageData& data ); |
---|
65 |
|
---|
66 |
FunctionBlock::ESpecialPurpose convertSpecialPurpose( |
---|
67 |
AVC::function_block_special_purpose_t specialPurpose ); |
---|
68 |
|
---|
69 |
virtual bool serializeChild( Glib::ustring basePath, |
---|
70 |
Util::IOSerialize& ser ) const; |
---|
71 |
virtual bool deserializeChild( Glib::ustring basePath, |
---|
72 |
Util::IODeserialize& deser, |
---|
73 |
AVC::Unit& unit ); |
---|
74 |
|
---|
75 |
protected: |
---|
76 |
FunctionBlockVector m_functions; |
---|
77 |
}; |
---|
78 |
|
---|
79 |
///////////////////////////// |
---|
80 |
|
---|
81 |
class SubunitMusic: public AVC::SubunitMusic { |
---|
82 |
public: |
---|
83 |
SubunitMusic( AVC::Unit& avDevice, |
---|
84 |
AVC::subunit_t id ); |
---|
85 |
SubunitMusic(); |
---|
86 |
virtual ~SubunitMusic(); |
---|
87 |
|
---|
88 |
virtual const char* getName(); |
---|
89 |
|
---|
90 |
protected: |
---|
91 |
virtual bool serializeChild( Glib::ustring basePath, |
---|
92 |
Util::IOSerialize& ser ) const; |
---|
93 |
virtual bool deserializeChild( Glib::ustring basePath, |
---|
94 |
Util::IODeserialize& deser, |
---|
95 |
AVC::Unit& unit ); |
---|
96 |
}; |
---|
97 |
|
---|
98 |
} |
---|
99 |
|
---|
100 |
#endif |
---|