jpatcher

The patcher. More...

+ Collaboration diagram for jpatcher:

Functions

int jpatcher_is_patcher (t_object *p)
 Determine of a t_object* is a patcher object.
t_objectjpatcher_get_box (t_object *p)
 If a patcher is inside a box, return its box.
long jpatcher_get_count (t_object *p)
 Determine the number of boxes in a patcher.
t_max_err jpatcher_set_locked (t_object *p, char c)
 Lock or unlock a patcher.
char jpatcher_get_presentation (t_object *p)
 Determine whether a patcher is currently in presentation mode.
t_max_err jpatcher_set_presentation (t_object *p, char c)
 Set a patcher to presentation mode.
t_objectjpatcher_get_firstobject (t_object *p)
 Get the first box in a patcher.
t_objectjpatcher_get_lastobject (t_object *p)
 Get the last box in a patcher.
t_objectjpatcher_get_firstline (t_object *p)
 Get the first line (patch-cord) in a patcher.
t_objectjpatcher_get_firstview (t_object *p)
 Get the first view (jpatcherview) for a given patcher.
t_symboljpatcher_get_title (t_object *p)
 Retrieve a patcher's title.
t_max_err jpatcher_set_title (t_object *p, t_symbol *ps)
 Set a patcher's title.
t_symboljpatcher_get_name (t_object *p)
 Retrieve a patcher's name.
t_symboljpatcher_get_filepath (t_object *p)
 Retrieve a patcher's file path.
t_symboljpatcher_get_filename (t_object *p)
 Retrieve a patcher's file name.
char jpatcher_get_dirty (t_object *p)
 Determine whether a patcher's dirty bit has been set.
t_max_err jpatcher_set_dirty (t_object *p, char c)
 Set a patcher's dirty bit.
char jpatcher_get_bglocked (t_object *p)
 Determine whether a patcher's background layer is locked.
t_max_err jpatcher_set_bglocked (t_object *p, char c)
 Set whether a patcher's background layer is locked.
char jpatcher_get_bghidden (t_object *p)
 Determine whether a patcher's background layer is hidden.
t_max_err jpatcher_set_bghidden (t_object *p, char c)
 Set whether a patcher's background layer is hidden.
char jpatcher_get_fghidden (t_object *p)
 Determine whether a patcher's foreground layer is hidden.
t_max_err jpatcher_set_fghidden (t_object *p, char c)
 Set whether a patcher's foreground layer is hidden.
t_max_err jpatcher_get_editing_bgcolor (t_object *p, t_jrgba *prgba)
 Retrieve a patcher's editing background color.
t_max_err jpatcher_set_editing_bgcolor (t_object *p, t_jrgba *prgba)
 Set a patcher's editing background color.
t_max_err jpatcher_get_bgcolor (t_object *p, t_jrgba *prgba)
 Retrieve a patcher's locked background color.
t_max_err jpatcher_set_bgcolor (t_object *p, t_jrgba *prgba)
 Set a patcher's locked background color.
t_max_err jpatcher_get_gridsize (t_object *p, double *gridsizeX, double *gridsizeY)
 Retrieve a patcher's grid size.
t_max_err jpatcher_set_gridsize (t_object *p, double gridsizeX, double gridsizeY)
 Set a patcher's grid size.
void jpatcher_deleteobj (t_object *p, t_jbox *b)
 Delete an object that is in a patcher.
t_objectjpatcher_get_parentpatcher (t_object *p)
 Given a patcher, return its parent patcher.
t_objectjpatcher_get_toppatcher (t_object *p)
 Given a patcher, return the top-level patcher for the tree in which it exists.
t_max_err jpatcher_get_rect (t_object *p, t_rect *pr)
 Query a patcher to determine its location and size.
t_max_err jpatcher_set_rect (t_object *p, t_rect *pr)
 Set a patcher's location and size.
t_max_err jpatcher_get_defrect (t_object *p, t_rect *pr)
 Query a patcher to determine the location and dimensions of its window when initially opened.
t_max_err jpatcher_set_defrect (t_object *p, t_rect *pr)
 Set a patcher's default location and size.
t_symboljpatcher_uniqueboxname (t_object *p, t_symbol *classname)
 Generate a unique name for a box in patcher.
t_symboljpatcher_get_default_fontname (t_object *p)
 Return the name of the default font used for new objects in a patcher.
float jpatcher_get_default_fontsize (t_object *p)
 Return the size of the default font used for new objects in a patcher.
long jpatcher_get_default_fontface (t_object *p)
 Return the index of the default font face used for new objects in a patcher.
long jpatcher_get_fileversion (t_object *p)
 Return the file version of the patcher.
long jpatcher_get_currentfileversion (void)
 Return the file version for any new patchers, e.g.

Detailed Description

The patcher.


Function Documentation

void jpatcher_deleteobj ( t_object p,
t_jbox b 
)

Delete an object that is in a patcher.

Parameters:
pThe patcher.
bThe object box to delete.
t_max_err jpatcher_get_bgcolor ( t_object p,
t_jrgba prgba 
)

Retrieve a patcher's locked background color.

