00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Rob Bairos,, 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: CHOP_Notes.h ( CHILI Library, C++) 00015 * 00016 * COMMENTS: 00017 * 00018 * A list of index notes overlayed on the graph 00019 */ 00020 00021 #ifndef __CHOP_Notes__ 00022 #define __CHOP_Notes__ 00023 00024 #include "CHOP_API.h" 00025 #include <iostream.h> 00026 00027 #include <UT/UT_FloatArray.h> 00028 #include <UT/UT_PtrArray.h> 00029 00030 typedef UT_PtrArray<const char *> CHOP_NoteList; 00031 typedef UT_FloatArray CHOP_TimeList; 00032 class UT_IStream; 00033 00034 class CHOP_API CHOP_Notes 00035 { 00036 00037 public: 00038 00039 CHOP_Notes(); 00040 ~CHOP_Notes(); 00041 00042 int putNote(float t, int index); 00043 int putNote(int index, const char *); 00044 int putNote(float t, const char *); 00045 00046 const char *getNote(int index) const; 00047 const char *getNote(float t0) const; 00048 int getNotes(float t0, float t1, 00049 CHOP_NoteList &clist, 00050 CHOP_TimeList &tlist) const; 00051 void clearNotes(); 00052 00053 int save(ostream &os, int binary); 00054 bool load(UT_IStream &is); 00055 00056 private: 00057 00058 UT_PtrArray<char *> myStrings; 00059 UT_FloatArray myTimes; 00060 00061 void reset(void); 00062 int removeNote(float t); 00063 int removeNote(int idx); 00064 00065 int findNote(float t) const; 00066 int findOrInsertNote(float t); 00067 00068 }; 00069 00070 #endif 00071
1.5.9