From: <ny...@us...> - 2007-02-23 09:38:47
|
Revision: 393 http://svn.sourceforge.net/pmplib/?rev=393&view=rev Author: nyaochi Date: 2007-02-23 01:38:48 -0800 (Fri, 23 Feb 2007) Log Message: ----------- Sort tracks in numerical order of disc numbers. Modified Paths: -------------- trunk/pmplib/lib/pmp_ipod/ipod.c Modified: trunk/pmplib/lib/pmp_ipod/ipod.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/ipod.c 2007-02-23 09:37:33 UTC (rev 392) +++ trunk/pmplib/lib/pmp_ipod/ipod.c 2007-02-23 09:38:48 UTC (rev 393) @@ -298,9 +298,12 @@ ret = comp_string(x->album, y->album); if (ret == 0) { - ret = COMP(x->track_number, y->track_number); + ret = COMP(x->disc_number, y->disc_number); if (ret == 0) { - return comp_string(x->title, y->title); + ret = COMP(x->track_number, y->track_number); + if (ret == 0) { + return comp_string(x->title, y->title); + } } } return ret; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-09-12 16:20:01
|
Revision: 411 http://pmplib.svn.sourceforge.net/pmplib/?rev=411&view=rev Author: nyaochi Date: 2007-09-12 09:20:00 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Added some indices, but it's still not working. Modified Paths: -------------- trunk/pmplib/lib/pmp_ipod/ipod.c Modified: trunk/pmplib/lib/pmp_ipod/ipod.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/ipod.c 2007-09-12 15:07:27 UTC (rev 410) +++ trunk/pmplib/lib/pmp_ipod/ipod.c 2007-09-12 16:20:00 UTC (rev 411) @@ -618,23 +618,23 @@ if (mhod) { if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; qsort(si, num_records, sizeof(si[0]), comp_title); - if (itunesdb_set_mhod_index(mhod, 0x03, si, num_records)) return ret; + if (ret = itunesdb_set_mhod_index(mhod, 0x03, si, num_records)) return ret; } - /* Construct an "mhod" chunk for album index. */ + /* Construct an "mhod" chunk for artist index. */ mhod = itunesdb_new_child(mhyp); if (mhod) { if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; - qsort(si, num_records, sizeof(si[0]), comp_album); - if (ret = itunesdb_set_mhod_index(mhod, 0x04, si, num_records)) return ret; + qsort(si, num_records, sizeof(si[0]), comp_artist); + if (ret = itunesdb_set_mhod_index(mhod, 0x05, si, num_records)) return ret; } - /* Construct an "mhod" chunk for artist index. */ + /* Construct an "mhod" chunk for album index. */ mhod = itunesdb_new_child(mhyp); if (mhod) { if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; - qsort(si, num_records, sizeof(si[0]), comp_artist); - if (ret = itunesdb_set_mhod_index(mhod, 0x05, si, num_records)) return ret; + qsort(si, num_records, sizeof(si[0]), comp_album); + if (ret = itunesdb_set_mhod_index(mhod, 0x04, si, num_records)) return ret; } /* Construct an "mhod" chunk for genre index. */ @@ -642,7 +642,7 @@ if (mhod) { if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; qsort(si, num_records, sizeof(si[0]), comp_genre); - if (ret = itunesdb_set_mhod_index(mhod, 0x06, si, num_records)) return ret; + if (ret = itunesdb_set_mhod_index(mhod, 0x07, si, num_records)) return ret; } /* Construct an "mhod" chunk for composer index. */ @@ -653,6 +653,46 @@ if (ret = itunesdb_set_mhod_index(mhod, 0x12, si, num_records)) return ret; } + /* Construct an "mhod" chunk for 'unknown' index. */ + mhod = itunesdb_new_child(mhyp); + if (mhod) { + if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; + qsort(si, num_records, sizeof(si[0]), comp_album); + if (ret = itunesdb_set_mhod_index(mhod, 0x23, si, num_records)) return ret; + } + + /* Construct an "mhod" chunk for 'unknown' index. */ + mhod = itunesdb_new_child(mhyp); + if (mhod) { + if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; + qsort(si, num_records, sizeof(si[0]), comp_album); + if (ret = itunesdb_set_mhod_index(mhod, 0x24, si, num_records)) return ret; + } + + /* Construct an "mhod" chunk for 'unknown' index. */ + mhod = itunesdb_new_child(mhyp); + if (mhod) { + if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; + qsort(si, num_records, sizeof(si[0]), comp_title); + if (ret = itunesdb_set_mhod_index(mhod, 0x1D, si, num_records)) return ret; + } + + /* Construct an "mhod" chunk for 'unknown' index. */ + mhod = itunesdb_new_child(mhyp); + if (mhod) { + if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; + qsort(si, num_records, sizeof(si[0]), comp_title); + if (ret = itunesdb_set_mhod_index(mhod, 0x1E, si, num_records)) return ret; + } + + /* Construct an "mhod" chunk for 'unknown' index. */ + mhod = itunesdb_new_child(mhyp); + if (mhod) { + if (ret = itunesdb_init(mhod, "mhod", "index")) return ret; + qsort(si, num_records, sizeof(si[0]), comp_title); + if (ret = itunesdb_set_mhod_index(mhod, 0x1F, si, num_records)) return ret; + } + /* End of the series of "mhod" chunks. */ mhyp_data->num_mhod = mhyp->num_children; @@ -779,7 +819,9 @@ if (ret = itunesdb_init(mhbd, "mhbd", NULL)) return ret; mhbd_data = (itunesdb_mhbd_t*)mhbd->data; - /* Construct "mhsd" chunk with track type. */ + /* Construct "mhsd" chunk with album_list type (type = 4). */ + + /* Construct "mhsd" chunk with track type (type = 1). */ mhsd = itunesdb_new_child(mhbd); if (mhsd) { itunesdb_mhsd_t* mhsd_data = NULL; @@ -814,7 +856,9 @@ return IPODE_FAILEDNEWCHUNK; } - /* Construct "mhsd" chunk with playlist type. */ + /* Construct "mhsd" chunk with playlist type (type = 3). */ + + /* Construct "mhsd" chunk with playlist type (type = 2). */ mhsd = itunesdb_new_child(mhbd); if (mhsd) { itunesdb_mhsd_t* mhsd_data = NULL; @@ -853,6 +897,8 @@ return IPODE_FAILEDNEWCHUNK; } + /* Construct "mhsd" chunk with unknown type (type = 5). */ + mhbd_data->num_children = mhbd->num_children; ipod->itunesdb = mhbd; return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |