Max 5 API Reference
Several high-level functions permit you to load patcher files. More...
![]() |
Functions | |
short | readtohandle (char *name, short volume, char ***h, long *sizep) |
Load a data file into a handle. | |
void * | fileload (char *name, short vol) |
Load a patcher file by name and volume reference number. | |
void * | intload (char *name, short volume, t_symbol *s, short ac, t_atom *av, short couldedit) |
Pass arguments to Max files when you open them. | |
void * | stringload (char *name) |
Load a patcher file located in the Max search path by name. |
Several high-level functions permit you to load patcher files.
These can be used in sophisticated objects that use Patcher objects to perform specific tasks.
void* fileload | ( | char * | name, | |
short | vol | |||
) |
Load a patcher file by name and volume reference number.
name | Filename of the patcher file to load (C string). | |
vol | Path ID specifying the location of the file. |
Pass arguments to Max files when you open them.
This function loads the specified file and returns a pointer to the created object. Historically, intload() is was used to open patcher files, whether they are in text or Max binary format. It could also open table files whose contents begin with the word “table.”
name | Name of the file to open. | |
volume | Path ID specifying the location of the file. | |
s | A symbol. | |
ac | Count of t_atoms in av. To properly open a patcher file, ac should be 9. | |
av | Array of t_atoms that will replace the changeable arguments 1-9. The default behavior could be to set all these to t_atoms of type A_LONG with a value of 0. | |
couldedit | If non-zero and the file is not a patcher file, the file is opened as a text file. |
short readtohandle | ( | char * | name, | |
short | volume, | |||
char *** | h, | |||
long * | sizep | |||
) |
Load a data file into a handle.
This is a low-level routine used for reading text and data files. You specify the file’s name and Path ID, as well as a pointer to a Handle.
name | Name of the patcher file to load. | |
volume | Path ID specifying the location of the file. | |
h | Pointer to a handle variable that will receive the handle that contains the data in the file. | |
sizep | Size of the handle returned in h. |
void* stringload | ( | char * | name | ) |
Load a patcher file located in the Max search path by name.
This function searches for a patcher file, opens it, evaluates it as a patcher file, opens a window for the patcher and brings it to the front. You need only specify a filename and Max will look through its search path for the file. The search path begins with the current “default volume” that is often the volume of the last opened patcher file, then the folders specified in the File Preferences dialog, searched depth first, then finally the folder that contains the Max application.
name | Filename of the patcher file to load (C string). |