ScummVM API documentation
mid.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #include "ultima/nuvie/sound/adplug/adplug_player.h"
23 
24 namespace Ultima {
25 namespace Nuvie {
26 
27 class OriginFXAdLibDriver;
28 
29 class CmidPlayer: public CPlayer {
30 public:
31  static CPlayer *factory(Copl *newopl);
32 
33  CmidPlayer(Copl *newopl);
34  ~CmidPlayer() override;
35 
36  bool load(const Common::Path &filename) override;
37  bool load(const Common::Path &filename, int song_index);
38  //bool load(const Std::string &filename, const CFileProvider &fp);
39  bool update() override;
40  void rewind(int subsong) override;
41  float getrefresh() override;
42 
43  Std::string gettype() override;
44  Std::string gettitle() override {
45  return Std::string(title);
46  }
47  Std::string getauthor() override {
48  return Std::string(author);
49  }
50  Std::string getdesc() override {
51  return Std::string(remarks);
52  }
53  unsigned int getinstruments() override {
54  return tins;
55  }
56  unsigned int getsubsongs() override {
57  return subsongs;
58  }
59 
60 protected:
61  static const unsigned char adlib_opadd[];
62  static const int ops[], map_chan[], fnums[], percussion_map[];
63 
64  struct midi_track {
65  unsigned long tend;
66  unsigned long spos;
67  unsigned long pos;
68  unsigned long iwait;
69  int on;
70  unsigned char pv;
71  };
72 
73  char *author, *title, *remarks, emptystr;
74  long flen;
75  unsigned long pos;
76 
77  int subsongs;
78  unsigned char *data;
79 
80 
81  int adlib_style;
82  int adlib_mode;
83 
84  int chp[18][3];
85 
86  long deltas;
87  long msqtr;
88 
89  midi_track track[16];
90  unsigned int curtrack;
91  unsigned int track_count;
92 
93  float fwait;
94  unsigned long iwait;
95  int doing;
96 
97  int type, tins, stins;
98 
99  OriginFXAdLibDriver *origin_fx_driver;
100 
101 private:
102 
103  void load_ultima_midi_tracks();
104  void midiprintf(const char *format, ...);
105  unsigned char datalook(long pos);
106  unsigned long getnexti(unsigned long num);
107  unsigned long getnext(unsigned long num);
108  unsigned long getval();
109 
110 public:
111  void interrupt_vector();
112 };
113 
114 } // End of namespace Nuvie
115 } // End of namespace Ultima
Definition: origin_fx_adib_driver.h:34
Definition: path.h:52
Definition: opl.h:30
Definition: detection.h:27
Definition: string.h:30
Definition: adplug_player.h:35
Definition: mid.h:29