comparison base/Clipboard.h @ 74:47fd14e29813

* Fix long-standing off-by-1 bug in WaveFileModel that was getting us the wrong values for almost all audio data when merging channels (channel == -1) * Implement cut, copy and paste * Make draw mode work properly in time value layer * Minor fixes to CSV import
author Chris Cannam
date Fri, 07 Apr 2006 17:50:33 +0000
parents
children 516819f2b97b 6f6ab834449d
comparison
equal deleted inserted replaced
73:e9b8b51f6326 74:47fd14e29813
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.
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 _CLIPBOARD_H_
17 #define _CLIPBOARD_H_
18
19 #include <QString>
20 #include <vector>
21
22 class Clipboard
23 {
24 public:
25 class Point
26 {
27 public:
28 Point(long frame, QString label);
29 Point(long frame, float value, QString label);
30 Point(long frame, float value, size_t duration, QString label);
31 Point(const Point &point);
32 Point &operator=(const Point &point);
33
34 bool haveFrame() const;
35 long getFrame() const;
36
37 bool haveValue() const;
38 float getValue() const;
39
40 bool haveDuration() const;
41 size_t getDuration() const;
42
43 bool haveLabel() const;
44 QString getLabel() const;
45
46 private:
47 bool m_haveFrame;
48 long m_frame;
49 bool m_haveValue;
50 float m_value;
51 bool m_haveDuration;
52 size_t m_duration;
53 bool m_haveLabel;
54 QString m_label;
55 };
56
57 Clipboard();
58 ~Clipboard();
59
60 typedef std::vector<Point> PointList;
61
62 void clear();
63 bool empty() const;
64 const PointList &getPoints() const;
65 void setPoints(const PointList &points);
66 void addPoint(const Point &point);
67
68 protected:
69 PointList m_points;
70 };
71
72 #endif