diff data/model/Model.cpp @ 1507:fe579dc6a713 import-audio-data

Merge from default branch
author Chris Cannam
date Tue, 04 Sep 2018 13:19:20 +0100
parents 9d37c8cf9686
children d3814e07b8aa
line wrap: on
line diff
--- a/data/model/Model.cpp	Fri Jun 29 13:52:36 2018 +0100
+++ b/data/model/Model.cpp	Tue Sep 04 13:19:20 2018 +0100
@@ -40,6 +40,20 @@
     }
 }
 
+int
+Model::getNextId()
+{
+    static int nextId = 0;
+    static QMutex mutex;
+    QMutexLocker locker(&mutex);
+    int i = nextId;
+    if (nextId == INT_MAX) {
+        nextId = INT_MIN;
+    }
+    ++nextId;
+    return i;
+}
+
 void
 Model::setSourceModel(Model *model)
 {