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