comparison base/PlayParameters.cpp @ 391:5858cc462d0a

* Fix #1628781 changes to layer visibility and mute should use a command * Also use a command for changes to layer playback pan, gain, plugin settings * Refactor PlayParameterRepository to remove dependency on audioio from base * Fix failure to save play parameters for main model in session file
author Chris Cannam
date Thu, 13 Mar 2008 14:06:03 +0000
parents 70a232b1f12a
children b4a8d8221eaf
comparison
equal deleted inserted replaced
390:21e79997e80f 391:5858cc462d0a
20 #include <QTextStream> 20 #include <QTextStream>
21 21
22 void 22 void
23 PlayParameters::copyFrom(const PlayParameters *pp) 23 PlayParameters::copyFrom(const PlayParameters *pp)
24 { 24 {
25 m_playMuted = pp->isPlayMuted(); 25 bool changed = false;
26 m_playPan = pp->getPlayPan(); 26
27 m_playGain = pp->getPlayGain(); 27 if (m_playMuted != pp->isPlayMuted()) {
28 m_playPluginId = pp->getPlayPluginId(); 28 m_playMuted = pp->isPlayMuted();
29 m_playPluginConfiguration = pp->getPlayPluginConfiguration(); 29 emit playMutedChanged(m_playMuted);
30 emit playAudibleChanged(!m_playMuted);
31 changed = true;
32 }
33
34 if (m_playPan != pp->getPlayPan()) {
35 m_playPan = pp->getPlayPan();
36 emit playPanChanged(m_playPan);
37 changed = true;
38 }
39
40 if (m_playGain != pp->getPlayGain()) {
41 m_playGain = pp->getPlayGain();
42 emit playGainChanged(m_playGain);
43 changed = true;
44 }
45
46 if (m_playPluginId != pp->getPlayPluginId()) {
47 m_playPluginId = pp->getPlayPluginId();
48 emit playPluginIdChanged(m_playPluginId);
49 changed = true;
50 }
51
52 if (m_playPluginConfiguration != pp->getPlayPluginConfiguration()) {
53 m_playPluginConfiguration = pp->getPlayPluginConfiguration();
54 emit playPluginConfigurationChanged(m_playPluginConfiguration);
55 changed = true;
56 }
57
58 if (changed) emit playParametersChanged();
30 } 59 }
31 60
32 void 61 void
33 PlayParameters::toXml(QTextStream &stream, 62 PlayParameters::toXml(QTextStream &stream,
34 QString indent, 63 QString indent,
51 80
52 void 81 void
53 PlayParameters::setPlayMuted(bool muted) 82 PlayParameters::setPlayMuted(bool muted)
54 { 83 {
55 // std::cerr << "PlayParameters: setPlayMuted(" << muted << ")" << std::endl; 84 // std::cerr << "PlayParameters: setPlayMuted(" << muted << ")" << std::endl;
56 m_playMuted = muted; 85 if (m_playMuted != muted) {
57 emit playMutedChanged(muted); 86 m_playMuted = muted;
58 emit playAudibleChanged(!muted); 87 emit playMutedChanged(muted);
59 emit playParametersChanged(); 88 emit playAudibleChanged(!muted);
89 emit playParametersChanged();
90 }
60 } 91 }
61 92
62 void 93 void
63 PlayParameters::setPlayAudible(bool audible) 94 PlayParameters::setPlayAudible(bool audible)
64 { 95 {