comparison base/PlayParameterRepository.cpp @ 863:1f98e28f70c6 tonioni

Toward using a sample mixer (with arbitrary frequency target) instead of dssi player plugin
author Chris Cannam
date Tue, 07 Jan 2014 10:57:28 +0000
parents 2d53205f70cd
children 3a3541b357fe
comparison
equal deleted inserted replaced
859:13803edd513d 863:1f98e28f70c6
45 cerr << "PlayParameterRepository:addPlayable: 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->setPlaySampleId
51 (playable->getDefaultPlayPluginId()); 51 (playable->getDefaultPlaySampleId());
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(playSampleIdChanged(QString)),
60 this, SLOT(playPluginIdChanged(QString))); 57 this, SLOT(playSampleIdChanged(QString)));
61 58
62 connect(params, SIGNAL(playPluginConfigurationChanged(QString)),
63 this, SLOT(playPluginConfigurationChanged(QString)));
64
65 cerr << "Connected play parameters " << params << " for playable " 59 cerr << "Connected play parameters " << params << " for playable "
66 << playable << " to this " << this << endl; 60 << playable << " to this " << this << endl;
67 } 61 }
68 } 62 }
69 63
105 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); 99 PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
106 emit playParametersChanged(params); 100 emit playParametersChanged(params);
107 } 101 }
108 102
109 void 103 void
110 PlayParameterRepository::playPluginIdChanged(QString id) 104 PlayParameterRepository::playSampleIdChanged(QString id)
111 { 105 {
112 PlayParameters *params = dynamic_cast<PlayParameters *>(sender()); 106 PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
113 for (PlayableParameterMap::iterator i = m_playParameters.begin(); 107 for (PlayableParameterMap::iterator i = m_playParameters.begin();
114 i != m_playParameters.end(); ++i) { 108 i != m_playParameters.end(); ++i) {
115 if (i->second == params) { 109 if (i->second == params) {
116 emit playPluginIdChanged(i->first, id); 110 emit playSampleIdChanged(i->first, id);
117 return;
118 }
119 }
120 }
121
122 void
123 PlayParameterRepository::playPluginConfigurationChanged(QString config)
124 {
125 PlayParameters *params = dynamic_cast<PlayParameters *>(sender());
126 // SVDEBUG << "PlayParameterRepository::playPluginConfigurationChanged" << endl;
127 for (PlayableParameterMap::iterator i = m_playParameters.begin();
128 i != m_playParameters.end(); ++i) {
129 if (i->second == params) {
130 emit playPluginConfigurationChanged(i->first, config);
131 return; 111 return;
132 } 112 }
133 } 113 }
134 } 114 }
135 115
173 { 153 {
174 m_to.setPlayGain(gain); 154 m_to.setPlayGain(gain);
175 } 155 }
176 156
177 void 157 void
178 PlayParameterRepository::EditCommand::setPlayPluginId(QString id) 158 PlayParameterRepository::EditCommand::setPlaySampleId(QString id)
179 { 159 {
180 m_to.setPlayPluginId(id); 160 m_to.setPlaySampleId(id);
181 }
182
183 void
184 PlayParameterRepository::EditCommand::setPlayPluginConfiguration(QString conf)
185 {
186 m_to.setPlayPluginConfiguration(conf);
187 } 161 }
188 162
189 void 163 void
190 PlayParameterRepository::EditCommand::execute() 164 PlayParameterRepository::EditCommand::execute()
191 { 165 {
219 if (m_to.getPlayPan() != m_from.getPlayPan()) { 193 if (m_to.getPlayPan() != m_from.getPlayPan()) {
220 name = tr("Change Playback Pan"); 194 name = tr("Change Playback Pan");
221 if (++changed > 1) return multiname; 195 if (++changed > 1) return multiname;
222 } 196 }
223 197
224 if (m_to.getPlayPluginId() != m_from.getPlayPluginId()) { 198 if (m_to.getPlaySampleId() != m_from.getPlaySampleId()) {
225 name = tr("Change Playback Plugin"); 199 name = tr("Change Playback Sample");
226 if (++changed > 1) return multiname;
227 }
228
229 if (m_to.getPlayPluginConfiguration() != m_from.getPlayPluginConfiguration()) {
230 name = tr("Configure Playback Plugin");
231 if (++changed > 1) return multiname; 200 if (++changed > 1) return multiname;
232 } 201 }
233 202
234 if (name == "") return multiname; 203 if (name == "") return multiname;
235 return name; 204 return name;