Beispiel #1
0
// Notification that this flow graph has just lost the focus.
// Disable our microphone and speaker resources
OsStatus MpTopologyGraph::loseFocus(void)
{
   UtlBoolean    boolRes;
   OsStatus      result;
   OsStatus      retval = OS_FAILED;

   // disable the FromInputDevice and ToOutputDevice -- we no longer have the focus.
   {
      MpResource* pResource = NULL;
      result = lookupResource("FromMic1",
                              pResource);
      if (result == OS_SUCCESS)
      {
         // This flowgraph have local input part. Disable it.
         assert(pResource);
         boolRes = pResource->disable();
         assert(boolRes);
         retval = OS_SUCCESS;
      }
   }
   {
      MpResource* pResource = NULL;
      result = lookupResource("ToSpeaker1",
                              pResource);
      if (result == OS_SUCCESS)
      {
         // This flowgraph have local input part. Disable it.
         assert(pResource);
         boolRes = pResource->disable();
         assert(boolRes);
         retval = OS_SUCCESS;
      }
   }

   return retval;
}