root/trunk/libfreebob/src/bebob_light/bebob_light_avdevice.h

Revision 231, 3.7 kB (checked in by pieterpalmers, 18 years ago)

- implemented a hacked solution to the naming problem when using 2 identical devices. Now the port name is prefixed with "dev#?" with # being the device number (in order of discovery), and the ? being either "c" or "p", meaning "capture" or "playback". Note however that there is no guarantee that device 1 will be the same device next time you start up.

Line 
1 /* bebob_light_avdevice.h
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 #ifndef BEBOB_LIGHT_AVDEVICE_H
22 #define BEBOB_LIGHT_AVDEVICE_H
23
24 #include "debugmodule/debugmodule.h"
25 #include "libfreebobavc/avc_definitions.h"
26 #include "libfreebobavc/avc_extended_cmd_generic.h"
27 #include "libfreebob/xmlparser.h"
28
29 #include "bebob_light/bebob_light_avplug.h"
30 #include "bebob_light/bebob_light_avdevicesubunit.h"
31
32 #include "iavdevice.h"
33
34 class ConfigRom;
35 class Ieee1394Service;
36 class SubunitPlugSpecificDataPlugAddress;
37
38 namespace BeBoB_Light {
39
40 class AvDevice : public IAvDevice {
41 public:
42     friend class AvDeviceSubunitAudio;
43     friend class AvDeviceSubunitMusic;
44
45     // takes ownership of config rom
46     AvDevice( Ieee1394Service& ieee1394service,
47               int nodeId,
48               int verboseLevel );
49     virtual ~AvDevice();
50
51     virtual bool discover();
52     virtual ConfigRom& getConfigRom() const;
53     virtual bool addXmlDescription( xmlNodePtr deviceNode );
54     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
55     virtual void showDevice() const;
56     bool setId(unsigned int id);
57
58 protected:
59     bool discoverStep1();
60     bool discoverStep2();
61     bool discoverStep3();
62     bool discoverStep4();
63     bool discoverStep4Plug( AvPlugVector& isoPlugs );
64     bool discoverStep5();
65     bool discoverStep5Plug( AvPlugVector& isoPlugs );
66     bool discoverStep6();
67     bool discoverStep6Plug( AvPlugVector& isoPlugs );
68     bool discoverStep7();
69     bool discoverStep7Plug( AvPlugVector& isoPlugs );
70     bool discoverStep8();
71     bool discoverStep8Plug( AvPlugVector& isoPlugs );
72     bool discoverStep9();
73     bool discoverStep9Plug( AvPlugVector& isoPlugs );
74     bool discoverStep10();
75     bool discoverStep10Plug( AvPlugVector& isoPlugs );
76
77     bool discoverPlugConnection( AvPlug& srcPlug,
78                                  SubunitPlugSpecificDataPlugAddress& subunitPlugAddress );
79
80     bool enumerateSubUnits();
81
82     AvDeviceSubunit* getSubunit( subunit_type_t subunitType,
83                                  subunit_id_t subunitId ) const;
84
85     unsigned int getNrOfSubunits( subunit_type_t subunitType ) const;
86     AvPlugConnection* getPlugConnection( AvPlug& srcPlug ) const;
87
88
89     AvPlug* getPlugById( AvPlugVector& plugs, int id );
90     bool addXmlDescriptionPlug( AvPlug& plug, xmlNodePtr conectionSet );
91     bool addXmlDescriptionStreamFormats( AvPlug& plug, xmlNodePtr streamFormats );
92
93     bool setSamplingFrequencyPlug( AvPlug& plug,
94                                    PlugAddress::EPlugDirection direction,
95                                    ESamplingFrequency samplingFrequency );
96 protected:
97     Ieee1394Service* m_1394Service;
98     ConfigRom*       m_configRom;
99     int              m_nodeId;
100     int              m_verboseLevel;
101
102     AvPlugVector           m_isoInputPlugs;
103     AvPlugVector           m_isoOutputPlugs;
104
105     AvPlugConnectionVector m_plugConnections;
106
107     AvDeviceSubunitVector  m_subunits;
108
109     nr_of_plugs_t m_serialBusIsochronousInputPlugs;
110     nr_of_plugs_t m_serialBusIsochronousOutputPlugs;
111
112     unsigned int m_id;
113
114     DECLARE_DEBUG_MODULE;
115 };
116
117 }
118
119 #endif
Note: See TracBrowser for help on using the browser.