| 157 | } |
| 158 | |
| 159 | void LocalPhotoFrameSource::requestImageUpdate() |
| 160 | { |
| 161 | // find the next valid image |
| 162 | bool loadCurrent = !_items.empty() && _current.isValid(); |
| 163 | if (_current.isValid()) |
| 164 | { |
| 165 | for (int i = 0; i < _items.size(); ++i) |
| 166 | { |
| 167 | if (_items[i].equals(_current)) |
| 168 | { |
| 169 | for (int j = 1; j < _items.size(); ++j) |
| 170 | { |
| 171 | int nextIndex = (i+j) % _items.size(); |
| 172 | if (_items[nextIndex].isValid()) |
| 173 | { |
| 174 | _current = _items[nextIndex]; |
| 175 | ++_imageUpdateCount; |
| 176 | break; |
| 177 | } |
| 178 | } |
| 179 | break; |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | else if (!_items.empty()) |
| 184 | { |
| 185 | _current = _items[0]; |
| 186 | loadCurrent = _current.isValid(); |
| 187 | ++_imageUpdateCount; |
| 188 | } |
| 189 | |
| 190 | if (loadCurrent) |
| 191 | { |
| 192 | // load the image (so that it will swap) |
| 193 | if (this->_textureDetail == HiResImage) |
| 194 | texMgr->loadTexture(GLTextureObject(Load|Reload, _textureBufferId, _current.getTexturePath(), HiResImage, IdlePriority)); |
| 195 | else |
| 196 | texMgr->loadTexture(GLTextureObject(Load|Compress|Reload, _textureBufferId, _current.getTexturePath(), SampledImage, IdlePriority)); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void LocalPhotoFrameSource::onImageUpdate(const FileTransfer& transfer) |
| 201 | { |
nothing calls this directly
no test coverage detected