setCallback() public method

public setCallback ( EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL ) : RESULT
callback EVENT_CALLBACK
callbackmask EVENT_CALLBACK_TYPE
return RESULT
 void Start()
 {
     myAnimation   = GetComponent <Animator>();
     beatCallback  = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);
     musicInstance = FMODUnity.RuntimeManager.CreateInstance("event:/INTRO");
     musicInstance.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
 }
    void Start()
    {
        markerOnEvent = new UnityEvent();
        barEvent      = new UnityEvent();
        markerOnEvent.AddListener(fireNote);
        instance = this;
        marker   = "";


        //FMOD shit
        timelineInfo = new TimelineInfo();

        // Explicitly create the delegate object and assign it to a member so it doesn't get freed
        // by the garbage collected while it's being used
        beatCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);

        musicInstance = FMODUnity.RuntimeManager.CreateInstance(LevelStateEvent);

        // Pin the class that will store the data modified during the callback
        timelineHandle = GCHandle.Alloc(timelineInfo, GCHandleType.Pinned);
        // Pass the object through the userdata of the instance
        musicInstance.setUserData(GCHandle.ToIntPtr(timelineHandle));

        musicInstance.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
        //Debug.Log("CALLBACK");

        musicInstance.start();

        //missInstance = FMODUnity.RuntimeManager.CreateInstance("event:/NoteMiss");

        //
    }
Beispiel #3
0
 public void AssignBeatEvent(FMOD.Studio.EventInstance instance)
 {
     timelineInfo   = new TimelineInfo();
     timelineHandle = GCHandle.Alloc(timelineInfo, GCHandleType.Pinned);
     beatCallback   = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);
     instance.setUserData(GCHandle.ToIntPtr(timelineHandle));
     instance.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
 }
Beispiel #4
0
    public void FMODMusicChange(string path)
    {
        FMODmusic.release();
        FMODmusic = FMODUnity.RuntimeManager.CreateInstance(path);
        FMODmusic.setUserData(GCHandle.ToIntPtr(timelineHandle));

        FMODmusic.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
    }
Beispiel #5
0
    void Start()
    {
        instance = FMODUnity.RuntimeManager.CreateInstance(drums);

        cb = new FMOD.Studio.EVENT_CALLBACK(StudioEventCallback);
        instance.setCallback(cb, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT);
        instance.start();
    }
    public FMODSyncEvent(string eventPath)
    {
        eventInstance = FMODUnity.RuntimeManager.CreateInstance(eventPath);
        eventCallback = new FMOD.Studio.EVENT_CALLBACK(StudioEventCallback);

        eventInstance.setCallback(eventCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT);
        eventInstance.start();
    }
Beispiel #7
0
    private void Start()
    {
        camera = GetComponent <Camera>();

        beatCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);

        eventInstance = FMODUnity.RuntimeManager.CreateInstance(eventName);

        eventInstance.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
        eventInstance.start();
    }
    private void AddInstance()
    {
        FMOD.Studio.EventInstance instance = FMODUnity.RuntimeManager.CreateInstance(path);
        instance.setCallback(callback, FMOD.Studio.EVENT_CALLBACK_TYPE.STOPPED);
        instance.setUserData(stackPtr);

        foreach (KeyValuePair <string, Parameter> parameter in parameters)
        {
            instance.setParameterByID(parameter.Value.id, parameter.Value.value);
        }

        instances.Add(instance);
        stoppedInstances.Push(instance);
    }
    // Start is called before the first frame update
    void Start()
    {
        secondPuzzleLayerTriggerScript = secondPuzzleLayerTriggerObject.GetComponent <TriggerPostSecondPuzzleLayers>();
        postBathroomMusic = secondPuzzleLayerTriggerScript.PostBathroomMusic;
        //postBathroomMusic = SceneManagement.PostBathroomMusic;

        callback = new FMOD.Studio.EVENT_CALLBACK(CallBackTriggered);
        postBathroomMusic.setCallback(callback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
        //audioTrack.EventInstance.setCallback(callback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);

        mausoleumShakeAnimation = mausoleum.GetComponent <Animator>();

        flickerScript = ghostLight.GetComponent <Flicker>();
    }
Beispiel #10
0
    public void PlayMusic()
    {
        EventDescription = RuntimeManager.GetEventDescription(Event);                       //this assigns the EventDescription from the Event string variable that we set in the editor
        EventDescription.createInstance(out EventInstance);                                 //this creates an EventInstance from the EventDescription
        EventInstance.start();                                                              //this starts the event

        FMOD.Studio.EVENT_CALLBACK callback;                                                //special type of variable defined by FMOD.studio called EVENT_CALLBACK
        callback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallBack);                       //pointer to the function that we're going to callback which is MusicEventCallBack

        EventInstance.setCallback(callback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT); // sets a callback on the event that is created with the flag to call this on every Timeline beat

        FMOD.Studio.PARAMETER_DESCRIPTION distanceToClue_fmodParam;
        EventDescription.getParameter("DistanceToClue", out distanceToClue_fmodParam);
        maxClueDistance = distanceToClue_fmodParam.maximum; // sets maxClueDistance to the maximum value of the game parameter in the fmod parameter (30)
        print("Max Distance to Clue = " + maxClueDistance);
    }
    void Start()
    {
        EventManager.StartListening("OnBeatZagal", zagal.GetComponent <ZagalBehaviour>().Beat);
        EventManager.StartListening("OnBeatPlayer", player.GetComponent <PlayerBehaviour>().Beat);

        currentBeat = 0 - startBeatOffset;

        BeatDuration = Time.time;

        beatCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);

        musicInstance = FMODUnity.RuntimeManager.CreateInstance("event:/MUSIC");

        musicInstance.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
        musicInstance.start();
    }
    // Start is called before the first frame update
    void Start()
    {
        timelineInfo = new TimelineInfo();
        // Explicitly create the delegate object and assign it to a member so it doesn't get freed
        // by the garbage collected while it's being used
        beatCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);
        musicEvent   = FMODUnity.RuntimeManager.CreateInstance(musicPath);

        // Pin the class that will store the data modified during the callback
        timelineHandle = GCHandle.Alloc(timelineInfo, GCHandleType.Pinned);
        // Pass the object through the userdata of the instance
        musicEvent.setUserData(GCHandle.ToIntPtr(timelineHandle));

        musicEvent.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
        musicEvent.start();

        gm = GameObject.Find("GameManager").GetComponent <GameManager>();
    }
