annotate base/PlayParameterRepository.h @ 885:12a6140b3ae0

Add unclamped range mapper methods
author Chris Cannam
date Thu, 06 Feb 2014 15:31:16 +0000
parents 5858cc462d0a
children 1f98e28f70c6
rev   line source
Chris@49 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@28 2
Chris@28 3 /*
Chris@52 4 Sonic Visualiser
Chris@52 5 An audio file viewer and annotation editor.
Chris@52 6 Centre for Digital Music, Queen Mary, University of London.
Chris@52 7 This file copyright 2006 Chris Cannam.
Chris@28 8
Chris@52 9 This program is free software; you can redistribute it and/or
Chris@52 10 modify it under the terms of the GNU General Public License as
Chris@52 11 published by the Free Software Foundation; either version 2 of the
Chris@52 12 License, or (at your option) any later version. See the file
Chris@52 13 COPYING included with this distribution for more information.
Chris@28 14 */
Chris@28 15
Chris@28 16 #ifndef _PLAY_PARAMETER_REPOSITORY_H_
Chris@28 17 #define _PLAY_PARAMETER_REPOSITORY_H_
Chris@28 18
Chris@391 19 #include "PlayParameters.h"
Chris@391 20 #include "Command.h"
Chris@391 21
Chris@391 22 class Playable;
Chris@28 23
Chris@28 24 #include <map>
Chris@28 25
Chris@29 26 #include <QObject>
Chris@391 27 #include <QString>
Chris@29 28
Chris@29 29 class PlayParameterRepository : public QObject
Chris@28 30 {
Chris@29 31 Q_OBJECT
Chris@29 32
Chris@28 33 public:
Chris@145 34 static PlayParameterRepository *getInstance();
Chris@28 35
Chris@28 36 virtual ~PlayParameterRepository();
Chris@28 37
Chris@391 38 void addPlayable(const Playable *playable);
Chris@391 39 void removePlayable(const Playable *playable);
Chris@391 40 void copyParameters(const Playable *from, const Playable *to);
Chris@30 41
Chris@391 42 PlayParameters *getPlayParameters(const Playable *playable);
Chris@28 43
Chris@28 44 void clear();
Chris@28 45
Chris@391 46 class EditCommand : public Command
Chris@391 47 {
Chris@391 48 public:
Chris@391 49 EditCommand(PlayParameters *params);
Chris@391 50 void setPlayMuted(bool);
Chris@391 51 void setPlayAudible(bool);
Chris@391 52 void setPlayPan(float);
Chris@391 53 void setPlayGain(float);
Chris@391 54 void setPlayPluginId(QString);
Chris@391 55 void setPlayPluginConfiguration(QString);
Chris@391 56 void execute();
Chris@391 57 void unexecute();
Chris@391 58 QString getName() const;
Chris@391 59
Chris@391 60 protected:
Chris@391 61 PlayParameters *m_params;
Chris@391 62 PlayParameters m_from;
Chris@391 63 PlayParameters m_to;
Chris@391 64 };
Chris@391 65
Chris@29 66 signals:
Chris@29 67 void playParametersChanged(PlayParameters *);
Chris@391 68 void playPluginIdChanged(const Playable *, QString);
Chris@391 69 void playPluginConfigurationChanged(const Playable *, QString);
Chris@29 70
Chris@29 71 protected slots:
Chris@29 72 void playParametersChanged();
Chris@57 73 void playPluginIdChanged(QString);
Chris@57 74 void playPluginConfigurationChanged(QString);
Chris@29 75
Chris@28 76 protected:
Chris@391 77 typedef std::map<const Playable *, PlayParameters *> PlayableParameterMap;
Chris@391 78 PlayableParameterMap m_playParameters;
Chris@28 79
Chris@28 80 static PlayParameterRepository *m_instance;
Chris@28 81 };
Chris@28 82
Chris@28 83 #endif