Giter Site home page Giter Site logo

Comments (6)

ricardomatias avatar ricardomatias commented on June 12, 2024 1

My bad, I put the updated one inside the LiveAPI folder by mistake. Well spotted @allforabit!

from ableton-live.

allforabit avatar allforabit commented on June 12, 2024

It's to do with the event callback name not being entirely unique. I've got a workaround by changing the callback signature in live api:

callback(objectPath, objectId, property)

and I generate a unique name with this function and use in place of just the objectPath:

function callbackName(path, id) {
	if(id) {
		return path + '-' + id;
	}
	return path;
}

from ableton-live.

allforabit avatar allforabit commented on June 12, 2024

I have a PR there if you want to try it out

from ableton-live.

ricardomatias avatar ricardomatias commented on June 12, 2024

Thanks for the thorough description of the problem and testable scenario!

from ableton-live.

allforabit avatar allforabit commented on June 12, 2024

Thanks very much for doing the update! I still seem to be having the same issue though after updating and using the latest device though I'm wondering if there was an issue updating it? Thanks again :-)

from ableton-live.

allforabit avatar allforabit commented on June 12, 2024

That's great, thanks for that. I did notice one other issue, there's always one :-) The removeObserver function isn't using the proper callback name in all places. Here's the updated function that seems to do the trick:

function removeObserver(args) {
	const res = JSON.parse(args);

	// * Request UUID
	var uuid = res.uuid;
	var objectId = res.objectId;
	var eventId = res.args.eventId;
	var objectPath = res.args.objectPath;

	var cbName = callbackName(objectPath, objectId)

	if (callbackEvents[cbName] !== undefined) {
		var listeners = callbackEvents[cbName].listeners;
		var idx = listeners.indexOf(eventId);

		listeners.splice(idx, 1);

		if (!listeners.length) {
			const api = callbackEvents[cbName].api;
			api.id = 0;
			delete callbackEvents[cbName];
		}
	}

	onSuccess(uuid);
}

from ableton-live.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.