[Tapper-develop] Serialization
Status: Pre-Alpha
Brought to you by:
druleeparsec
From: <Gre...@ub...> - 2000-10-12 18:23:09
|
I fixed the bugs in Serialization today. I'll upload the code to the web page and files section tonight. Here's what we have so far: The User/Select Tuning menu will bring up a dialog box with a combo box full of tunings. The dialog also has Create, Edit, and Delete buttons. These all work. There is a flag in the Tuning Object that can be set that says "You may not delete this". I havn't used it yet. Do we want any of the tunings to be permanent? When you build a tuning and click OK or Apply the tuning will be created and added to the tuning list. When the program is shut down the list of tunings will be serialized to a file called tunings.ser. When the program is started those objects will be de-serialized from tunings.ser and re-built back into the list (my test show that this all works). There are 2 static methods in Tapper that you will find usefull. Tapper.getTuningList(); will return a com.gregb.util.SortedVector with the current list of all the tunings. You probably won't need this but it's nice to have access to. Tapper.getCurrentTuning() will return a com.gregb.tunings.Tuning object which is the currently selected tuning. WARNING. There may not be any tunings selected in which case this will return a null. Watch for that and handle that situation in your own code. In other words it is possible for the user to delete all the tunings and then click OK. Also, what should happen if the user opens this dialog box. Clicks "Delete" (which will immediately delete the tuning) and then clicks "Cancel". I'll think about this but I'd like your input. I won't worry about fixing it tonight though. I mainly want to get out another code release so you guys can start writing code to fit this release. CLASS STRUCTURE: The list of tunings is a sorted vector (from com.gregb.utils) which is a collection of tuning objects. A Tuning object has a name and at least one (and no more than 2) TuningBlock objects. Each TuningBlock object has a name, a number of strings, a maximum number of frets. and an arrrayList of Note objects which is the same size as the number of strings. Each Note object has a MIDI value and it knows how to display it's note name (C#, Fb, G, etc.) The EditCreateDialog has two TuningPanel objects. These TuningPanel objects display a TuningBlock. They can also be edited and will return a new TuningBlock that represents the current state of the GUI. Easy as pi. I should have the new code out by 9:00 pm Pacific Standard Time tonight Oct 12th Dru Lee Parsec A.K.A. GB |