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 SV_VIEW_MANAGER_BASE_H
17 #define SV_VIEW_MANAGER_BASE_H
18 
19 #include <QObject>
20 
21 #include "Selection.h"
22 
23 class AudioPlaySource;
24 class AudioRecordTarget;
25 
32 class ViewManagerBase : public QObject
33 {
34  Q_OBJECT
35 
36 public:
37  virtual ~ViewManagerBase();
38 
39  virtual void setAudioPlaySource(AudioPlaySource *source) = 0;
40  virtual void setAudioRecordTarget(AudioRecordTarget *target) = 0;
41 
44 
45  virtual const MultiSelection &getSelection() const = 0;
46  virtual const MultiSelection::SelectionList &getSelections() const = 0;
47  virtual sv_frame_t constrainFrameToSelection(sv_frame_t frame) const = 0;
48 
50  (sv_frame_t frame, bool defaultToFollowing) const = 0;
51 
52  virtual bool getPlayLoopMode() const = 0;
53  virtual bool getPlaySelectionMode() const = 0;
54  virtual bool getPlaySoloMode() const = 0;
55  virtual bool getAlignMode() const = 0;
56 
57 signals:
59  void selectionChanged();
60 
62  void playLoopModeChanged();
63  void playLoopModeChanged(bool);
64 
67  void playSelectionModeChanged(bool);
68 
70  void playSoloModeChanged();
71  void playSoloModeChanged(bool);
72 
74  void alignModeChanged();
75  void alignModeChanged(bool);
76 };
77 
78 #endif
79 
Simple interface for audio playback.
virtual void setAudioRecordTarget(AudioRecordTarget *target)=0
virtual ~ViewManagerBase()
void playSoloModeChanged()
Emitted when the play solo mode has been changed.
int64_t sv_frame_t
Frame index, the unit of our time axis.
Definition: BaseTypes.h:31
virtual sv_frame_t constrainFrameToSelection(sv_frame_t frame) const =0
A selection object simply represents a range in time, via start and end frame.
Definition: Selection.h:40
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 sv_frame_t alignReferenceToPlaybackFrame(sv_frame_t) const =0
Base class for ViewManager, with no GUI content.
void alignModeChanged()
Emitted when the alignment mode has been changed.
The record target API used by the view manager.
virtual const MultiSelection & getSelection() const =0
std::set< Selection > SelectionList
Definition: Selection.h:69
virtual void setAudioPlaySource(AudioPlaySource *source)=0
void playSelectionModeChanged()
Emitted when the play selection mode has been changed.
virtual sv_frame_t alignPlaybackFrameToReference(sv_frame_t) const =0
virtual bool getPlaySoloMode() const =0
virtual bool getAlignMode() const =0
virtual bool getPlayLoopMode() const =0
virtual bool getPlaySelectionMode() const =0
virtual Selection getContainingSelection(sv_frame_t frame, bool defaultToFollowing) const =0