/[svn]/linuxsampler/trunk/src/scriptvm/common.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/common.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3035 by schoenebeck, Mon Oct 31 12:00:00 2016 UTC revision 3285 by schoenebeck, Thu Jun 22 10:45:38 2017 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014-2016 Christian Schoenebeck   * Copyright (c) 2014-2017 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 157  namespace LinuxSampler { Line 157  namespace LinuxSampler {
157           * expressions to an array expression for you, instead this method will           * expressions to an array expression for you, instead this method will
158           * simply return NULL!           * simply return NULL!
159           *           *
160             * @b Note: this method is currently, and in contrast to its other
161             * counter parts, declared as virtual method. Some deriving classes are
162             * currently using this to override this default implementation in order
163             * to implement an "evaluate now as integer array" behavior. This has
164             * efficiency reasons, however this also currently makes this part of
165             * the API less clean and should thus be addressed in future with
166             * appropriate changes to the API.
167             *
168           * @see exprType()           * @see exprType()
169           */           */
170          VMIntArrayExpr* asIntArray() const;          virtual VMIntArrayExpr* asIntArray() const;
171    
172          /**          /**
173           * Returns true in case this expression can be considered to be a           * Returns true in case this expression can be considered to be a
# Line 636  namespace LinuxSampler { Line 644  namespace LinuxSampler {
644      struct VMInt8Array {      struct VMInt8Array {
645          int8_t* data;          int8_t* data;
646          int size;          int size;
647            bool readonly; ///< Whether the array data may be modified or just be read.
648    
649          VMInt8Array() : data(NULL), size(0) {}          VMInt8Array() : data(NULL), size(0), readonly(false) {}
650      };      };
651    
652      /** @brief Virtual machine script variable.      /** @brief Virtual machine script variable.
# Line 749  namespace LinuxSampler { Line 758  namespace LinuxSampler {
758      public:      public:
759      };      };
760    
761        /** @brief Dynamically executed variable (of integer array data type).
762         *
763         * This is the base class for all built-in integer array script variables
764         * whose variable content needs to be provided dynamically by executable
765         * native code on each script variable access.
766         */
767        class VMDynIntArrayVar : virtual public VMDynVar, virtual public VMIntArrayExpr {
768        public:
769        };
770    
771      /** @brief Provider for built-in script functions and variables.      /** @brief Provider for built-in script functions and variables.
772       *       *
773       * Abstract base class defining the high-level interface for all classes       * Abstract base class defining the high-level interface for all classes
# Line 832  namespace LinuxSampler { Line 851  namespace LinuxSampler {
851           * @see ScriptVM::exec()           * @see ScriptVM::exec()
852           */           */
853          virtual int suspensionTimeMicroseconds() const = 0;          virtual int suspensionTimeMicroseconds() const = 0;
854    
855            /**
856             * Causes all polyphonic variables to be reset to zero values. A
857             * polyphonic variable is expected to be zero when entering a new event
858             * handler instance. As an exception the values of polyphonic variables
859             * shall only be preserved from an note event handler instance to its
860             * correspending specific release handler instance. So in the latter
861             * case the script author may pass custom data from the note handler to
862             * the release handler, but only for the same specific note!
863             */
864            virtual void resetPolyphonicData() = 0;
865    
866            /**
867             * Returns amount of virtual machine instructions which have been
868             * performed the last time when this execution context was executing a
869             * script. So in case you need the overall amount of instructions
870             * instead, then you need to add them by yourself after each
871             * ScriptVM::exec() call.
872             */
873            virtual size_t instructionsPerformed() const = 0;
874    
875            /**
876             * Sends a signal to this script execution instance to abort its script
877             * execution as soon as possible. This method is called i.e. when one
878             * script execution instance intends to stop another script execution
879             * instance.
880             */
881            virtual void signalAbort() = 0;
882      };      };
883    
884      /** @brief Script callback for a certain event.      /** @brief Script callback for a certain event.
# Line 863  namespace LinuxSampler { Line 910  namespace LinuxSampler {
910      };      };
911    
912      /**      /**
913         * Reflects the precise position and span of a specific code block within
914         * a script. This is currently only used for the locations of commented
915         * code blocks due to preprocessor statements.
916         *
917         * @see VMParserContext::preprocessorComments()
918         */
919        struct CodeBlock {
920            int firstLine; ///< The first line number of this code block within the script (indexed with 1 being the very first line).
921            int lastLine; ///< The last line number of this code block within the script.
922            int firstColumn; ///< The first column of this code block within the script (indexed with 1 being the very first column).
923            int lastColumn; ///< The last column of this code block within the script.
924        };
925    
926        /**
927       * Encapsulates a noteworty parser issue. This encompasses the type of the       * Encapsulates a noteworty parser issue. This encompasses the type of the
928       * issue (either a parser error or parser warning), a human readable       * issue (either a parser error or parser warning), a human readable
929       * explanation text of the error or warning and the location of the       * explanation text of the error or warning and the location of the
# Line 955  namespace LinuxSampler { Line 1016  namespace LinuxSampler {
1016          virtual std::vector<ParserIssue> warnings() const = 0;          virtual std::vector<ParserIssue> warnings() const = 0;
1017    
1018          /**          /**
1019             * Returns all code blocks of the script which were filtered out by the
1020             * preprocessor.
1021             */
1022            virtual std::vector<CodeBlock> preprocessorComments() const = 0;
1023    
1024            /**
1025           * Returns the translated virtual machine representation of an event           * Returns the translated virtual machine representation of an event
1026           * handler block (i.e. "on note ... end on" code block) within the           * handler block (i.e. "on note ... end on" code block) within the
1027           * parsed script. This translated representation of the event handler           * parsed script. This translated representation of the event handler

Legend:
Removed from v.3035  
changed lines
  Added in v.3285

  ViewVC Help
Powered by ViewVC