libsidplayfp  1.1.0
sidplayfp.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2013 Leandro Nini <drfiemost@users.sourceforge.net>
5  * Copyright 2007-2010 Antti Lankila
6  * Copyright 2000 Simon White
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef SIDPLAYFP_H
24 #define SIDPLAYFP_H
25 
26 #include <stdint.h>
27 #include <stdio.h>
28 
29 #include "sidplayfp/siddefs.h"
30 #include "sidplayfp/sidversion.h"
31 
32 class SidConfig;
33 class SidTune;
34 class SidInfo;
35 class EventContext;
36 class SidTuneInfo;
37 
38 // Private Sidplayer
39 namespace SIDPLAYFP_NAMESPACE
40 {
41  class Player;
42 }
43 
47 class SID_EXTERN sidplayfp
48 {
49 private:
50  SIDPLAYFP_NAMESPACE::Player &sidplayer;
51 
52 public:
53  sidplayfp();
54  ~sidplayfp();
55 
61  const SidConfig &config() const;
62 
68  const SidInfo &info() const;
69 
77  bool config(const SidConfig &cfg);
78 
84  const char *error() const;
85 
91  bool fastForward(unsigned int percent);
92 
100  bool load(SidTune *tune);
101 
109  uint_least32_t play(short *buffer, uint_least32_t count);
110 
116  bool isPlaying() const;
117 
121  void stop();
122 
131  void debug(bool enable, FILE *out);
132 
140  void mute(unsigned int sidNum, unsigned int voice, bool enable);
141 
147  uint_least32_t time() const;
148 
157  void setRoms(const uint8_t* kernal, const uint8_t* basic=0, const uint8_t* character=0);
158 
164  EventContext *getEventContext();
165 
169  uint_least16_t getCia1TimerA() const;
170 };
171 
172 #endif // SIDPLAYFP_H