comparison base/StorageAdviser.cpp @ 1098:329ddaf7415d simple-fft-model

Store temporary audio files in memory if we have plenty of it
author Chris Cannam
date Mon, 15 Jun 2015 14:35:37 +0100
parents cc27f35aa75c
children e86a7ea3dc38
comparison
equal deleted inserted replaced
1097:abc309f507ae 1098:329ddaf7415d
20 20
21 #include "system/System.h" 21 #include "system/System.h"
22 22
23 #include <iostream> 23 #include <iostream>
24 24
25 //#define DEBUG_STORAGE_ADVISER 1 25 #define DEBUG_STORAGE_ADVISER 1
26 26
27 size_t StorageAdviser::m_discPlanned = 0; 27 size_t StorageAdviser::m_discPlanned = 0;
28 size_t StorageAdviser::m_memoryPlanned = 0; 28 size_t StorageAdviser::m_memoryPlanned = 0;
29 29
30 StorageAdviser::Recommendation 30 StorageAdviser::Recommendation
34 StorageAdviser::recommend(Criteria criteria, 34 StorageAdviser::recommend(Criteria criteria,
35 size_t minimumSize, 35 size_t minimumSize,
36 size_t maximumSize) 36 size_t maximumSize)
37 { 37 {
38 #ifdef DEBUG_STORAGE_ADVISER 38 #ifdef DEBUG_STORAGE_ADVISER
39 SVDEBUG << "StorageAdviser::recommend: Criteria " << criteria 39 cerr << "StorageAdviser::recommend: Criteria " << criteria
40 << ", minimumSize " << minimumSize 40 << ", minimumSize " << minimumSize
41 << ", maximumSize " << maximumSize << endl; 41 << ", maximumSize " << maximumSize << endl;
42 #endif 42 #endif
43 43
44 if (m_baseRecommendation != NoRecommendation) { 44 if (m_baseRecommendation != NoRecommendation) {
45 return m_baseRecommendation; // for now 45 return m_baseRecommendation; // for now
46 } 46 }
179 recommendation |= UseAsMuchAsYouLike; 179 recommendation |= UseAsMuchAsYouLike;
180 } 180 }
181 } 181 }
182 } 182 }
183 183
184 #ifdef DEBUG_STORAGE_ADVISER
185 cerr << "StorageAdviser: returning recommendation " << recommendation << endl;
186 #endif
187
184 return Recommendation(recommendation); 188 return Recommendation(recommendation);
185 } 189 }
186 190
187 void 191 void
188 StorageAdviser::notifyPlannedAllocation(AllocationArea area, size_t size) 192 StorageAdviser::notifyPlannedAllocation(AllocationArea area, size_t size)