Esempio n. 1
0
void MusicServiceAccessMsgReceiver::shutdown()
{
    // unsubscribe to system messages
    if (GetMessenger() != NULL)
    {
        GetMessenger()->UnsubscribeSysMsg(*this);
    }
}
Esempio n. 2
0
void MusicServiceAccessMsgReceiver::startup(GtfPluginLoader& rLoader)
{
    GtfMsgExtReceiver::Init(rLoader);

    if (m_pWorkLoop == NULL)
    {
        m_pWorkLoop = static_cast<GtfMainWorkLoop*>(
            rLoader.getInterface(
            static_cast<uint32_t>(GtfMainWorkLoop::cm_gtfInterfaceId),
            static_cast<uint32_t>(GtfMainWorkLoop::cm_gtfInterfaceVersion)));
    }

    // subscribe to system messages
    if (GetMessenger() != NULL)
    {
        GetMessenger()->SubscribeSysMsg(*this);
    }
}
Esempio n. 3
0
void MusicServiceAccessMsgReceiver::RequestShutdownOnFailure()
{
    // send the system failure message
    GtfMsgHandle handle = GetMessenger()->CreateMsg(GTF_MID_SYSTEM_FAILURE);
    GetMessenger()->PublishMsg(handle);
    GetMessenger()->DestroyMsg(handle);

    // request shutdown
    handle = GetMessenger()->CreateMsg(GTF_MID_RUN_SHUTDOWN);
    GetMessenger()->PublishMsg(handle);
    GetMessenger()->DestroyMsg(handle);
}
Esempio n. 4
0
status_t SendMessageToReplicant(int32 index, BMessage *msg)
{
	BMessage aReply;
	status_t aErr = B_OK;
	
	msg->AddInt32( "what2", msg->what );
	msg->what = B_SET_PROPERTY;

	BMessage	uid_specifier(B_ID_SPECIFIER);
	
	msg->AddSpecifier("View");
	uid_specifier.AddInt32("id", index);
	uid_specifier.AddString("property", "Replicant");
	msg->AddSpecifier(&uid_specifier);
		
	aErr = GetMessenger().SendMessage( msg, (BHandler*)NULL, 1000000 );
	return aErr;
}
Esempio n. 5
0
void MusicServiceAccessMsgReceiver::UnlockRunlevel()
{
    GtfMsgHandle msg = GetMessenger()->CreateMsg(GTF_MID_RUN_RUNLEVEL_UNLOCK);
    GetMessenger()->PublishMsg(msg);
    GetMessenger()->DestroyMsg(msg);
}