Parameters:
pThe patcher to be queried.
prgbaThe address of a valid t_jrgba struct that will be filled-in with the current patcher color values.
Returns:
A Max error code.
char jpatcher_get_bghidden ( t_object p)

Determine whether a patcher's background layer is hidden.

Parameters:
pThe patcher to be queried.
Returns:
True if the background layer is hidden, otherwise false.
char jpatcher_get_bglocked ( t_object p)

Determine whether a patcher's background layer is locked.

Parameters:
pThe patcher to be queried.
Returns:
True if the background layer is locked, otherwise false.
t_object* jpatcher_get_box ( t_object p)

If a patcher is inside a box, return its box.

Parameters:
pThe patcher to be queried.
Returns:
A pointer to the box containing the patcher, otherwise NULL.
long jpatcher_get_count ( t_object p)

Determine the number of boxes in a patcher.

Parameters:
pThe patcher to be queried.
Returns:
The number of boxes in the patcher.
long jpatcher_get_currentfileversion ( void  )

Return the file version for any new patchers, e.g.

the current version created by Max.

Returns:
The file version number.
long jpatcher_get_default_fontface ( t_object p)

Return the index of the default font face used for new objects in a patcher.

Parameters:
pA pointer to a patcher instance.
Returns:
The index of the default font face used for new objects in a patcher.
t_symbol* jpatcher_get_default_fontname ( t_object p)

Return the name of the default font used for new objects in a patcher.

Parameters:
pA pointer to a patcher instance.
Returns:
The name of the default font used for new objects in a patcher.
float jpatcher_get_default_fontsize ( t_object p)

Return the size of the default font used for new objects in a patcher.

Parameters:
pA pointer to a patcher instance.
Returns:
The size of the default font used for new objects in a patcher.
t_max_err jpatcher_get_defrect ( t_object p,
t_rect pr 
)

Query a patcher to determine the location and dimensions of its window when initially opened.

Parameters:
pA pointer to a patcher instance.
prThe address of valid t_rect whose values will be filled-in upon return.
Returns:
A Max error code.
char jpatcher_get_dirty ( t_object p)

Determine whether a patcher's dirty bit has been set.

Parameters:
pThe patcher to be queried.
Returns:
True if the patcher is dirty, otherwise false.
t_max_err jpatcher_get_editing_bgcolor ( t_object p,
t_jrgba prgba 
)

Retrieve a patcher's editing background color.

Parameters:
pThe patcher to be queried.
prgbaThe address of a valid t_jrgba struct that will be filled-in with the current patcher color values.
Returns:
A Max error code.
char jpatcher_get_fghidden ( t_object p)

Determine whether a patcher's foreground layer is hidden.

Parameters:
pThe patcher to be queried.
Returns:
True if the foreground layer is hidden, otherwise false.
t_symbol* jpatcher_get_filename ( t_object p)

Retrieve a patcher's file name.

Parameters:
pThe patcher to be queried.
Returns:
The patcher's file name.
t_symbol* jpatcher_get_filepath ( t_object p)

Retrieve a patcher's file path.

Parameters:
pThe patcher to be queried.
Returns:
The patcher's file path.
long jpatcher_get_fileversion ( t_object p)

Return the file version of the patcher.

Parameters:
pA pointer to the patcher whose version number is desired.
Returns:
The file version number.
t_object* jpatcher_get_firstline ( t_object p)

Get the first line (patch-cord) in a patcher.

All lines in a patcher are maintained internally in a t_linklist. Use this function to begin traversing a patcher's lines.

Parameters:
pThe patcher to be queried.
Returns:
The first jpatchline in a patcher.
t_object* jpatcher_get_firstobject ( t_object p)

Get the first box in a patcher.

All boxes in a patcher are maintained internally in a t_linklist. Use this function together with jbox_get_nextobject() to traverse a patcher.

Parameters:
pThe patcher to be queried.
Returns:
The first box in a patcher.
See also:
jbox_get_prevobject() jbox_get_nextobject() jpatcher_get_lastobject()
t_object* jpatcher_get_firstview ( t_object p)

Get the first view (jpatcherview) for a given patcher.

All views of a patcher are maintained internally as a t_linklist. Use this function to begin traversing a patcher's views.

Parameters:
pThe patcher to be queried.
Returns:
The first view of a patcher.
t_max_err jpatcher_get_gridsize ( t_object p,
double *  gridsizeX,
double *  gridsizeY 
)

Retrieve a patcher's grid size.

Parameters:
pThe patcher to be queried.
gridsizeXThe address of a double that will be set to the current horizontal grid spacing for the patcher.
gridsizeYThe address of a double that will be set to the current vertical grid spacing for the patcher.
Returns:
A Max error code.
t_object* jpatcher_get_lastobject ( t_object p)

Get the last box in a patcher.

All boxes in a patcher are maintained internally in a t_linklist. Use this function together with jbox_get_prevobject() to traverse a patcher.

Parameters:
pThe patcher to be queried.
Returns:
The last box in a patcher.
See also:
jbox_get_prevobject() jbox_get_nextobject() jpatcher_get_firstobject()
t_symbol* jpatcher_get_name ( t_object p)

