43 | | |
---|
44 | | |
---|
45 | | |
---|
46 | | class Subunit { |
---|
47 | | public: |
---|
48 | | Subunit( Unit& avDevice, |
---|
49 | | ESubunitType type, |
---|
50 | | subunit_t id ); |
---|
51 | | virtual ~Subunit(); |
---|
52 | | |
---|
53 | | virtual bool discover(); |
---|
54 | | virtual bool discoverConnections() |
---|
55 | | {//FIXME: |
---|
56 | | #warning FIXME |
---|
57 | | }; |
---|
58 | | |
---|
59 | | virtual const char* getName() = 0; |
---|
60 | | |
---|
61 | | subunit_t getSubunitId() |
---|
62 | | { return m_sbId; } |
---|
63 | | ESubunitType getSubunitType() |
---|
64 | | { return m_sbType; } |
---|
65 | | |
---|
66 | | bool addPlug( Plug& plug ); |
---|
67 | | |
---|
68 | | PlugVector& getPlugs() |
---|
69 | | { return m_plugs; } |
---|
70 | | Plug* getPlug(Plug::EPlugDirection direction, plug_id_t plugId); |
---|
71 | | |
---|
72 | | |
---|
73 | | Unit& getUnit() const |
---|
74 | | { return *m_unit; } |
---|
75 | | |
---|
76 | | |
---|
77 | | bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; |
---|
78 | | static Subunit* deserialize( Glib::ustring basePath, |
---|
79 | | Util::IODeserialize& deser, |
---|
80 | | Unit& avDevice ); |
---|
81 | | protected: |
---|
82 | | Subunit(); |
---|
83 | | |
---|
84 | | // bool discoverPlugs(); |
---|
85 | | // bool discoverPlugs(Plug::EPlugDirection plugDirection, |
---|
86 | | // plug_id_t plugMaxId ); |
---|
87 | | // |
---|
88 | | virtual bool serializeChild( Glib::ustring basePath, |
---|
89 | | Util::IOSerialize& ser ) const = 0; |
---|
90 | | virtual bool deserializeChild( Glib::ustring basePath, |
---|
91 | | Util::IODeserialize& deser, |
---|
92 | | Unit& avDevice ) = 0; |
---|
93 | | |
---|
94 | | protected: |
---|
95 | | Unit* m_unit; |
---|
96 | | ESubunitType m_sbType; |
---|
97 | | subunit_t m_sbId; |
---|
98 | | |
---|
99 | | PlugVector m_plugs; |
---|
100 | | |
---|
101 | | DECLARE_DEBUG_MODULE; |
---|
102 | | }; |
---|
103 | | |
---|
104 | | typedef std::vector<Subunit*> SubunitVector; |
---|
105 | | |
---|
143 | | // ///////////////////////////// |
---|
144 | | |
---|
145 | | class SubunitMusic: public Subunit { |
---|
146 | | public: |
---|
147 | | SubunitMusic( Unit& avDevice, |
---|
148 | | subunit_t id ); |
---|
149 | | SubunitMusic(); |
---|
150 | | virtual ~SubunitMusic(); |
---|
151 | | |
---|
152 | | virtual const char* getName(); |
---|
153 | | |
---|
154 | | protected: |
---|
155 | | virtual bool serializeChild( Glib::ustring basePath, |
---|
156 | | Util::IOSerialize& ser ) const; |
---|
157 | | virtual bool deserializeChild( Glib::ustring basePath, |
---|
158 | | Util::IODeserialize& deser, |
---|
159 | | Unit& avDevice ); |
---|
160 | | }; |
---|
161 | | |
---|