Get end position of clip (trim end of video), which can be affected by the time curve.
| 412 | |
| 413 | // Get end position of clip (trim end of video), which can be affected by the time curve. |
| 414 | float Clip::End() const |
| 415 | { |
| 416 | // if a time curve is present, use its length |
| 417 | if (time.GetCount() > 1) |
| 418 | { |
| 419 | // Determine the FPS fo this clip |
| 420 | float fps = 24.0; |
| 421 | if (reader) |
| 422 | // file reader |
| 423 | fps = reader->info.fps.ToFloat(); |
| 424 | else |
| 425 | // Throw error if reader not initialized |
| 426 | throw ReaderClosed("No Reader has been initialized for this Clip. Call Reader(*reader) before calling this method."); |
| 427 | |
| 428 | return float(time.GetLength()) / fps; |
| 429 | } |
| 430 | else |
| 431 | // just use the duration (as detected by the reader) |
| 432 | return end; |
| 433 | } |
| 434 | |
| 435 | // Override End() position |
| 436 | void Clip::End(float value) { |
no test coverage detected