Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 26th, 2006, 7:13 PM   #11
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Wow you're good! :p

That bmp would be the loading art associated with the beginning of the note chart. I'll have to check out those programs. This should help A LOT.

Any idea how those programs work?

Thanks! @_@
Sane is offline   Reply With Quote
Old Jan 26th, 2006, 10:44 PM   #12
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
I'd have to say I've had a great deal of success thanks to your guidance andros! Thank-you!

I've got it so it can extract and save the loading art as a png, as well as extract some usefull attributes from the song.

import Image

def load_ojn(sid):
    dat = open("Music/o2ma%s.ojn"%sid,"rb").read()

    def get(i):
        r = ''
        while ord(dat[i]) > 0:
            r += dat[i]
            i += 1
        return r

    # INFO
    song = get(108)
    comp = get(172)
    manu = get(204)
    #confirm with , sid  = get(236).split('.')[0][4:]

    # RATINGS
    easy = str(ord(dat[20]))
    norm = str(ord(dat[22]))
    hard = str(ord(dat[24]))

    # THUMB
    ascii = ''.join(map(chr, [255, 216, 255, 224]))
    if "BM6K" in dat:
        thumb = "BM6K"+dat.split("BM6K")[-1]
        ext = 'bmp'
    elif "BM8K" in dat:
        thumb = "BM8K"+dat.split("BM8K")[-1]
        ext = 'bmp'
    elif ascii in dat:
        thumb = ascii+dat.split(ascii)[-1]
        ext = 'jpg'

    file = open("thumbs/temp.%s"%ext, "wb")
    file.write(thumb)
    file.close()

    im = Image.open("thumbs/temp.%s"%ext)

    name = ''.join(['',x][(ord(x)>64 and ord(x)<91) or (ord(x)>47 and ord(x)<58)] for x in song.upper())
    im.save("thumbs/%s.png"%name, "PNG")

    # return [sid, song, comp, manu, easy, norm, hard]

At least it was able to do this to the site for me: http://jammersbase.ath.cx/notices

=)

Now all that's left is to extract the notes.
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:31 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC