/[qspeakers]/branches/qtcharts/speaker.h
ViewVC logotype

Contents of /branches/qtcharts/speaker.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 270 - (show annotations)
Sun Oct 25 20:46:15 2020 UTC (7 months, 2 weeks ago) by ben
File MIME type: text/plain
File size: 2124 byte(s)
Implement dual VC display
1 #ifndef SPEAKER_H
2 #define SPEAKER_H
3
4 #include <QString>
5 #include <QMetaType>
6 #include <QDomNode>
7 #include <QDomElement>
8 #include <QDomDocument>
9 #include <QPainter>
10 #include <QRectF>
11
12 class Speaker
13 {
14
15 public:
16 Speaker();
17 Speaker(const Speaker& copy);
18 ~Speaker();
19
20 Speaker& operator=(const Speaker& copy);
21 bool operator!=(const Speaker& r) const;
22 bool operator==(const Speaker& r) const;
23 bool isValid(void) const;
24
25 void setVendor(const QString& vnd);
26 void setModel(const QString& mdl);
27
28 void setFs(double val);
29 void setVas(double val);
30 void setRe(double val);
31 void setQts(double val);
32 void setSd(double val);
33 void setXmax(double val);
34 void setZ(double val);
35 void setLe(double val);
36 void setQms(double val);
37 void setQes(double val);
38 void setSpl(double val);
39 void setPe(double val);
40 void setBL(double val);
41 void setDia(double val);
42 void setVc(int val);
43
44 QString getVendor() const;
45 QString getModel() const;
46
47 double getFs(void) const;
48 double getVas(void) const;
49 double getRe(void) const;
50 double getQts(void) const;
51 double getSd(void) const;
52 double getXmax() const;
53 double getZ() const;
54 double getLe() const;
55 double getQms() const;
56 double getQes() const;
57 double getSpl() const;
58 double getPe() const;
59 double getBL() const;
60 double getDia() const;
61 int getVc() const;
62
63 QDomElement toDomElement(QDomDocument& doc) const;
64 void fromDomElement(const QDomElement& el);
65 void render(QPainter *painter, const QRectF& area);
66
67 private:
68 QString vendor;
69 QString model;
70
71 double fs; // Hz
72 double vas; // L
73 double re; // Ohm
74 double qts; // unitless
75 double sd; // m² (emissive surface)
76 double xmax; // mm
77 double z; // Ohm
78 double le; // mH
79 double qms; // unitless
80 double qes; // unitless
81 double spl; // dB (sensitivity)
82 double pe; // W (maxpower in normal use)
83 double bl; // Tm (force factor)
84 double dia; // m (diameter)
85 int vc; // number of voice coils
86 };
87
88 Q_DECLARE_METATYPE(Speaker)
89
90 #endif // SPEAKER_H

  ViewVC Help
Powered by ViewVC 1.1.26