/***************************************************************************
                          types.h  -  description
                             -------------------
    begin                : Sam Nov 22 2003
    copyright            : (C) 2003 by klaus frieler
    email                : kgf@omniversum.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef _LIBMELODY_TYPES_H
#define _LIBMELODY_TYPES_H

#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cmath>

#include "MelError.h"

#ifdef WIN32
#pragma warning(disable: 4267)//size_t<->uint warning
#pragma warning(disable: 4702)//size_t<->uint warning
#endif
#define  C0         60
#define  INVALID    ((unsigned int)-1)
#define  END        ((unsigned int)-1)
#define  nopos      ((uint)-1)

#define  BEGIN_PHRASE      1
#define  END_PHRASE        2
#define  IN_PHRASE         0

using namespace std;
enum Format    { unknown = -1, esac , csv, gnu, midi, notes};
enum MIDIState { noteon = 0,  noteoff,  noteonTwin,  other} ;

typedef unsigned int          uint;
typedef unsigned short        ushort;
typedef unsigned char         byte, uchar;
typedef unsigned long         ulong;
typedef  vector<uint>         iData;
typedef  vector<double>       dData;
typedef  vector<string>       sData;

typedef  iData                duration;
typedef  iData                indizes;
inline
double   bpm2ms(uint bpm){return 60000.0/bpm;}
inline
double   ms2bpm(uint ms){return ms/60000.0;}
#endif
