comparison base/PlayParameterRepository.h @ 391:5858cc462d0a

* Fix #1628781 changes to layer visibility and mute should use a command * Also use a command for changes to layer playback pan, gain, plugin settings * Refactor PlayParameterRepository to remove dependency on audioio from base * Fix failure to save play parameters for main model in session file
author Chris Cannam
date Thu, 13 Mar 2008 14:06:03 +0000
parents 41d64b873d87
children 1f98e28f70c6
comparison
equal deleted inserted replaced
390:21e79997e80f 391:5858cc462d0a
14 */ 14 */
15 15
16 #ifndef _PLAY_PARAMETER_REPOSITORY_H_ 16 #ifndef _PLAY_PARAMETER_REPOSITORY_H_
17 #define _PLAY_PARAMETER_REPOSITORY_H_ 17 #define _PLAY_PARAMETER_REPOSITORY_H_
18 18
19 class PlayParameters; 19 #include "PlayParameters.h"
20 class Model; 20 #include "Command.h"
21
22 class Playable;
21 23
22 #include <map> 24 #include <map>
23 25
24 #include <QObject> 26 #include <QObject>
27 #include <QString>
25 28
26 class PlayParameterRepository : public QObject 29 class PlayParameterRepository : public QObject
27 { 30 {
28 Q_OBJECT 31 Q_OBJECT
29 32
30 public: 33 public:
31 static PlayParameterRepository *getInstance(); 34 static PlayParameterRepository *getInstance();
32 35
33 virtual ~PlayParameterRepository(); 36 virtual ~PlayParameterRepository();
34 37
35 void addModel(const Model *model); 38 void addPlayable(const Playable *playable);
36 void removeModel(const Model *model); 39 void removePlayable(const Playable *playable);
37 void copyParameters(const Model *from, const Model *to); 40 void copyParameters(const Playable *from, const Playable *to);
38 41
39 PlayParameters *getPlayParameters(const Model *model); 42 PlayParameters *getPlayParameters(const Playable *playable);
40 43
41 void clear(); 44 void clear();
42 45
46 class EditCommand : public Command
47 {
48 public:
49 EditCommand(PlayParameters *params);
50 void setPlayMuted(bool);
51 void setPlayAudible(bool);
52 void setPlayPan(float);
53 void setPlayGain(float);
54 void setPlayPluginId(QString);
55 void setPlayPluginConfiguration(QString);
56 void execute();
57 void unexecute();
58 QString getName() const;
59
60 protected:
61 PlayParameters *m_params;
62 PlayParameters m_from;
63 PlayParameters m_to;
64 };
65
43 signals: 66 signals:
44 void playParametersChanged(PlayParameters *); 67 void playParametersChanged(PlayParameters *);
45 void playPluginIdChanged(const Model *, QString); 68 void playPluginIdChanged(const Playable *, QString);
46 void playPluginConfigurationChanged(const Model *, QString); 69 void playPluginConfigurationChanged(const Playable *, QString);
47 70
48 protected slots: 71 protected slots:
49 void playParametersChanged(); 72 void playParametersChanged();
50 void playPluginIdChanged(QString); 73 void playPluginIdChanged(QString);
51 void playPluginConfigurationChanged(QString); 74 void playPluginConfigurationChanged(QString);
52 75
53 protected: 76 protected:
54 typedef std::map<const Model *, PlayParameters *> ModelParameterMap; 77 typedef std::map<const Playable *, PlayParameters *> PlayableParameterMap;
55 ModelParameterMap m_playParameters; 78 PlayableParameterMap m_playParameters;
56 79
57 static PlayParameterRepository *m_instance; 80 static PlayParameterRepository *m_instance;
58 }; 81 };
59 82
60 #endif 83 #endif