]> git.sesse.net Git - nageru/blobdiff - futatabi/clip_list.cpp
Call the done callback only when the entire playlist is done. Simplifies a fair amoun...
[nageru] / futatabi / clip_list.cpp
index b456c75ca77ee4ee2a3beb029b6b62d5ada8275b..0bb73ae404e367bc8c52d106928a4e435749c044 100644 (file)
@@ -220,7 +220,7 @@ QVariant ClipList::headerData(int section, Qt::Orientation orientation, int role
        case Column::DURATION:
                return "Duration";
        default:
-               if (section >= int(Column::CAMERA_1) && section < int(Column::CAMERA_1) + num_cameras) {
+               if (is_camera_column(section)) {
                        return QString::fromStdString("Camera " + to_string(section - int(Column::CAMERA_1) + 1));
                } else {
                        return "";
@@ -329,7 +329,7 @@ bool PlayList::setData(const QModelIndex &index, const QVariant &value, int role
        case Column::CAMERA: {
                bool ok;
                int camera_idx = value.toInt(&ok);
-               if (!ok || camera_idx < 1 || camera_idx > num_cameras) {
+               if (!ok || camera_idx < 1 || camera_idx > int(num_cameras)) {
                        return false;
                }
                clips[row].stream_idx = camera_idx - 1;
@@ -433,25 +433,6 @@ void ClipList::change_num_cameras(size_t num_cameras)
        emit any_content_changed();
 }
 
-void PlayList::set_currently_playing(int index, double progress)
-{
-       int old_index = currently_playing_index;
-       int column = int(Column::PLAYING);
-       if (index != old_index) {
-               currently_playing_index = index;
-               play_progress = progress;
-               if (old_index != -1) {
-                       emit dataChanged(this->index(old_index, column), this->index(old_index, column));
-               }
-               if (index != -1) {
-                       emit dataChanged(this->index(index, column), this->index(index, column));
-               }
-       } else if (index != -1 && fabs(progress - play_progress) > 1e-3) {
-               play_progress = progress;
-               emit dataChanged(this->index(index, column), this->index(index, column));
-       }
-}
-
 void PlayList::set_progress(const map<size_t, double> &progress)
 {
        const int column = int(Column::PLAYING);