Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * OpenTyrian: A modern cross-platform port of Tyrian
  3.  * Copyright (C) 2007-2009  The OpenTyrian Development Team
  4.  *
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License
  7.  * as published by the Free Software Foundation; either version 2
  8.  * of the License, or (at your option) any later version.
  9.  *
  10.  * This program 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
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  18.  */
  19. #ifndef LDS_PLAY_H
  20. #define LDS_PLAY_H
  21.  
  22. #include "opentyr.h"
  23.  
  24. #include <stdio.h>
  25.  
  26. extern bool playing, songlooped;
  27.  
  28. int lds_update( void );
  29. bool lds_load( FILE *f, unsigned int music_offset, unsigned int music_size );
  30. void lds_free( void );
  31. void lds_rewind( void );
  32.  
  33. #define REFRESH 70.0f
  34.  
  35. /*unsigned int getorders() { return numposi; }
  36. unsigned int getorder() { return posplay; }
  37. unsigned int getrow() { return pattplay; }
  38. unsigned int getspeed() { return speed; }
  39. unsigned int getinstruments() { return numpatch; }*/
  40.  
  41. typedef struct {
  42.         unsigned char mod_misc, mod_vol, mod_ad, mod_sr, mod_wave,
  43.                 car_misc, car_vol, car_ad, car_sr, car_wave, feedback, keyoff,
  44.                 portamento, glide, finetune, vibrato, vibdelay, mod_trem, car_trem,
  45.                 tremwait, arpeggio, arp_tab[12];
  46.         unsigned short start, size;
  47.         unsigned char fms;
  48.         unsigned short transp;
  49.         unsigned char midinst, midvelo, midkey, midtrans, middum1, middum2;
  50. } SoundBank;
  51.  
  52. typedef struct {
  53.         unsigned short gototune, lasttune, packpos;
  54.         unsigned char finetune, glideto, portspeed, nextvol, volmod, volcar,
  55.                 vibwait, vibspeed, vibrate, trmstay, trmwait, trmspeed, trmrate, trmcount,
  56.                 trcwait, trcspeed, trcrate, trccount, arp_size, arp_speed, keycount,
  57.                 vibcount, arp_pos, arp_count, packwait, arp_tab[12];
  58.         struct {
  59.                 unsigned char chandelay, sound;
  60.                 unsigned short high;
  61.         } chancheat;
  62. } Channel;
  63.  
  64. typedef struct {
  65.         unsigned short patnum;
  66.         unsigned char transpose;
  67. } Position;
  68.  
  69. void lds_playsound(int inst_number, int channel_number, int tunehigh);
  70. void lds_setregs(unsigned char reg, unsigned char val);
  71. void lds_setregs_adv(unsigned char reg, unsigned char mask, unsigned char val);
  72.  
  73. #endif /* LDS_PLAY_H */
  74.  
  75.