svcore  1.9
PlayParameterRepository.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 _PLAY_PARAMETER_REPOSITORY_H_
17 #define _PLAY_PARAMETER_REPOSITORY_H_
18 
19 #include "PlayParameters.h"
20 #include "Command.h"
21 
22 class Playable;
23 
24 #include <map>
25 
26 #include <QObject>
27 #include <QString>
28 
29 class PlayParameterRepository : public QObject
30 {
31  Q_OBJECT
32 
33 public:
35 
36  virtual ~PlayParameterRepository();
37 
38  void addPlayable(const Playable *playable);
39  void removePlayable(const Playable *playable);
40  void copyParameters(const Playable *from, const Playable *to);
41 
42  PlayParameters *getPlayParameters(const Playable *playable);
43 
44  void clear();
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 setPlayClipId(QString);
55  void execute();
56  void unexecute();
57  QString getName() const;
58 
59  protected:
63  };
64 
65 signals:
67  void playClipIdChanged(const Playable *, QString);
68 
69 protected slots:
70  void playParametersChanged();
71  void playClipIdChanged(QString);
72 
73 protected:
74  typedef std::map<const Playable *, PlayParameters *> PlayableParameterMap;
76 
78 };
79 
80 #endif
PlayParameters * getPlayParameters(const Playable *playable)
static PlayParameterRepository * getInstance()
void copyParameters(const Playable *from, const Playable *to)
void removePlayable(const Playable *playable)
static PlayParameterRepository * m_instance
PlayableParameterMap m_playParameters
std::map< const Playable *, PlayParameters * > PlayableParameterMap
void playClipIdChanged(const Playable *, QString)
void addPlayable(const Playable *playable)