Interesting updates on Channel Selector & Reference Channel boxes

I committed a couple of interesting changes lately that will be released after I leave INRIA… (actually, they are already available in the SVN repository for those who care). It has been reported a number of times that the Channel Selector and the Reference Channel boxes were using 0-based indices. And this is damn like a mistake of the programmer here. Those two boxes are among the first boxes that we had in the software… and at that time, we did not care about the user as much as we do now. And this 0-based indices are clearly a C-like thing.

Updating these two boxes to 1-based indices would completely break the compatibility with existing scenarios based on any of those two boxes… And I believe the channel selector is one of the most used boxes around ! For this reason, this weird indexing has never been fixed…

But using OpenViBE myself, I felt like a couple of other enhancements could be developed such as for instance channel unselection (the box selects all the channels you did not actually list) or range selection (specify channels 1 to 10 instead of channels 1, 2, 3…, 9, 10)… So for this reason, these two boxes have been completely reimplemented !

What about existing scenarios ? Well that’s obviously a good opportunity to explain how such issue should be handled in OpenViBE.

On one hand, the existing Channel Selector and Reference Channel boxes have actually not been changed in any way except that I added a deprecitation flag. This can be done in the box descriptor when filling its prototype, adding the OpenViBE::Kernel::BoxFlag_IsDeprecated flag. This results in the boxes not appearing on the right pane anymore (the scenario Author is not able to put them on a new scenario anymore until he copy/pastes those boxes from another scenario or he has the Designer_ShowUnstable flag set to true in his configuration file). But – and this is the interesting part – they are still registered and known of the kernel. So executing an existing scenario with those boxes will still work as well as before !

On the other hand, the new Channel Selector and Reference Channel boxes have appeared. They have the same name so they will hopefully be quickly adopted by scenario Authors… slowly replacing the deprecated ones.

The deprecated boxes can be removed several months later, maybe in one, two, three releases from now… This gives enough time for the author to update his scenarios… and does not slow down contributors to submit enhancement, even breaking compatibility with existing scenarios !

New features of these two boxes are as follows :

Channel Selector :

  • either select or reject channel
  • 1 based indices
  • range selection
  • smart channel recognition

Reference Channel :

  • 1 based indices
  • smart channel recognition

The smart channel recognition feature allows to chose a channel either by its name or by its index ; the box automatically detects if the token is a name or an index. For instance, using “1-16;Ref;Cz” as input of the new Channel Selector box will select channels 1 to 16, plus channel named Ref and channel named Cz.

I hope you find these new boxes useful !

Comments are closed.