/***************************************************************************
                          Types.h  -  description
                             -------------------
    begin                : Mit Feb 5 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 _TYPES_H
#define _TYPES_H

#include<vector>
#include<string>
#include<list>
#include<iostream>
#ifdef WIN32
#pragma warning(disable:4267)
#pragma warning(disable:4244)
#endif
//extern string toLower(const string& str);
//#define MY_DEBUG true
#define MIREX
#define FLOAT_FORMAT_ENGLISH 1
#define FLOAT_FORMAT_GERMAN 2

#define OUTPUT_FORMAT_CSV  1
#define OUTPUT_FORMAT_R    2
#define OUTPUT_FORMAT_ARFF 3
#define OUTPUT_FORMAT_GNU 4

#define OUTPUT_MODE_FEATURE    1
#define OUTPUT_MODE_TRANSFORM  2

#define  OFF 0
#define  ON  1

#define  TIMEPOINTS 1
#define  IOIS       2

#define  MAJOR      1
#define  MINOR      2
#define  MINOR1     MINOR
#define  MINOR2     3
#define  MINOR3     4
#define  CHROMATIC  5
#define  UNKNOWN    0
#define  ALL_BARS   1

#define  C0         60
#define  TOTAL      4
#define  MODUS      8
#define  MAX       16

#define  ACCENT_MIN  1
#define  ACCENT_MAJ  2

#define DBL_EPSILON 1e-6
#ifndef PI
#define PI     3.141592653589793
#endif
#ifndef TWOPI
#define TWOPI  6.28318530717959
#endif

//similarity types
#define  _VOID_               0x00000000
#define  TICKS                0x00000001
#define  WEIGHTED             0x00000001
#define  PITCH                0x00000002
#define  CONTOUR              0x00000004
#define  INTERVAL             0x00000008
#define  FOURIER              0x00000010
#define  INTERVALS            0x00000020
#define  RHYTHM               0x00000040
#define  NGRAM                0x00000080
#define  ACCENT_THOMASSEN     0x00000100
#define  HARM_CORR            0x00000200
#define  CONSTSIM             0x00000400
#define  ACCENTS              0x00000800
#define  ACCENTS_CLASS1       0x00001000
#define  ACCENTS_CLASS2       0x00002000
#define  ACCENTS_CLASS3       0x00004000
#define  ACCENTS_CLASS_OPTI1  0x00008000
#define  ACCENTS_CLASS_OPTI2  0x00010000
#define  NUMBER               0x00000100
#define  BAR                  0x00000200
#define  DURATION16           0x00000400
#define  ACCENTCOHERENCE      0x00001000
#define  HURONCONTOUR         0x10000000
#define  SIMPLE               0x00000001
#define  ZIPF                 0x00010000
#define  STATISTIC            0x80000000
#define  SPECIAL              0x10000000
#define  PHASES               0x20000000
#define  PHASES_RE            0x40000000
#define  PHASES_IM            0x80000000
#define  KEY                  0x10000000
#define  SUBBEAT_PHASES       0x01000000
#define  PHASES_DELTA         0x02000000
#define  TONAL_PITCH_PHASES   0x04000000
#define THOMASSEN_THRESHOLD   0x00000001
#define THOMASSEN_WEIGHTED    0x00000002
#define THOMASSEN_PHRASE      0x00000004

//transformation modes
#define TRANS_NONE            0x00000001
#define TRANS_PITCH           0x00000002
#define TRANS_WEIGHTED        0x00000004
#define TRANS_PITCHCLASS      0x00000008
#define TRANS_ROMANSNUMERALS  0x00000010
#define TRANS_INTERVALS       0x00000020
#define TRANS_FUZZYINTERVALS  0x00000040
#define TRANS_PARSONS         0x00000080
#define TRANS_DURATIONS16     0x00000100
#define TRANS_LOGDURATIONS    0x00000200
#define TRANS_FUZZY_DURATION  0x00000400
#define TRANS_ACCENTS         0x00000800
#define TRANS_NGRAMS          0x00001000
#define TRANS_BARS            0x00002000
#define TRANS_HURONCONTOUR    0x00004000
#define TRANS_SYNCOPES0       0x00008000
#define TRANS_SYNCOPES1       0x00010000
#define TRANS_SYNCOPES2       0x00020000
#define TRANS_SYNCOPES3       0x00040000
#define TRANS_ACCENT_OPTI1    0x00080000
#define TRANS_ACCENT_OPTI2    0x00100000
#define TRANS_ACC_OPTI1_THR   0x00200000
#define TRANS_ACC_OPTI2_THR   0x00400000

//feature group: statistics submodes
#define  STAT_NONE                 0x00000000
#define  STAT_COUNT                0x00000001
#define  STAT_RANGE                0x00000002
#define  STAT_AVERAGE              0x00000004
#define  STAT_MODUS                0x00000008
#define  STAT_MEDIAN               0x00000010
#define  STAT_VARIANCE             0x00000020
#define  STAT_STDDEV               0x00000040
#define  STAT_SKEWNESS             0x00000080
#define  STAT_KURTOSIS             0x00000100
#define  STAT_MIN                  0x00000200
#define  STAT_MAX                  0x00000400
#define  STAT_ENTROPY              0x00000800
#define  STAT_JSD                  0x00001000
#define  STAT_JSDMAX               0x00002000
#define  STAT_RUNTEST              0x00004000
   
//similarity  subtypes
#define  PEARSON_BRAVAIS      0x00010000
#define  CROSS                0x00020000
#define  EDIT_DISTANCE        0x00040000
#define  STEINBECK            0x00080000
#define  RANKS                0x00100000
#define  NATURAL              0x00100000
#define  FUZZY                0x00200000
#define  SQUASH               0x00400000
#define  SUM_COMMON           0x00800000
#define  COORDINATE           0x01000000
#define  UKKONEN              0x02000000
#define  TF_IDF               0x04000000
#define  PARSONS              0x08000000
#define  EXPONENTIAL          0x10000000
#define  MAXNORM2             0x20000000
#define  KRUMHANSL            0x40000000
#define  ED_DIST_WEIGHT       0x80000000


#define  NO_ACCENTS           0x00000000
#define  ACCENT_JUMPAFT3      0x00000001 //bit 0
#define  ACCENT_JUMPAFT4      0x00000002 //bit 1
#define  ACCENT_JUMPAFT5      0x00000004 //bit 2
#define  ACCENT_JUMPBEF3      0x00000008 //bit 3

#define  ACCENT_JUMPBEF4      0x00000010 //bit 4
#define  ACCENT_JUMPBEF5      0x00000020 //bit 5
#define  ACCENT_JUMPLOC       0x00000040 //bit 6
#define  ACCENT_BEATALL       0x00000080 //bit 7

#define  ACCENT_PITCH_BASE    ACCENT_JUMPAFT4|ACCENT_JUMPLOC|ACCENT_SHORTPHR

#define  ACCENT_PEXTREM       0x00000100 //bit 8
#define  ACCENT_PEXTRST       0x00000200 //bit 9
#define  ACCENT_PEXTRMF       0x00000400 //bit 10
#define  ACCENT_PEXTRSTA      0x00000800 //bit 11

#define  ACCENT_LONGPR        0x00001000 //bit 12
#define  ACCENT_LONG2PR       0x00002000 //bit 13
#define  ACCENT_LONGMOD       0x00004000 //bit 14
#define  ACCENT_LONG2MOD      0x00008000 //bit 15
#define  ACCENT_LONG_IOI      ACCENT_LONGPR|ACCENT_LONG2PR|ACCENT_LONGMOD|ACCENT_LONG2MOD
#define  ACCENT_LONG_BASE     ACCENT_LONGPR|ACCENT_LONGMOD
#define  ACCENT_LONG_BASE     ACCENT_LONGPR|ACCENT_LONGMOD

#define  ACCENT_SHORTPR       0x00010000 //bit 16
#define  ACCENT_SHORT2PR      0x00020000 //bit 17
#define  ACCENT_ENDLOIOI      0x00040000 //bit 18
#define  ACCENT_JUMPBEA5      0x00080000 //bit 19


#define  ACCENT_SHORT_IOI     ACCENT_SHORTPR|ACCENT_SHORT2PR|ACCENT_ENDLOIOI
#define  ACCENT_SHORT_BASE    ACCENT_SHORTPR|ACCENT_ENDLOIOI|ACCENT_LONGPR

#define  ACCENT_BEAT1         0x00100000 //bit 20
#define  ACCENT_BEAT13        0x00200000 //bit 21
#define  ACCENT_JUMPBEA3      0x00400000 //bit 22
#define  ACCENT_JUMPBEA4      0x00800000 //bit 23

#define  ACCENTS_BEAT         ACCENT_BEAT1|ACCENT_BEAT13|ACCENT_BEATALL
#define  ACCENT_BEAT_BASE     ACCENT_BEAT1|ACCENT_BEAT13

#define  ACCENT_TRIAD         0x01000000 //bit 24
#define  ACCENT_TRIAPHEN      0x02000000 //bit 25
#define  ACCENT_SYNCOP1       0x04000000 //bit 26
#define  ACCENT_SYNCOP2       0x08000000 //bit 27
#define  ACCENT_HARM          ACCENT_TRIAD|ACCENT_TRIAPHEN
#define  ACCENT_HARM_BASE     ACCENT_TRIAD

#define  ACCENT_PHRASBEG      0x10000000 //bit 28
#define  ACCENT_PHRASEND      0x20000000 //bit 29
#define  ACCENT_CONST         0x40000000 //bit 29
#define  ACCENT_SHORTPHR      0x80000000 //bit 

#define  ACCENT_PHRASE        ACCENT_PHRASBEG|ACCENT_PHRASEND
#define  ACCENT_PHRASE_BASE   ACCENT_PHRASBEG|ACCENT_PHRASEND

#define  ACCENT_BASE          ACCENT_PITCH_BASE|ACCENT_SHORT_BASE|ACCENT_LONG_BASE|ACCENT_HARM_BASE|ACCENT_PHRASE_BASE

#define  ACCENT_ALWAYS       ACCENT_SHORTPHR|ACCENT_PHRASBEG

#define  ACCENTS_JUMPAFT      ACCENT_JUMPAFT3|ACCENT_JUMPAFT4|ACCENT_JUMPAFT5
#define  ACCENTS_JUMPBEF      ACCENT_JUMPBEF3|ACCENT_JUMPBEF4|ACCENT_JUMPBEF5
#define  ACCENTS_JUMPBEA      ACCENT_JUMPBEA3|ACCENT_JUMPBEA4|ACCENT_JUMPBEA5

#define  ACCENTS_PITCH         ACCENTS_JUMPAFT|ACCENTS_JUMPBEF|ACCENTS_JUMPBEA|ACCENT_JUMPLOC
#define  ACCENTS_CONTOUR       ACCENT_PEXTREM|ACCENT_PEXTRST|ACCENT_PEXTRMF|ACCENT_PEXTRSTA
#define  ACCENTS_DURATIONAL    ACCENT_LONG_IOI|ACCENT_SHORT_IOI
#define  ACCENTS_METER         ACCENTS_BEAT|ACCENT_SYNCOP1|ACCENT_SYNCOP2
#define  ACCENTS_HARM          TRIAD|TRIADPHEN
#define  ACCENTS_PHRASE        ACCENT_PHRASE|ACCENT_SHORTPHR
#define  CHECK_ACCENTS(rules, flags)  (((rules) & (flags)) !=0 )

inline bool checkAccents(int rules, int flags)
{
   return (rules & flags) != 0;
}

#define  ACCENT_JOINT41    ACCENT_JUMPAFT4|ACCENT_LONG2PR|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT42    ACCENT_PEXTRMF|ACCENT_LONG2PR|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT43    ACCENT_JUMPAFT4|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT44    ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT45    ACCENT_JUMPBEA3|ACCENT_LONG2PR|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT46    ACCENT_JUMPBEA3|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_TRIAD

#define  ACCENT_JOINT51    ACCENT_JUMPAFT4|ACCENT_PEXTRMF|ACCENT_LONG2PR|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT52    ACCENT_JUMPAFT4|ACCENT_PEXTRMF|ACCENT_LONG2PR|ACCENT_PHRASEND|ACCENT_TRIAD
#define  ACCENT_JOINT53    ACCENT_JUMPAFT4|ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT54    ACCENT_JUMPAFT4|ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_PHRASEND|ACCENT_TRIAD
#define  ACCENT_JOINT55    ACCENT_JUMPBEA3|ACCENT_PEXTRMF|ACCENT_LONG2PR|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT56    ACCENT_JUMPBEA3|ACCENT_PEXTRMF|ACCENT_LONG2PR|ACCENT_PHRASEND|ACCENT_TRIAD
#define  ACCENT_JOINT57    ACCENT_JUMPBEA3|ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_TRIAD
#define  ACCENT_JOINT58    ACCENT_JUMPBEA3|ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_PHRASEND|ACCENT_TRIAD

#define  ACCENT_JOINT61    ACCENT_JUMPAFT4|ACCENT_PEXTRMF|ACCENT_LONG2PR |ACCENT_BEAT13|ACCENT_PHRASEND|ACCENT_TRIAD
#define  ACCENT_JOINT62    ACCENT_JUMPAFT4|ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_PHRASEND|ACCENT_TRIAD
#define  ACCENT_JOINT63    ACCENT_JUMPBEA3|ACCENT_PEXTRMF|ACCENT_LONG2PR |ACCENT_BEAT13|ACCENT_PHRASEND|ACCENT_TRIAD
#define  ACCENT_JOINT64    ACCENT_JUMPBEA3|ACCENT_PEXTRMF|ACCENT_ENDLOIOI|ACCENT_BEAT13|ACCENT_PHRASEND|ACCENT_TRIAD


#define  ACCENTS0       ACCENTS|EDIT_DISTANCE
#define  ACCENTS1       ACCENTS|EDIT_DISTANCE|ACCENTS_CLASS1
#define  ACCENTS2       ACCENTS|EDIT_DISTANCE|ACCENTS_CLASS2
#define  ACCENTS3       ACCENTS|EDIT_DISTANCE|ACCENTS_CLASS3
#define  ACCENTS4       ACCENTS|ED_DIST_WEIGHT
#define  ACCENTS5       ACCENTS|ED_DIST_WEIGHT|ACCENTS_CLASS3
#define  ACCENTS_OPTI1  ACCENTS|ED_DIST_WEIGHT|ACCENTS_CLASS_OPTI1
#define  ACCENTS_OPTI2  ACCENTS|ED_DIST_WEIGHT|ACCENTS_CLASS_OPTI2

enum eAccentPos{
eAccPos_NONE = -1,

eAccPos_JUMPAFT3, //bit 0
eAccPos_JUMPAFT4, //bit 1
eAccPos_JUMPAFT5, //bit 2
eAccPos_JUMPBEF3, //bit 3

eAccPos_JUMPBEF4, //bit 4
eAccPos_JUMPBEF5, //bit 5
eAccPos_JUMPLOC,  //bit 6
eAccPos_BEATALL,  //bit 7

eAccPos_PEXTREM, //bit 8
eAccPos_PEXTRST, //bit 9
eAccPos_PEXTRMF, //bit 10
eAccPos_PEXTRSTA,//bit 11

eAccPos_LONGPR,  //bit 12
eAccPos_LONG2PR, //bit 13
eAccPos_LONGMOD, //bit 14
eAccPos_LONG2MOD,//bit 15

eAccPos_SHORTPR, //bit 16
eAccPos_SHORT2PR,//bit 17
eAccPos_ENDLIOI, //bit 18
eAccPos_JUMPBEA5,//bit 19

eAccPos_BEAT1,   //bit 20
eAccPos_BEAT13,  //bit 21
eAccPos_JUMPBEA3,//bit 22
eAccPos_JUMPBEA4,//bit 23

eAccPos_TRIAD,    //bit 24
eAccPos_TRIAPHEN, //bit 25
eAccPos_SYNCOP1,  //bit 26
eAccPos_SYNCOP2,  //bit 27

eAccPos_PHRASBEG, //bit 28
eAccPos_PHRASEND, //bit 29
eAccPos_CONST,    //bit 30
eAccPos_SHORTPHR,  //bit 31

eAccPos_MAX    
};
#define  BEGIN_PHRASE      1
#define  END_PHRASE        2
#define  IN_PHRASE         0

#define GETBIT(x,n) ((x)&(1<<(n)))

#define FILE_MODE_READ      0
#define FILE_MODE_WRITE     1
#define FILE_MODE_APPEND    2

#define ACCENT_COHERENCE_NONE             0
#define ACCENT_COHERENCE_MAX_VARIANCE     0x00001001
#define ACCENT_COHERENCE_MEAN_KORR        0x00001002
#define ACCENT_COHERENCE_MEAN_ED_KORR     0x00001004
#define ACCENT_COHERENCE_MEAN_ED_KORR_EXP 0x00001008

enum eContourMode{eCont_none = 0, eCont_all, eCont_classic, eCont_steinbeck};

#define CONTOUR_MODE_NONE        0x00000000
#define CONTOUR_MODE_MF          0x00000001
#define CONTOUR_MODE_STEINBECK   0x00000002
#define CONTOUR_MODE_ALL         0x00000003
#define CONTOUR_MODE_NO_CONTOUR  0x00000004

#define NORM_MODE_NONE           0x00000000
#define NORM_MODE_AMBITUS        0x00000010
#define NORM_MODE_MEAN           0x00000020
#define NORM_MODE_HURON          0x00000040


using namespace std;

typedef  char                 MIDIPitch;        
typedef  vector<double>  data;
typedef  vector<double>::iterator dataIter;
typedef  vector<double>::const_iterator const_dataIter;
typedef  unsigned int         uint;
typedef  vector<MIDIPitch>    PitchSequence;
typedef  vector<uint>         durations;
typedef  vector<uint>         indizes;
typedef  vector<uint>         iData;
typedef  vector<string>       stringlist;
typedef  vector<data>         dataVec;

typedef struct{
   int idx;
   int left, mid1, mid2, right;
}INTERVALFEATURE;

typedef enum{ silent = 0, normal, verbose} verbosity;

typedef enum{
   silentOpt = 0,
   verboseOpt,
   allfileOpt,
   nextFileOpt,
   onefileOpt,
   filefileOpt,
   typeFileOpt,
   threshOpt,
   appendOpt,
   randomOpt,
   queryOpt,
   queryFullOpt,
   dirOpt,
   phraseOpt,
   tonalityOpt,
   outputOpt,
   outputFileOpt,
   headerOpt,
   floatFormatOpt,
   outputFormatOpt,
   printOpt,
   explanationOpt,
   helpOpt,
   fileListOpt,
   quantOpt,
   fieldSepOpt
}
tagOption;


typedef enum{
  csv = 0
} fileType;

struct SimType{
    SimType():m_sName(""), m_sDisplay(""), m_iMode(0), m_iSubmode(0),m_iAccentFlags(0){}
    SimType(const uint mode, const uint submode = _VOID_, const uint accentFlags = NO_ACCENTS): 
      m_sName(""),
      m_sDisplay(""),
      m_iMode(mode),
      m_iSubmode(submode),
      m_iAccentFlags(accentFlags)
    {}
    SimType(const char *name, const char *display, const uint mode, const uint submode, const uint accentFlags = 0): 
      m_sName(name),
      m_sDisplay(display),
      m_iMode(mode),
      m_iSubmode(submode),
      m_iAccentFlags(accentFlags)
    {}
    SimType(const SimType& simT):
      m_sName(simT.m_sName),
      m_sDisplay(simT.m_sDisplay),
      m_iMode(simT.m_iMode),
      m_iSubmode(simT.m_iSubmode),
      m_iAccentFlags(simT.m_iAccentFlags)
    {}
    SimType(const SimType* pSimT):
      m_sName(pSimT->m_sName),
      m_sDisplay(pSimT->m_sDisplay),
      m_iMode(pSimT->m_iMode),
      m_iSubmode(pSimT->m_iSubmode),
      m_iAccentFlags(pSimT->m_iAccentFlags)      
    {}
    
    bool    operator ==(const SimType& comp);
    bool    operator!=(const SimType& comp);

    void    setFlag(const uint flag)   { m_iAccentFlags |= flag; }
    void    clearFlag(const uint flag) { m_iAccentFlags &= ~flag;}
    void    setAccentFlag(const uint flag)   { m_iAccentFlags |= flag; }
    void    clearAccentFlag(const uint flag) { m_iAccentFlags &= ~flag;}
    void    setDisplayName(const string & name){ m_sDisplay = name;}
    
    string  m_sName;
    string  m_sDisplay;
    uint    m_iMode;
    uint    m_iSubmode;
    uint    m_iAccentFlags;
    
    void    dump() const


    {
       cerr<<"Simtype: "<<m_sName.c_str()<<" Display: "<<m_sDisplay.c_str()<<"Flags: 0x"<<hex<<m_iMode<<endl;
    }
};
class FeatureDef
{
public:
   FeatureDef():m_sName(""), m_sDisplay(""), m_iMode(0), m_iSubmode(0){}
   FeatureDef(const uint mode, const uint submode): 
      m_sName(""),
      m_sDisplay(""),
      m_iMode(mode),
      m_iSubmode(submode)
    {}
   FeatureDef(const char *name, const char *display, const uint mode, const uint submode): 
      m_sName(name),
      m_sDisplay(display),
      m_iMode(mode),
      m_iSubmode(submode)
    {}
    FeatureDef(const FeatureDef& featureDef):
      m_sName(featureDef.m_sName),
      m_sDisplay(featureDef.m_sDisplay),
      m_iMode(featureDef.m_iMode),
      m_iSubmode(featureDef.m_iSubmode)
    {}
    string  getName()const { return m_sName;}
    string  getDisplayName()const { return m_sDisplay;}
    uint    getMode()    const { return m_iMode;}
    uint    getSubMode() const {return m_iSubmode;}

   void    setDisplayName(const string &name){ m_sDisplay = name;}

protected:
    string  m_sName;
    string  m_sDisplay;
    uint    m_iMode;
    uint    m_iSubmode;
    
    void    dump() const
    {
       cerr<<"FeatureDef: "<<m_sName.c_str()<<" Display: "<<m_sDisplay.c_str()<<"Mode: 0x"<<hex<<m_iMode<<"Submode: 0x"<<hex<<m_iSubmode<<endl;
    }
};

typedef vector<const FeatureDef*> FeatureList;
typedef list<const SimType*> SimList;

struct CombiTypeElement:SimList
{
   CombiTypeElement(): m_sCombiName(""), m_dWeight(0.0)
   {}
   CombiTypeElement(const string& combiName, double weight = 1.0)
      :m_sCombiName(combiName), m_dWeight(weight)
   {}
   CombiTypeElement(SimList simTypeList, const string& combiName, double weight = 1.0)
      :SimList(simTypeList), m_sCombiName(combiName), m_dWeight(weight)
   {}

   void  set(const string& combiName, double weight = 1.0)
   {
      m_sCombiName = combiName;
      m_dWeight    = weight;
   }

   string            m_sCombiName;
   double            m_dWeight;
   void              dump() const
   {
       cerr<<"Combiname: "<<m_sCombiName<<" Weight: "<<m_dWeight<<endl;
   }
};

typedef list<CombiTypeElement> CombiList;

class CombiType: public CombiList
{
public:
  CombiType(const char *combiName = ""): m_sCombiName(combiName){ clear();}
  CombiType(const CombiType& combi):CombiList(static_cast<CombiList>(combi))
  {
    CombiType::const_iterator it ;
    m_sCombiName = combi.m_sCombiName;
    m_sCombiDisplay = combi.m_sCombiDisplay;
    clear();
    //cerr<<"Copy constructor"<<endl;
    for(it = combi.begin(); it != combi.end(); ++it){
      push_back(*it);
    }
    //dump();
  }
  bool operator ==(const CombiType& comp)const
  {
    return m_sCombiName == comp.m_sCombiName;
  }
  bool operator !=(const CombiType& comp)const
  {
    return m_sCombiName != comp.m_sCombiName;
  }
  string m_sCombiName;
  string m_sCombiDisplay;
  
  void   dump() const
  {
    for(CombiType::const_iterator it = begin(); it != end(); ++it){
      it->dump();
    }
  }
};


typedef vector<CombiType> SimTypeList;

class Melody;
typedef Melody          *PMelody;
typedef vector<PMelody>  MelodyList;


#endif

