Browse Source

BLOCKS: Fixed comment in getMemorySize and added getHeapMemorySize

tags/2021-05-28
Daniel Walz Julian Storer 7 years ago
parent
commit
3c124095dd
2 changed files with 10 additions and 1 deletions
  1. +4
    -1
      modules/juce_blocks_basics/blocks/juce_Block.h
  2. +6
    -0
      modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp

+ 4
- 1
modules/juce_blocks_basics/blocks/juce_Block.h View File

@@ -264,9 +264,12 @@ public:
virtual void removeProgramEventListener (ProgramEventListener*);
//==============================================================================
/** Returns the size of the data block that setDataByte and other functions can write to. */
/** Returns the overall memory of the block. */
virtual uint32 getMemorySize() = 0;
/** Returns the size of the data block that setDataByte and other functions can write to. */
virtual uint32 getHeapMemorySize() = 0;
/** Sets a single byte on the littlefoot heap. */
virtual void setDataByte (size_t offset, uint8 value) = 0;


+ 6
- 0
modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp View File

@@ -1741,6 +1741,12 @@ struct PhysicalTopologySource::Internal
return modelData.programAndHeapSize;
}
uint32 getHeapMemorySize() override
{
jassert (isPositiveAndNotGreaterThan (programSize, modelData.programAndHeapSize));
return modelData.programAndHeapSize - programSize;
}
void setDataByte (size_t offset, uint8 value) override
{
remoteHeap.setByte (programSize + offset, value);


Loading…
Cancel
Save