use Qt Signals & Slots for progress tracking
[mussa.git] / alg / mussa.hpp
index cfb9ece6b95b9ef95d4ffce13283e8b9d03081b9..55547ec7cc3d60598b0f85a80da820d533aa15d8 100644 (file)
@@ -13,6 +13,8 @@
 //                        ----------------------------------------
 //                          ---------- mussa_class.hh -----------
 //                        ----------------------------------------
+#include <QObject> 
+
 #include <boost/filesystem/path.hpp>
 
 #include <list>
 
 std::string int_to_str(int an_int);
 
-class Mussa
+class Mussa : public QObject
 {
-  public:
+    Q_OBJECT 
+
+signals:
+    //! call whatever signaling system we want
+    void progress(const std::string& description, int cur, int max);
+
+public:
     enum analysis_modes { TransitiveNway, RadialNway, EntropyNway, 
                           RecursiveNway };
 
@@ -63,9 +71,6 @@ class Mussa
      */
     int size() const;
 
-    void set_analysis_callback(analysis_callback cb);
-    analysis_callback get_analysis_calback() const;
-
     //! set number of bases for this window size
     void set_window(int a_window);
     //! get number of bases for the sliding window
@@ -174,8 +179,6 @@ class Mussa
     bool win_append; 
     //! should we append _t<threshold> to the saved analysis
     bool thres_append;
-    //! callback, periodically called as we run an analysis
-    analysis_callback analysis_cb;
 
     //! sequence data
     std::vector<Sequence> the_seqs;