1 /***************************************************************************
2                           sidplay2.h  -  Public sidplay header
3                              -------------------
4     begin                : Fri Jun 9 2000
5     copyright            : (C) 2000 by Simon White
6     email                : s_a_white@email.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef _sidplay2_h_
19 #define _sidplay2_h_
20 
21 #include "sidtypes.h"
22 #include "SidTune.h"
23 #include "sidbuilder.h"
24 
25 
26 // Private Sidplayer
27 namespace SIDPLAY2_NAMESPACE
28 {
29     class Player;
30 }
31 
32 class SID_EXTERN sidplay2
33 {
34 private:
35     SIDPLAY2_NAMESPACE::Player &sidplayer;
36 
37 public:
38     sidplay2 ();
39     virtual ~sidplay2 ();
40 
41     const sid2_config_t &config (void) const;
42     const sid2_info_t   &info   (void) const;
43 
44     int            config       (const sid2_config_t &cfg);
45     const char    *error        (void) const;
46     int            fastForward  (uint percent);
47     int            load         (SidTune *tune);
48     void           pause        (void);
49     uint_least32_t play         (void *buffer, uint_least32_t length);
50     sid2_player_t  state        (void) const;
51     void           stop         (void);
52     void           debug        (bool enable, FILE *out);
53 
54     // Timer functions with respect to resolution returned by timebase
55     uint_least32_t timebase (void) const;
56     uint_least32_t time     (void) const;
57     uint_least32_t mileage  (void) const;
58 
59     operator bool()  const { return (&sidplayer ? true: false); }
60     bool operator!() const { return (&sidplayer ? false: true); }
61 };
62 
63 #endif // _sidplay2_h_
64