Mercurial > hg > svcore
comparison base/ViewManager.cpp @ 28:4b16526b011b
* Add LED button
* Add note model playback (currently assuming that value == MIDI pitch)
* Reorganise PlayParameters and move repository from ViewManager to new
PlayParameterRepository class
author | Chris Cannam |
---|---|
date | Wed, 15 Feb 2006 17:58:35 +0000 |
parents | bb9291d84810 |
children | aaf73f7309f2 |
comparison
equal
deleted
inserted
replaced
27:070e9e1e40ea | 28:4b16526b011b |
---|---|
7 This is experimental software. Not for distribution. | 7 This is experimental software. Not for distribution. |
8 */ | 8 */ |
9 | 9 |
10 #include "ViewManager.h" | 10 #include "ViewManager.h" |
11 #include "AudioPlaySource.h" | 11 #include "AudioPlaySource.h" |
12 #include "PlayParameters.h" | |
13 #include "Model.h" | 12 #include "Model.h" |
14 | 13 |
15 #include <iostream> | 14 #include <iostream> |
16 | 15 |
17 //#define DEBUG_VIEW_MANAGER 1 | 16 //#define DEBUG_VIEW_MANAGER 1 |
176 QTimer::singleShot(100, this, SLOT(checkPlayStatus())); | 175 QTimer::singleShot(100, this, SLOT(checkPlayStatus())); |
177 } | 176 } |
178 m_playSource = source; | 177 m_playSource = source; |
179 } | 178 } |
180 | 179 |
181 PlayParameters * | |
182 ViewManager::getPlayParameters(const Model *model) | |
183 { | |
184 if (m_playParameters.find(model) == m_playParameters.end()) { | |
185 // Give all models the same type of play parameters for the moment | |
186 m_playParameters[model] = new PlayParameters; | |
187 } | |
188 | |
189 return m_playParameters[model]; | |
190 } | |
191 | |
192 void | |
193 ViewManager::clearPlayParameters() | |
194 { | |
195 while (!m_playParameters.empty()) { | |
196 delete m_playParameters.begin()->second; | |
197 m_playParameters.erase(m_playParameters.begin()); | |
198 } | |
199 } | |
200 | |
201 void | 180 void |
202 ViewManager::playStatusChanged(bool playing) | 181 ViewManager::playStatusChanged(bool playing) |
203 { | 182 { |
204 checkPlayStatus(); | 183 checkPlayStatus(); |
205 } | 184 } |