I put some debug in the Chunk routines, as follows
on Module load
onGetChunkLen called, is_preset = 0, size calculated as 604
onGetChunkLen called, is_preset = 0, size calculated as 604
onSetChunk called (loading), size 612, is_preset = 0
on Module save
onGetChunkLen called, is_preset = -1, size calculated as 620
onGetChunk called (saving), is_preset = 1
onGetChunkLen called, is_preset = 0, size calculated as 620
onGetChunk called (saving), is_preset = 0
on Preset load
onGetChunkLen called, is_preset = -1, size calculated as 612
onGetChunkLen called, is_preset = 1, size calculated as 612
onSetChunk called (loading), size 620, is_preset = 1
onPreset save
onGetChunkLen called, is_preset = -1, size calculated as 620
onGetChunk called (saving), is_preset = 1
OK, got to go, I'll expand on this later !
onGetChunkLen called twice
-
sm_jamieson
- Member
- Posts: 551
- Contact:
There appears to be the following issues:
Preset value of -1:
It is clear that the Preset -1 value is supposed to be a true value, but surely this is a bug, as if it is compared to the LongBool TRUE value then the check will fail. If it is checked using the C "if (value)" syntax of course it will be OK, as in C any non-zero value is "true".
onGetChunkLen called twice when a patch or preset is being recalled:
I don't know why if should be called at all when something is being loaded. However, this might be the type of routine that Usine may call whenever it wants (like the onPaint routines, etc).
The reason onGetChunkLen being called when it is not required is a pain in my modules is that I have a dynamically created data to be stored, so I have to create the data in the OnGetChunkLen in order to know what the length will be, which uses up some processing power, so I don't want to do this unnecessarily.
Anyway, I just thought I'd point this out in case it catches anyone out. But I'll probably raise the -1 as a bug.
Simon.
Preset value of -1:
It is clear that the Preset -1 value is supposed to be a true value, but surely this is a bug, as if it is compared to the LongBool TRUE value then the check will fail. If it is checked using the C "if (value)" syntax of course it will be OK, as in C any non-zero value is "true".
onGetChunkLen called twice when a patch or preset is being recalled:
I don't know why if should be called at all when something is being loaded. However, this might be the type of routine that Usine may call whenever it wants (like the onPaint routines, etc).
The reason onGetChunkLen being called when it is not required is a pain in my modules is that I have a dynamically created data to be stored, so I have to create the data in the OnGetChunkLen in order to know what the length will be, which uses up some processing power, so I don't want to do this unnecessarily.
Anyway, I just thought I'd point this out in case it catches anyone out. But I'll probably raise the -1 as a bug.
Simon.
Who is online
Users browsing this forum: No registered users and 4 guests
