public override void Stop()
 {
     base.Stop();
     StopCoroutine("RunWhenLoaded");
     mobileVideoTrack.controls.DeactivatePlane();
     Diglbug.Log("Stopping mobile video track " + name, PrintStream.AUDIO_PLAYBACK);
     mobileVideoTrack.controls.Stop();
     SetSourceTime(0f);
 }
Beispiel #2
0
 public static string PayloadName(Payload p)
 {
     switch (p)
     {
     default:
         Diglbug.LogError("Failed to return a pre-defined PayloadName for " + p + " - please define one!");
         return("undefined_payload_string");
     }
 }
Beispiel #3
0
 public override void StartReceiving()
 {
     Diglbug.LogMobile("Start rec", "PIPE");
     pipe.Digl_Stop();
     pipe.Digl_SetSwitch(BroadcastMode.receive);
     // The null beacon is set
     pipe.Digl_Start();
     ActivateReinitialiseCountdown();
     ResetReinitialiseCountdown();
 }
Beispiel #4
0
 public void CustomSceneConfirmed()
 {
     if (pendingItem == false)
     {
         Diglbug.LogError("Confirmed an undefined custom scene start.");
         return;
     }
     sceneControls.BeginCustomAct(actPayloadPairs.GetActForDefinedAct(pendingItem.act));
     Diglbug.Log("Confirmed: Sending custom act from item select " + pendingItem.act);
 }
Beispiel #5
0
    private void RecoverSignature()
    {
        int oldSignature = PlayerPrefs.GetInt(oldSignatureKey, 0);

        if (oldSignature == 0)
        {
            Diglbug.Log("Old Signature was None! This may happen for Actors", PrintStream.RECOVERY);
        }
        ShowMode.Instance.Signature = (Signature)oldSignature;
    }
Beispiel #6
0
 public void ClearExpectedPayload()
 {
     Diglbug.Log("Cleared expected payload", PrintStream.SIGNALS);
     expectingPayload = false;
     upcomingPayload  = Payload.NONE;
     if (ExpectedPayloadClearedEvent != null)
     {
         ExpectedPayloadClearedEvent();
     }
 }
Beispiel #7
0
 public void ShowNotUnderway()
 {
     if (runningRecovery)
     {
         Diglbug.Log("Blocked a ShowUnderway call while we're running recovery", PrintStream.RECOVERY);
         return;
     }
     showUnderway = false;
     PlayerPrefs.SetInt(showUnderwayKey, 0);
 }
 public override void Play()
 {
     base.Play();
     placeholderScreen.SetActive(true);
     Diglbug.Log("Play " + name, PrintStream.VIDEO);
     SetSourceTime(0f);
     Unpause();
     audioPlayer.Play();
     trackRunning = true;
 }
    public override void Stop()
    {
        base.Stop();
        placeholderScreen.SetActive(false);
        Diglbug.Log("Stop " + name, PrintStream.VIDEO);
        SetSourceTime(0f);

        audioPlayer.Stop();
        trackRunning = false;
    }
Beispiel #10
0
    public override void ModeSelected()
    {
        if (!RecoveryManager.Instance.RunningRecovery())
        {
            Diglbug.Log("Welcome to the show, Audience Member");
            BLE.Instance.Manager.StartReceiving();
            StartCoroutine("RunBeginShowRoutine");
        }
//		BeginShow ();
    }
Beispiel #11
0
 public void OptionPressed(DebugStreamOption option, bool value)
 {
     if (value)
     {
         Diglbug.EnablePrintStream(option.stream);
     }
     else
     {
         Diglbug.DisablePrintStream(option.stream);
     }
 }
 public override void Exit()
 {
     if (gameObject.activeSelf)
     {
         animator.SetBool("open", false);
     }
     else
     {
         Diglbug.Log("Ignored a close request for " + name + " because we were inactive", PrintStream.ANIMATION);
     }
 }
Beispiel #13
0
 private void CheckEvents(List <TimingEvent> events, float previousTime, float currentTime)
 {
     for (int k = 0; k < events.Count; k++)
     {
         if (EventShouldOccur(events[k], previousSourceTime, currentTime))
         {
             Diglbug.Log(name.Substring(0, 5) + "(def:" + events[k].time + ")" + " Event fired for at time " + currentTime, PrintStream.DELEGATES);
             events [k].function();
         }
     }
 }
Beispiel #14
0
 private void Awake()
 {
     if (audioClip)
     {
         SetAudioClip(audioClip);
     }
     else
     {
         Diglbug.LogWarning("AudioClip not found at Awake for " + name + ", this must be set before use");
     }
 }
Beispiel #15
0
 public Sprite GetSpriteForAct(DefinedAct a)
 {
     for (int k = 0; k < photos.Length; k++)
     {
         if (photos [k].GetDefinedAct() == a)
         {
             return(photos [k].GetPhoto());
         }
     }
     Diglbug.Log("Couldn't find Guide Photo for defined act " + a);
     return(defaultSprite);
 }
Beispiel #16
0
 public Act GetActForDefinedAct(DefinedAct a)
 {
     for (int k = 0; k < acts.Length; k++)
     {
         if (acts [k].definedAct == a)
         {
             return(acts [k]);
         }
     }
     Diglbug.LogWarning("GetActForDefinedAct request returned empty! " + a);
     return(null);
 }
