Merging Rosegarden

Ok, so it’s time to merge the trunk revisions of Rosegarden onto the mingw branch that I’ve created which  makes the Rosegarden for Windows build available.  This process is done of course in Windows and traditionally I’ve used the excellent QtCreator alongside Tortoise SVN to handle the source control side of things.  Aside from that and a little perl to ease the cogs a little it’s all done just like that.

This time though I’m making life a little bit more complicated.  I’m using Codename Friendlier to do the editing and to run the builds.  I’m using this merge exercise as a test bed for my other software – so see if it’s possible and fun to work in the new environment for this ‘Light’ IDE.  I probably could have started this exercise a month ago but instead I fell down a  rabbit hole with indenting and text highlighting and to be honest this has made me feel a lot better about using Friendlier.  None of the features are finished yet but it’s quite competent at allowing me to edit and build stuff.  Or so I will find out in the next few days..


Annoyance of Maintenance

Of course a lot of the software job is maintaining things.  We don’t get to work on new code that often so we have to deal with code other people have written, or code that we’ve written a long time ago.

And how to best describe this activity?  Well if you’re lucky, or if you’re clever and tidy, you’ll have made sure that the code is neat and well formatted, the functions or methods are not too long and heavily indented and you may even have defined unit tests (if you believe in that kind of thing) to help you modify the code without breaking things too much.

More often than not though the code you’ve inherited or having to debug is difficult to understand, badly formatted, and comes as if written by a cabal of rabid monkeys after a raid on a sugar factory.  Indeed for the last few days I’ve had the pleasure of trying to track down a bug in some VB code which appears to be something to do with either file handles or database connection record sets going out of scope.

This isn’t made easier by the fact that we’ve recently moved to Oracle 11g.  So this could even be down to some vagary of the ODBC driver memory management changing – or it could be something to do with a Microsoft security patch even.  However before testing out any of these options (as that would require re-installing Oracle clients) I’ve been trying to track it down with good old debug statements.

However, I’m still stuck several days later.   It appears that a CreateObject(“ADODB.Connection”) call will create a recordset ok – however the scope of the recordset seems to wave around seemingly at random.  Well, perhaps tomorrow I’ll try another tack.

How we do Indenting

One of the more interesting things about writing an IDE from scratch because you end up at points where you can see how other people did things and making perhaps the same decisions as them, perhaps different ones.  For example I’m just looking at indentation and bracketing in the text editor for Friendlier.

When you type in a closing brace in C++ or Java for example I would expect the formatting to work out that we’ve stepped down a level of indentation and adjust the text accordingly.  Hence you are expecting to see a closing brace and then you can write it out with a command which might look a bit like this:

insertTextCommand(fileBuffer, someText, positionOfTheText)

 And when the someText happens to be ‘}’ what can we do?  Well we can change insertTextCommand to do something clever with the FileBuffer at the position of the text – or we can write another command that will do the formatting of the closing brace afterwards.  Of course it’s useful to have a reformatting command anyway so shall we just have a generic command for reformatting a file?  Probably not as formatting is target language specific (what may be a closing brace in one language isn’t the same as one in another) so perhaps we need a generic command which can be specialised per language we’re going to support somehow?

In Friendlier we already have a generic SyntaxManager class and specialise this to (for example) CppSyntaxManager.  This handles text indentation, keyword highlighting, text completion and other functions already.  We can pass this into our reformat command and it can work out what kind of text we’re reformatting:

reformatTextCommand(fileBuffer, syntaxManager, startPosition, endPosition)

So I can then run this command right after the insertTextCommand and it will reformat the text for me and best of all I leave my working insertTextCommand unsullied.  Additionally if I don’t like the formatting that’s been automatically applied I can undo just that one command.  Oddly enough this is exactly how Visual Studio appears to work too.  I wonder if they code this in a similar way?

To Kickstart or not to Kickstart?

A long long time ago I was quite heavily involved in developing a piece of open source software called Rosegarden (the history of which is pretty well documented). It was, and still is, a piece of software that helps you compose, record and create music and it originally came into being during a final year University project that Chris and Andy did back way before when there was a Linux – back when everyone still thought Macs were just for accountants or graphic designers.

I got involved in the first steps of Rosegarden under Linux in 1995 and that snowballed into working on it full time for a while during the early 2000s. I’ve not been involved with the project in any big capacity since about 2006 but I’m pleased to say that the project is still going strong under the watchful eye of D. Michael McIntyre who has been the self-appointed custodian of all things Rosegarden since the rest of us swanned off to have children and do real jobs and have all the fun you can’t have when you’re sweating over an open source cookpot.

Rosegarden is now, what, about 18 years old? About to come of age or already there. Perhaps it’s coming to the end of the road, perhaps it just needs a nudge in the right direction? I’m keen to see it continue and I’ve been doing a small amount of work on a Windows version but the days when we could sit around throwing days and weeks and coding challenges are way behind us. Challenges need to be bite-sized, or life-sized, and Rosegarden might be just too much of a monster to continue. The last time I looked there were over 200k lines of code in there.

So the question is – where to now? And from a quick search I can see that Rosegarden is not the only Open Source audio project thinking the same thing. The question being is there any incentive to continue? Is there a will and if there’s a will – what is the way?

I’m ambivalent about Kickstarter for software projects because I’m not really sure who it benefits the most. For example I love the idea of Light Table maybe because that’s because I’m working on something similar myself (which, like Light Table, will be paid software) but I don’t want to take people’s money up front for it. However for a project such as Rosegarden – where there already is a popular piece of software there already and it’s looking for a way to survive – is this a more valid way for a project to fund itself? If so how should it be structured to attract and retain developers? Who decides who gets paid and how? To me the accountabilty and governance of a Kickstarter software project is still something of a mystery and perhaps we will see a backlash occuring at some point if and when projects fail to deliver? From the Kickstarter guidelines it is suggested that a project should ‘under promise and over deliver’. Perception is everything and with some big ticket Kickstarter projects currently running who is to say what the perception will be in a year’s time for crowd funding?

For Rosegarden perhaps nothing needs to be done other than a holiday for developers and a dose of enthusiasm. However structure always helps any development be it open source, commercial or both. Without vision and leadership things will drift and what helps to keep everyone sweet is an occasional pay day too. So – to Kickstart or not to Kickstart?