1 /* 2 * Copyright (C) 2018 3 * Matthias P. Braendli (matthias.braendli@mpb.li) 4 * 5 * Copyright (C) 2017 6 * Albrecht Lohofener (albrechtloh@gmx.de) 7 * 8 * This file is based on SDR-J 9 * Copyright (C) 2010, 2011, 2012 10 * Jan van Katwijk (J.vanKatwijk@gmail.com) 11 * 12 * This file is part of the welle.io. 13 * Many of the ideas as implemented in welle.io are derived from 14 * other work, made available through the GNU general Public License. 15 * All copyrights of the original authors are recognized. 16 * 17 * welle.io is free software; you can redistribute it and/or modify 18 * it under the terms of the GNU General Public License as published by 19 * the Free Software Foundation; either version 2 of the License, or 20 * (at your option) any later version. 21 * 22 * welle.io is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 * GNU General Public License for more details. 26 * 27 * You should have received a copy of the GNU General Public License 28 * along with welle.io; if not, write to the Free Software 29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 30 * 31 */ 32 33 #ifndef CHANNELS_H 34 #define CHANNELS_H 35 36 #include <map> 37 #include <string> 38 39 #define NUMBEROFCHANNELS 54 40 41 class Channels 42 { 43 public: 44 Channels(); 45 int getFrequency(const std::string& channelName); 46 std::string getNextChannel(void); 47 std::string getCurrentChannel(void); 48 int getCurrentFrequency(void); 49 int getCurrentIndex(void); 50 std::string getChannelForFrequency(int frequency); 51 52 static std::string firstChannel; 53 54 private: 55 std::string getChannelNameAtIndex(int index); 56 57 std::map<std::string, int> frequencyMap; 58 int currentFrequencyIndex; 59 std::string currentChannel; 60 int currentFrequency; 61 }; 62 63 #endif // CCHANNELS_H 64