| 264 | } |
| 265 | |
| 266 | bool RundownFileRecorderWidget::executeCommand(Playout::PlayoutType type) |
| 267 | { |
| 268 | if (type == Playout::PlayoutType::Stop) |
| 269 | executeStop(); |
| 270 | else if (type == Playout::PlayoutType::Play) |
| 271 | { |
| 272 | if (this->command.getDelay() < 0) |
| 273 | return true; |
| 274 | |
| 275 | if (!this->model.getDeviceName().isEmpty()) // The user need to select a device. |
| 276 | { |
| 277 | const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(this->model.getDeviceName()).getChannelFormats().split(","); |
| 278 | if (this->command.getChannel() > channelFormats.count()) |
| 279 | return true; |
| 280 | |
| 281 | this->itemScheduler.schedulePlayAndStop( |
| 282 | this->command.getDelay(), |
| 283 | this->command.getDuration(), |
| 284 | this->delayType, |
| 285 | DatabaseManager::getInstance().getFormat(channelFormats[this->command.getChannel() - 1]).getFramesPerSecond().toDouble()); |
| 286 | } |
| 287 | } |
| 288 | else if (type == Playout::PlayoutType::PlayNow) |
| 289 | executePlay(); |
| 290 | else if (type == Playout::PlayoutType::Clear) |
| 291 | executeStop(); |
| 292 | else if (type == Playout::PlayoutType::ClearVideoLayer) |
| 293 | executeStop(); |
| 294 | else if (type == Playout::PlayoutType::ClearChannel) |
| 295 | executeStop(); |
| 296 | |
| 297 | if (this->active) |
| 298 | this->animation->start(1); |
| 299 | |
| 300 | return true; |
| 301 | } |
| 302 | |
| 303 | void RundownFileRecorderWidget::executeStop() |
| 304 | { |
nothing calls this directly
no test coverage detected