| 1 |
// |
| 2 |
// MDRubyPointer.h |
| 3 |
// Alchemusica |
| 4 |
// |
| 5 |
// Created by Toshi Nagata on 08/03/30. |
| 6 |
// Copyright 2008-2016 Toshi Nagata. All rights reserved. |
| 7 |
// |
| 8 |
/* |
| 9 |
This program is free software; you can redistribute it and/or modify |
| 10 |
it under the terms of the GNU General Public License as published by |
| 11 |
the Free Software Foundation version 2 of the License. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef __MDRubyPointer__ |
| 20 |
#define __MDRubyPointer__ |
| 21 |
|
| 22 |
#include <ruby.h> |
| 23 |
#include "MDHeaders.h" |
| 24 |
#include "MyDocument.h" |
| 25 |
|
| 26 |
@class MyDocument; |
| 27 |
|
| 28 |
// Pointer class |
| 29 |
extern VALUE rb_cMRPointer; |
| 30 |
|
| 31 |
// Internal structure |
| 32 |
typedef struct MRPointerInfo { |
| 33 |
MyDocumentTrackInfo trackInfo; // MDTrack is _not_ retained |
| 34 |
MDPointer *pointer; // MDPointer _is_ retained |
| 35 |
} MRPointerInfo; |
| 36 |
|
| 37 |
VALUE MREventSymbolFromEventKindAndCode(int kind, int code, int *is_generic); |
| 38 |
int MREventKindAndCodeFromEventSymbol(VALUE sym, int *code, int *is_generic); |
| 39 |
|
| 40 |
VALUE MRPointer_GetDataSub(const MDEvent *ep); |
| 41 |
void MRPointer_SetDataSub(VALUE val, MDEvent *ep, MyDocument *doc, int trackNo, int32_t position); |
| 42 |
|
| 43 |
MDPointer *MDPointerFromMRPointerValue(VALUE val); |
| 44 |
VALUE MRPointerValueFromTrackInfo(MDTrack *track, MyDocument *doc, int num, int position); |
| 45 |
|
| 46 |
VALUE MRPointer_Top(VALUE self); |
| 47 |
VALUE MRPointer_Bottom(VALUE self); |
| 48 |
VALUE MRPointer_Next(VALUE self); |
| 49 |
VALUE MRPointer_Last(VALUE self); |
| 50 |
VALUE MRPointer_NextInSelection(VALUE self); |
| 51 |
VALUE MRPointer_LastInSelection(VALUE self); |
| 52 |
// VALUE MRPointer_Flush(VALUE self); |
| 53 |
|
| 54 |
void MRPointerInitClass(void); |
| 55 |
|
| 56 |
#endif /* __MDRubyPointer__ */ |