Beispiel #17
0
 public static void SetAllPrintStream(bool active)
 {
     if (active)
     {
         Diglbug.Log("Enabled all PrintStreams", PrintStream.PRINT_STREAMS);
     }
     else
     {
         Diglbug.Log("Disabled all PrintStreams", PrintStream.PRINT_STREAMS);
     }
     streamPrintEnabled = Utils.booleanArray(Enum.GetValues(typeof(PrintStream)).Length, active);
 }
Beispiel #18
0
    public void SkipToNextTrack()
    {
        Diglbug.Log("Skipping track... ", PrintStream.AUDIO_PLAYBACK);
        bool shouldSkip = (currentOutput.GetTrack() is LoopingTrack);

        currentOutput.Skipped();          // just used for FireRemainingEvents.
        if (shouldSkip)
        {
            PlayNextTrack();
        }
        // this is firing the event to begin the next track. Looping don't, though.
    }
Beispiel #19
0
 private void SetCurrentMode(Mode m)
 {
     if (Mode != null)
     {
         Mode.ModeDeselected();
     }
     Mode = m;
     SetFabMode(false);
     Mode.ModeSelected();
     RecoveryManager.Instance.SetMode(m.ModeName);
     Diglbug.Log("Set Mode to " + Mode.ModeName, PrintStream.MODES);
 }
Beispiel #20
0
 public void SendExpectedPayload()
 {
     if (expectingPayload)
     {
         RequestSendSignal(GetExpectedSignal());
         ClearExpectedPayload();
     }
     else
     {
         Diglbug.Log("Requested SendExpectedPayload when not expecting!");
     }
 }
Beispiel #21
0
 public Payload GetPayloadForDefinedAct(DefinedAct a)
 {
     for (int k = 0; k < acts.Length; k++)
     {
         if (acts [k].definedAct == a)
         {
             return(acts [k].entryPayload);
         }
     }
     Diglbug.LogWarning("GetPayloadForDefinedAct request returned empty! " + a);
     return(Payload.NONE);
 }
Beispiel #22
0
 public void Load()
 {
     if (ShouldLoad())
     {
         RunLoad();
         Diglbug.Log("Loading track " + GetTrackName(), PrintStream.MEDIA_LOAD);
     }
     else
     {
         Diglbug.Log("Skipping load of already-loaded/ing track " + GetTrackName(), PrintStream.MEDIA_LOAD);
     }
 }
Beispiel #23
0
 public void Unload()
 {
     if (ShouldUnload())
     {
         RunUnload();
         Diglbug.Log("Unloading track " + GetTrackName(), PrintStream.MEDIA_LOAD);
     }
     else
     {
         Diglbug.Log("Skipping unload of already-unloaded track " + GetTrackName(), PrintStream.MEDIA_LOAD);
     }
 }
Beispiel #24
0
 public TracklistEntry GetFirstTrackEntry()
 {
     if (trackEntries.Length == 0)
     {
         Diglbug.Log("GetFirstTrackEntry requested but no trackEntires found for ActorActSet " + name, PrintStream.DEBUGGING);
         return(null);
     }
     else
     {
         return(trackEntries [0]);
     }
 }
Beispiel #25
0
 public Act GetActForPayload(Payload p)
 {
     for (int k = 0; k < acts.Length; k++)
     {
         if (acts [k].entryPayload == p)
         {
             return(acts [k]);
         }
     }
     Diglbug.LogWarning("GetActForPayload request returned empty! " + p);
     return(null);
 }
Beispiel #26
0
 public void RemoveOneShotDelegate(FloatDelegate function)
 {
     if (oneShotDelegates.Contains(function))
     {
         oneShotDelegates.Remove(function);
         FloatEvent -= function;
     }
     else
     {
         Diglbug.LogError("Unexpected call to RemoveOneShotDelegate");
     }
     Diglbug.Log("Removed oneShotDelegate, total: " + oneShotDelegates.Count, PrintStream.DELEGATES);
 }
Beispiel #27
0
    public void SetMode(ModeName modeName)
    {
        Mode newMode = GetModeByName(modeName);

        if (newMode != null)
        {
            SetCurrentMode(newMode);
        }
        else
        {
            Diglbug.LogError("Mode with name " + modeName + " not found!");
        }
    }
Beispiel #28
0
 public void PayloadExpected(Payload p)
 {
     if (p != upcomingPayload)
     {
         Diglbug.Log("Warning: Demanded PayloadExpected " + p + " doesn't match upcomingPayload " + upcomingPayload, PrintStream.SIGNALS);
         SetUpcomingPayload(p);
     }
     expectingPayload = true;
     if (ExpectedPayloadReadyEvent != null)
     {
         ExpectedPayloadReadyEvent(p);
     }
 }
Beispiel #29
0
 private void PlayTrackEntryAtIndex(int index, float timeSkip)
 {
     if (index < tracklist.entries.Length)
     {
         trackIndex = index;
         TracklistEntry entry = tracklist.GetTrackEntryAtIndex(index);
         HandlePlayRequest(entry, timeSkip);
     }
     else
     {
         Diglbug.Log("Refused to play track at invalid index: " + index);
     }
 }
Beispiel #30
0
 private void Update()
 {
     if (isReceiving)
     {
         timePassedSinceLastReception += Time.deltaTime;
         if (timePassedSinceLastReception > pluginReinitialiseTimeout)
         {
             Diglbug.Log("Reinitialising iOS BLE Rec", PrintStream.SIGNALS);
             ResetReinitialiseCountdown();
             StartReceiving();                  // re-trigger the StartReceiving, which shoudl reinitialise the plugin.
         }
     }
 }