Chris@49: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@28: Chris@28: /* Chris@52: Sonic Visualiser Chris@52: An audio file viewer and annotation editor. Chris@52: Centre for Digital Music, Queen Mary, University of London. Chris@52: This file copyright 2006 Chris Cannam. Chris@28: Chris@52: This program is free software; you can redistribute it and/or Chris@52: modify it under the terms of the GNU General Public License as Chris@52: published by the Free Software Foundation; either version 2 of the Chris@52: License, or (at your option) any later version. See the file Chris@52: COPYING included with this distribution for more information. Chris@28: */ Chris@28: Chris@28: #ifndef _PLAY_PARAMETER_REPOSITORY_H_ Chris@28: #define _PLAY_PARAMETER_REPOSITORY_H_ Chris@28: Chris@391: #include "PlayParameters.h" Chris@391: #include "Command.h" Chris@391: Chris@391: class Playable; Chris@28: Chris@28: #include Chris@28: Chris@29: #include Chris@391: #include Chris@29: Chris@29: class PlayParameterRepository : public QObject Chris@28: { Chris@29: Q_OBJECT Chris@29: Chris@28: public: Chris@145: static PlayParameterRepository *getInstance(); Chris@28: Chris@28: virtual ~PlayParameterRepository(); Chris@28: Chris@391: void addPlayable(const Playable *playable); Chris@391: void removePlayable(const Playable *playable); Chris@391: void copyParameters(const Playable *from, const Playable *to); Chris@30: Chris@391: PlayParameters *getPlayParameters(const Playable *playable); Chris@28: Chris@28: void clear(); Chris@28: Chris@391: class EditCommand : public Command Chris@391: { Chris@391: public: Chris@391: EditCommand(PlayParameters *params); Chris@391: void setPlayMuted(bool); Chris@391: void setPlayAudible(bool); Chris@391: void setPlayPan(float); Chris@391: void setPlayGain(float); Chris@866: void setPlayClipId(QString); Chris@391: void execute(); Chris@391: void unexecute(); Chris@391: QString getName() const; Chris@391: Chris@391: protected: Chris@391: PlayParameters *m_params; Chris@391: PlayParameters m_from; Chris@391: PlayParameters m_to; Chris@391: }; Chris@391: Chris@29: signals: Chris@29: void playParametersChanged(PlayParameters *); Chris@866: void playClipIdChanged(const Playable *, QString); Chris@29: Chris@29: protected slots: Chris@29: void playParametersChanged(); Chris@866: void playClipIdChanged(QString); Chris@29: Chris@28: protected: Chris@391: typedef std::map PlayableParameterMap; Chris@391: PlayableParameterMap m_playParameters; Chris@28: Chris@28: static PlayParameterRepository *m_instance; Chris@28: }; Chris@28: Chris@28: #endif