comparison base/PlayParameterRepository.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
children 8460b3bf8f04
comparison
equal deleted inserted replaced
27:070e9e1e40ea 28:4b16526b011b
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005-2006
6
7 This is experimental software. Not for distribution.
8 */
9
10 #include "PlayParameterRepository.h"
11 #include "PlayParameters.h"
12
13 PlayParameterRepository *
14 PlayParameterRepository::m_instance = new PlayParameterRepository;
15
16 PlayParameterRepository *
17 PlayParameterRepository::instance()
18 {
19 return m_instance;
20 }
21
22 PlayParameterRepository::~PlayParameterRepository()
23 {
24 }
25
26 PlayParameters *
27 PlayParameterRepository::getPlayParameters(const Model *model)
28 {
29 if (m_playParameters.find(model) == m_playParameters.end()) {
30 // Give all models the same type of play parameters for the moment
31 m_playParameters[model] = new PlayParameters;
32 }
33
34 return m_playParameters[model];
35 }
36
37 void
38 PlayParameterRepository::clear()
39 {
40 while (!m_playParameters.empty()) {
41 delete m_playParameters.begin()->second;
42 m_playParameters.erase(m_playParameters.begin());
43 }
44 }
45