Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#104842 - 13/07/2002 01:03 Deleting Wendy Flags
mschrag
pooh-bah

Registered: 09/09/2000
Posts: 2303
Loc: Richmond, VA
Add Wendy Flag 1 (bitmask = 001)
Add Wendy Flag 2 (bitmask = 010)
Add Wendy Flag 3 (bitmask = 100)

Choose a song and tag it as Flag 1 and Flag 3 (bitmask = 101)

Now delete Flag 2, which turns Flag 3 into bitmask 010 but doesn't update the tunes that have that flag checked.

I suppose when you delete a flag, it should probably go through all the tunes in the player and fix the wendy flags? Is there a less nasty way?

ms

Top
#104843 - 13/07/2002 09:56 Re: Deleting Wendy Flags [Re: mschrag]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Are you saying this is Emplode's behavior? Emptool's behavior? Jemplode's behavior? Or are you asking how Emplode handles this sticky situation?
_________________________
Tony Fabris

Top
#104844 - 13/07/2002 11:46 Re: Deleting Wendy Flags [Re: tfabris]
mschrag
pooh-bah

Registered: 09/09/2000
Posts: 2303
Loc: Richmond, VA
Now now ... you know that jEmplode bugs don't go in the Bugs forum, and Emptool doesn't support wendy flags

Back to serious mode, this appears to be an Emplode (2.0b11) bug (haven't installed b12 on my XP machine yet).

The last part was my question/comment about how it _shoiuld_ behave (since I am writing Wendy stuff into jEmplode now) with a request for suggestions if the Empeg guys have a better idea...

Mike

Top
#104845 - 13/07/2002 11:51 Re: Deleting Wendy Flags [Re: mschrag]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Okay, I put that one on the internal bug list.
_________________________
Tony Fabris

Top
#104846 - 13/07/2002 23:28 Re: Deleting Wendy Flags [Re: tfabris]
mschrag
pooh-bah

Registered: 09/09/2000
Posts: 2303
Loc: Richmond, VA
I don't know if Empeg people read this or care, but here is the implementation I used in jEmplode... This appears in my WendyFlags class. Basically, the Wendy editor keeps track of what original flag indexes are deleted, and when you Apply the changes, it calls the following method for each index (basically): This code should be almost identical to the C/emptool equivalent:




/**
* Removes a Wendy Flag from all the nodes in the
* database that reference that flag.
*
* @param _flagIndex the Wendy flag index to remove
* @param _db the PlayerDatabase to update
*/
public void removeFlag(int _flagIndex, PlayerDatabase _db) {
Enumeration elements = _db.getNodeMap().elements();
while (elements.hasMoreElements()) {
AbstractFIDNode node = (AbstractFIDNode)elements.nextElement();
int wendy = node.getIntTag("wendy");
if (wendy > 0) {
int lowerPart = wendy & ((1 << _flagIndex) - 1);
int upperPart = (wendy >> (_flagIndex + 1)) << _flagIndex;
int newWendy = lowerPart | upperPart;
node.setIntTag("wendy", newWendy);
}
}
}

Top