Next: Playing in the mudbox, Previous: Contributing source documentation, Up: Contributing to Marsyas
If possible, configure your editor/IDE to use this code style.
Otherwise, you can use the astyle tool (Artistic Style)
(with the ansi style) for automated clean up of code style issues (braces, indentation, whitespace).
For ease of use, we have a file misc/astylerc with predefined options. To use it, call
astyle --options=/path/to/marsyas_topdir/misc/astylerc filename.cpp
‘filename.cpp’ can include wildcards, like ‘*.h’ and ‘*.cpp’.
You do not need to format your source code according to this style, but don't complain if someone else modifies/cleans up your file accordingly.
Unfortunately, due to historical reasons the code style is not consistant within the Marsyas source code itself.
_ after member
variables (“member variables” are variables which can be used
throughout the class). In other words, in your .h files use:
class MyMar: public MarSystem
{
private:
mrs_real varname_; // don't use a plain "varname"
...
}
exit(0) upon successful completion. If any problems arise, the
program should return a number greater than 0.