PlayParameters.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.
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_PLAY_PARAMETERS_H
17 #define SV_PLAY_PARAMETERS_H
18 
19 #include <QObject>
20 
21 #include "XmlExportable.h"
22 
23 class PlayParameters : public QObject, public XmlExportable
24 {
25  Q_OBJECT
26 
27 public:
28  PlayParameters() : m_playMuted(false), m_playPan(0.0), m_playGain(1.0) { }
29 
30  virtual bool isPlayMuted() const { return m_playMuted; }
31  virtual bool isPlayAudible() const { return !m_playMuted; }
32  virtual float getPlayPan() const { return m_playPan; } // -1.0 -> 1.0
33  virtual float getPlayGain() const { return m_playGain; }
34 
35  virtual QString getPlayClipId() const { return m_playClipId; }
36 
37  virtual void copyFrom(const PlayParameters *);
38 
39  void toXml(QTextStream &stream,
40  QString indent = "",
41  QString extraAttributes = "") const override;
42 
43 public slots:
44  virtual void setPlayMuted(bool muted);
45  virtual void setPlayAudible(bool nonMuted);
46  virtual void setPlayPan(float pan);
47  virtual void setPlayGain(float gain);
48  virtual void setPlayClipId(QString id);
49 
50 signals:
51  void playParametersChanged();
52  void playMutedChanged(bool);
53  void playAudibleChanged(bool);
54  void playPanChanged(float);
55  void playGainChanged(float);
56  void playClipIdChanged(QString);
57 
58 protected:
60  float m_playPan;
61  float m_playGain;
62  QString m_playClipId;
63 
64 private:
67 };
68 
69 #endif
70 
71 
72 
73 
virtual bool isPlayMuted() const
void playPanChanged(float)
void playAudibleChanged(bool)
void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const override
Stream this exportable object out to XML on a text stream.
virtual QString getPlayClipId() const
virtual float getPlayPan() const
QString m_playClipId
virtual void setPlayAudible(bool nonMuted)
PlayParameters & operator=(const PlayParameters &)
void playParametersChanged()
void playMutedChanged(bool)
virtual float getPlayGain() const
virtual void setPlayClipId(QString id)
void playGainChanged(float)
void playClipIdChanged(QString)
virtual bool isPlayAudible() const
virtual void copyFrom(const PlayParameters *)
virtual void setPlayGain(float gain)
virtual void setPlayMuted(bool muted)
virtual void setPlayPan(float pan)