[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-devel] CommandGroup

From: Remon Sijrier
Subject: [Traverso-devel] CommandGroup
Date: Sat, 26 Jul 2008 17:05:54 +0200
User-agent: KMail/1.9.9


> I should think its better to re-use existing commands/concepts as much as
> possible. However, this may get tricky when we implement actions as
> compound commands, (e.g. cutting part of a clip by using several 'atomic'
> commands like split-split-move). This may blow up the history list. I'll
> have to think about it. What am I saying - my brain's already smokin'

I created the CommandGroup [1] class for this very purpose. 

One example is importing files. This is more then a one liner, the Import 
class is used for that. Importing multiple files is then done by creating a 
CommandGroup object first, adding Import objects for each file, and finally 
returning the CommandGroup object, so the InputEngine can push it to the 
history stack.

Some other actions like cutting part of a clip is basically a remove (the old 
clip) copy twice (both halves) and setting the edges of both clips. See 
SplitClip, so its better to create a new Command class for that, since it's 
more then just one/two lines of code.

Very simple actions like changing one parameter (like the Gain) of a core 
object can be realized by using PCommand (which means Programmable Command), 
to avoid lots of simplistic Command classes that are basically all the same, 
except for the function they call in do/undo_action()

> I had a short read of the suggested post and will look into it in detail as
> I go on. The descriptions given here are already _very_ helpful, thanks for
> taking the time to explain it in such detail!

No problem!

> Concerning submissions, I'll happily submit diffs. As far as I know I
> create a diff from a command line by issuing the command:
> diff {new-file} {old-file} > {diffout-file}
> and then attaching {diffout-file} to another mail. Is that the way I should
> do it or should I use another way of invoking diff?

That should do it, you can also diff multiple files or directories, I'm not 
very used to diff myself, so please google around a little, there are many 
examples to be found on the net.

Have a nice weekend,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]