// ----
// ---- file   : MIDIPipeEvent.h
// ---- author : Bastian Spiegel <bs@tkscript.de>
// ---- legal  : (c) 2014-2016 by Bastian Spiegel. 
// ----          Distributed under terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL). See 
// ----          http://www.gnu.org/licenses/licenses.html#LGPL or COPYING for further information.
// ----
// ---- info   : This is part of the "syntracker" sequencer.
// ----
// ---- changed: 01Sep2014, 06Sep2014, 07Sep2014, 11Jan2015, 16Feb2015, 26Mar2015, 30Jun2015
// ----          27Feb2016, 10Feb2017
// ----
// ----
// ----

#ifndef __TK_MIDIPIPEEVENT_H__
#define __TK_MIDIPIPEEVENT_H__

YG("midipipe")


/* @class MIDIPipeEvent,Object
 */
YC class MIDIPipeEvent : public YAC_Object {

#define MIDIPIPE_EVENT_TYPE_NONE          YCI  (0u)
#define MIDIPIPE_EVENT_TYPE_PRGCHG        YCI  (1u)
#define MIDIPIPE_EVENT_TYPE_CHPRESSURE    YCI  (2u)
#define MIDIPIPE_EVENT_TYPE_PITCHBEND     YCI  (3u)
#define MIDIPIPE_EVENT_TYPE_CC            YCI  (4u)
#define MIDIPIPE_EVENT_TYPE_RPN           YCI  (5u)
#define MIDIPIPE_EVENT_TYPE_NRPN          YCI  (6u)
#define MIDIPIPE_EVENT_TYPE_NOTE_OFF      YCI  (7u)
#define MIDIPIPE_EVENT_TYPE_NOTE_ON       YCI  (8u)
#define MIDIPIPE_EVENT_TYPE_POLYPRESSURE  YCI  (9u)

#define MIDIPIPE_EVENT_TYPE_NOTES         YCI  (10u)  // special io_filter case

#define MIDIPIPE_EVENT_TYPE_ALL_NOTES_OFF YCI  (11u)
#define MIDIPIPE_EVENT_TYPE_SYSEX         YCI  (12u)


  public:
   sUI event_index;   // absolute index in MIDIPipeFrame
   sUI event_type;

   midipipe_frame_u data;

  public:
   MIDIPipeEvent(void);
   ~MIDIPipeEvent();

   YAC(MIDIPipeEvent);

  public:

  public:
   YM sUI  getIndex(void);
   YM sUI  getType(void);
   YM void getTypeName(YAC_Value *_r);
   YM sSI  getDevIdx(void);
   YM sSI  getMidiCh(void);
   YM sSI  getPrgChg(void);
   YM sSI  getChPressure(void);
   YM sSI  getPitchbend(void);
   YM sSI  getCcId(void);
   YM sSI  getCcValue(void);
   YM sSI  getRpn(void);
   YM sSI  getRpnValue(void);
   YM sSI  getNrpn(void);
   YM sSI  getNrpnValue(void);
   YM sSI  getNote(void);
   YM sSI  getVelocity(void);
   YM sSI  getDuration(void);
   YM sSI  getPolyPressureNote(void);
   YM sSI  getPolyPressureValue(void);

   YM sSI getArg1(void);
   YM sSI getArg2(void);
   YM sSI getArg3(void);

   YM void getArg1Name(YAC_Value *_r);
   YM void getArg2Name(YAC_Value *_r);
   YM void getArg3Name(YAC_Value *_r);

   YM sSI isNote(void);

   /* void setArg1(sSI _val); */
   /* void setArg2(sSI _val); */
   /* void setArg3(sSI _val); */

   YM YAC_Buffer *getSysExBuffer(void);
};


#endif // __TK_MIDIPIPEEVENT_H__
