On Mar 27, 2006, at 12:59 PM, Philip Regan wrote:

Howdy--

I've been writing as my main project a simple MIDI editor off and on
for the past year or so. As my programming skills improve, I tend to
go back and rewrite certain parts of the editor.

Right now, I'm doing a major rebuild of the editor interface (the part
where the user adds/clicks/drags/deletes notes) and I'm coming to a
conceptual question/problem that I'd like to ask folks on the list,
and it regards how to manage objects whose order can be changed at the
whim of the user.

Currently, I manage notes (a custom class) in a set of arrays,
everything from all the notes themselves, selecting, deselecting, etc.
This is fine as long as the notes remain in their sequential order,
and is particularly handy when it comes to playing and writing
binaries of the song. It seems to work fine so far, but I'm hitting
some roadblocks when it comes to selecting and deselecting multiple
objects that I'm pretty sure are due to them being held in an array.

Since the order of the notes and their selection can changed by the
user, I'm thinking that a Dictionary might be the way to go. The only
part that's truly fuzzy to me is how to put them all into sequential
order when the user wants to play and save their files. Beyond that,
the Dictionary seems to be the way to go with object management in
this application.

In the long run, a better approach might be to write a container for notes with the precise interface that you need, then figure what data structures are best used to implement the behavior.

--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to