Beispiel #13
0
	// Use this for initialization
	void Start () {

		musicEv = FMODUnity.RuntimeManager.CreateInstance (Catalogue.getMusic());
		musicEv.getParameter (enemyCount, out enemyCountPa);
		musicEv.getParameter (speed, out speedPa);
		musicEv.getParameter (state, out statePa);

		previousFrameTime = Time.time;
		lastReportedPlayPosition = 0;
		musicEv.start ();
		enemyCountChange (3);
		statePa.setValue (1);
		speedPa.setValue (3);
		beatExecutor = GetComponent<BeatExecutor> ();
		cb = new FMOD.Studio.EVENT_CALLBACK(onBeatWrapper);
		musicEv.setCallback (cb, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);

	}
    //THE SINGLETON HAS APPEARED: This allows for everything to access this SINGLE INSTANCE of the script and access its variables
    //The drawback is that if this script ever gets destroyed, it's gonna mean everything that relies on the information provided
    //by this script is gonna break.
    //public static FMODVibeTracker vt;

    /*
     * void Awake()
     * {
     *     vt = this;
     * }
     */
    // Start is called before the first frame update
    void Start()
    {
        timelineInfo = new TimelineInfo();

        //Explicitly create the delegate object and assign it to a member so it doesn't get freed
        //by the garbage collected while it's being used
        beatCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);

        musicInstance = FMODUnity.RuntimeManager.CreateInstance(music);

        //Pin the class that will store the data modified during the callback
        timelineHandle = GCHandle.Alloc(timelineInfo, GCHandleType.Pinned);
        //Pass the object through the userdata of the instance
        musicInstance.setUserData(GCHandle.ToIntPtr(timelineHandle));

        musicInstance.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);
        musicInstance.start();

        musicInstance.getDescription(out descriptionCallback);
        descriptionCallback.getLength(out int length);

        timelineInfo.songLength = length;
    }
Beispiel #15
0
    // Use this for initialization
    void Start()
    {
        //distToGround = GetComponent<Collider> ().bounds.size.y - GetComponent<Collider>();

        //start music
        Track4Event = FMODUnity.RuntimeManager.CreateInstance(track4);
        //Track4Event.start();

        Track1Event = FMODUnity.RuntimeManager.CreateInstance(drums);
        cb = new FMOD.Studio.EVENT_CALLBACK(StudioEventCallback);
        Track1Event.setCallback(cb, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT);
        //Track1Event.start();

        Track2Event = FMODUnity.RuntimeManager.CreateInstance(chords);
        //Track2Event.start();

        Track3Event = FMODUnity.RuntimeManager.CreateInstance(track3);
        //Track3Event.start();

        myOneShot = FMODUnity.RuntimeManager.CreateInstance(BreatheIn1);

        beatOn = false;
    }
Beispiel #16
0
    // Use this for initialization
    void Start()
    {
        //distToGround = GetComponent<Collider> ().bounds.size.y - GetComponent<Collider>();

        //start music
        Track4Event = FMODUnity.RuntimeManager.CreateInstance(track4);
        Track4Event.start();

        Track1Event = FMODUnity.RuntimeManager.CreateInstance(drums);
        cb = new FMOD.Studio.EVENT_CALLBACK(StudioEventCallback);
        Track1Event.setCallback(cb, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT);
        Track1Event.start();

        Track2Event = FMODUnity.RuntimeManager.CreateInstance(chords);
        Track2Event.start();

        Track3Event = FMODUnity.RuntimeManager.CreateInstance(track3);
        Track3Event.start();

        myOneShot = FMODUnity.RuntimeManager.CreateInstance(oneShot);

        //setup parameters
        /*Track1Event.getParameter("Track1Vol", out track1VolParam);
        track1VolParam.setValue (0);

        Track2Event.getParameter("Track1Vol", out track2VolParam);
        track2VolParam.setValue (0);

        Track3Event.getParameter("Track1Vol", out track3VolParam);
        track3VolParam.setValue (0);

        Track4Event.getParameter("Track1Vol", out track4VolParam);
        track4VolParam.setValue (0);

        soundSystem.getParameter("Track5Vol", out track5VolParam);
        track5VolParam.setValue (0);
        soundSystem.getParameter("Track6Vol", out track6VolParam);
        track6VolParam.setValue (0);
        soundSystem.getParameter("Track7Vol", out track7VolParam);
        track7VolParam.setValue (0);
        soundSystem.getParameter("Track8Vol", out track8VolParam);
        track8VolParam.setValue (0);
        soundSystem.getParameter("Track9Vol", out track9VolParam);
        track9VolParam.setValue (0);*/

        beatOn = false;
    }