1 /* 2 * Adplug - Replayer for many OPL2/OPL3 audio file formats. 3 * Copyright (C) 1999 - 2003 Simon Peter, <dn.tlp@gmx.net>, et al. 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 * 19 * dfm.h - Digital-FM Loader by Simon Peter <dn.tlp@gmx.net> 20 */ 21 22 #include "protrack.h" 23 24 class CdfmLoader: public CmodPlayer 25 { 26 public: 27 static CPlayer *factory(Copl *newopl); 28 CdfmLoader(Copl * newopl)29 CdfmLoader(Copl *newopl) 30 : CmodPlayer(newopl) 31 { }; 32 33 bool load(const std::string &filename, const CFileProvider &fp); 34 float getrefresh(); 35 36 std::string gettype(); getinstruments()37 unsigned int getinstruments() 38 { return 32; }; getinstrument(unsigned int n)39 std::string getinstrument(unsigned int n) 40 { if (n < 32 && *instname[n]) return std::string(instname[n] + 1, *instname[n]); else return std::string(); }; getdesc()41 std::string getdesc() 42 { return std::string(songinfo + 1, *songinfo); }; 43 44 private: 45 struct { 46 char id[4]; 47 unsigned char hiver,lover; 48 } header; 49 50 char songinfo[33]; 51 char instname[32][12]; 52 }; 53