/* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2008 Simon Peter, , et al. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * rol.h - ROL Player by OPLx * * Visit: http://tenacity.hispeed.com/aomit/oplx/ */ #ifndef H_ROLPLAYER #define H_ROLPLAYER #include "player.h" class CrolPlayer: public CPlayer { public: static CPlayer *factory(Copl *newopl); CrolPlayer(Copl *newopl); ~CrolPlayer(); bool load (const char *filename, const CFileProvider &fp); bool update (); void rewind (int subsong); // rewinds to specified subsong float getrefresh(); // returns needed timer refresh rate const char * gettype() { return "Adlib Visual Composer"; } private: typedef unsigned short uint16; typedef signed short int16; #ifdef __x86_64__ typedef signed int int32; #else typedef signed long int int32; #endif typedef float real32; typedef struct { uint16 version_major; uint16 version_minor; char unused0[40]; uint16 ticks_per_beat; uint16 beats_per_measure; uint16 edit_scale_y; uint16 edit_scale_x; char unused1; char mode; char unused2[90]; char filler0[38]; char filler1[15]; real32 basic_tempo; } SRolHeader; typedef struct { int16 time; real32 multiplier; } STempoEvent; typedef struct { int16 number; int16 duration; } SNoteEvent; typedef struct { int16 time; char name[9]; int16 ins_index; } SInstrumentEvent; typedef struct { int16 time; real32 multiplier; } SVolumeEvent; typedef struct { int16 time; real32 variation; } SPitchEvent; enum { MAX_NOTE_EVENTS = 2000, }; #define bit_pos( pos ) (1<