summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ea502b7)
that was already playing.
Non-infinite clips were okay all along, but infinite clips would have zero
(well, negative) length.
void MainWindow::content_changed()
{
// If we are playing, update the part of the playlist that's not playing yet.
void MainWindow::content_changed()
{
// If we are playing, update the part of the playlist that's not playing yet.
- vector<ClipWithID> clips;
- for (unsigned row = 0; row < playlist_clips->size(); ++row) {
- clips.emplace_back(*playlist_clips->clip_with_id(row));
- }
+ vector<ClipWithID> clips = get_playlist(0, playlist_clips->size());
live_player->splice_play(clips);
// Serialize the state.
live_player->splice_play(clips);
// Serialize the state.
}
unsigned start_row = selected->selectedRows(0)[0].row();
}
unsigned start_row = selected->selectedRows(0)[0].row();
- vector<ClipWithID> clips;
- for (unsigned row = start_row; row < playlist_clips->size(); ++row) {
- ClipWithID clip = *playlist_clips->clip_with_id(row);
- if (clip.clip.pts_out == -1) {
- clip.clip.pts_out = clip.clip.pts_in + int64_t(TIMEBASE) * 86400 * 7; // One week; effectively infinite, but without overflow issues.
- }
- clips.emplace_back(clip);
- }
+ vector<ClipWithID> clips = get_playlist(start_row, playlist_clips->size());
live_player->play(clips);
playlist_clips->set_progress({ { start_row, 0.0f } });
ui->playlist->selectionModel()->clear();
live_player->play(clips);
playlist_clips->set_progress({ { start_row, 0.0f } });
ui->playlist->selectionModel()->clear();
enable_or_disable_queue_button();
}
enable_or_disable_queue_button();
}
+vector<ClipWithID> MainWindow::get_playlist(size_t start_row, size_t end_row)
+{
+ vector<ClipWithID> clips;
+ for (unsigned row = start_row; row < end_row; ++row) {
+ ClipWithID clip = *playlist_clips->clip_with_id(row);
+ if (clip.clip.pts_out == -1) {
+ clip.clip.pts_out = clip.clip.pts_in + int64_t(TIMEBASE) * 86400 * 7; // One week; effectively infinite, but without overflow issues.
+ }
+ clips.emplace_back(clip);
+ }
+ return clips;
+}
+
void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_left)
{
char time_str[256];
void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_left)
{
char time_str[256];
void playlist_selection_changed();
void clip_list_selection_changed(const QModelIndex ¤t, const QModelIndex &previous);
void playlist_selection_changed();
void clip_list_selection_changed(const QModelIndex ¤t, const QModelIndex &previous);
+ std::vector<ClipWithID> get_playlist(size_t start_row, size_t end_row);
void resizeEvent(QResizeEvent *event) override;
bool eventFilter(QObject *watched, QEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
bool eventFilter(QObject *watched, QEvent *event) override;