Exemplo n.º 1
0
 private async Task StartOperationAsync(INotificationReceiver nRec)
 {
     if (UseNotifications)
     {
         bool haveFocus = nMan.RequestAudioResources(nRec);
         if (haveFocus)
         {
             //	status.Text = "Granted";
             await nRec.StartAsync();
         }
         else
         {
             //status.Text = "Denied";
         }
     }
     else
     {
         await nRec.StartAsync();
     }
 }
Exemplo n.º 2
0
        private async Task StartOperationAsync(INotificationReceiver notificationReceiver)
        {
            bool haveFocus = _notificationManager.RequestAudioResources(notificationReceiver);

            if (haveFocus)
            {
                //status.Text = "Granted";
                await notificationReceiver.StartAsync();
            }
            else
            {
                //status.Text = "Denied";
            }
        }
            public void OnAudioFocusChange(AudioFocus focusChange)
            {
                switch (focusChange)
                {
                // We will take any flavor of AudioFocusgain that the system gives us and use it.
                case AudioFocus.GainTransient:
                case AudioFocus.GainTransientMayDuck:
                case AudioFocus.Gain:
                    parent.StartAsync();
                    SetStatus("Granted");
                    break;

                // If we get any notificationthat removes focus - just terminate what we were doing.
                case AudioFocus.LossTransientCanDuck:
                case AudioFocus.LossTransient:
                case AudioFocus.Loss:
                    parent.Stop();
                    SetStatus("Removed");
                    break;

                default:
                    break;
                }
            }
Exemplo n.º 4
0
		async Task startOperationAsync (INotificationReceiver nRec)
		{
			if (useNotifications) {
				bool haveFocus = nMan.RequestAudioResources (nRec);
				if (haveFocus) {
					status.Text = "Granted";
					await nRec.StartAsync ();
				} else {
					status.Text = "Denied";
				}
			} else {
				await nRec.StartAsync ();
			}
		}
Exemplo n.º 5
0
 async Task startOperationAsync(INotificationReceiver nRec)
 {
     await nRec.StartAsync();
 }
Exemplo n.º 6
0
 async Task StartOperationAsync(INotificationReceiver nRec)
 {
     //if (useNotifications)
     //{
     //    bool haveFocus = nMan.RequestAudioResources(nRec);
     //    if (haveFocus)
     //    {
     //        status.Text = "Granted";
     //        await nRec.StartAsync();
     //    }
     //    else
     //    {
     //        status.Text = "Denied";
     //    }
     //}
     //else
     //{
         await nRec.StartAsync();
     //}
 }