# HG changeset patch # User Chris Cannam # Date 1141665625 0 # Node ID b2d1a61ab916dbc7adcf622bc2b31f113f3b59ef # Parent e1a0cf2dcc7997ce45870b5b76ae837dbade2d5c * A bit more work on main window / document / commands stuff. This is still pretty unstable. * Enable CSV file reader also to read files with other separators (e.g. .lab files with space separators) * Show "(R)" on waveform display when resampling during playback * Add ability to import additional audio files (can't process them yet) * Fixes to spectrogram cache for multiple views * Fix to avoid floating-point exception in sparse model when resolution not set yet diff -r e1a0cf2dcc79 -r b2d1a61ab916 base/AudioPlaySource.h --- a/base/AudioPlaySource.h Fri Mar 03 17:52:21 2006 +0000 +++ b/base/AudioPlaySource.h Mon Mar 06 17:20:25 2006 +0000 @@ -50,6 +50,12 @@ * 0.0 -> 1.0, for metering purposes. */ virtual bool getOutputLevels(float &left, float &right) = 0; + + /** + * Return the sample rate set by the target audio device (or the + * source sample rate if the target hasn't set one). + */ + virtual size_t getTargetSampleRate() const = 0; }; #endif diff -r e1a0cf2dcc79 -r b2d1a61ab916 base/Layer.h --- a/base/Layer.h Fri Mar 03 17:52:21 2006 +0000 +++ b/base/Layer.h Mon Mar 06 17:20:25 2006 +0000 @@ -198,9 +198,8 @@ * view and is not expected to become visible in the near future * (for example because the user has explicitly removed or hidden * it). The layer may respond by (for example) freeing any cache - * memory it is using, until next time its paint method is called. - * It does not need to remember not to draw itself; the view will - * handle that. + * memory it is using, until next time its paint method is called, + * when it should set itself un-dormant again. */ virtual void setLayerDormant(const View *v, bool dormant) { m_dormancy[v] = dormant; @@ -230,7 +229,7 @@ void layerNameChanged(); protected: - std::map m_dormancy; + mutable std::map m_dormancy; }; #endif diff -r e1a0cf2dcc79 -r b2d1a61ab916 base/ViewManager.cpp --- a/base/ViewManager.cpp Fri Mar 03 17:52:21 2006 +0000 +++ b/base/ViewManager.cpp Mon Mar 06 17:20:25 2006 +0000 @@ -174,6 +174,15 @@ emit playSelectionModeChanged(); } +size_t +ViewManager::getPlaybackSampleRate() const +{ + if (m_playSource) { + return m_playSource->getTargetSampleRate(); + } + return 0; +} + void ViewManager::setAudioPlaySource(AudioPlaySource *source) { diff -r e1a0cf2dcc79 -r b2d1a61ab916 base/ViewManager.h --- a/base/ViewManager.h Fri Mar 03 17:52:21 2006 +0000 +++ b/base/ViewManager.h Mon Mar 06 17:20:25 2006 +0000 @@ -83,6 +83,8 @@ bool getPlaySelectionMode() const { return m_playSelectionMode; } void setPlaySelectionMode(bool on); + size_t getPlaybackSampleRate() const; + signals: /** Emitted when a widget pans. The originator identifies the widget. */ void centreFrameChanged(void *originator, unsigned long frame, bool locked);