# SetObjectInfo

Sets values in the object based on tag arguments.

### Synopsis

`Err SetObjectInfo( CObject *obj, TagArg *tags )`

### Description

This is a method macro that is part of the Juggler object-oriented toolbox. An object's method can be called explicitly through the class structure function pointer, or with one of the defined method macros.

This method macro sets the values in the object based on the supplied tag arguments. Valid tag arguments are as follows:

### Tags

Tags for Jugglee SuperClass

As the jugglee is the superclass for the other Juggler classes, its methods are inherited by other Juggler classes. The following tags are for `SetObjectInfo()` for the jugglee superclass:

JGLR_TAG_CONTEXT <usercontext> User-specified context; this may be a pointer to almost anything. It is passed to the Interpreter function.

JGLR_TAG_START_DELAY <ticks> The delay interval before starting this object. This is used to stagger the execution of parallel objects within a collection for canon.

JGLR_TAG_REPEAT_DELAY <ticks> The time to wait between repetitions.

JGLR_TAG_STOP_DELAY <ticks> The time to wait after stopping.

JGLR_TAG_START_FUNCTION <*function(object, time)> This function is called before executing the first element of the object.

JGLR_TAG_REPEAT_FUNCTION <*function(object, time)> JGLR_TAG_STOP_FUNCTION <*function(object, time)> JGLR_TAG_MUTE <flag> If the flag is true, the object will be muted when played. The Interpreter function must look at the mute flag.

Tags for Sequence

A sequence contains an array of events that are to be executed over time. An event consists of a timestamp, followed by a user-defined, fixed-size data field. A sequence keeps track of time, advances through the events in its array, and calls a user-defined Interpreter function to "play" the event.

Sequences will typically contain arrays of MIDI messages from a MIDI file. Sequences may also contain other things; these other things each require a different Interpreter function. The possible sequence contents and their functions are as follows:

FunctionPointers, Data schedule arbitrary functions.

Cel, Corners draw this cel.

Knob, Value tweak a knob for timbral sequences.

Collections schedule scores at a very high level.

The following are tags for a sequence:

JGLR_TAG_INTERPRETER_FUNCTION Specifies the user-defined function to be called for interpreting events in a sequence. This function is called at the time specified in the event. When the function is called, it is passed a pointer to one of your events. It is also passed a pointer to your context data structure that was set using JGLR_TAG_CONTEXT and `SetObjectInfo()`. The function prototype for interpreting events is given below:

int32 InterpretEvent( Sequence *SeqPtr, void *CurrentEvent, void *UserContext)

JGLR_TAG_MAX Sets the maximum number of events that can be used.

JGLR_TAG_MANY Sets the actual number of events that can be used.

JGLR_TAG_EVENTS <void *Events> Sets a pointer to your event array.

JGLR_TAG_EVENT_SIZE <size_in_bytes> Sets the size of a single event in bytes so that an index into an array can be constructed.

### Other Tags

Other tag arguments are listed below:

JGLR_TAG_SELECTOR_FUNCTION

JGLR_TAG_AUTO_DELETE

JGLR_TAG_DURATION

### Arguments

obj
  A pointer to the CObject data structure for the object.

tags
  A pointer to the TagArg list.

### Return Value

This macro returns 0 if successful or an error code (a negative value) if an error occurs.

### Implementation

Macro implemented in cobj.h V20.

### Associated Files

cobj.h, music.lib

### See Also

``GetObjectInfo`(),StartObject(), StopObject(), AllocObject(), FreeObject(), GetNthFromObject(), RemoveNthFromObject(), PrintObject()`