Chris@168: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@168: Chris@168: /* Chris@168: Sonic Visualiser Chris@168: An audio file viewer and annotation editor. Chris@168: Centre for Digital Music, Queen Mary, University of London. Chris@168: This file copyright 2006 Chris Cannam. Chris@168: Chris@168: This program is free software; you can redistribute it and/or Chris@168: modify it under the terms of the GNU General Public License as Chris@168: published by the Free Software Foundation; either version 2 of the Chris@168: License, or (at your option) any later version. See the file Chris@168: COPYING included with this distribution for more information. Chris@168: */ Chris@168: Chris@168: #ifndef _STORAGE_ADVISER_H_ Chris@168: #define _STORAGE_ADVISER_H_ Chris@168: Chris@168: /** Chris@168: * A utility class designed to help decide whether to store cache data Chris@168: * (for example FFT outputs) in memory or on disk in the TempDirectory. Chris@168: */ Chris@168: Chris@168: class StorageAdviser Chris@168: { Chris@168: public: Chris@168: // pass to recommend() zero or more of these OR'd together Chris@168: enum Criteria { Chris@168: SpeedCritical = 1, Chris@168: PrecisionCritical = 2, Chris@168: RepeatabilityUseful = 4 Chris@168: }; Chris@168: Chris@168: // recommend() returns one or two of these OR'd together Chris@168: enum Recommendation { Chris@168: UseMemory = 1, Chris@168: UseDisc = 2, Chris@168: ConserveSpace = 4, Chris@168: UseAsMuchAsYouLike = 8 Chris@168: }; Chris@168: Chris@168: // may throw InsufficientDiscSpace exception if it looks like Chris@168: // minimumSize won't fit on the disc Chris@168: Chris@168: static Recommendation recommend(Criteria criteria, Chris@168: int minimumSize, Chris@168: int maximumSize); Chris@168: }; Chris@168: Chris@168: #endif Chris@168: