Mercurial > hg > svcore
annotate base/PlayParameterRepository.cpp @ 29:8460b3bf8f04
* Implement play mute, level and pan controls and a layer visibility control
* Handle swapping the buffers in AudioCallbackPlaySource more gracefully, so
that in many cases it can be done inaudibly. Still gets it wrong when
playing in a noncontiguous selection.
* Fix to SV file save for non-2d sparse models
* Fixes to LED button drawing and AudioDial mouse functionality
* Add progress bar for Ogg file import
* Reshuffle PropertyContainer and its subclasses so it can be a QObject
* Add layer dormancy (invisible layer permitted to free its cache space)
* Optimisations to SpectrogramLayer, removing locks when reading/writing
individual pixels in the cache (should be unnecessary there) -- there's
still an issue here as we need a lock when reading from the model in
case the model is replaced, and we don't currently have one
* Several munlock() calls to make it harder to exhaust real memory if
running in an RT mode with mlockall() active
author | Chris Cannam |
---|---|
date | Fri, 17 Feb 2006 18:04:26 +0000 |
parents | 4b16526b011b |
children | a6ef94ecbe74 |
rev | line source |
---|---|
Chris@28 | 1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@28 | 2 |
Chris@28 | 3 /* |
Chris@28 | 4 A waveform viewer and audio annotation editor. |
Chris@28 | 5 Chris Cannam, Queen Mary University of London, 2005-2006 |
Chris@28 | 6 |
Chris@28 | 7 This is experimental software. Not for distribution. |
Chris@28 | 8 */ |
Chris@28 | 9 |
Chris@28 | 10 #include "PlayParameterRepository.h" |
Chris@28 | 11 #include "PlayParameters.h" |
Chris@28 | 12 |
Chris@29 | 13 #include <iostream> |
Chris@29 | 14 |
Chris@28 | 15 PlayParameterRepository * |
Chris@28 | 16 PlayParameterRepository::m_instance = new PlayParameterRepository; |
Chris@28 | 17 |
Chris@28 | 18 PlayParameterRepository * |
Chris@28 | 19 PlayParameterRepository::instance() |
Chris@28 | 20 { |
Chris@28 | 21 return m_instance; |
Chris@28 | 22 } |
Chris@28 | 23 |
Chris@28 | 24 PlayParameterRepository::~PlayParameterRepository() |
Chris@28 | 25 { |
Chris@28 | 26 } |
Chris@28 | 27 |
Chris@28 | 28 PlayParameters * |
Chris@28 | 29 PlayParameterRepository::getPlayParameters(const Model *model) |
Chris@28 | 30 { |
Chris@28 | 31 if (m_playParameters.find(model) == m_playParameters.end()) { |
Chris@28 | 32 // Give all models the same type of play parameters for the moment |
Chris@29 | 33 std::cerr << "Creating new PlayParameters for model " << model << std::endl; |
Chris@28 | 34 m_playParameters[model] = new PlayParameters; |
Chris@29 | 35 connect(m_playParameters[model], SIGNAL(playParametersChanged()), |
Chris@29 | 36 this, SLOT(playParametersChanged())); |
Chris@28 | 37 } |
Chris@28 | 38 |
Chris@28 | 39 return m_playParameters[model]; |
Chris@28 | 40 } |
Chris@28 | 41 |
Chris@28 | 42 void |
Chris@29 | 43 PlayParameterRepository::playParametersChanged() |
Chris@29 | 44 { |
Chris@29 | 45 emit playParametersChanged(dynamic_cast<PlayParameters *>(sender())); |
Chris@29 | 46 } |
Chris@29 | 47 |
Chris@29 | 48 void |
Chris@28 | 49 PlayParameterRepository::clear() |
Chris@28 | 50 { |
Chris@28 | 51 while (!m_playParameters.empty()) { |
Chris@28 | 52 delete m_playParameters.begin()->second; |
Chris@28 | 53 m_playParameters.erase(m_playParameters.begin()); |
Chris@28 | 54 } |
Chris@28 | 55 } |
Chris@28 | 56 |