示例#1
0
 public override void Activate(ShowSetup callback)
 {
     base.Activate(callback);
     if (ShowMode.Instance.Mode.ModeName == ModeName.GUIDE)
     {
         for (int k = 0; k < secretButtons.Length; k++)
         {
             secretButtons[k].SetActive(true);
         }
     }
     player.LoadTrackIfNeeded(entryTrack.GetTrack());
 }
示例#2
0
    private void HandlePlayRequest(TracklistEntry entry, float timeSkip)
    {
        float  fadeTime  = entry.GetEntranceFadeTime();
        ITrack nextTrack = entry.GetTrack();

        currentOutput.FadeOut(fadeTime);
        // This even fires as the track is fading out, not strictly as it ends. Good enough for our purposes.
//		if (TrackEndsEvent != null) {
//			TrackEndsEvent (currentOutput.GetTrack ());
//		}
        currentOutput = GetOutputForNewEntry(entry);
        currentOutput.SetTrack(nextTrack);

        // safety
        LoadTrackIfNeeded(nextTrack);
        currentOutput.FadeIn(fadeTime);
        if (NewTrackBeginsEvent != null)
        {
            NewTrackBeginsEvent(nextTrack);
        }
        if (timeSkip != 0)
        {
            Diglbug.Log("TracklistPlayer Skipping to catch up with signal delay: " + timeSkip, PrintStream.AUDIO_PLAYBACK);
            currentOutput.SetTrackTime(timeSkip);
        }
        else
        {
            Diglbug.Log("TracklistPlayer timeSkip neglibile", PrintStream.AUDIO_PLAYBACK);
        }
    }
示例#3
0
    private IEnumerator PlayActWhenLoaded(ActSignalBundle asb)
    {
        Act            a          = asb.act;
        Signal         s          = asb.signal;
        int            timeToSkip = SignalUtils.GetSignalTimeOffset(s.GetSignalTime());
        TracklistEntry toPlay     = a.GetEntryAtActTime(timeToSkip);

        LoadTrackIfNeeded(toPlay.GetTrack());
        while (!toPlay.GetTrack().IsLoaded())
        {
            yield return(null);
        }
//		RecoveryManager.Instance.RecoveryComplete ();// TODO: Move this somewhere nicer. Maybe sub.

        int   postLoadTimeToSkip = SignalUtils.GetSignalTimeOffset(s.GetSignalTime());
        float timeToPlayFrom     = a.GetSpecificEntryTimeAtActTime(toPlay, postLoadTimeToSkip);

        PlayTrackEntry(toPlay, timeToPlayFrom);
    }
示例#4
0
    private IEnumerator SendWhenLoaded(ActBoolBundle abb)
    {
        Act            a      = abb.act;
        bool           forced = abb.b;
        TracklistEntry toPlay = a.GetFirstTracklistEntry();

//		SetTrack (toPlay.GetTrack ());
        LoadTrackIfNeeded(toPlay.GetTrack());
        while (!toPlay.GetTrack().IsLoaded())
        {
            yield return(null);
        }
        if (forced)
        {
            Payload toSend = actSet.GetPayloadForDefinedAct(a.definedAct);
            Diglbug.Log("Forcing Payload Send from TracklistPlayer " + toSend);
            BLE.Instance.Manager.ForceSendPayload(toSend);
        }
        else
        {
            Diglbug.Log("Sending Expected from TracklistPlayer ");
            BLE.Instance.Manager.SendExpectedPayload();
        }
    }
示例#5
0
    // public for rehearsal controls scrub.
    public void PlayTrackEntry(TracklistEntry entry, float timeSkip)
    {
        int requestedIndex = IndexOfEntryInTracklist(entry);

        if (requestedIndex != -1)
        {
            if (!IsExpectedIndex(requestedIndex))
            {
                Diglbug.Log("Detected unorthodox track request (" + requestedIndex + ") - unloading previously loaded tracks", PrintStream.MEDIA_LOAD);
                UnloadAllTracksExcept(entry.GetTrack());
            }
            PlayTrackEntryAtIndex(requestedIndex, timeSkip);
        }
        else
        {
            Diglbug.LogError("Requested play of TrackEntry failed - entry not initialised in the Tracklist player's Tracklist");
        }
    }