bool Profile::processApplicationDescriptor( bool &serviceBound, BYTE &visibility, BYTE &priority, std::vector<BYTE> &transports ) { desc::MapOfDescriptors::const_iterator it; // Check application descriptor if (!findDesc( AIT_APP_DESC, it )) { printf( "[Profile] Warning, Application Descriptor not present\n" ); return false; } const ait::ApplicationDescriptor &appDesc = (*it).second.get<ait::ApplicationDescriptor>(); // Check profile: ETSI TS 102 812 v1.2.1 // The MHP terminal shall only launch applications if the following // expression is true for one of the singalled profiles bool appSupported=false; BOOST_FOREACH( const ait::ApplicationProfile &appProfile, appDesc.profiles ) { // If profile is supported if (isProfileSupported( appProfile )) { appSupported=true; break; } } if (!appSupported) { printf( "[Profile] Warning, Application profile not supported\n" ); return false; } serviceBound = appDesc.serviceBoundFlag; visibility = appDesc.visibility; priority = appDesc.priority; transports = appDesc.transports; return true; }
bool Profile::processTransportProtocol( BYTE &tag, std::vector<BYTE> &transports ) { desc::MapOfDescriptors::const_iterator it; // Check tranport protocol descriptor present if (!findDesc( AIT_TRANSPORT_PROTOCOL_DESC, it )) { printf( "[Profile] Warning, ignoring application becouse Transport Protocol Descriptor not present\n" ); return false; } const ait::TransportDescriptor &transportsDesc = (*it).second.get<ait::TransportDescriptor>(); // Try find a transport by label ait::TransportDescriptor::const_iterator itTrans=transportsDesc.end(); BOOST_FOREACH( BYTE label, transports ) { itTrans=std::find_if( transportsDesc.begin(), transportsDesc.end(), TransportFinder(label) ); if (itTrans != transportsDesc.end()) { break; } }
bool Profile::processApplicationNameDescriptor( std::string &name, std::string &language ) { desc::MapOfDescriptors::const_iterator it; // Check application name descriptor if (!findDesc( AIT_APP_NAME_DESC, it )) { printf( "[Profile] Warning, ignoring application becouse Application Name Descriptor not present\n" ); return false; } const ait::ApplicationNameDescriptor &appNameDesc = (*it).second.get<ait::ApplicationNameDescriptor>(); // Check if application name is valid if (!appNameDesc.size()) { printf( "[Profile] Warning, ignoring application becouse Application Name is invalid\n" ); return false; } // Get first name const ait::ApplicationName &appName = appNameDesc[0]; name = appName.name; language = appName.language; return true; }
/** * Display menu and play menu music. */ void WorldMap::own_resumeState() { LevelNode *nextLevel = NULL; if (m_levelStatus->wasRunning()) { if (m_levelStatus->isComplete()) { markSolved(); if (checkEnding()) { nextLevel = m_ending; } } m_levelStatus->setRunning(false); OptionAgent *options = OptionAgent::agent(); options->setParam("caption", findDesc("menu")); options->setParam("screen_width", m_bg->getW()); options->setParam("screen_height", m_bg->getH()); VideoAgent::agent()->initVideoMode(); } m_selected = nextLevel; SoundAgent::agent()->playMusic( Path::dataReadPath("music/menu.ogg"), NULL); }