mrVanDalo / stepp0r

a launchpad step sequencer for renoise
http://mrvandalo.github.io/stepp0r/
11 stars 4 forks source link

Find a better way to remove notifiers #17

Closed mrVanDalo closed 10 years ago

mrVanDalo commented 10 years ago

renoise object notfiers are still calling function. but theses functions just don't react to changes when inactive.

It is better to unregister theses functions. For this we have to safe the callbacks itself.

self.foo_callback = function (_) ... end 
renoise.song().some_observable:add_notifier(self.foo_callback)
renoise.song().some_observable:remove_notifier(self.foo_callback)

Right now its done using the is_first_run and is_not_active values. which is kinda the same, but we can't react on configuration changes (on restarting the plugin start -> stop -> reconfigure -> start) which need different callback registrations, than before.

mrVanDalo commented 10 years ago

I did, by creating the callbacks as values and using my own wrappers add_notifier and remove_notifier on those values.

In this ticket I'll move everything to that standard.