root/trunk/libfreebob/src/avdevicesubunit.h

Revision 183, 3.2 kB (checked in by wagi, 18 years ago)

2006-03-30 Daniel Wagner <wagi@monom.org>

  • configure.ac: Version bump to 0.6.0
  • src/*: Verbose bool turned int verbose level.
  • src/libfreebobavc/*: Moved fire implementation to
    base class (AVCCommand).
  • libfreebob/freebob.h: freebob_sleep_after_avc_command
    workaround added.
  • tests/test-freebob.c: Verbose bool turned into verbose level.
    Workaround: sleep after avc command added.
  • tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD.
  • tests/Makefile.am (*_SOURCES): Likewise.
  • tests/streaming/teststreaming2.c (fid_in): compiler warning fixed.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* avdevicesubunit.h
2  * Copyright (C) 2005 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 AVDEVICESUBUNIT_H
22 #define AVDEVICESUBUNIT_H
23
24 #include "avplug.h"
25 #include "functionblock.h"
26
27 #include "debugmodule/debugmodule.h"
28 #include "libfreebobavc/avc_extended_subunit_info.h"
29 #include "libfreebobavc/avc_definitions.h"
30 #include "libfreebobavc/avc_generic.h"
31
32 #include <vector>
33
34 class AvDevice;
35
36 class AvDeviceSubunit {
37  public:
38     AvDeviceSubunit( AvDevice& avDevice,
39                      AVCCommand::ESubunitType type,
40                      subunit_t id,
41                      int verboseLevel );
42     virtual ~AvDeviceSubunit();
43
44     virtual bool discover();
45     virtual bool discoverConnections();
46     virtual const char* getName() = 0;
47
48     bool addPlug( AvPlug& plug );
49
50     subunit_t getSubunitId()
51         { return m_sbId; }
52     AVCCommand::ESubunitType getSubunitType()
53         { return m_sbType; }
54
55     AvPlugVector& getPlugs()
56         { return m_plugs; }
57     AvPlug* getPlug(AvPlug::EAvPlugDirection direction, plug_id_t plugId);
58
59
60     AvDevice& getAvDevice() const
61         { return *m_avDevice; }
62
63  protected:
64     bool discoverPlugs();
65     bool discoverPlugs(AvPlug::EAvPlugDirection plugDirection,
66                        plug_id_t plugMaxId );
67
68  protected:
69     AvDevice*                m_avDevice;
70     AVCCommand::ESubunitType m_sbType;
71     subunit_t                m_sbId;
72     int                      m_verboseLevel;
73
74     AvPlugVector             m_plugs;
75
76     DECLARE_DEBUG_MODULE;
77 };
78
79 typedef std::vector<AvDeviceSubunit*> AvDeviceSubunitVector;
80
81 /////////////////////////////
82
83 class AvDeviceSubunitAudio: public AvDeviceSubunit {
84  public:
85     AvDeviceSubunitAudio( AvDevice& avDevice,
86                           subunit_t id,
87                           int verboseLevel );
88     virtual ~AvDeviceSubunitAudio();
89
90     virtual bool discover();
91     virtual bool discoverConnections();
92
93     virtual const char* getName();
94
95
96 protected:
97     bool discoverFunctionBlocks();
98     bool discoverFunctionBlocksDo(
99         ExtendedSubunitInfoCmd::EFunctionBlockType fbType );
100     bool createFunctionBlock(
101         ExtendedSubunitInfoCmd::EFunctionBlockType fbType,
102         ExtendedSubunitInfoPageData& data );
103
104     FunctionBlock::ESpecialPurpose convertSpecialPurpose(
105         function_block_special_purpose_t specialPurpose );
106
107 protected:
108     FunctionBlockVector m_functions;
109 };
110
111 /////////////////////////////
112
113 class AvDeviceSubunitMusic: public AvDeviceSubunit {
114  public:
115     AvDeviceSubunitMusic( AvDevice& avDevice,
116                           subunit_t id,
117                           int verboseLevel );
118     virtual ~AvDeviceSubunitMusic();
119
120     virtual const char* getName();
121 };
122
123 #endif
Note: See TracBrowser for help on using the browser.