/***************************************************************************
                          NotesReader.h  -  description
                             -------------------
    begin                : Frei Feb 11 2005
    copyright            : (C) 2005 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_NOTESREADER_H
#define _LIBMELODY_NOTESREADER_H

#include "types.h"
#include "Melody.h"

class NotesReader
{
public:
   typedef enum{ modeNotes, modeNoteOnOff, unknown} readMode;
   public:
   NotesReader(const string& inFile, Melody *pMel):m_sInFile(inFile), m_pMel(pMel)
   {
      
   }
   ~NotesReader(){}

   bool     read();
   string   getErrText() const{ return m_sErrText;}
   void     dumpMelody();

protected:
   string   m_sInFile;
   Melody   *m_pMel;
   string   m_sErrText;

   bool     readNotes();
   bool     readNoteOnOff();
   bool     parseLine(const char *line, readMode mode, iData& vals);

};
#endif