Retrieve a patcher's name.

Parameters:
pThe patcher to be queried.
Returns:
The patcher's name.
t_object* jpatcher_get_parentpatcher ( t_object p)

Given a patcher, return its parent patcher.

Parameters:
pThe patcher to be queried.
Returns:
The patcher's parent patcher, if there is one. If there is no parent patcher (this is a top-level patcher) then NULL is returned.
char jpatcher_get_presentation ( t_object p)

Determine whether a patcher is currently in presentation mode.

Parameters:
pThe patcher to be queried.
Returns:
True if the patcher is in presentation mode, otherwise false.
t_max_err jpatcher_get_rect ( t_object p,
t_rect pr 
)

Query a patcher to determine its location and size.

Parameters:
pA pointer to a patcher instance.
prThe address of valid t_rect whose values will be filled-in upon return.
Returns:
A Max error code.
t_symbol* jpatcher_get_title ( t_object p)

Retrieve a patcher's title.

Parameters:
pThe patcher to be queried.
Returns:
The patcher's title.
t_object* jpatcher_get_toppatcher ( t_object p)

Given a patcher, return the top-level patcher for the tree in which it exists.

Parameters:
pThe patcher to be queried.
Returns:
The patcher's top-level parent patcher.
int jpatcher_is_patcher ( t_object p)

Determine of a t_object* is a patcher object.

Parameters:
pThe object pointer to test.
Returns:
Returns true if the object is a patcher, otherwise returns non-zero.
t_max_err jpatcher_set_bgcolor ( t_object p,
t_jrgba prgba 
)

Set a patcher's locked background color.

Parameters:
pThe patcher to be queried.
prgbaThe address of a t_jrgba struct containing the new color to use.
Returns:
A Max error code.
t_max_err jpatcher_set_bghidden ( t_object p,
char  c 
)

Set whether a patcher's background layer is hidden.

Parameters:
pThe patcher whose dirty bit will be set.
cPass true to hide the patcher's background layer, otherwise pass false.
Returns:
A Max error code.
t_max_err jpatcher_set_bglocked ( t_object p,
char  c 
)

Set whether a patcher's background layer is locked.

Parameters:
pThe patcher whose dirty bit will be set.
cPass true to lock the patcher's background layer, otherwise pass false.
Returns:
A Max error code.
t_max_err jpatcher_set_defrect ( t_object p,
t_rect pr 
)

Set a patcher's default location and size.

Parameters:
pA pointer to a patcher instance.
prThe address of a t_rect with the new position and size.
Returns:
A Max error code.
t_max_err jpatcher_set_dirty ( t_object p,
char  c 
)

Set a patcher's dirty bit.

Parameters:
pThe patcher whose dirty bit will be set.
cThe new value for the patcher's dirty bit (pass true or false).
Returns:
A Max error code.
t_max_err jpatcher_set_editing_bgcolor ( t_object p,
t_jrgba prgba 
)

Set a patcher's editing background color.

Parameters:
pThe patcher to be queried.
prgbaThe address of a t_jrgba struct containing the new color to use.
Returns:
A Max error code.
t_max_err jpatcher_set_fghidden ( t_object p,
char  c 
)

Set whether a patcher's foreground layer is hidden.

Parameters:
pThe patcher whose dirty bit will be set.
cPass true to hide the patcher's foreground layer, otherwise pass false.
Returns:
A Max error code.
t_max_err jpatcher_set_gridsize ( t_object p,
double  gridsizeX,
double  gridsizeY 
)

Set a patcher's grid size.

Parameters:
pThe patcher to be queried.
gridsizeXThe new horizontal grid spacing for the patcher.
gridsizeYThe new vertical grid spacing for the patcher.
Returns:
A Max error code.
t_max_err jpatcher_set_locked ( t_object p,
char  c 
)

Lock or unlock a patcher.

Parameters:
pThe patcher whose locked state will be changed.
cPass true to lock a patcher, otherwise pass false.
Returns:
A Max error code.
t_max_err jpatcher_set_presentation ( t_object p,
char  c 
)

Set a patcher to presentation mode.

Parameters:
pThe patcher whose locked state will be changed.
cPass true to switch the patcher to presentation mode, otherwise pass false.
Returns:
A Max error code.
t_max_err jpatcher_set_rect ( t_object p,
t_rect pr 
)

Set a patcher's location and size.

Parameters:
pA pointer to a patcher instance.
prThe address of a t_rect with the new position and size.
Returns:
A Max error code.
t_max_err jpatcher_set_title ( t_object p,
t_symbol ps 
)

Set a patcher's title.

Parameters:
pThe patcher whose locked state will be changed.
psThe new title for the patcher.
Returns:
A Max error code.
t_symbol* jpatcher_uniqueboxname ( t_object p,
t_symbol classname 
)

Generate a unique name for a box in patcher.

Parameters:
pA pointer to a patcher instance.
classnameThe name of an object's class.
Returns:
The newly-generated unique name.
Remarks:
This is the function used by pattr to assign names to objects in a patcher.