Mercurial > hg > svcore
comparison base/StorageAdviser.cpp @ 168:04baa690f90d
* Start adding StorageAdviser class to determine whether caches should be
on disc or in memory
author | Chris Cannam |
---|---|
date | Mon, 25 Sep 2006 13:44:05 +0000 |
parents | |
children | b23eea68357e |
comparison
equal
deleted
inserted
replaced
167:665342c6ec57 | 168:04baa690f90d |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 Sonic Visualiser | |
5 An audio file viewer and annotation editor. | |
6 Centre for Digital Music, Queen Mary, University of London. | |
7 This file copyright 2006 Chris Cannam. | |
8 | |
9 This program is free software; you can redistribute it and/or | |
10 modify it under the terms of the GNU General Public License as | |
11 published by the Free Software Foundation; either version 2 of the | |
12 License, or (at your option) any later version. See the file | |
13 COPYING included with this distribution for more information. | |
14 */ | |
15 | |
16 #include "StorageAdviser.h" | |
17 | |
18 #include "Exceptions.h" | |
19 #include "TempDirectory.h" | |
20 | |
21 #include "system/System.h" | |
22 | |
23 #include <iostream> | |
24 | |
25 StorageAdviser::Recommendation | |
26 StorageAdviser::recommend(Criteria criteria, | |
27 int minimumSize, | |
28 int maximumSize) | |
29 { | |
30 QString path = TempDirectory::getInstance()->getPath(); | |
31 | |
32 int discSpace = GetDiscSpaceMBAvailable(path.toLocal8Bit()); | |
33 int memory = GetRealMemoryMBAvailable(); | |
34 | |
35 std::cerr << "Disc space: " << discSpace << ", memory: " << memory << std::endl; | |
36 | |
37 return Recommendation(0); | |
38 } | |
39 | |
40 | |
41 |