Stream events **********/
| 285 | |
| 286 | /********** Stream events **********/ |
| 287 | int PlaybackManager::streamCountUp() |
| 288 | { |
| 289 | std::lock_guard<std::mutex> lock(mutex_); |
| 290 | |
| 291 | int state = tickCounter_.lock()->countUp(); |
| 292 | |
| 293 | if (state > 0) { // Tick process in playback |
| 294 | checkValidPosition(); |
| 295 | tickProcess(state); |
| 296 | } |
| 297 | else if (!state) { // Step process in playback |
| 298 | checkValidPosition(); |
| 299 | if (stepDown()) { |
| 300 | stepProcess(); |
| 301 | if (!isFindNextStep_) findNextStep(); |
| 302 | } |
| 303 | else if (!isPlayingStep()) { |
| 304 | stopPlay(); |
| 305 | } |
| 306 | } |
| 307 | else { // Stop playback |
| 308 | for (auto& attrib : songStyle_.trackAttribs) { |
| 309 | opnaCtrl_->tickEvent(attrib.source, attrib.channelInSource); |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | return state; |
| 314 | } |
| 315 | |
| 316 | bool PlaybackManager::stepDown() |
| 317 | { |
no test coverage detected