#ifndef _EVENT_H_
#define _EVENT_H_
#include "atom.h"
#include "position.h"
/** Events are atoms with a well defined position and duration
*/
class Event : public Atoma
{
protected:
Position _pos;
long _duration;
public:
/** Default constructor */
Event();
/** Constructor used by copy() */
Event(const Event&);
/** Constructor at a position */
Event(Position);
/** Constructor with position and duration */
Event(Position,long);
/** returns the start position (relative to the part) of an event. For the absolute position (within the track) use
* the part's method position(event) */
const Position & internalStart() const { return _pos; }
/** returns the end position (relative to the part) of an event */
long internalEnd() const;
/** returns the duration of an event */
long duration() const { return _duration; }
/** sets the start position */
void setInternalStart(Position);
/** quantizes the position */
void snapStart(int);
/** sets the duration of an event */
void setDuration(long);
/** print has to be implemented */
virtual ostream & print(int,ostream&) const = 0;
/** flush has to be implemented */
virtual void flush(const char*) const = 0;
/** copy has to be implemented */
virtual Element * copy() const = 0;
/* -> into part
bool startsBefore(long);
bool startsBehind(long);
bool startsAt(long);
bool endsBefore(long);
bool endsBehind(long);
bool endsAt(long);
*/
virtual bool isEvent() const { return true; }
// static Event * load(char*,ifstream*&);
};
#endif
| Generated by: wuerthne on clouseau on Fri Sep 21 19:20:46 2001, using kdoc 2.0a53. |