comparison data/model/RangeSummarisableTimeValueModel.h @ 297:c022976d18e8

* Merge from sv-match-alignment branch (excluding alignment-specific document). - add aggregate wave model (not yet complete enough to be added as a true model in a layer, but there's potential) - add play solo mode - add alignment model -- unused in plain SV - fix two plugin leaks - add m3u playlist support (opens all files at once, potentially hazardous) - fix retrieval of pre-encoded URLs - add ability to resample audio files on import, so as to match rates with other files previously loaded; add preference for same - add preliminary support in transform code for range and rate of transform input - reorganise preferences dialog, move dark-background option to preferences, add option for temporary directory location
author Chris Cannam
date Fri, 28 Sep 2007 13:56:38 +0000
parents 185454896a76
children 5877d68815c7
comparison
equal deleted inserted replaced
296:2b6c99b607f1 297:c022976d18e8
2 2
3 /* 3 /*
4 Sonic Visualiser 4 Sonic Visualiser
5 An audio file viewer and annotation editor. 5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London. 6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Chris Cannam. 7 This file copyright 2006-2007 Chris Cannam and QMUL.
8 8
9 This program is free software; you can redistribute it and/or 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 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 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
19 #include <QObject> 19 #include <QObject>
20 20
21 #include "DenseTimeValueModel.h" 21 #include "DenseTimeValueModel.h"
22 #include "base/ZoomConstraint.h" 22 #include "base/ZoomConstraint.h"
23 23
24 class AlignmentModel;
25
24 /** 26 /**
25 * Base class for models containing dense two-dimensional data (value 27 * Base class for models containing dense two-dimensional data (value
26 * against time) that may be meaningfully represented in a zoomed view 28 * against time) that may be meaningfully represented in a zoomed view
27 * using min/max range summaries. Audio waveform data is an obvious 29 * using min/max range summaries. Audio waveform data is an obvious
28 * example: think "peaks and minima" for "ranges". 30 * example: think "peaks and minima" for "ranges".
31 class RangeSummarisableTimeValueModel : public DenseTimeValueModel 33 class RangeSummarisableTimeValueModel : public DenseTimeValueModel
32 { 34 {
33 Q_OBJECT 35 Q_OBJECT
34 36
35 public: 37 public:
38 RangeSummarisableTimeValueModel() : m_alignment(0) { }
39
36 struct Range 40 struct Range
37 { 41 {
38 float min; 42 float min;
39 float max; 43 float max;
40 float absmean; 44 float absmean;
66 * Return the range between the given start and end frames, 70 * Return the range between the given start and end frames,
67 * summarised at a block size equal to the distance between start 71 * summarised at a block size equal to the distance between start
68 * and end frames. 72 * and end frames.
69 */ 73 */
70 virtual Range getRange(size_t channel, size_t start, size_t end) const = 0; 74 virtual Range getRange(size_t channel, size_t start, size_t end) const = 0;
75
76 virtual void setAlignment(AlignmentModel *alignment); // I take ownership
77 virtual const Model *getAlignmentReference() const;
78 virtual size_t alignToReference(size_t frame) const;
79 virtual size_t alignFromReference(size_t referenceFrame) const;
80 virtual int getAlignmentCompletion() const;
81
82 signals:
83 void alignmentCompletionChanged();
84
85 protected:
86 AlignmentModel *m_alignment;
71 }; 87 };
72 88
73 #endif 89 #endif
74 90