/*
 * amplayer.h
 * Copyright (C) 2002 P.Everett <peter@everett9981.freeserve.co.uk>
 *
 * This file is part of KinoAMP, a free RISCOS MPEG program stream decoder.
 *
 * KinoAMP is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * KinoAMP 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * Definitions for the interface to the AMPlayer module.
 * Derived from documentation provided with AMPlayer v1.39
 * Refer to the AMPlayer Programmers Reference Manual for further details.
 *
 * note. This is not a complete set of definitions.
 */

#ifndef amplayer_h
#define amplayer_h

/* SWI's */
#define AMPlayer_Play               0x52e00
#define AMPlayer_Stop               0x52e01
#define AMPlayer_Pause              0x52e02
#define AMPlayer_Locate             0x52e03
#define AMPlayer_Info               0x52e04
#define AMPlayer_Control            0x52e05
#define AMPlayer_Plugin             0x52e06
#define AMPlayer_FileInfo           0x52e07
#define AMPlayer_StreamOpen         0x52e08
#define AMPlayer_StreamClose        0x52e09
#define AMPlayer_StreamGiveData     0x52e0a
#define AMPlayer_StreamInfo         0x52e0b
#define AMPlayer_MetaDataPollChange 0x52e0c
#define AMPlayer_MetaDataLookup     0x52e0d
#define AMPlayer_SoundSystem        0x52e0e
#define AMPlayer_StreamReadData     0x52e0f
#define AMPlayer_Instance           0x52e10

/* bit definitions for file_info.flags */
#define TOTAL_TIME_VALID            0x001
#define ELAPSED_TIME_VALID          0x002
#define ID3_TAG_VALID               0x004
#define VU_VALID                    0x008
#define ERROR_VALID                 0x010
#define NEXT_VALID                  0x020
#define VBR_VALID                   0x040
#define ID3_TRACK_VALID             0x080
#define DATA_FROM_STREAM            0x100

/* File Information Block */
typedef struct file_info_s
{
  int flags;             /* validity flags for following fields */
  int buff_usage;        /* buffer usage, percent */
  int total_time;        /* cs (centi secs) */
  int elapsed_time;      /* cs */

  struct
  {
    char *title;
    char *artist;
    char *album_name;
    char *year;
    char *comment;
  } ID3;

  struct
  {
    int left;
    int right;
  } VU;                  /* 1/6th dB steps, -42dB..0dB -> 0..255 */

  int volume;            /* main volume 0..127 */
  char *error;
  char *next;
  int ID3_genre;
  int ID3_track;
  int min_bitrate;
  int max_bitrate;
}
file_info_t;

/* Frame Information Block */
typedef struct frame_info_s
{
  int version;           /* 3 packed ascii chars + null */
  int layer;             /* 1..3 */
  int samp_rate;         /* Hz */
  int bitrate;           /* Kbit/sec */
  int mode;              /* {STEREO,JOINT,DUAL,SINGLE} */
  int channels;
  int flags;             /* bits: 0=copyright, 1=original, 2=crc */
  int *left_DCT;
  int *right_DCT;
}
frame_info_t;

#endif
