4 IntAutos::IntAutos(EDL *edl, Track *track)
14 Auto* IntAutos::new_auto()
16 return new IntAuto(edl, this);
19 int IntAutos::automation_is_constant(int64_t start, int64_t end)
21 Auto *current_auto, *before = 0, *after = 0;
24 result = 1; // default to constant
25 if(!last && !first) return result; // no automation at all
27 // quickly get autos just outside range
28 get_neighbors(start, end, &before, &after);
32 current_auto = before; // try first auto
36 // test autos in range
40 current_auto->position < end;
41 current_auto = current_auto->next)
44 if(((IntAuto*)current_auto->next)->value != ((IntAuto*)current_auto)->value)
51 double IntAutos::get_automation_constant(int64_t start, int64_t end)
53 Auto *current_auto, *before = 0, *after = 0;
55 // quickly get autos just outside range
56 get_neighbors(start, end, &before, &after);
58 // no auto before range so use first
60 current_auto = before;
64 // no autos at all so use default value
65 if(!current_auto) current_auto = default_auto;
67 return ((IntAuto*)current_auto)->value;
73 printf(" Default %p: position: %ld value: %d\n", default_auto, default_auto->position, ((IntAuto*)default_auto)->value);
74 for(Auto* current = first; current; current = NEXT)
76 printf(" %p position: %ld value: %d\n", current, current->position, ((IntAuto*)current)->value);