MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / load

Method load

Source/Core/CtrlrPanel/CtrlrPanelResource.cpp:148–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void CtrlrPanelResource::load()
149{
150 calculateHash();
151
152 if (resourceLoaded || resourceType == ImageRes)
153 {
154 // ImageCache deals with that
155 }
156 else if (resourceType == AudioRes
157 || resourceType == XmlRes
158 || resourceType == TextRes
159 || resourceType ==FontRes)
160 {
161 // We don't load theese types, they will be rad when accessed
162 }
163 else if (resourceType == DataRes)
164 {
165 // Theese types go into memory
166
167 resourceDataFile.loadFileAsData (data);
168 }
169
170 setProperty (Ids::resourceLoadedTime, Time::getCurrentTime().toMilliseconds());
171 setProperty (Ids::resourceSize, resourceDataFile.getSize());
172
173 resourceLoaded = true;
174}
175
176Time CtrlrPanelResource::getLoadedTime()
177{

Callers 1

getHashCodeMethod · 0.45

Calls 5

calculateHashFunction · 0.85
setPropertyFunction · 0.85
toMillisecondsMethod · 0.80
loadFileAsDataMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected