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

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

   return retval;
}