svcore
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2006 Chris Cannam. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _PLAY_PARAMETERS_H_ 00017 #define _PLAY_PARAMETERS_H_ 00018 00019 #include <QObject> 00020 00021 #include "XmlExportable.h" 00022 00023 class PlayParameters : public QObject, public XmlExportable 00024 { 00025 Q_OBJECT 00026 00027 public: 00028 PlayParameters() : m_playMuted(false), m_playPan(0.0), m_playGain(1.0) { } 00029 00030 virtual bool isPlayMuted() const { return m_playMuted; } 00031 virtual bool isPlayAudible() const { return !m_playMuted; } 00032 virtual float getPlayPan() const { return m_playPan; } // -1.0 -> 1.0 00033 virtual float getPlayGain() const { return m_playGain; } 00034 00035 virtual QString getPlayClipId() const { return m_playClipId; } 00036 00037 virtual void copyFrom(const PlayParameters *); 00038 00039 virtual void toXml(QTextStream &stream, 00040 QString indent = "", 00041 QString extraAttributes = "") const; 00042 00043 public slots: 00044 virtual void setPlayMuted(bool muted); 00045 virtual void setPlayAudible(bool nonMuted); 00046 virtual void setPlayPan(float pan); 00047 virtual void setPlayGain(float gain); 00048 virtual void setPlayClipId(QString id); 00049 00050 signals: 00051 void playParametersChanged(); 00052 void playMutedChanged(bool); 00053 void playAudibleChanged(bool); 00054 void playPanChanged(float); 00055 void playGainChanged(float); 00056 void playClipIdChanged(QString); 00057 00058 protected: 00059 bool m_playMuted; 00060 float m_playPan; 00061 float m_playGain; 00062 QString m_playClipId; 00063 00064 private: 00065 PlayParameters(const PlayParameters &); 00066 PlayParameters &operator=(const PlayParameters &); 00067 }; 00068 00069 #endif 00070 00071 00072 00073