]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/selection.cpp
Match the API change in GLtk
[r2c2.git] / source / designer / selection.cpp
index 5f71e8b68a5b6be56d72cb2d73f878689807e7d2..c6b1e390d97cb8f80f2aad3ea3f0cc60171b2ac0 100644 (file)
@@ -6,6 +6,7 @@ Distributed under the GPL
 */
 
 #include <algorithm>
+#include "libmarklin/block.h"
 #include "selection.h"
 
 using namespace std;
@@ -94,3 +95,21 @@ void Selection::select_linked()
        if(changed)
                signal_changed.emit();
 }
+
+void Selection::select_blocks()
+{
+       bool changed = false;
+       for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+       {
+               const set<Track *> &btracks = (*i)->get_block().get_tracks();
+               for(set<Track *>::iterator j=btracks.begin(); j!=btracks.end(); ++j)
+                       if(!tracks.count(*j))
+                       {
+                               tracks.insert(*j);
+                               changed = true;
+                       }
+       }
+
+       if(changed)
+               signal_changed.emit();
+}