Chris@0
|
1
|
Chris@58
|
2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@0
|
3
|
Chris@0
|
4 /*
|
Chris@59
|
5 Sonic Visualiser
|
Chris@59
|
6 An audio file viewer and annotation editor.
|
Chris@59
|
7 Centre for Digital Music, Queen Mary, University of London.
|
Chris@59
|
8 This file copyright 2006 Chris Cannam.
|
Chris@0
|
9
|
Chris@59
|
10 This program is free software; you can redistribute it and/or
|
Chris@59
|
11 modify it under the terms of the GNU General Public License as
|
Chris@59
|
12 published by the Free Software Foundation; either version 2 of the
|
Chris@59
|
13 License, or (at your option) any later version. See the file
|
Chris@59
|
14 COPYING included with this distribution for more information.
|
Chris@0
|
15 */
|
Chris@0
|
16
|
Chris@0
|
17 #ifndef _PANESTACK_H_
|
Chris@0
|
18 #define _PANESTACK_H_
|
Chris@0
|
19
|
Chris@0
|
20 #include <QSplitter>
|
Chris@0
|
21
|
Chris@0
|
22 class QWidget;
|
Chris@0
|
23 class QLabel;
|
Chris@52
|
24 class View;
|
Chris@0
|
25 class Pane;
|
Chris@17
|
26 class Layer;
|
Chris@0
|
27 class ViewManager;
|
Chris@0
|
28 class PropertyContainer;
|
Chris@0
|
29 class PropertyStack;
|
Chris@0
|
30
|
Chris@0
|
31 class PaneStack : public QSplitter
|
Chris@0
|
32 {
|
Chris@0
|
33 Q_OBJECT
|
Chris@0
|
34
|
Chris@0
|
35 public:
|
Chris@0
|
36 PaneStack(QWidget *parent, ViewManager *viewManager);
|
Chris@0
|
37
|
Chris@0
|
38 Pane *addPane(bool suppressPropertyBox = false); // I own the returned value
|
Chris@52
|
39 void deletePane(Pane *pane); // Deletes the pane, but _not_ its layers
|
Chris@0
|
40
|
Chris@52
|
41 int getPaneCount() const; // Returns only count of visible panes
|
Chris@52
|
42 Pane *getPane(int n); // Of visible panes; I own the returned value
|
Chris@52
|
43
|
Chris@52
|
44 void hidePane(Pane *pane); // Also removes pane from getPane/getPaneCount
|
Chris@52
|
45 void showPane(Pane *pane); // Returns pane to getPane/getPaneCount
|
Chris@52
|
46
|
Chris@52
|
47 int getHiddenPaneCount() const;
|
Chris@52
|
48 Pane *getHiddenPane(int n); // I own the returned value
|
Chris@43
|
49
|
Chris@0
|
50 void setCurrentPane(Pane *pane);
|
Chris@19
|
51 void setCurrentLayer(Pane *pane, Layer *layer);
|
Chris@0
|
52 Pane *getCurrentPane();
|
Chris@0
|
53
|
Chris@0
|
54 signals:
|
Chris@0
|
55 void currentPaneChanged(Pane *pane);
|
Chris@17
|
56 void currentLayerChanged(Pane *pane, Layer *layer);
|
Chris@0
|
57
|
Chris@0
|
58 public slots:
|
Chris@0
|
59 void propertyContainerAdded(PropertyContainer *);
|
Chris@0
|
60 void propertyContainerRemoved(PropertyContainer *);
|
Chris@52
|
61 void propertyContainerSelected(View *client, PropertyContainer *);
|
Chris@0
|
62 void paneInteractedWith();
|
Chris@0
|
63
|
Chris@0
|
64 protected:
|
Chris@0
|
65 Pane *m_currentPane;
|
Chris@52
|
66
|
Chris@52
|
67 struct PaneRec
|
Chris@52
|
68 {
|
Chris@52
|
69 Pane *pane;
|
Chris@52
|
70 QWidget *propertyStack;
|
Chris@52
|
71 QLabel *currentIndicator;
|
Chris@52
|
72 };
|
Chris@52
|
73
|
Chris@52
|
74 std::vector<PaneRec> m_panes;
|
Chris@52
|
75 std::vector<PaneRec> m_hiddenPanes;
|
Chris@52
|
76
|
Chris@0
|
77 ViewManager *m_viewManager; // I don't own this
|
Chris@0
|
78 void sizePropertyStacks();
|
Chris@0
|
79 };
|
Chris@0
|
80
|
Chris@0
|
81 #endif
|
Chris@0
|
82
|