Adding extra data to the bmx

Post Reply
User avatar
chahur
Posts: 203
Joined: Sun Nov 27, 2011 5:19 pm

Adding extra data to the bmx

Post by chahur »

Hello !

I'm looking for a way to add some extra data to a song.
The data should be available from every instance of PatternXP, that is why I don't want to save the data as a part of the machine.

The only solution I can think of is to create another machine, a dummy one, to act as a server of this extra data.
But it seems a lot of work ...

If anyone have a very clever idea for my problem, that would be great :-)

User avatar
UNZ
Posts: 747
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Adding extra data to the bmx

Post by UNZ »

use an atomic global boolean to check in every save() callback if the data was already written.
for loading do something similar. the instance that actually holds the data fills the shared data.

should work, unless someone has a better idea.

User avatar
chahur
Posts: 203
Joined: Sun Nov 27, 2011 5:19 pm

Re: Adding extra data to the bmx

Post by chahur »

UNZ wrote:use an atomic global boolean to check in every save() callback if the data was already written.
for loading do something similar. the instance that actually holds the data fills the shared data.

should work, unless someone has a better idea.
That could be. I thought about that, but if this instance is removed, I have to send the data to another.
That's probably not impossible.

I had also the idea to use the "Info View" to save the data, I don't know if a lot of people use it ?

User avatar
UNZ
Posts: 747
Joined: Mon Nov 21, 2011 9:42 pm
Contact:

Re: Adding extra data to the bmx

Post by UNZ »

remember that there is only one instance of "data". so since the data would be shared (either global or static inside your class) you dont really have to "send the data to another", instead whatever instance gets to save first just does the real save and the others dont save anything. the pointer to the data is the same in every instance.

User avatar
chahur
Posts: 203
Joined: Sun Nov 27, 2011 5:19 pm

Re: Adding extra data to the bmx

Post by chahur »

UNZ wrote:remember that there is only one instance of "data". so since the data would be shared (either global or static inside your class) you dont really have to "send the data to another", instead whatever instance gets to save first just does the real save and the others dont save anything. the pointer to the data is the same in every instance.
You are right, that's what I'll do, thanks

Post Reply