Mercurial > hg > svcore
comparison base/PlayParameterRepository.cpp @ 911:73c2fd9a7dbe
Merge from branch tony_integration
author | Chris Cannam |
---|---|
date | Wed, 14 May 2014 09:54:20 +0100 |
parents | 3a3541b357fe |
children | ad14e7ed096d |
comparison
equal
deleted
inserted
replaced
907:a589d2201a0c | 911:73c2fd9a7dbe |
---|---|
33 } | 33 } |
34 | 34 |
35 void | 35 void |
36 PlayParameterRepository::addPlayable(const Playable *playable) | 36 PlayParameterRepository::addPlayable(const Playable *playable) |
37 { | 37 { |
38 // cerr << "PlayParameterRepository:addPlayable " << playable << endl; | 38 cerr << "PlayParameterRepository:addPlayable playable = " << playable << endl; |
39 | 39 |
40 if (!getPlayParameters(playable)) { | 40 if (!getPlayParameters(playable)) { |
41 | 41 |
42 // Give all playables the same type of play parameters for the | 42 // Give all playables the same type of play parameters for the |
43 // moment | 43 // moment |
44 | 44 |
45 // cerr << "PlayParameterRepository: Adding play parameters for " << playable << endl; | 45 cerr << "PlayParameterRepository:addPlayable: Adding play parameters for " << playable << endl; |
46 | 46 |
47 PlayParameters *params = new PlayParameters; | 47 PlayParameters *params = new PlayParameters; |
48 m_playParameters[playable] = params; | 48 m_playParameters[playable] = params; |
49 | 49 |
50 params->setPlayPluginId | 50 params->setPlayClipId |
51 (playable->getDefaultPlayPluginId()); | 51 (playable->getDefaultPlayClipId()); |
52 | |
53 params->setPlayPluginConfiguration | |
54 (playable->getDefaultPlayPluginConfiguration()); | |
55 | 52 |
56 connect(params, SIGNAL(playParametersChanged()), | 53 connect(params, SIGNAL(playParametersChanged()), |
57 this, SLOT(playParametersChanged())); | 54 this, SLOT(playParametersChanged())); |
58 | 55 |
59 connect(params, SIGNAL(playPluginIdChanged(QString)), | 56 connect(params, SIGNAL(playClipIdChanged(QString)), |
60 this, SLOT(playPluginIdChanged(QString))); | 57 this, SLOT(playClipIdChanged(QString))); |
61 | 58 |
62 connect(params, SIGNAL(playPluginConfigurationChanged(QString)), | 59 cerr << "Connected play parameters " << params << " for playable " |
63 this, SLOT(playPluginConfigurationChanged(QString))); | 60 << playable << " to this " << this << endl; |
64 | |
65 // cerr << "Connected play parameters " << params << " for playable " | |
66 // << playable << " to this " << this << endl; | |
67 | |
68 } | 61 } |
69 } | 62 } |
70 | 63 |
71 void | 64 void |
72 PlayParameterRepository::removePlayable(const Playable *playable) | 65 PlayParameterRepository::removePlayable(const Playable *playable) |
106 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); | 99 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); |
107 emit playParametersChanged(params); | 100 emit playParametersChanged(params); |
108 } | 101 } |
109 | 102 |
110 void | 103 void |
111 PlayParameterRepository::playPluginIdChanged(QString id) | 104 PlayParameterRepository::playClipIdChanged(QString id) |
112 { | 105 { |
113 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); | 106 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); |
114 for (PlayableParameterMap::iterator i = m_playParameters.begin(); | 107 for (PlayableParameterMap::iterator i = m_playParameters.begin(); |
115 i != m_playParameters.end(); ++i) { | 108 i != m_playParameters.end(); ++i) { |
116 if (i->second == params) { | 109 if (i->second == params) { |
117 emit playPluginIdChanged(i->first, id); | 110 emit playClipIdChanged(i->first, id); |
118 return; | |
119 } | |
120 } | |
121 } | |
122 | |
123 void | |
124 PlayParameterRepository::playPluginConfigurationChanged(QString config) | |
125 { | |
126 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); | |
127 // SVDEBUG << "PlayParameterRepository::playPluginConfigurationChanged" << endl; | |
128 for (PlayableParameterMap::iterator i = m_playParameters.begin(); | |
129 i != m_playParameters.end(); ++i) { | |
130 if (i->second == params) { | |
131 emit playPluginConfigurationChanged(i->first, config); | |
132 return; | 111 return; |
133 } | 112 } |
134 } | 113 } |
135 } | 114 } |
136 | 115 |
174 { | 153 { |
175 m_to.setPlayGain(gain); | 154 m_to.setPlayGain(gain); |
176 } | 155 } |
177 | 156 |
178 void | 157 void |
179 PlayParameterRepository::EditCommand::setPlayPluginId(QString id) | 158 PlayParameterRepository::EditCommand::setPlayClipId(QString id) |
180 { | 159 { |
181 m_to.setPlayPluginId(id); | 160 m_to.setPlayClipId(id); |
182 } | |
183 | |
184 void | |
185 PlayParameterRepository::EditCommand::setPlayPluginConfiguration(QString conf) | |
186 { | |
187 m_to.setPlayPluginConfiguration(conf); | |
188 } | 161 } |
189 | 162 |
190 void | 163 void |
191 PlayParameterRepository::EditCommand::execute() | 164 PlayParameterRepository::EditCommand::execute() |
192 { | 165 { |
220 if (m_to.getPlayPan() != m_from.getPlayPan()) { | 193 if (m_to.getPlayPan() != m_from.getPlayPan()) { |
221 name = tr("Change Playback Pan"); | 194 name = tr("Change Playback Pan"); |
222 if (++changed > 1) return multiname; | 195 if (++changed > 1) return multiname; |
223 } | 196 } |
224 | 197 |
225 if (m_to.getPlayPluginId() != m_from.getPlayPluginId()) { | 198 if (m_to.getPlayClipId() != m_from.getPlayClipId()) { |
226 name = tr("Change Playback Plugin"); | 199 name = tr("Change Playback Sample"); |
227 if (++changed > 1) return multiname; | |
228 } | |
229 | |
230 if (m_to.getPlayPluginConfiguration() != m_from.getPlayPluginConfiguration()) { | |
231 name = tr("Configure Playback Plugin"); | |
232 if (++changed > 1) return multiname; | 200 if (++changed > 1) return multiname; |
233 } | 201 } |
234 | 202 |
235 if (name == "") return multiname; | 203 if (name == "") return multiname; |
236 return name; | 204 return name; |