2 * This file is part of jSpeed.
4 * jSpeed is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * jSpeed is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with jSpeed. If not, see <http://www.gnu.org/licenses/>.
22 #include <QtCore/QList>
23 #include <QtCore/QSet>
24 #include <QtCore/QQueue>
25 #include "poireader.h"
29 class PoiAlerts : public QObject
34 static int const POI_ALERT_INTERVAL = 120;
35 static int const IN_ROUTE_MARGIN = 20;
36 static PoiAlerts& instance();
37 static QString getPoiDir();
42 double getCurrentDistance() const;
43 QString getCurrentPoi() const;
44 bool poiInView() const;
45 QString const& error() const;
57 void playSound(int poiIndex);
58 static double calculateDistance(double latitude1, double longitude1,
59 double latitude2, double longitude2);
60 static double calculateTrack(double latitude1, double longitude1,
61 double latitude2, double longitude2);
64 QList<PoiReader::Poi> pois_;
65 QQueue<int> playedSounds_;
69 PoiReader::Poi* currentPoi_;
70 double currentDistance_;