buzz forums
http://forums.jeskola.net/

Adding extra data to the bmx
http://forums.jeskola.net/viewtopic.php?f=3&t=2240
Page 1 of 1

Author:  chahur [ Wed Feb 01, 2017 2:48 pm ]
Post subject:  Adding extra data to the bmx

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 :-)

Author:  UNZ [ Wed Feb 01, 2017 9:57 pm ]
Post subject:  Re: Adding extra data to the bmx

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.

Author:  chahur [ Thu Feb 02, 2017 11:16 am ]
Post subject:  Re: Adding extra data to the bmx

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 ?

Author:  UNZ [ Fri Feb 03, 2017 11:25 pm ]
Post subject:  Re: Adding extra data to the bmx

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.

Author:  chahur [ Mon Feb 06, 2017 11:11 am ]
Post subject:  Re: Adding extra data to the bmx

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/