Mercurial > hg > dmlib
diff dmtimelinew.c @ 402:0f290af63fc1
Timeline event drawing prototype works.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 19 Oct 2012 17:49:22 +0300 |
parents | 525f7af644c4 |
children | d4b84101e480 |
line wrap: on
line diff
--- a/dmtimelinew.c Fri Oct 19 16:28:06 2012 +0300 +++ b/dmtimelinew.c Fri Oct 19 17:49:22 2012 +0300 @@ -260,12 +260,10 @@ } -int dmTimelineEventSetEffect(DMTimelineEvent *event, const char *name) +int dmTimelineEventSetEffect(DMTimelineEvent *event, DMEffect *ef) { int param; - DMEffect *ef; - - if ((ef = engineFindEffectByName(name)) == NULL) + if (ef == NULL) return DMERR_INVALID_DATA; event->effect = ef; @@ -299,6 +297,21 @@ } +int dmTimelineEventSetEffectByIndex(DMTimelineEvent *event, const int index) +{ + if (index < 0 || index >= nengineEffects) + return DMERR_INVALID_DATA; + + return dmTimelineEventSetEffect(event, &engineEffects[index]); +} + + +int dmTimelineEventSetEffectByName(DMTimelineEvent *event, const char *name) +{ + return dmTimelineEventSetEffect(event, engineFindEffectByName(name)); +} + + DMTimelineEvent *dmTimelineGetEventAt(DMTimelineTrack *track, const int time) { int event;