160 | | sinfo.m_name=mplug->getName(); |
---|
| 160 | sinfo.m_name = mplug->getName(); |
---|
| 161 | |
---|
| 162 | #if AVC_STREAMCONFIG_USE_MUSICPLUG |
---|
| 163 | if (plug.getDirection() == Plug::eAPD_Input) { |
---|
| 164 | // it's an input plug to the subunit |
---|
| 165 | // so we have to check the source field of the music plug |
---|
| 166 | if(s.stream_position != mplug->m_source_stream_position) { |
---|
| 167 | debugWarning("s.stream_position (= 0x%02X) != mplug->m_source_stream_position (= 0x%02X)\n", |
---|
| 168 | s.stream_position, mplug->m_source_stream_position); |
---|
| 169 | // use the one from the music plug |
---|
| 170 | sinfo.m_streamPosition= mplug->m_source_stream_position; |
---|
| 171 | } |
---|
| 172 | if(s.stream_location != mplug->m_source_stream_location) { |
---|
| 173 | debugWarning("s.stream_location (= 0x%02X) != mplug->m_source_stream_location (= 0x%02X)\n", |
---|
| 174 | s.stream_location, mplug->m_source_stream_location); |
---|
| 175 | // use the one from the music plug |
---|
| 176 | sinfo.m_location=mplug->m_source_stream_location; |
---|
| 177 | } |
---|
| 178 | } else if (plug.getDirection() == Plug::eAPD_Output) { |
---|
| 179 | // it's an output plug from the subunit |
---|
| 180 | // so we have to check the destination field of the music plug |
---|
| 181 | if(s.stream_position != mplug->m_dest_stream_position) { |
---|
| 182 | debugWarning("s.stream_position (= 0x%02X) != mplug->m_dest_stream_position (= 0x%02X)\n", |
---|
| 183 | s.stream_position, mplug->m_dest_stream_position); |
---|
| 184 | |
---|
| 185 | // use the one from the music plug |
---|
| 186 | sinfo.m_streamPosition=mplug->m_dest_stream_position; |
---|
| 187 | } |
---|
| 188 | if(s.stream_location != mplug->m_dest_stream_location) { |
---|
| 189 | debugWarning("s.stream_location (= 0x%02X) != mplug->m_dest_stream_location (= 0x%02X)\n", |
---|
| 190 | s.stream_location, mplug->m_dest_stream_location); |
---|
| 191 | // use the one from the music plug |
---|
| 192 | //sinfo.m_location=mplug->m_dest_stream_location; |
---|
| 193 | // HACK: recent ECHO firmware only fills the AVCMusicClusterInfoBlock correctly |
---|
| 194 | sinfo.m_location=s.stream_location; |
---|
| 195 | } |
---|
| 196 | } else { |
---|
| 197 | debugWarning("Invalid plug direction.\n"); |
---|
| 198 | } |
---|
| 199 | #endif |
---|
163 | | if (plug.getDirection() == Plug::eAPD_Input) { |
---|
164 | | // it's an input plug to the subunit |
---|
165 | | // so we have to check the source field of the music plug |
---|
166 | | if(s.stream_position != mplug->m_source_stream_position) { |
---|
167 | | debugWarning("s.stream_position (= 0x%02X) != mplug->m_source_stream_position (= 0x%02X)\n", |
---|
168 | | s.stream_position, mplug->m_source_stream_position); |
---|
169 | | // use the one from the music plug |
---|
170 | | sinfo.m_streamPosition= mplug->m_source_stream_position; |
---|
171 | | } |
---|
172 | | if(s.stream_location != mplug->m_source_stream_location) { |
---|
173 | | debugWarning("s.stream_location (= 0x%02X) != mplug->m_source_stream_location (= 0x%02X)\n", |
---|
174 | | s.stream_location, mplug->m_source_stream_location); |
---|
175 | | // use the one from the music plug |
---|
176 | | sinfo.m_location=mplug->m_source_stream_location; |
---|
177 | | } |
---|
178 | | } else if (plug.getDirection() == Plug::eAPD_Output) { |
---|
179 | | // it's an output plug from the subunit |
---|
180 | | // so we have to check the destination field of the music plug |
---|
181 | | if(s.stream_position != mplug->m_dest_stream_position) { |
---|
182 | | debugWarning("s.stream_position (= 0x%02X) != mplug->m_dest_stream_position (= 0x%02X)\n", |
---|
183 | | s.stream_position, mplug->m_dest_stream_position); |
---|
184 | | #if AVC_STREAMPOSITION_USE_MUSICPLUG |
---|
185 | | // use the one from the music plug |
---|
186 | | sinfo.m_streamPosition=mplug->m_dest_stream_position; |
---|
187 | | #else |
---|
188 | | // HACK: recent ECHO firmware only fills the AVCMusicClusterInfoBlock correctly |
---|
189 | | sinfo.m_streamPosition=s.stream_position; |
---|
190 | | #endif |
---|
191 | | } |
---|
192 | | if(s.stream_location != mplug->m_dest_stream_location) { |
---|
193 | | debugWarning("s.stream_location (= 0x%02X) != mplug->m_dest_stream_location (= 0x%02X)\n", |
---|
194 | | s.stream_location, mplug->m_dest_stream_location); |
---|
195 | | // use the one from the music plug |
---|
196 | | //sinfo.m_location=mplug->m_dest_stream_location; |
---|
197 | | // HACK: recent ECHO firmware only fills the AVCMusicClusterInfoBlock correctly |
---|
198 | | sinfo.m_location=s.stream_location; |
---|
199 | | } |
---|
200 | | } else { |
---|
201 | | debugWarning("Invalid plug direction.\n"); |
---|
202 | | } |
---|
203 | | |
---|
232 | | void SubunitMusic::setVerboseLevel(int l) |
---|
| 230 | void |
---|
| 231 | SubunitMusic::showMusicPlugs() |
---|
| 232 | { |
---|
| 233 | if(m_status_descriptor) { |
---|
| 234 | unsigned int nbplugs = m_status_descriptor->getNbMusicPlugs(); |
---|
| 235 | printf( "digraph musicplugconnections {\n" ); |
---|
| 236 | |
---|
| 237 | for(unsigned int i=0;i<nbplugs;i++) { |
---|
| 238 | AVCMusicPlugInfoBlock *mplug = m_status_descriptor->getMusicPlugInfoBlock(i); |
---|
| 239 | if(mplug==NULL) { |
---|
| 240 | debugError("NULL plug!\n"); |
---|
| 241 | return; |
---|
| 242 | } |
---|
| 243 | char plugstr[32]; |
---|
| 244 | snprintf(plugstr, 32, "MusicPlug %d", mplug->m_music_plug_id); |
---|
| 245 | |
---|
| 246 | // the plug itself |
---|
| 247 | printf( "\t\"%s\" [color=red,style=filled];\n", |
---|
| 248 | plugstr ); |
---|
| 249 | |
---|
| 250 | Plug * plug; |
---|
| 251 | // the source connection (where it's signal originates) |
---|
| 252 | plug = m_unit->getPlugManager().getPlug( eST_Music, 0, |
---|
| 253 | 0xFF, 0xFF, |
---|
| 254 | Plug::eAPA_SubunitPlug, |
---|
| 255 | Plug::eAPD_Input, |
---|
| 256 | mplug->m_source_plug_id); |
---|
| 257 | if(plug) { |
---|
| 258 | printf( "\t\"(%d) %s\" -> \"%s\"\n", |
---|
| 259 | plug->getGlobalId(), |
---|
| 260 | plug->getName(), |
---|
| 261 | plugstr ); |
---|
| 262 | } else { |
---|
| 263 | debugWarning("Destination plug not found\n"); |
---|
| 264 | } |
---|
| 265 | |
---|
| 266 | // the destination connection (where it's signal goes) |
---|
| 267 | plug = m_unit->getPlugManager().getPlug( eST_Music, 0, |
---|
| 268 | 0xFF, 0xFF, |
---|
| 269 | Plug::eAPA_SubunitPlug, |
---|
| 270 | Plug::eAPD_Output, |
---|
| 271 | mplug->m_dest_plug_id); |
---|
| 272 | if(plug) { |
---|
| 273 | |
---|
| 274 | printf( "\t\"%s\" -> \"(%d) %s\"\n", |
---|
| 275 | plugstr, |
---|
| 276 | plug->getGlobalId(), |
---|
| 277 | plug->getName() ); |
---|
| 278 | } else { |
---|
| 279 | debugWarning("Source plug not found\n"); |
---|
| 280 | } |
---|
| 281 | |
---|
| 282 | } |
---|
| 283 | |
---|
| 284 | printf("}\n" ); |
---|
| 285 | printf( "Use \"dot -Tps FILENAME.dot -o FILENAME.ps\" " |
---|
| 286 | "to generate graph\n"); |
---|
| 287 | } |
---|
| 288 | } |
---|
| 289 | |
---|
| 290 | void |
---|
| 291 | SubunitMusic::setVerboseLevel(int l) |
---|