void Init() { AddService(new CECD_S_Interface); AddService(new CECD_U_Interface); cecinfo_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::cecinfo_event"); change_state_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::change_state_event"); }
void Init() { AddService(new PTM_Play_Interface); AddService(new PTM_Sysm_Interface); AddService(new PTM_U_Interface); shell_open = true; battery_is_charging = true; // Open the SharedExtSaveData archive 0xF000000B and create the gamecoin.dat file if it doesn't exist FileSys::Path archive_path(ptm_shared_extdata_id); auto archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); // If the archive didn't exist, create the files inside if (archive_result.Code().description == ErrorDescription::FS_NotFormatted) { // Format the archive to create the directories Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); // Open it again to get a valid archive now that the folder exists archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); ASSERT_MSG(archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!"); FileSys::Path gamecoin_path("gamecoin.dat"); FileSys::Mode open_mode = {}; open_mode.write_flag = 1; open_mode.create_flag = 1; // Open the file and write the default gamecoin information auto gamecoin_result = Service::FS::OpenFileFromArchive(*archive_result, gamecoin_path, open_mode); if (gamecoin_result.Succeeded()) { auto gamecoin = gamecoin_result.MoveFrom(); gamecoin->backend->Write(0, sizeof(GameCoin), 1, reinterpret_cast<const u8*>(&default_game_coin)); gamecoin->backend->Close(); } } }
int main(int argc, char** argv) { DIBSTATUS rc; unsigned int i; DibChannelHdl[0] = DIB_UNSET; DibChannelHdl[1] = DIB_UNSET; DibChannelHdl[2] = DIB_UNSET; DibChannelHdl[3] = DIB_UNSET; /*** Open Driver ***/ rc = Open(Board); /*** Display Board Layout ***/ DisplayLayout(); if (rc == DIBSTATUS_SUCCESS) { /*** Tune Channel Stream 0, Chip 0, HOST DMA ***/ rc = Tune(0, FrequencyStream1, Bandwidth); printf("Press Key to Continue\n"); getchar(); /*** Tune Channel Stream 4, Chip 0, HOST DMA ***/ rc = Tune(4, FrequencyStream2, Bandwidth); printf("Press Key to Continue\n"); getchar(); /*** Tune Channel Stream 5, Chip 0, HOST DMA ***/ rc = Tune(5, FrequencyStream3, Bandwidth); printf("Press Key to Continue\n"); getchar(); for (i=0;i<10;i++) { /*** Monitor Signal Stream 1 ***/ SignalMonitor(0); SignalMonitor(4); SignalMonitor(5); } printf("Press Key to Continue\n"); /*** Add Subchannel 0 on Stream 0 ***/ AddService(0,1); /*** Add Subchannel 0 on Stream 0 ***/ AddService(4,1); /*** Add Subchannel 0 on Stream 0 ***/ AddService(5,2); printf("Press Key to Continue\n"); getchar(); /*** Close Driver ***/ DibClose(pContext); } }
void Init() { AddService(new IR_RST_Interface); AddService(new IR_U_Interface); AddService(new IR_User_Interface); InitUser(); InitRST(); }
void ServiceLocator::LoadDefaultServices() { AddService(new ShaderManager()); AddService(new TextureManager()); AddService(new Graphics()); AddService(new InputManager()); AddService(new AudioManager()); AddService(new FontManager()); AddService(new SceneManager()); AddService(new LoadingUI()); AddService(new DebugUI()); AddService(new ShapeCache()); }
/*---------------------------------------------------------------------- | PLT_MediaConnect::PLT_MediaConnect +---------------------------------------------------------------------*/ PLT_MediaConnect::PLT_MediaConnect(const char* path, const char* friendly_name, bool show_ip, const char* udn, unsigned int port, NPT_UInt16 fileserver_port) : PLT_FileMediaServer(path, friendly_name, show_ip, udn, port, fileserver_port) { m_RegistrarService = new PLT_Service( this, "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar"); if (NPT_SUCCEEDED(m_RegistrarService->SetSCPDXML((const char*) X_MS_MediaReceiverRegistrarSCPD))) { m_RegistrarService->InitURLs("X_MS_MediaReceiverRegistrar", m_UUID); AddService(m_RegistrarService); m_RegistrarService->SetStateVariable("AuthorizationGrantedUpdateID", "0", false); m_RegistrarService->SetStateVariable("AuthorizationDeniedUpdateID", "0", false); m_RegistrarService->SetStateVariable("ValidationSucceededUpdateID", "0", false); m_RegistrarService->SetStateVariable("ValidationRevokedUpdateID", "0", false); } m_ModelName = "Windows Media Connect"; m_ModelNumber = "2.0"; m_ModelDescription = "Media Server"; m_Manufacturer = "Plutinosoft"; m_ManufacturerURL = "http://www.plutinosoft.com/"; m_ModelURL = "http://www.plutinosoft.com"; m_DlnaDoc = "DMS-1.00"; }
void ModuleManager::AddServices(const ServiceList& list) { for (ServiceList::const_iterator i = list.begin(); i != list.end(); ++i) { ServiceProvider& s = **i; AddService(s); } }
NPT_Result GPAC_GenericDevice::SetupServices() { u32 i, count; count = gf_list_count(m_pServices); for (i=0; i<count; i++) { GPAC_Service *service = (GPAC_Service *)gf_list_get(m_pServices, i); AddService(service); } return NPT_SUCCESS; }
//IContainer/////// IKnown * xContainer::GetService(QString id) { QString sid = xPluginMng::GetSID(id); Name2Service::Iterator service = RunningServices.find(sid); if(service != RunningServices.end()) { return service.value(); } return AddService(id); }
QueryService::QueryService(ENM::Node& node,const std::string& path) :node_(node),path_(path) { //init log log_ = log4cxx::Logger::getLogger("query_service"); //get all so file under path GetFile(); AddService(); node_.service()->run(false); }
bool CW32Service::OpenService(DWORD dwDesiredAccess) { stSvcStatus* pStatus = NULL; if ( !m_scmHandle || !m_lpszServiceName ) return FALSE; if ( !(m_serviceHandle = ::OpenService( m_scmHandle, m_lpszServiceName, dwDesiredAccess )) ) return FALSE; pStatus = AddService( m_lpszServiceName ); return TRUE; }
/*---------------------------------------------------------------------- | PLT_MediaServer::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_MediaServer::SetupServices() { PLT_Service* service; { service = new PLT_Service( this, "urn:schemas-upnp-org:service:ContentDirectory:1", "urn:upnp-org:serviceId:ContentDirectory", "ContentDirectory"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) MS_ContentDirectorywSearchSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariable("ContainerUpdateIDs", ""); service->SetStateVariableRate("ContainerUpdateIDs", NPT_TimeInterval(2.)); service->SetStateVariable("SystemUpdateID", "0"); service->SetStateVariableRate("SystemUpdateID", NPT_TimeInterval(2.)); service->SetStateVariable("SearchCapability", "@id,@refID,dc:title,upnp:class,upnp:genre,upnp:artist,upnp:author,upnp:author@role,upnp:album,dc:creator,res@size,res@duration,res@protocolInfo,res@protection,dc:publisher,dc:language,upnp:originalTrackNumber,dc:date,upnp:producer,upnp:rating,upnp:actor,upnp:director,upnp:toc,dc:description,microsoft:userRatingInStars,microsoft:userEffectiveRatingInStars,microsoft:userRating,microsoft:userEffectiveRating,microsoft:serviceProvider,microsoft:artistAlbumArtist,microsoft:artistPerformer,microsoft:artistConductor,microsoft:authorComposer,microsoft:authorOriginalLyricist,microsoft:authorWriter,upnp:userAnnotation,upnp:channelName,upnp:longDescription,upnp:programTitle"); service->SetStateVariable("SortCapability", "dc:title,upnp:genre,upnp:album,dc:creator,res@size,res@duration,res@bitrate,dc:publisher,dc:language,upnp:originalTrackNumber,dc:date,upnp:producer,upnp:rating,upnp:actor,upnp:director,upnp:toc,dc:description,microsoft:year,microsoft:userRatingInStars,microsoft:userEffectiveRatingInStars,microsoft:userRating,microsoft:userEffectiveRating,microsoft:serviceProvider,microsoft:artistAlbumArtist,microsoft:artistPerformer,microsoft:artistConductor,microsoft:authorComposer,microsoft:authorOriginalLyricist,microsoft:authorWriter,microsoft:sourceUrl,upnp:userAnnotation,upnp:channelName,upnp:longDescription,upnp:programTitle"); } { service = new PLT_Service( this, "urn:schemas-upnp-org:service:ConnectionManager:1", "urn:upnp-org:serviceId:ConnectionManager", "ConnectionManager"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) MS_ConnectionManagerSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariable("CurrentConnectionIDs", "0"); service->SetStateVariable("SinkProtocolInfo", ""); service->SetStateVariable("SourceProtocolInfo", "http-get:*:*:*"); } return NPT_SUCCESS; }
/*---------------------------------------------------------------------- | PLT_MediaServer::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_MediaServer::SetupServices() { PLT_Service* service; { service = new PLT_Service( this, "urn:schemas-upnp-org:service:ContentDirectory:1", "urn:upnp-org:serviceId:ContentDirectory", "ContentDirectory"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) MS_ContentDirectorywSearchSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariable("ContainerUpdateIDs", ""); service->SetStateVariableRate("ContainerUpdateIDs", NPT_TimeInterval(2.)); service->SetStateVariable("SystemUpdateID", "0"); service->SetStateVariableRate("SystemUpdateID", NPT_TimeInterval(2.)); service->SetStateVariable("SearchCapability", "upnp:class"); service->SetStateVariable("SortCapability", ""); } { service = new PLT_Service( this, "urn:schemas-upnp-org:service:ConnectionManager:1", "urn:upnp-org:serviceId:ConnectionManager", "ConnectionManager"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) MS_ConnectionManagerSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariable("CurrentConnectionIDs", "0"); service->SetStateVariable("SinkProtocolInfo", ""); service->SetStateVariable("SourceProtocolInfo", "http-get:*:*:*"); } return NPT_SUCCESS; }
/*---------------------------------------------------------------------- | PLT_Simple::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_Simple::SetupServices() { PLT_Service* service = new PLT_Service( this, "urn:schemas-upnp-org:service:Test:1", "urn:upnp-org:serviceId:Test.001", "Test"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*)SCPDXML_SIMPLE)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariable("Status", "True"); return NPT_SUCCESS; }
BOOL ServiceChecker::Init() { BOOL bInitReturn = FALSE; SC_HANDLE hscman = OpenSCManager( NULL, NULL, GENERIC_READ ); if(hscman) { DWORD needsize =0 ; DWORD resumehandle = 0; DWORD returnednumber = 0; BOOL bret = EnumServicesStatus(hscman, SERVICE_WIN32, SERVICE_STATE_ALL, NULL, 0, &needsize, &returnednumber, &resumehandle ); if(bret == FALSE) { BYTE *buffer = new BYTE[needsize]; bret = EnumServicesStatus(hscman, SERVICE_WIN32, SERVICE_STATE_ALL, (LPENUM_SERVICE_STATUSW)buffer, needsize, &needsize, &returnednumber, &resumehandle ); if(bret) { AddService( hscman , (LPENUM_SERVICE_STATUSW)buffer, returnednumber ) ; } else { while( ( bret == FALSE ) && ( ::GetLastError() == ERROR_MORE_DATA ) ) { AddService((HANDLE)hscman, (LPENUM_SERVICE_STATUSW)buffer, returnednumber ); bret = EnumServicesStatus( hscman,SERVICE_WIN32, SERVICE_STATE_ALL, (LPENUM_SERVICE_STATUSW)buffer, needsize, &needsize, &returnednumber, &resumehandle ); } AddService( (HANDLE)hscman, ( LPENUM_SERVICE_STATUSW)buffer, returnednumber ); } delete buffer; } CloseServiceHandle(hscman); } return bInitReturn; }
virtual bool OnSettingServer(unsigned int listeningPort, unsigned int maxBacklog, bool v6) { //amIntegrated and amMixed not supported yet CSocketProServer::Config::SetAuthenticationMethod(amOwn); //add service(s) into SocketPro server AddService(); //create three chat groups PushManager::AddAChatGroup(1, L"R&D Department"); PushManager::AddAChatGroup(2, L"Sales Department"); PushManager::AddAChatGroup(3, L"Management Department"); PushManager::AddAChatGroup(7, L"HR Department"); return true; //true -- ok; false -- no listening server }
/*---------------------------------------------------------------------- | PLT_LightSampleDevice::PLT_LightSampleDevice +---------------------------------------------------------------------*/ PLT_LightSampleDevice::PLT_LightSampleDevice(char* FriendlyName, char* UUID) : PLT_DeviceHost("/", UUID, "urn:schemas-upnp-org:device:SwitchPower:1", FriendlyName) { PLT_Service* service = new PLT_Service( this, "urn:schemas-upnp-org:service:SwitchPower:1", "urn:upnp-org:serviceId:SwitchPower.001"); if (SCPDXML && NPT_SUCCEEDED(service->SetSCPDXML((const char*)SCPDXML))) { service->InitURLs("SwitchPower", m_UUID); AddService(service); } else { delete service; } service->SetStateVariable("Status", "True"); }
static void GetServices(BOOL bHideOSVendorServices = FALSE) { // // First of all, clear the list. // ClearServicesList(); // // Now, we can list the services. // // Open the Service Control Manager. SC_HANDLE hSCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); if (hSCManager == NULL) return; // Enumerate all the Win32 services. DWORD dwBytesNeeded = 0; DWORD dwNumServices = 0; // DWORD dwResumeHandle = 0; EnumServicesStatusExW(hSCManager, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, NULL, 0, &dwBytesNeeded, &dwNumServices, NULL /* &dwResumeHandle */, NULL); // if (GetLastError() == ERROR_MORE_DATA) LPENUM_SERVICE_STATUS_PROCESS lpServices = (LPENUM_SERVICE_STATUS_PROCESS)MemAlloc(0, dwBytesNeeded); if (!lpServices) { CloseServiceHandle(hSCManager); return; } EnumServicesStatusExW(hSCManager, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)lpServices, dwBytesNeeded, &dwBytesNeeded, &dwNumServices, NULL /* &dwResumeHandle */, NULL); // Add them into the list. for (DWORD i = 0 ; i < dwNumServices ; ++i) { AddService(hSCManager, lpServices + i, bHideOSVendorServices); } // Cleaning. MemFree(lpServices); CloseServiceHandle(hSCManager); return; }
/*---------------------------------------------------------------------- | PLT_LightSampleDevice::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_LightSampleDevice::SetupServices() { NPT_Result res; PLT_Service* service = new PLT_Service( this, "urn:schemas-upnp-org:service:SwitchPower:1", "urn:upnp-org:serviceId:SwitchPower.001", "SwitchPower"); NPT_CHECK_LABEL_FATAL(res = service->SetSCPDXML((const char*)SCPDXML), failure); NPT_CHECK_LABEL_FATAL(res = AddService(service), failure); service->SetStateVariable("Status", "True"); return NPT_SUCCESS; failure: delete service; return res; }
/*---------------------------------------------------------------------- | PLT_MediaConnect::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_MediaConnect::SetupServices() { NPT_Reference<PLT_Service> service(new PLT_Service( this, "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar", "X_MS_MediaReceiverRegistrar")); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) X_MS_MediaReceiverRegistrarSCPD)); NPT_CHECK_FATAL(AddService(service.AsPointer())); service->SetStateVariable("AuthorizationGrantedUpdateID", "1"); service->SetStateVariable("AuthorizationDeniedUpdateID", "1"); service->SetStateVariable("ValidationSucceededUpdateID", "0"); service->SetStateVariable("ValidationRevokedUpdateID", "0"); service.Detach(); return PLT_MediaServer::SetupServices(); }
/*---------------------------------------------------------------------- | PLT_Simple::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_Simple::SetupServices() { NPT_Result res; PLT_Service* service = new PLT_Service( this, "urn:schemas-upnp-org:service:Test:1", "urn:upnp-org:serviceId:Test.001", "Test"); NPT_CHECK_LABEL_FATAL(res = service->SetSCPDXML((const char*)SCPDXML_SIMPLE), failure); NPT_CHECK_LABEL_FATAL(res = AddService(service), failure); service->SetStateVariable("Status", "True"); return NPT_SUCCESS; failure: delete service; return res; }
/// Initialize archives void ArchiveInit() { next_handle = 1; AddService(new FS::Interface); // TODO(Subv): Add the other archive types (see here for the known types: // http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes). std::string sdmc_directory = FileUtil::GetUserPath(D_SDMC_IDX); std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX); auto sdmc_factory = Common::make_unique<FileSys::ArchiveFactory_SDMC>(sdmc_directory); if (sdmc_factory->Initialize()) RegisterArchiveType(std::move(sdmc_factory), ArchiveIdCode::SDMC); else LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str()); // Create the SaveData archive auto savedata_factory = Common::make_unique<FileSys::ArchiveFactory_SaveData>(sdmc_directory); RegisterArchiveType(std::move(savedata_factory), ArchiveIdCode::SaveData); auto extsavedata_factory = Common::make_unique<FileSys::ArchiveFactory_ExtSaveData>(sdmc_directory, false); if (extsavedata_factory->Initialize()) RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); else LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path %s", extsavedata_factory->GetMountPoint().c_str()); auto sharedextsavedata_factory = Common::make_unique<FileSys::ArchiveFactory_ExtSaveData>(nand_directory, true); if (sharedextsavedata_factory->Initialize()) RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); else LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path %s", sharedextsavedata_factory->GetMountPoint().c_str()); // Create the SaveDataCheck archive, basically a small variation of the RomFS archive auto savedatacheck_factory = Common::make_unique<FileSys::ArchiveFactory_SaveDataCheck>(nand_directory); RegisterArchiveType(std::move(savedatacheck_factory), ArchiveIdCode::SaveDataCheck); auto systemsavedata_factory = Common::make_unique<FileSys::ArchiveFactory_SystemSaveData>(nand_directory); RegisterArchiveType(std::move(systemsavedata_factory), ArchiveIdCode::SystemSaveData); }
Service *ServiceManager::GetService(LPCSTR p_serviceID) { ATOM serviceID = FindAtomA(p_serviceID); t_serviceList::iterator service = std::find_if(m_serviceList.begin(), m_serviceList.end(), std::bind2nd(std::mem_fun(&Service::IsService), serviceID)); if (service != m_serviceList.end()) { return *service; } else { Service *newService = KnownService(serviceID); if (newService) { AddService(newService); return newService; } else { TRACE("WARNING: Could not create service %s", p_serviceID); return NULL; } } }
/*---------------------------------------------------------------------- | PLT_MediaRenderer::SetupServices +---------------------------------------------------------------------*/ NPT_Result PLT_MediaRenderer::SetupServices() { PLT_Service* service; { /* AVTransport */ service = new PLT_Service( this, "urn:schemas-upnp-org:service:AVTransport:1", "urn:upnp-org:serviceId:AVTransport", "AVTransport", "urn:schemas-upnp-org:metadata-1-0/AVT/"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_AVTransportSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f)); service->SetStateVariable("A_ARG_TYPE_InstanceID", "0"); // GetCurrentTransportActions service->SetStateVariable("CurrentTransportActions", "Play,Pause,Stop,Seek,Next,Previous"); // GetDeviceCapabilities service->SetStateVariable("PossiblePlaybackStorageMedia", "NONE,NETWORK,HDD,CD-DA,UNKNOWN"); service->SetStateVariable("PossibleRecordStorageMedia", "NOT_IMPLEMENTED"); service->SetStateVariable("PossibleRecordQualityModes", "NOT_IMPLEMENTED"); // GetMediaInfo service->SetStateVariable("NumberOfTracks", "0"); service->SetStateVariable("CurrentMediaDuration", "00:00:00"); service->SetStateVariable("AVTransportURI", ""); service->SetStateVariable("AVTransportURIMetadata", "");; service->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED"); service->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED"); service->SetStateVariable("PlaybackStorageMedium", "NONE"); service->SetStateVariable("RecordStorageMedium", "NOT_IMPLEMENTED"); service->SetStateVariable("RecordMediumWriteStatus", "NOT_IMPLEMENTED"); // GetPositionInfo service->SetStateVariable("CurrentTrack", "0"); service->SetStateVariable("CurrentTrackDuration", "00:00:00"); service->SetStateVariable("CurrentTrackMetadata", ""); service->SetStateVariable("CurrentTrackURI", ""); service->SetStateVariable("RelativeTimePosition", "00:00:00"); service->SetStateVariable("AbsoluteTimePosition", "00:00:00"); service->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED service->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED // disable indirect eventing for certain state variables PLT_StateVariable* var; var = service->FindStateVariable("RelativeTimePosition"); if (var) var->DisableIndirectEventing(); var = service->FindStateVariable("AbsoluteTimePosition"); if (var) var->DisableIndirectEventing(); var = service->FindStateVariable("RelativeCounterPosition"); if (var) var->DisableIndirectEventing(); var = service->FindStateVariable("AbsoluteCounterPosition"); if (var) var->DisableIndirectEventing(); // GetTransportInfo service->SetStateVariable("TransportState", "NO_MEDIA_PRESENT"); service->SetStateVariable("TransportStatus", "OK"); service->SetStateVariable("TransportPlaySpeed", "1"); // GetTransportSettings service->SetStateVariable("CurrentPlayMode", "NORMAL"); service->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED"); } { /* ConnectionManager */ service = new PLT_Service( this, "urn:schemas-upnp-org:service:ConnectionManager:1", "urn:upnp-org:serviceId:ConnectionManager", "ConnectionManager"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariable("CurrentConnectionIDs", "0"); // put all supported mime types here instead service->SetStateVariable("SinkProtocolInfo", "http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO,http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_SP_G726,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMDRM_WMABASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPLL_BASE,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC_XAC3,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMDRM_WMVSPLL_BASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_BASE,http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L5_SO_G726,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL_XAC3,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN,http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L4_SO_G726,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3X,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_MP3,http-get:*:video/x-ms-wmv:*"); service->SetStateVariable("SourceProtocolInfo", ""); } { /* RenderingControl */ service = new PLT_Service( this, "urn:schemas-upnp-org:service:RenderingControl:1", "urn:upnp-org:serviceId:RenderingControl", "RenderingControl", "urn:schemas-upnp-org:metadata-1-0/RCS/"); NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD)); NPT_CHECK_FATAL(AddService(service)); service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f)); service->SetStateVariable("Mute", "0"); service->SetStateVariableExtraAttribute("Mute", "Channel", "Master"); service->SetStateVariable("Volume", "100"); service->SetStateVariableExtraAttribute("Volume", "Channel", "Master"); service->SetStateVariable("VolumeDB", "0"); service->SetStateVariableExtraAttribute("VolumeDB", "Channel", "Master"); service->SetStateVariable("PresetNameList", "FactoryDefaults"); } return NPT_SUCCESS; }
void ServiceLocator::AddService(LoadingUI* aLoadingUI, bool aResponsibleForDeletion) { AddService((GameService**)&s_LoadingUI, aLoadingUI, aResponsibleForDeletion); }
void ServiceLocator::AddService(FontManager* aFontManager, bool aResponsibleForDeletion) { AddService((GameService**)&s_FontManager, aFontManager, aResponsibleForDeletion); }
void ServiceLocator::AddService(SceneManager* aSceneManager, bool aResponsibleForDeletion) { AddService((GameService**)&s_SceneManager, aSceneManager, aResponsibleForDeletion); }
void ServiceLocator::AddService(AudioManager* aAudioManager, bool aResponsibleForDeletion) { AddService((GameService**)&s_AudioManager, aAudioManager, aResponsibleForDeletion); }
/*---------------------------------------------------------------------- | PLT_MediaRenderer::PLT_MediaRenderer +---------------------------------------------------------------------*/ PLT_MediaRenderer::PLT_MediaRenderer(PlaybackCmdListener* listener, const char* friendly_name, bool show_ip, const char* uuid, unsigned int port) : PLT_DeviceHost("/", uuid, "urn:schemas-upnp-org:device:MediaRenderer:1", friendly_name, show_ip, port) { NPT_COMPILER_UNUSED(listener); PLT_Service* service; /* AVTransport */ service = new PLT_Service( this, "urn:schemas-upnp-org:service:AVTransport:1", "urn:upnp-org:serviceId:AVT_1-0"); if (NPT_SUCCEEDED(service->SetSCPDXML((const char*) RDR_AVTransportSCPD))) { service->InitURLs("AVTransport", m_UUID); AddService(service); service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f)); // GetCurrentTransportActions service->SetStateVariable("CurrentTransportActions", "", false); // GetDeviceCapabilities service->SetStateVariable("PossiblePlaybackStorageMedia", "vendor-defined ,NOT_IMPLEMENTED,NONE,NETWORK,MICRO-MV,HDD,LD,DAT,DVD-AUDIO,DVD-RAM,DVD-RW,DVD+RW,DVD-R,DVD-VIDEO,DVD-ROM,MD-PICTURE,MD-AUDIO,SACD,VIDEO-CD,CD-RW,CD-R,CD-DA,CD-ROM,HI8,VIDEO8,VHSC,D-VHS,S-VHS,W-VHS,VHS,MINI-DV,DV,UNKNOWN", false); service->SetStateVariable("PossibleRecordStorageMedia", "vendor-defined ,NOT_IMPLEMENTED,NONE,NETWORK,MICRO-MV,HDD,LD,DAT,DVD-AUDIO,DVD-RAM,DVD-RW,DVD+RW,DVD-R,DVD-VIDEO,DVD-ROM,MD-PICTURE,MD-AUDIO,SACD,VIDEO-CD,CD-RW,CD-R,CD-DA,CD-ROM,HI8,VIDEO8,VHSC,D-VHS,S-VHS,W-VHS,VHS,MINI-DV,DV,UNKNOWN", false); service->SetStateVariable("PossibleRecordQualityModes", "vendor-defined ,NOT_IMPLEMENTED,2:HIGH,1:MEDIUM,0:BASIC,2:SP,1:LP,0:EP", false); // GetMediaInfo service->SetStateVariable("PlaybackStorageMedium", "UNKNOWN", false); service->SetStateVariable("RecordStorageMedium", "UNKNOWN", false); service->SetStateVariable("RecordMediumWriteStatus", "UNKNOWN", false); service->SetStateVariable("NumberOfTracks", "0", false); service->SetStateVariable("CurrentTrackDuration", "00:00:00", false); service->SetStateVariable("CurrentMediaDuration", "00:00:00", false); service->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED", false); service->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED", false); // GetPositionInfo service->SetStateVariable("AbsTime", "NOT_IMPLEMENTED", false); service->SetStateVariable("CurrentTrack", "0", false); service->SetStateVariable("RelativeTimePosition", "00:00:00", false); //?? service->SetStateVariable("AbsoluteTimePosition", "NOT_IMPLEMENTED", false); //?? service->SetStateVariable("RelativeCounterPosition", "0", false); //?? service->SetStateVariable("AbsoluteCounterPosition", "0", false); //?? // GetTransportInfo service->SetStateVariable("TransportState", "NO_MEDIA_PRESENT", false); service->SetStateVariable("TransportStatus", "OK", false); service->SetStateVariable("TransportPlaySpeed", "1", false); // GetTransportSettings service->SetStateVariable("CurrentPlayMode", "NORMAL", false); service->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED", false); } /* ConnectionManager */ service = new PLT_Service( this, "urn:schemas-upnp-org:service:ConnectionManager:1", "urn:upnp-org:serviceId:CMGR_1-0"); if (NPT_SUCCEEDED(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD))) { service->InitURLs("ConnectionManager", m_UUID); AddService(service); service->SetStateVariable("CurrentConnectionIDs", "0", false); // put all supported mime types here instead service->SetStateVariable("SinkProtocolInfo", "http-get:*:*:*", false); service->SetStateVariable("SourceProtocolInfo", "", false); } /* RenderingControl */ service = new PLT_Service( this, "urn:schemas-upnp-org:service:RenderingControl:1", "urn:upnp-org:serviceId:RCS_1-0"); if (NPT_SUCCEEDED(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD))) { service->InitURLs("RenderingControl", m_UUID); AddService(service); service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f)); } }
void ServiceLocator::AddService(DebugUI* aDebugUI, bool aResponsibleForDeletion) { AddService((GameService**)&s_DebugUI, aDebugUI, aResponsibleForDeletion); }