Multiple instances of same timeline ID?
Avargas
Posts: 57
Hi all,
In our company we have a module template that we use when we want to create a module for a new device. We used to have the button feedback in the define_program, so in the last few months we replaced it for a timeline_event.
So now, all our modules have inside a timeline with the same ID (always 1), so we can have in a single project 4 or 5 modules made by our own running timelines with the same ID.
Is that a problem? I've just read in a P2 Evaluation Sheet that it is considered a bad practice, why? do the timeline events ID have a global scope and it doesn't matter if they are inside a module? I've never seen a problem or any strange behaviour since we program that way, so I don't understand that statement from the exam reviewer (and I feel bad because I tell all my students to do it in that way:( ) .
What do you think?
In our company we have a module template that we use when we want to create a module for a new device. We used to have the button feedback in the define_program, so in the last few months we replaced it for a timeline_event.
So now, all our modules have inside a timeline with the same ID (always 1), so we can have in a single project 4 or 5 modules made by our own running timelines with the same ID.
Is that a problem? I've just read in a P2 Evaluation Sheet that it is considered a bad practice, why? do the timeline events ID have a global scope and it doesn't matter if they are inside a module? I've never seen a problem or any strange behaviour since we program that way, so I don't understand that statement from the exam reviewer (and I feel bad because I tell all my students to do it in that way:( ) .
What do you think?
0
Comments
I do know that constants and variables live only in the module. You 'can' leave the source code in and wathc them in debug but they don't work outside the module.
I will say that I came up with my own scheme to keep my timelines unique even inside modules but this doesn't cover AMX created modules where I have no idea what's going on.
I suppose one could test this by creating a timeline in a module, then creating a separtate timeline event of the same ID outside it and watcching it for activity. Even better yet, you could run a TIMELINE_ACTIVE(my_Moudle_Timeline__ID) outside the module during its running to see if what it kicks back.
and inside module
result in terminal:
Don't get me wrong - I understand how it works and it doesn't confuse me. It's just one of those things where the rules don't seem to me to be followed consistently. In my mind an event is a "thing that happened" and it should traverse the scope of the system. Other events do.
The other little one that's always not quite followed what my pea brain senses as the logic is how button/channel feedback and button pushes are not the same thing and one doesn't cause the other. but levels do if the level feedback being sent is an active fader. sending a level (which is supposed to be feedback) to an active fader produces an incoming level event.
There are lots of these kinds of things in netlinx.
I also tested it and it works perfectly with all functions (pause, restart, kill, etc.)
Here the code:
OUTSIDE:
INSIDE: