Ejemplo n.º 1
0
        public static async Task ProcessEvent(PlaybackEvent ev, UrlHelper url, HttpContextBase context)
        {
            if (ev.Status != "done")
            {
                return;
            }
            Trace.WriteLine("PlaybackEvent", "Events");
            var call = new Call {
                Id = ev.CallId
            };

            if (ev.Tag == "dolphin-state")
            {
                await call.CreateGather(new Dictionary <string, object>
                {
                    { "maxDigits", "5" },
                    { "terminatingDigits", "*" },
                    { "interDigitTimeout", "3" },
                    { "prompt", new Dictionary <string, object> {
                          { "sentence", "Press 1 to speak with the fish, press 2 to let it go" },
                          { "loopEnabled", false },
                          { "voice", "Kate" }
                      } },
                    { "tag", "gather_started" }
                });
            }
        }
 public static async Task ProcessEvent(PlaybackEvent ev, UrlHelper url, HttpContextBase context, dynamic viewBag)
 {
     if (ev.Status != "done")
     {
         return;
     }
     await ProcessPlaybackEvent(viewBag, ev.Tag);
 }
Ejemplo n.º 3
0
 public void OnPlaybackEvent(PlaybackEvent playbackEvent)
 {
     if (playbackEvent.eventCode == 1)
     {
         InvokePlay();
     }
     else if (playbackEvent.eventCode == 2)
     {
         InvokePause();
     }
 }
Ejemplo n.º 4
0
 private void RaisePlaybackEvent(byte eventCode)
 {
     if (NetworkServer.active)
     {
         var playbackEvent = new PlaybackEvent()
         {
             eventCode = eventCode
         };
         NetworkServer.SendToAll(playbackEvent);
         OnPlaybackEvent(playbackEvent);
     }
     else
     {
         Debug.LogError("Mirror: Cannot send event if not server");
     }
 }
Ejemplo n.º 5
0
 internal void OnPlaybackEvent(MediaEngineEvent @event, nuint param1, int param2)
 {
     PlaybackEvent?.Invoke(@event, param1, param2);
 }
Ejemplo n.º 6
0
 public SoundEventArgs(SoundFX source, PlaybackEvent type, uint sample) : base(source)
 {
     this.EventType     = type;
     this.CurrentSample = sample;
 }
Ejemplo n.º 7
0
 public static string Symbolize(this PlaybackEvent playbackEvent)
 => NSString.FromHandle(symbolise(new UIntPtr((ulong)playbackEvent)));
 private async Task ProcessCalledToOwnerEvent(PlaybackEvent ev, TinyIoCContainer container)
 {
     if (ev.Status != "done")
     {
         return;
     }
     var call = new Call {Id = ev.CallId};
     switch (ev.Tag)
     {
         case "start-recording":
             Trace.WriteLine("Start recording of voice message");
             await call.RecordingOn();
             break;
         default:
         {
             var tags = ev.Tag.Split(':');
             if (tags[0] == "voice-message")
             {
                 var index = int.Parse(tags[1]);
                 if (index > 0)
                 {
                     Trace.WriteLine(string.Format("Play next voice message: {0}", index - 1));
                     await PlayVoiceMessage(container, call, index - 1);
                 }
                 else
                 {
                     Trace.WriteLine("Return back to the conference");
                     await
                         CurrentConferenceMember
                             .Update(new Dictionary<string, object>
                             {
                                 {"hold", false}
                             });
                 }
             }
             break;
         }
     }
 }