00001 #ifndef GUIDOEngine_H
00002 #define GUIDOEngine_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <ostream>
00019 #include <string>
00020 #include <vector>
00021 #include "GUIDOExport.h"
00022
00023 class GuidoFeedback;
00024 class VGDevice;
00025
00026 struct NodeAR;
00027 struct NodeGR;
00028 typedef struct NodeAR * ARHandler;
00029 typedef struct NodeGR * GRHandler;
00030 typedef const struct NodeAR * CARHandler;
00031 typedef const struct NodeGR * CGRHandler;
00032
00036 struct GuidoInitDesc
00037 {
00039 VGDevice * graphicDevice;
00040
00041 void * reserved;
00042
00044 const char * musicFont;
00046 const char * textFont;
00047 };
00048
00051 struct GPaintStruct
00052 {
00054 bool erase;
00057 int left;
00058 int top;
00059 int right;
00060 int bottom;
00061 };
00062
00067 struct GuidoOnDrawDesc
00068 {
00070 GRHandler handle;
00071
00073 VGDevice * hdc;
00075 int page;
00077 GPaintStruct updateRegion;
00078
00084 int scrollx, scrolly;
00085
00089 float reserved;
00090
00091 int sizex, sizey;
00092
00095 int isprint;
00096 };
00097
00098
00101 enum { kNoBB, kPageBB,
00102 kSystemsBB = 2,
00103 kSystemsSliceBB = 4,
00104 kStavesBB = 8,
00105 kMeasureBB = 0x10,
00106 kEventsBB = 0x20,
00107 };
00108
00109
00119 enum GuidoErrCode
00120 {
00122 guidoNoErr = 0,
00124 guidoErrParse = -1,
00126 guidoErrMemory = -2,
00128 guidoErrFileAccess = -3,
00130 guidoErrUserCancel = -4,
00132 guidoErrNoMusicFont = -5,
00134 guidoErrNoTextFont = -6,
00136 guidoErrBadParameter = -7,
00138 guidoErrInvalidHandle = -8,
00140 guidoErrNotInitialized = -9,
00142 guidoErrActionFailed = -10
00143 };
00150 typedef struct
00151 {
00153 int num;
00155 int denom;
00156 } GuidoDate;
00157
00158
00159 enum { kAutoDistrib = 1, kAlwaysDistrib = 2, kNeverDistrib = 3 };
00160
00164 typedef struct GuidoLayoutSettings
00165 {
00169 float systemsDistance;
00170
00174 int systemsDistribution;
00175
00180 float systemsDistribLimit;
00181
00185 float force;
00186
00190 float spring;
00191
00195 int neighborhoodSpacing;
00196
00200 int optimalPageFill;
00201
00205 int resizePage2Music;
00206
00207 } GuidoLayoutSettings;
00208
00215 typedef struct
00216 {
00217 float width;
00218 float height;
00219 float marginleft;
00220 float margintop;
00221 float marginright;
00222 float marginbottom;
00223 } GuidoPageFormat;
00224
00225 #ifdef __cplusplus
00226 extern "C" {
00227 #endif
00228
00252 GUIDOAPI(GuidoErrCode) GuidoInit(GuidoInitDesc * desc);
00253
00261 GUIDOAPI(void) GuidoShutdown();
00262
00271
00272 GUIDOAPI(GuidoErrCode) GuidoParseFile(const char * filename, ARHandler* ar);
00273
00282
00283 GUIDOAPI(GuidoErrCode) GuidoParseString(const char * str, ARHandler* ar);
00284
00298 GUIDOAPI(GuidoErrCode) GuidoAR2GR( ARHandler ar, const GuidoLayoutSettings* settings, GRHandler* gr);
00299
00300
00313 GUIDOAPI(GuidoErrCode) GuidoAR2RProportional( ARHandler ar, int width, int height, const GuidoDate& start, const GuidoDate& end, bool drawdur, VGDevice* dev);
00314
00327
00328
00340
00341
00342
00350 GUIDOAPI(GuidoErrCode) GuidoUpdateGR( GRHandler gr, const GuidoLayoutSettings* settings);
00351
00356 GUIDOAPI(void) GuidoFreeAR (ARHandler ar);
00357
00362 GUIDOAPI(void) GuidoFreeGR (GRHandler gr);
00363
00370 GUIDOAPI(const char *) GuidoGetErrorString( GuidoErrCode errCode );
00371
00376
00377 GUIDOAPI(int) GuidoGetParseErrorLine();
00378
00384 GUIDOAPI(void) GuidoGetDefaultLayoutSettings (GuidoLayoutSettings * settings);
00385
00403 GUIDOAPI(int) GuidoCountVoices( CARHandler inHandleAR );
00404
00410 GUIDOAPI(int) GuidoGetPageCount( CGRHandler inHandleGR );
00411
00418 GUIDOAPI(int) GuidoGetSystemCount( CGRHandler inHandleGR, int page );
00419
00429 GUIDOAPI(GuidoErrCode) GuidoDuration( CGRHandler inHandleGR, GuidoDate * date );
00430
00431
00440 GUIDOAPI(int) GuidoFindEventPage( CGRHandler inHandleGR, const GuidoDate& date );
00441
00442
00451 GUIDOAPI(int) GuidoFindPageAt( CGRHandler inHandleGR, const GuidoDate& date );
00452
00453
00454
00462 GUIDOAPI(GuidoErrCode) GuidoGetPageDate( CGRHandler inHandleGR, int pageNum, GuidoDate* date);
00463
00464
00482 GUIDOAPI(GuidoErrCode) GuidoOnDraw( GuidoOnDrawDesc * desc );
00483
00491 GUIDOAPI(GuidoErrCode) GuidoSVGExport( const GRHandler handle, int page, std::ostream& out, const char* fontfile );
00492
00498 GUIDOAPI(GuidoErrCode) GuidoAbstractExport( const GRHandler handle, int page, std::ostream& out);
00499
00505 GUIDOAPI(GuidoErrCode) GuidoBinaryExport( const GRHandler handle, int page, std::ostream& out);
00506
00511 GUIDOAPI(void) GuidoDrawBoundingBoxes(int bbMap);
00512
00515 GUIDOAPI(int) GuidoGetDrawBoundingBoxes();
00516
00523 GUIDOAPI(void) GuidoGetPageFormat( CGRHandler inHandleGR, int pageNum, GuidoPageFormat* format );
00524
00538 GUIDOAPI(void) GuidoSetDefaultPageFormat( const GuidoPageFormat* format);
00539
00544 GUIDOAPI(void) GuidoGetDefaultPageFormat( GuidoPageFormat* format );
00545
00551 GUIDOAPI(float) GuidoUnit2CM(float val);
00552
00558 GUIDOAPI(float) GuidoCM2Unit(float val);
00559
00565 GUIDOAPI(float) GuidoUnit2Inches(float val);
00566
00572 GUIDOAPI(float) GuidoInches2Unit(float val);
00573
00574
00580 GUIDOAPI(GuidoErrCode) GuidoResizePageToMusic( GRHandler inHandleGR );
00581
00582
00600 GUIDOAPI(void) GuidoGetVersionNums(int * major, int * minor, int * sub);
00601
00605 GUIDOAPI(const char*) GuidoGetVersionStr();
00606
00607
00617 GUIDOAPI(GuidoErrCode) GuidoCheckVersionNums(int major, int minor, int sub);
00618
00619
00627 GUIDOAPI(float) GuidoGetLineSpace();
00628
00629
00644 GUIDOAPI(GuidoErrCode) GuidoMarkVoice( ARHandler inHandleAR, int voicenum,
00645 const GuidoDate & date, const GuidoDate & duration,
00646 unsigned char red, unsigned char green, unsigned char blue );
00647
00648
00656 GUIDOAPI(GuidoErrCode) GuidoSetSymbolPath(ARHandler inHandleAR, const std::vector<std::string> &inPaths);
00657
00658
00666 GUIDOAPI(GuidoErrCode) GuidoGetSymbolPath(const ARHandler inHandleAR, std::vector<std::string> &inPathVector);
00667
00670 void AddGGSOutput(const char *s);
00671 void AddGuidoOutput(const char *s);
00672
00673 #ifdef __cplusplus
00674 }
00675 #endif
00676
00677
00678 #endif