• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

GUIDOEngineAdapter.h

Go to the documentation of this file.
00001 #ifndef GUIDOENGINEADAPTER_H
00002 #define GUIDOENGINEADAPTER_H
00003 /*
00004   GUIDO Library
00005   Copyright (C) 2014    Grame
00006 
00007   This Source Code Form is subject to the terms of the Mozilla Public
00008   License, v. 2.0. If a copy of the MPL was not distributed with this
00009   file, You can obtain one at http://mozilla.org/MPL/2.0/.
00010 
00011   Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
00012   research@grame.fr
00013 
00014 */
00015 
00016 #include <string>
00017 #include "GUIDOEngine.h"
00018 
00019 class GuidoParser;
00020 class GuidoStream;
00021 
00025 typedef struct {
00027     int line;
00029     int col;
00031     std::string msg;
00032 } ParserError;
00033 
00037 typedef struct {
00039     int major;
00041     int minor;
00043     int sub;
00045     std::string str;
00046 } GuidoVersion;
00047 
00056 class_export GuidoEngineAdapter
00057 {
00058     public:
00062         GuidoEngineAdapter();
00066         virtual ~GuidoEngineAdapter();
00067 
00068 
00084         GuidoErrCode init(GuidoInitDesc * desc);
00085 
00092         GuidoErrCode init();
00093 
00101         void     shutdown();
00102 
00113         GRHandler ar2gr(ARHandler ar);
00114 
00126         GRHandler ar2gr(ARHandler ar, const GuidoLayoutSettings &settings);
00127 
00134         GuidoErrCode updateGR(GRHandler gr);
00135 
00142         GuidoErrCode updateGR(GRHandler gr, const GuidoLayoutSettings &settings);
00143 
00149         void freeAR(ARHandler ar);
00150 
00156         void freeGR(GRHandler gr);
00157 
00164         std::string getErrorString(GuidoErrCode errCode);
00165 
00171         GuidoLayoutSettings getDefaultLayoutSettings();
00189         int countVoices(CARHandler inHandleAR);
00190 
00196         int getPageCount(CGRHandler inHandleGR);
00197 
00204         int getSystemCount(CGRHandler inHandleGR, int page);
00205 
00214         GuidoDate duration(CGRHandler inHandleGR);
00215 
00224         int findEventPage(CGRHandler inHandleGR, const GuidoDate& date);
00225 
00234         int findPageAt(CGRHandler inHandleGR, const GuidoDate& date);
00235 
00242         GuidoDate getPageDate(CGRHandler inHandleGR, int pageNum);
00260         GuidoErrCode onDraw(GuidoOnDrawDesc * desc);
00261 
00273         GuidoErrCode gr2SVG( const GRHandler handle, int page, std::ostream& out, bool embedFont = true, const char* font = 0, const int mappingMode = 0 );
00274 
00283         std::string gr2SVG(const GRHandler handle, int page, bool embedFont = true, const int mappingMode = 0);
00284 
00292         GuidoErrCode abstractExport(const GRHandler handle, int page, std::ostream& out);
00293 
00300         std::string abstractExport(const GRHandler handle, int page);
00301 
00309         GuidoErrCode binaryExport(const GRHandler handle, int page, std::ostream& out);
00310 
00317         std::string binaryExport(const GRHandler handle, int page);
00318 
00319 #ifdef CANVASSYSTEM
00320 
00326         GuidoErrCode javascriptExport(const GRHandler handle, int page);
00327 #endif
00328 
00332         void setDrawBoundingBoxes(int bbMap);
00333 
00337         int getDrawBoundingBoxes();
00338 
00345         GuidoPageFormat getPageFormat(CGRHandler inHandleGR, int pageNum);
00346 
00360         void setDefaultPageFormat(const GuidoPageFormat &format);
00361 
00366         GuidoPageFormat getDefaultPageFormat();
00367 
00368 
00374         float unit2CM(float val);
00375 
00381         float cm2Unit(float val);
00382 
00388         float unit2Inches(float val);
00389 
00395         float inches2Unit(float val);
00396 
00402         GuidoErrCode resizePageToMusic( GRHandler inHandleGR );
00419         GuidoVersion getVersion();
00420 
00430         GuidoErrCode checkVersionNums(int major, int minor, int sub);
00431 
00432 
00440         float getLineSpace();
00441 
00442 
00457         GuidoErrCode markVoice( ARHandler inHandleAR, int voicenum,
00458                                                 const GuidoDate & date, const GuidoDate & duration,
00459                                                 unsigned char red, unsigned char green, unsigned char blue );
00460 
00461 
00469         GuidoErrCode setSymbolPath(ARHandler inHandleAR, const std::vector<std::string> &inPaths);
00470 
00471 
00477         std::vector<std::string> getSymbolPath(const ARHandler inHandleAR);
00478 
00493         long getParsingTime (const ARHandler ar);
00494 
00500         long getAR2GRTime(const GRHandler gr);
00501 
00507         long getOnDrawTime(const GRHandler gr);
00508 
00519         GuidoParser * openParser();
00520 
00526         GuidoErrCode closeParser(GuidoParser *p);
00527 
00534         ARHandler file2AR(GuidoParser *parser, const std::string &file);
00535 
00542         ARHandler string2AR(GuidoParser *parser, const std::string &gmnCode);
00543 
00549         std::string getStream(GuidoStream *gStream);
00550 
00558         ARHandler stream2AR(GuidoParser *p, GuidoStream* stream);
00559 
00565         ParserError parserGetErrorCode(GuidoParser *p);
00566 
00574         GuidoStream * openStream ();
00575 
00581         GuidoErrCode closeStream (GuidoStream *s);
00582 
00605         GuidoErrCode writeStream (GuidoStream *s, const std::string &str);
00606 
00613         GuidoErrCode resetStream (GuidoStream *s);
00614 
00616 };
00619 #endif // GUIDOENGINEADAPTER_H

Generated on Mon Jan 5 2015 11:16:24 for GUIDOLib by doxygen 1.7.2 - © Grame Research Lab.