Wednesday, June 18, 2008

Class diagram for AVClip

So how are we managing the effects?


An AVClip has a vector of effects.
An Effect consists of a map (string, FXParamTimelines). The string denotes the parameter's name.
An FXParamTimeline is a map of (integer, string parameter), where the integer represents a point in time.

(Notice that there are no bezier curves in this diagram. But there will be, don't worry about that).

Time is measured in milliseconds, but I'm going to replace the integer with a 64-bit integer so I can represent nanoseconds (this is necessary to be able to move audio clips around with one-sample precision in time).

One thing that I forgot to mention is that none of the data structures I present here, have pointers (pointers are EVIL!). This is so we can duplicate the instances of effects and clips easily. Since the indirection is handled through array (or vector / map) indexes, we won't have segmentation faults due to a badly dereferenced pointer. This also makes serializing and deserializing the data a piece of cake.

When copying a series of clips to the clipboard, I will replace the clip id's with new ones. Simpler than a Jedi mind trick. "These aren't the id#s you're looking for." *Waves hand* No pointer mangling, no headaches.

So this is the reason why I'm trying to focus on the User Interface first. Because it's the task which takes most of the time. And since I already got rid of the wxWidgets-specific classes in this framework, we can choose whatever UI library we want. But I'm sticking with wxWidgets for the user interface.

No comments: