reSID.h
1 /* 2 Arduino SID 3 Copyright (c) 2015 Frank Bösing 4 This library 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. 8 This library is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 You should have received a copy of the GNU General Public License 13 along with this library. If not, see <http://www.gnu.org/licenses/>. 14 15 Diese Bibliothek ist freie Software: Sie können es unter den Bedingungen 16 der GNU General Public License, wie von der Free Software Foundation, 17 Version 3 der Lizenz oder (nach Ihrer Wahl) jeder neueren 18 veröffentlichten Version, weiterverbreiten und/oder modifizieren. 19 Diese Bibliothek wird in der Hoffnung, dass es nützlich sein wird, aber 20 OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite 21 Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. 22 Siehe die GNU General Public License für weitere Details. 23 Sie sollten eine Kopie der GNU General Public License zusammen mit diesem 24 Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. 25 26 */ 27 #include "reSID/sid.h" 28 #include <stdint.h> 29 30 #ifndef play_sid_h_ 31 #define play_sid_h_ 32 33 34 class AudioPlaySID 35 { 36 public: 37 AudioPlaySID(void) { begin(); } 38 void begin(void); 39 void setSampleParameters(float clockfreq, float samplerate); 40 inline void setreg(int ofs, int val) { sid.write(ofs, val); } 41 inline uint8_t getreg(int ofs) { return sid.read(ofs); } 42 void reset(void); 43 void stop(void); 44 void update(void * stream, int len); 45 inline bool isPlaying(void) { return playing; } 46 private: 47 cycle_count csdelta; 48 volatile bool playing; 49 SID sid; 50 SID* sidptr; 51 }; 52 53 54 #endif