Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Wilkes
purr-data
Commits
522c1530
Commit
522c1530
authored
12 years ago
by
Ivica Bukvic
Browse files
Options
Downloads
Patches
Plain Diff
added core files for preset_node and preset_hub
parent
0a031190
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/x_preset.c
+1044
-0
1044 additions, 0 deletions
src/x_preset.c
src/x_preset.h
+84
-0
84 additions, 0 deletions
src/x_preset.h
with
1128 additions
and
0 deletions
src/x_preset.c
0 → 100644
+
1044
−
0
View file @
522c1530
This diff is collapsed.
Click to expand it.
src/x_preset.h
0 → 100644
+
84
−
0
View file @
522c1530
#ifndef __x_preset_h_
#define __x_preset_h_
/*
Global preset system by Ivica Ico Bukvic <ico@vt.edu> July, 2012
*/
// each node in the patch
typedef
struct
_preset_node
{
t_object
pn_obj
;
t_atom
pn_val
;
// last known value (null if not initialized)
t_symbol
*
pn_hub_name
;
// hub name this node is associated with
t_preset_hub
*
pn_hub
;
// pointer to the hub (null if none, equiv. to active/disabled)
t_canvas
*
pn_canvas
;
int
*
pn_gl_loc
;
int
pn_gl_loc_length
;
// we use this to compare with the old position,
// so that hub can be notified of node's new position
int
*
pn_old_gl_loc
;
int
pn_old_gl_loc_length
;
t_outlet
*
pn_outlet
;
}
t_preset_node
;
// stores each of the presets per each preset_node
typedef
struct
_node_preset
{
int
np_preset
;
t_atom
np_val
;
struct
_node_preset
*
np_next
;
}
t_node_preset
;
// stores each of the nodes within a hub
typedef
struct
_preset_hub_data
{
t_preset_node
*
phd_node
;
// if the node is erased, this will be NULL (inactive)
int
*
phd_pn_gl_loc
;
// last known location of the node (according to the hub)
int
phd_pn_gl_loc_length
;
// location array's length (see x_preset.c for explanation)
struct
_preset_hub_data
*
phd_next
;
t_node_preset
*
phd_npreset
;
}
t_preset_hub_data
;
// preset hub (nexus for data saving/recalling)
struct
_preset_hub
{
t_object
ph_obj
;
t_symbol
*
ph_name
;
int
ph_invis
;
// make it invisible (only for the k12 mode)
int
ph_preset
;
// last enabled preset (-1 at init time)
t_canvas
*
ph_canvas
;
struct
_preset_hub
*
ph_next
;
// next hub on the same canvas
t_preset_hub_data
*
ph_data
;
// pointer to data (single-linked list)
t_outlet
*
ph_outlet
;
};
typedef
struct
_glob_preset_hub_list
{
t_preset_hub
*
gphl_hub
;
struct
_glob_preset_hub_list
*
gphl_next
;
}
t_glob_preset_hub_list
;
typedef
struct
_glob_preset_node_list
{
t_preset_node
*
gpnl_node
;
int
gpnl_paired
;
// whether the node is paired with a hub (otherwise don't bother updating its location)
struct
_glob_preset_node_list
*
gpnl_next
;
}
t_glob_preset_node_list
;
#ifndef t_preset_hub
#define t_preset_hub struct _preset_hub
#endif
EXTERN
int
we_are_undoing
;
#endif
/* __x_preset_h_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment