comparison base/PlayParameterRepository.cpp @ 847:2d53205f70cd tonioni

Merge from default branch
author Chris Cannam
date Tue, 26 Nov 2013 14:37:01 +0000
parents 2fa49f5caac5 e802e550a1f2
children 1f98e28f70c6
comparison
equal deleted inserted replaced
841:226733f3cf3f 847:2d53205f70cd
33 } 33 }
34 34
35 void 35 void
36 PlayParameterRepository::addPlayable(const Playable *playable) 36 PlayParameterRepository::addPlayable(const Playable *playable)
37 { 37 {
38 std::cerr << "PlayParameterRepository:addPlayable playable = " << playable << std::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 std::cerr << "PlayParameterRepository:addPlayable: Adding play parameters for " << playable << std::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->setPlayPluginId
60 this, SLOT(playPluginIdChanged(QString))); 60 this, SLOT(playPluginIdChanged(QString)));
61 61
62 connect(params, SIGNAL(playPluginConfigurationChanged(QString)), 62 connect(params, SIGNAL(playPluginConfigurationChanged(QString)),
63 this, SLOT(playPluginConfigurationChanged(QString))); 63 this, SLOT(playPluginConfigurationChanged(QString)));
64 64
65 std::cerr << "Connected play parameters " << params << " for playable " 65 cerr << "Connected play parameters " << params << " for playable "
66 << playable << " to this " << this << std::endl; 66 << playable << " to this " << this << endl;
67
68 } 67 }
69 } 68 }
70 69
71 void 70 void
72 PlayParameterRepository::removePlayable(const Playable *playable) 71 PlayParameterRepository::removePlayable(const Playable *playable)
73 { 72 {
74 if (m_playParameters.find(playable) == m_playParameters.end()) { 73 if (m_playParameters.find(playable) == m_playParameters.end()) {
75 std::cerr << "WARNING: PlayParameterRepository::removePlayable: unknown playable " << playable << std::endl; 74 cerr << "WARNING: PlayParameterRepository::removePlayable: unknown playable " << playable << endl;
76 return; 75 return;
77 } 76 }
78 delete m_playParameters[playable]; 77 delete m_playParameters[playable];
79 m_playParameters.erase(playable); 78 m_playParameters.erase(playable);
80 } 79 }
81 80
82 void 81 void
83 PlayParameterRepository::copyParameters(const Playable *from, const Playable *to) 82 PlayParameterRepository::copyParameters(const Playable *from, const Playable *to)
84 { 83 {
85 if (!getPlayParameters(from)) { 84 if (!getPlayParameters(from)) {
86 std::cerr << "ERROR: PlayParameterRepository::copyParameters: source playable unknown" << std::endl; 85 cerr << "ERROR: PlayParameterRepository::copyParameters: source playable unknown" << endl;
87 return; 86 return;
88 } 87 }
89 if (!getPlayParameters(to)) { 88 if (!getPlayParameters(to)) {
90 std::cerr << "WARNING: PlayParameterRepository::copyParameters: target playable unknown, adding it now" << std::endl; 89 cerr << "WARNING: PlayParameterRepository::copyParameters: target playable unknown, adding it now" << endl;
91 addPlayable(to); 90 addPlayable(to);
92 } 91 }
93 getPlayParameters(to)->copyFrom(getPlayParameters(from)); 92 getPlayParameters(to)->copyFrom(getPlayParameters(from));
94 } 93 }
95 94
135 } 134 }
136 135
137 void 136 void
138 PlayParameterRepository::clear() 137 PlayParameterRepository::clear()
139 { 138 {
140 // std::cerr << "PlayParameterRepository: PlayParameterRepository::clear" << std::endl; 139 // cerr << "PlayParameterRepository: PlayParameterRepository::clear" << endl;
141 while (!m_playParameters.empty()) { 140 while (!m_playParameters.empty()) {
142 delete m_playParameters.begin()->second; 141 delete m_playParameters.begin()->second;
143 m_playParameters.erase(m_playParameters.begin()); 142 m_playParameters.erase(m_playParameters.begin());
144 } 143 }
145 } 144 }