diff base/ViewManager.h @ 8:214054a0d8b8

* Hook up tool selection buttons to switch the cursor mode * Implement simple and multi-selection, snapping to the resolution of the current layer. You can't actually do anything with a selection yet
author Chris Cannam
date Mon, 23 Jan 2006 17:02:57 +0000
parents d86891498eef
children 73d85d19919f
line wrap: on
line diff
--- a/base/ViewManager.h	Thu Jan 19 17:59:11 2006 +0000
+++ b/base/ViewManager.h	Mon Jan 23 17:02:57 2006 +0000
@@ -14,6 +14,9 @@
 #include <QTimer>
 
 #include <map>
+#include <set>
+
+#include "Selection.h"
 
 class AudioPlaySource;
 class PlayParameters;
@@ -42,9 +45,34 @@
     PlayParameters *getPlayParameters(const Model *model);
     void clearPlayParameters();
 
+    bool isPlaying() const;
+
     unsigned long getGlobalCentreFrame() const;
     unsigned long getGlobalZoom() const;
 
+    typedef std::set<Selection> SelectionList;
+
+    bool haveInProgressSelection() const;
+    const Selection &getInProgressSelection(bool &exclusive) const;
+    void setInProgressSelection(const Selection &selection, bool exclusive);
+    void clearInProgressSelection();
+
+    const SelectionList &getSelections() const;
+    void setSelection(const Selection &selection);
+    void addSelection(const Selection &selection);
+    void removeSelection(const Selection &selection);
+    void clearSelections();
+
+    enum ToolMode {
+	NavigateMode,
+	SelectMode,
+        EditMode,
+	DrawMode,
+	TextMode
+    };
+    ToolMode getToolMode() const { return m_toolMode; }
+    void setToolMode(ToolMode mode);
+
 signals:
     /** Emitted when a widget pans.  The originator identifies the widget. */
     void centreFrameChanged(void *originator, unsigned long frame, bool locked);
@@ -58,6 +86,12 @@
     /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */
     void outputLevelsChanged(float left, float right);
 
+    /** Emitted when the selection has changed. */
+    void selectionChanged();
+
+    /** Emitted when the tool mode has been changed. */
+    void toolModeChanged();
+
 protected slots:
     void checkPlayStatus();
     void considerSeek(void *, unsigned long, bool);
@@ -71,6 +105,12 @@
     float m_lastLeft;
     float m_lastRight;
 
+    SelectionList m_selections;
+    Selection m_inProgressSelection;
+    bool m_inProgressExclusive;
+
+    ToolMode m_toolMode;
+
     std::map<const Model *, PlayParameters *> m_playParameters;
 };