/[paths]/src/graph.h
ViewVC logotype

Contents of /src/graph.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations)
Sun Jul 29 13:24:15 2012 UTC (7 years, 2 months ago) by ben
File MIME type: text/plain
File size: 939 byte(s)
fix and add randomize fonctions
1 #ifndef GRAPH_H
2 #define GRAPH_H
3 struct event {
4 int pitch;
5 int duration;
6 int attack;
7 int decay;
8 int sustain;
9 int release;
10 int instrument;
11 int modulation;
12 int detune;
13 int velocity;
14 int volume;
15 };
16
17 struct node;
18
19 struct edge {
20 struct node *to;
21 int distance;
22 };
23
24 struct node {
25 struct event event;
26 int wheight;
27 struct edge *neighbours;
28 int count;
29 };
30
31 struct graph {
32 struct node* nodes;
33 int count;
34 };
35
36 void node_destroy(struct node* n);
37
38 void node_radomize(struct node* n);
39
40 void edge_randomize(struct edge* e);
41
42 int node_is_linked(struct node* a, struct node* b);
43
44 /* d: distance */
45 int node_link(struct node* a, struct node* b, int d);
46
47 int node_unlink(struct node* a, struct node* b);
48
49 /* n: node number */
50 struct graph* graph_new(int n);
51
52 /* l: edge number */
53 int graph_randomize1(struct graph*, int l);
54
55 /* l: min edges per node */
56 int graph_randomize2(struct graph*, int l);
57
58 void graph_destroy(struct graph* g);
59
60 #endif

  ViewVC Help
Powered by ViewVC 1.1.26