root/branches/streaming-rework/src/bebob/bebob_avdevice_xml.cpp

Revision 404, 3.7 kB (checked in by pieterpalmers, 17 years ago)

- introduce support framework for DICE and Metric Halo
- change probe/discovery code to make adding devices easier
- made conditional compilation effectively work.

./configure now has the following switches:

--enable-bebob build BeBoB support (default=yes)
--enable-motu build Motu support (default=no)
--enable-dice build DICE support (default=no)
--enable-metric-halo build Metric Halo support (note: completely useless)

(default=no)

--enable-rme build RME support (note: completely useless)

(default=no)

--enable-bounce build Bounce device support (default=no)
--enable-all-devices build support for all supported devices (default=no)

these now turn on/off compilation effectively.

Line 
1 /* bebob_avdevice_xml.cpp
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 #ifdef ENABLE_BEBOB
22
23 // AvDevice XML stuff
24
25 #include "bebob/bebob_avdevice.h"
26 #include "configrom.h"
27
28 #include "libfreebobavc/ieee1394service.h"
29
30 namespace BeBoB {
31
32 bool
33 AvDevice::addXmlDescription( xmlNodePtr deviceNode )
34 {
35     // connection set
36     //  direction
37     //  connection
38     //    id
39     //    port
40     //    node
41     //    plug
42     //    dimension
43     //    samplerate
44     //    streams
45     //      stream
46
47
48     ///////////
49     // get plugs
50
51     AvPlug* inputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Input, 0 );
52     if ( !inputPlug ) {
53         debugError( "addXmlDescription: No iso input plug found with id 0\n" );
54         return false;
55     }
56     AvPlug* outputPlug = getPlugById( m_pcrPlugs, AvPlug::eAPD_Output, 0 );
57     if ( !outputPlug ) {
58         debugError( "addXmlDescription: No iso output plug found with id 0\n" );
59         return false;
60     }
61
62     ///////////
63     // add connection set output
64
65     xmlNodePtr connectionSet = xmlNewChild( deviceNode, 0,
66                                             BAD_CAST "ConnectionSet", 0 );
67     if ( !connectionSet ) {
68         debugError( "addXmlDescription:: Could not create 'ConnnectionSet' node for "
69                     "direction 1 (playback)\n" );
70         return false;
71     }
72
73     if ( !inputPlug->addXmlDescription( connectionSet ) ) {
74         debugError( "addXmlDescription: Could not add iso input plug 0 to XML description\n" );
75         return false;
76     }
77
78     // add connection set input
79
80     connectionSet = xmlNewChild( deviceNode, 0,
81                                  BAD_CAST "ConnectionSet", 0 );
82     if ( !connectionSet ) {
83         debugError( "addXmlDescription: Couldn't create 'ConnectionSet' node for "
84                     "direction 0 (recorder)\n" );
85         return false;
86     }
87
88     if ( !outputPlug->addXmlDescription( connectionSet ) ) {
89         debugError( "addXmlDescription: Could not add iso output plug 0 to XML description\n" );
90         return false;
91     }
92
93     ////////////
94     // add stream format
95
96     xmlNodePtr streamFormatNode = xmlNewChild( deviceNode, 0,
97                                                BAD_CAST "StreamFormats", 0 );
98     if ( !streamFormatNode ) {
99         debugError( "addXmlDescription: Could not create 'StreamFormats' node\n" );
100         return false;
101     }
102
103     if ( !inputPlug->addXmlDescriptionStreamFormats( streamFormatNode ) ) {
104         debugError( "addXmlDescription:: Could not add stream format info\n" );
105         return false;
106     }
107
108     streamFormatNode= xmlNewChild( deviceNode, 0,
109                                  BAD_CAST "StreamFormats", 0 );
110     if ( !streamFormatNode ) {
111         debugError( "addXmlDescription: Could not create 'StreamFormat' node\n" );
112         return false;
113     }
114
115     if ( !outputPlug->addXmlDescriptionStreamFormats( streamFormatNode ) ) {
116         debugError( "addXmlDescription:: Could not add stream format info\n" );
117         return false;
118     }
119
120     return true;
121 }
122
123 }
124
125 #endif //#ifdef ENABLE_BEBOB
Note: See TracBrowser for help on using the browser.