Chris@394
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@394
|
2
|
Chris@394
|
3 /*
|
Chris@394
|
4 Sonic Visualiser
|
Chris@394
|
5 An audio file viewer and annotation editor.
|
Chris@394
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@394
|
7 This file copyright 2006 Chris Cannam and QMUL.
|
Chris@394
|
8
|
Chris@394
|
9 This program is free software; you can redistribute it and/or
|
Chris@394
|
10 modify it under the terms of the GNU General Public License as
|
Chris@394
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@394
|
12 License, or (at your option) any later version. See the file
|
Chris@394
|
13 COPYING included with this distribution for more information.
|
Chris@394
|
14 */
|
Chris@394
|
15
|
Chris@394
|
16 #ifndef _VIEW_MANAGER_BASE_H_
|
Chris@394
|
17 #define _VIEW_MANAGER_BASE_H_
|
Chris@394
|
18
|
Chris@394
|
19 #include <QObject>
|
Chris@394
|
20
|
Chris@394
|
21 #include "Selection.h"
|
Chris@394
|
22
|
Chris@394
|
23 class AudioPlaySource;
|
Chris@394
|
24
|
Chris@394
|
25 /**
|
Chris@394
|
26 * Base class for ViewManager, with no GUI content. This should
|
Chris@394
|
27 * define all of the ViewManager interface that e.g. audio I/O classes
|
Chris@394
|
28 * need to refer to.
|
Chris@394
|
29 */
|
Chris@394
|
30
|
Chris@394
|
31 class ViewManagerBase : public QObject
|
Chris@394
|
32 {
|
Chris@394
|
33 Q_OBJECT
|
Chris@394
|
34
|
Chris@394
|
35 public:
|
Chris@394
|
36 virtual void setAudioPlaySource(AudioPlaySource *source) = 0;
|
Chris@394
|
37
|
Chris@394
|
38 virtual size_t alignPlaybackFrameToReference(size_t) const = 0;
|
Chris@394
|
39 virtual size_t alignReferenceToPlaybackFrame(size_t) const = 0;
|
Chris@394
|
40
|
Chris@394
|
41 virtual const MultiSelection &getSelection() const = 0;
|
Chris@394
|
42 virtual const MultiSelection::SelectionList &getSelections() const = 0;
|
Chris@394
|
43 virtual size_t constrainFrameToSelection(size_t frame) const = 0;
|
Chris@394
|
44
|
Chris@394
|
45 virtual Selection getContainingSelection
|
Chris@394
|
46 (size_t frame, bool defaultToFollowing) const = 0;
|
Chris@394
|
47
|
Chris@394
|
48 virtual bool getPlayLoopMode() const = 0;
|
Chris@394
|
49 virtual bool getPlaySelectionMode() const = 0;
|
Chris@394
|
50 virtual bool getPlaySoloMode() const = 0;
|
Chris@394
|
51 virtual bool getAlignMode() const = 0;
|
Chris@394
|
52
|
Chris@394
|
53 signals:
|
Chris@394
|
54 /** Emitted when the selection has changed. */
|
Chris@394
|
55 void selectionChanged();
|
Chris@394
|
56
|
Chris@394
|
57 /** Emitted when the play loop mode has been changed. */
|
Chris@394
|
58 void playLoopModeChanged();
|
Chris@394
|
59 void playLoopModeChanged(bool);
|
Chris@394
|
60
|
Chris@394
|
61 /** Emitted when the play selection mode has been changed. */
|
Chris@394
|
62 void playSelectionModeChanged();
|
Chris@394
|
63 void playSelectionModeChanged(bool);
|
Chris@394
|
64
|
Chris@394
|
65 /** Emitted when the play solo mode has been changed. */
|
Chris@394
|
66 void playSoloModeChanged();
|
Chris@394
|
67 void playSoloModeChanged(bool);
|
Chris@394
|
68
|
Chris@394
|
69 /** Emitted when the alignment mode has been changed. */
|
Chris@394
|
70 void alignModeChanged();
|
Chris@394
|
71 void alignModeChanged(bool);
|
Chris@394
|
72 };
|
Chris@394
|
73
|
Chris@394
|
74 #endif
|
Chris@394
|
75
|