# HG changeset patch # User Chris Cannam # Date 1186670403 0 # Node ID 41d64b873d87208d1abbb3a58dc736bda089a585 # Parent 7336fe3a7caafbd8113a74f16d71cd355901cb02 * continue to pick "new" colours for coloured layers even when all colours have been used at least once, rather than sticking on the last one * some messing about with application palette settings * when replacing an audio file, retain the previous playback settings for any layers that depended on the old file * re-check plugin program setting when a parameter changes -- so a plugin can decide to reset the program if the parameters no longer match those for the current program * fix failure to update check-boxes for toggled plugin parameters when their parameters are changed by program changes diff -r 7336fe3a7caa -r 41d64b873d87 base/PlayParameterRepository.cpp --- a/base/PlayParameterRepository.cpp Thu Aug 09 10:06:02 2007 +0000 +++ b/base/PlayParameterRepository.cpp Thu Aug 09 14:40:03 2007 +0000 @@ -85,8 +85,22 @@ m_playParameters.erase(model); } +void +PlayParameterRepository::copyParameters(const Model *from, const Model *to) +{ + if (!getPlayParameters(from)) { + std::cerr << "ERROR: PlayParameterRepository::copyParameters: source model unknown" << std::endl; + return; + } + if (!getPlayParameters(to)) { + std::cerr << "WARNING: PlayParameterRepository::copyParameters: target model unknown, adding it now" << std::endl; + addModel(to); + } + getPlayParameters(to)->copyFrom(getPlayParameters(from)); +} + PlayParameters * -PlayParameterRepository::getPlayParameters(const Model *model) const +PlayParameterRepository::getPlayParameters(const Model *model) { if (m_playParameters.find(model) == m_playParameters.end()) return 0; return m_playParameters.find(model)->second; diff -r 7336fe3a7caa -r 41d64b873d87 base/PlayParameterRepository.h --- a/base/PlayParameterRepository.h Thu Aug 09 10:06:02 2007 +0000 +++ b/base/PlayParameterRepository.h Thu Aug 09 14:40:03 2007 +0000 @@ -34,8 +34,9 @@ void addModel(const Model *model); void removeModel(const Model *model); + void copyParameters(const Model *from, const Model *to); - PlayParameters *getPlayParameters(const Model *model) const; + PlayParameters *getPlayParameters(const Model *model); void clear(); diff -r 7336fe3a7caa -r 41d64b873d87 base/PlayParameters.cpp --- a/base/PlayParameters.cpp Thu Aug 09 10:06:02 2007 +0000 +++ b/base/PlayParameters.cpp Thu Aug 09 14:40:03 2007 +0000 @@ -17,6 +17,16 @@ #include +void +PlayParameters::copyFrom(const PlayParameters *pp) +{ + m_playMuted = pp->isPlayMuted(); + m_playPan = pp->getPlayPan(); + m_playGain = pp->getPlayGain(); + m_playPluginId = pp->getPlayPluginId(); + m_playPluginConfiguration = pp->getPlayPluginConfiguration(); +} + QString PlayParameters::toXmlString(QString indent, QString extraAttributes) const diff -r 7336fe3a7caa -r 41d64b873d87 base/PlayParameters.h --- a/base/PlayParameters.h Thu Aug 09 10:06:02 2007 +0000 +++ b/base/PlayParameters.h Thu Aug 09 14:40:03 2007 +0000 @@ -34,6 +34,8 @@ virtual QString getPlayPluginId() const { return m_playPluginId; } virtual QString getPlayPluginConfiguration() const { return m_playPluginConfiguration; } + virtual void copyFrom(const PlayParameters *); + virtual QString toXmlString(QString indent = "", QString extraAttributes = "") const; @@ -60,6 +62,10 @@ float m_playGain; QString m_playPluginId; QString m_playPluginConfiguration; + +private: + PlayParameters(const PlayParameters &); + PlayParameters &operator=(const PlayParameters &); }; #endif