From: <ny...@us...> - 2007-02-28 12:21:47
|
Revision: 402 http://svn.sourceforge.net/pmplib/?rev=402&view=rev Author: nyaochi Date: 2007-02-28 04:21:46 -0800 (Wed, 28 Feb 2007) Log Message: ----------- - Implemented database update for iPod players. - Removed filepath_changeroot function. - Added an argument to filepath_skiproot to specify the necessity of a path character at the head of the string returned by the function. - Added comment field to pmp_t. - Time stamps are now represented in uint64_t. - Reduced warnings. - Removed unnecessary routines. Modified Paths: -------------- trunk/pmplib/frontend/easypmp/common/database.c trunk/pmplib/frontend/easypmp/common/settle.c trunk/pmplib/frontend/easypmp/cui/console_win32.c trunk/pmplib/frontend/easypmp/cui/device.c trunk/pmplib/include/pmplib/filepath.h trunk/pmplib/include/pmplib/pmp.h trunk/pmplib/lib/filepath/filepath_win32.c trunk/pmplib/lib/gmi/gmi_mp4v2.c trunk/pmplib/lib/pmp_ipod/ipod.c trunk/pmplib/lib/pmp_ipod/ipod.h trunk/pmplib/lib/pmp_ipod/itunesdb.c trunk/pmplib/lib/pmp_ipod/itunesdb.h trunk/pmplib/lib/pmp_ipod/pmp_ipod.c trunk/pmplib/lib/pmp_ipod/util.c trunk/pmplib/lib/pmp_ipod/util.h trunk/pmplib/lib/pmp_iriverplus2/ip2db.c trunk/pmplib/lib/pmp_iriverplus2/playlist.c trunk/pmplib/lib/pmp_iriverplus3/dat.c trunk/pmplib/lib/pmp_iriverplus3/dic.c trunk/pmplib/lib/pmp_iriverplus3/idx.c trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c trunk/pmplib/lib/pmp_irivnavi/playlist.c trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c trunk/pmplib/lib/pmp_portalplayer1/playlist.c Modified: trunk/pmplib/frontend/easypmp/common/database.c =================================================================== --- trunk/pmplib/frontend/easypmp/common/database.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/frontend/easypmp/common/database.c 2007-02-28 12:21:46 UTC (rev 402) @@ -283,7 +283,7 @@ int easypmp_set_strip_words(option_t* opt, const ucs2char_t* str) { - size_t i; + int i; const ucs2char_t *p = 0, *q = 0; /* Modified: trunk/pmplib/frontend/easypmp/common/settle.c =================================================================== --- trunk/pmplib/frontend/easypmp/common/settle.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/frontend/easypmp/common/settle.c 2007-02-28 12:21:46 UTC (rev 402) @@ -93,7 +93,7 @@ ucs2char_t music[MAX_PATH]; ucs2char_t directory[MAX_PATH]; - srand(time(NULL)); + srand((unsigned int)time(NULL)); // Remove music files that are not pointed by any links. if (opt->verb & MODE_REMOVE_UNREF) { Modified: trunk/pmplib/frontend/easypmp/cui/console_win32.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/console_win32.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/frontend/easypmp/cui/console_win32.c 2007-02-28 12:21:46 UTC (rev 402) @@ -101,7 +101,7 @@ return (int)(p - line); } else { fprintf(fp, "%S\n", line); - return ucs2len(line); + return (int)ucs2len(line); } } Modified: trunk/pmplib/frontend/easypmp/cui/device.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/device.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/frontend/easypmp/cui/device.c 2007-02-28 12:21:46 UTC (rev 402) @@ -47,7 +47,7 @@ void device_show_information(pmp_t* pmp, FILE *fp) { - int i; + uint32_t i; fprintf(fp, "Device identifier: %s\n", pmp->info.decl.id); fprintf(fp, " Manufacturer: %s\n", pmp->info.decl.manufacturer); Modified: trunk/pmplib/include/pmplib/filepath.h =================================================================== --- trunk/pmplib/include/pmplib/filepath.h 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/include/pmplib/filepath.h 2007-02-28 12:21:46 UTC (rev 402) @@ -125,26 +125,16 @@ * function skips the portion. * @param root The pointer to the string representing the portion to * be skipped. + * @param pathchar Boolean value to determine whether the resultant + * string should starts with a path character or not. + * If \a pathchar is non-zero value, the resultant string + * will starts with a path character. * @retval const ucs2char_t* The pointer at the next character after the * portion \a root ends in \a path. */ -FILEPATHAPI const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root); +FILEPATHAPI const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root, int pathchar); /** - * Skip a portion in filepath name, assuming it as the root directory. - * - * The resultant string will begin with a path character. - * - * @param path The pointer to the filepath name from which this - * function skips the portion. - * @param root The pointer to the string representing the portion to - * be skipped. - * @retval const ucs2char_t* The pointer at the next character after the - * portion \a root ends in \a path. - */ -FILEPATHAPI const ucs2char_t* filepath_changeroot(const ucs2char_t* path, const ucs2char_t* root); - -/** * Skip a directory name in filepath name. * * @param path The pointer to the filepath name from which this Modified: trunk/pmplib/include/pmplib/pmp.h =================================================================== --- trunk/pmplib/include/pmplib/pmp.h 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/include/pmplib/pmp.h 2007-02-28 12:21:46 UTC (rev 402) @@ -129,7 +129,9 @@ #define PMPCODEC_NONE PMPFOURCC(' ',' ',' ',' ') /** MPEG Audio Layer III. */ #define PMPCODEC_MPEGLAYER3 PMPFOURCC('M','P','A','3') -/** MPEG 4. */ +/** MPEG AAC. */ +#define PMPCODEC_MPEGAAC PMPFOURCC('A','A','C',' ') +/** MPEG 4 Audio. */ #define PMPCODEC_MPEG4AUDIO PMPFOURCC('M','P','4','A') /** Windows Media Audio. */ #define PMPCODEC_WMA PMPFOURCC('W','M','A',' ') @@ -377,6 +379,13 @@ ucs2char_t *date; /** + * Comment. + * e.g., "Encoded with LAME" + * @assert @code comment != NULL @endcode + */ + ucs2char_t *comment; + + /** * Compilation flag. * e.g., 1 for compilation album. */ @@ -437,8 +446,8 @@ uint32_t bitrate; /** - * Duration in seconds. - * e.g., 260 + * Duration in miliseconds. + * e.g., 260000 */ uint32_t duration; @@ -456,9 +465,9 @@ /** * Timestamp of the last update of the music file. - * The value is equivalent to \c st.st_mtime after \c stat(&st, filename); + * The value represents the elapsed seconds from 1970-01-01T00:00:00 (UTC). */ - uint32_t ts_update; + uint64_t ts_update; /** * Rating. @@ -474,13 +483,15 @@ /** * Timestamp of the recent playback on the device. + * The value represents the elapsed seconds from 1970-01-01T00:00:00 (UTC). */ - uint32_t ts_playback; + uint64_t ts_playback; /** * timestamp when the track was imported. + * The value represents the elapsed seconds from 1970-01-01T00:00:00 (UTC). */ - uint32_t ts_import; + uint64_t ts_import; }; /** Modified: trunk/pmplib/lib/filepath/filepath_win32.c =================================================================== --- trunk/pmplib/lib/filepath/filepath_win32.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/filepath/filepath_win32.c 2007-02-28 12:21:46 UTC (rev 402) @@ -106,10 +106,17 @@ return dst; } -const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root) +const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root, int pathchar) { - if (ucs2ncmp(path, root, ucs2len(root)) == 0) { - return path + ucs2len(root); + /* Make sure the _root ends with a PATHCHAR. */ + ucs2char_t* _root = alloca(sizeof(ucs2char_t) * (ucs2len(root) + 2)); + ucs2cpy(_root, root); + filepath_addslash(_root); + + if (ucs2ncmp(path, _root, ucs2len(_root)) == 0) { + const ucs2char_t* p = path + ucs2len(_root); + if (pathchar) --p; + return p < path ? path : p; } else { return path; } @@ -121,16 +128,6 @@ return p ? p+1 : path; } -const ucs2char_t* filepath_changeroot(const ucs2char_t* path, const ucs2char_t* root) -{ - const ucs2char_t* p = filepath_skiproot(path, root); - if (p == NULL) p = path; - if (path < p && p[-1] == '\\') { - --p; - } - return p; -} - const ucs2char_t* filepath_skipadirectory(const ucs2char_t* path) { ucs2char_t* p = ucs2chr(path, '\\'); Modified: trunk/pmplib/lib/gmi/gmi_mp4v2.c =================================================================== --- trunk/pmplib/lib/gmi/gmi_mp4v2.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/gmi/gmi_mp4v2.c 2007-02-28 12:21:46 UTC (rev 402) @@ -89,7 +89,7 @@ if (type && strcmp(type, MP4_AUDIO_TRACK_TYPE) == 0) { MP4Duration duration = MP4GetTrackDuration(mp4file, tid); info->num_samples = (uint64_t)duration; - info->duration = MP4ConvertFromTrackDuration(mp4file, tid, duration, MP4_MSECS_TIME_SCALE); + info->duration = (uint32_t)MP4ConvertFromTrackDuration(mp4file, tid, duration, MP4_MSECS_TIME_SCALE); info->sample_rate = MP4GetTrackTimeScale(mp4file, tid); info->bitrate = MP4GetTrackBitRate(mp4file, tid); } Modified: trunk/pmplib/lib/pmp_ipod/ipod.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/ipod.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/ipod.c 2007-02-28 12:21:46 UTC (rev 402) @@ -32,6 +32,7 @@ #include <string.h> #endif/*HAVE_STRING_H*/ #include <pmplib/ucs2char.h> +#include <pmplib/filepath.h> #include <pmplib/pmp.h> #include "serialize.h" @@ -248,7 +249,12 @@ return 0; } -static int set_music_record(itunesdb_chunk_t* mhit, const pmp_music_record_t* rec, uint32_t uid) +static int set_music_record( + itunesdb_chunk_t* mhit, + const pmp_music_record_t* rec, + uint32_t uid, + const ucs2char_t* path_to_root + ) { itunesdb_chunk_t* mhod = NULL; chunk_mhit_t* mhit_data = (chunk_mhit_t*)mhit->data; @@ -267,8 +273,8 @@ break; } mhit_data->compilation = rec->is_compilation ? 1 : 0; - mhit_data->rating = 0; - mhit_data->last_modified = rec->ts_update; + mhit_data->rating = rec->rating; + mhit_data->last_modified = (uint32_t)from_time((time_t)rec->ts_update); mhit_data->filesize = rec->filesize; mhit_data->duration = rec->duration; mhit_data->track_number = rec->track_number; @@ -278,7 +284,7 @@ mhit_data->samplerate = rec->sample_rate; mhit_data->disc_number = rec->disc_number; mhit_data->total_discs = rec->total_discs; - mhit_data->date_added = rec->ts_import; + mhit_data->date_added = (uint32_t)from_time((time_t)rec->ts_import); mhit_data->dbid = 0; mhit_data->unk9 = 0xFFFF; switch (rec->codec) { @@ -343,10 +349,12 @@ } /* Construct an "mhod" chunk for comment. */ - mhod = itunesdb_new_child(mhit); - if (mhod) { - itunesdb_init(mhod, "mhod", "comment"); - itunesdb_set_mhod_string(mhod, L"Some comment"); + if (rec->comment && *rec->comment) { + mhod = itunesdb_new_child(mhit); + if (mhod) { + itunesdb_init(mhod, "mhod", "comment"); + itunesdb_set_mhod_string(mhod, rec->comment); + } } /* Construct an "mhod" chunk for location. */ @@ -354,11 +362,11 @@ mhod = itunesdb_new_child(mhit); if (mhod) { ucs2char_t pathname[MAX_PATH], *p = NULL; - itunesdb_init(mhod, "mhod", "location"); - ucs2cpy(pathname, rec->filename + 2); + ucs2cpy(pathname, filepath_skiproot(rec->filename, path_to_root, 1)); for (p = pathname;*p;++p) { if (*p == PATHCHAR) *p = ':'; } + itunesdb_init(mhod, "mhod", "location"); itunesdb_set_mhod_string(mhod, pathname); } } @@ -367,6 +375,87 @@ return 0; } +static int get_music_record( + itunesdb_chunk_t* mhit, + pmp_music_record_t* rec, + uint32_t uid, + const ucs2char_t* path_to_root + ) +{ + uint32_t i; + itunesdb_chunk_t* mhod = NULL; + chunk_mhit_t* mhit_data = (chunk_mhit_t*)mhit->data; + + switch (mhit_data->filetype) { + case 0x4D503320: + rec->codec = PMPCODEC_MPEGLAYER3; + rec->is_vbr = mhit_data->type1 ? 1 : 0; + break; + case 0x41414320: + rec->codec = PMPCODEC_MPEGAAC; + break; + case 0x4D344120: + rec->codec = PMPCODEC_MPEG4AUDIO; + break; + } + + rec->is_compilation = mhit_data->compilation ? 1 : 0; + rec->rating = mhit_data->rating; + rec->ts_update = (uint64_t)to_time(mhit_data->last_modified); + rec->filesize = mhit_data->filesize; + rec->duration = mhit_data->duration; + rec->track_number = mhit_data->track_number; + rec->total_tracks = mhit_data->total_tracks; + //rec->date = + rec->bitrate = mhit_data->bitrate * 1000; + rec->sample_rate = mhit_data->samplerate; + rec->disc_number = mhit_data->disc_number; + rec->total_discs = mhit_data->total_discs; + rec->ts_import = (uint64_t)to_time(mhit_data->date_added); + switch (rec->codec) { + case PMPCODEC_MPEGLAYER3: + switch (mhit_data->unk14_1) { + case 0x0016: rec->codec_version = 200; break; + case 0x0020: rec->codec_version = 205; break; + default: rec->codec_version = 100; break; + } + break; + } + rec->num_samples = mhit_data->num_samples; + + for (i = 0;i < mhit->num_children;++i) { + mhod = &mhit->childlen[i]; + if (itunesdb_ischunk(mhod, "mhod", "title")) { + itunesdb_get_mhod_string(mhod, &rec->title); + } else if (itunesdb_ischunk(mhod, "mhod", "artist")) { + itunesdb_get_mhod_string(mhod, &rec->artist); + } else if (itunesdb_ischunk(mhod, "mhod", "album")) { + itunesdb_get_mhod_string(mhod, &rec->album); + } else if (itunesdb_ischunk(mhod, "mhod", "genre")) { + itunesdb_get_mhod_string(mhod, &rec->genre); + } else if (itunesdb_ischunk(mhod, "mhod", "comment")) { + itunesdb_get_mhod_string(mhod, &rec->comment); + } else if (itunesdb_ischunk(mhod, "mhod", "location")) { + ucs2char_t *location = NULL; + itunesdb_get_mhod_string(mhod, &location); + if (location) { + size_t length = 0; + ucs2char_t* p = NULL; + for (p = location;*p;++p) { + if (*p == ':') *p = PATHCHAR; + } + length = ucs2len(path_to_root) + ucs2len(location) + 3; + rec->filename = ucs2calloc(sizeof(ucs2char_t) * length); + if (rec->filename) { + filepath_combinepath(rec->filename, length, path_to_root, location); + } + ucs2free(location); + } + } + } + return 0; +} + static int comp_string(const ucs2char_t* x, const ucs2char_t*y) { int ret = 0; @@ -560,7 +649,7 @@ static uint32_t get_record_index(const ucs2char_t* filename, const pmp_music_record_t* records, int num_records) { - uint32_t i; + int i; for (i = 0;i < num_records;++i) { if (ucs2icmp(records[i].filename, filename) == 0) { @@ -593,8 +682,8 @@ mhyp_data->num_mhod = mhyp->num_children; /* */ - for (i = 0;i < playlist->num_entries;++i) { - uint32_t index = get_record_index(playlist->entries[i], records, num_records); + for (i = 0;i < (int)playlist->num_entries;++i) { + int index = (int)get_record_index(playlist->entries[i], records, num_records); if (index < num_records) { mhip = itunesdb_new_child(mhyp); @@ -622,7 +711,14 @@ return 0; } -result_t ipod_set(ipod_t* ipod, const pmp_music_record_t* records, int num_records, const pmp_playlist_t* playlists, int num_playlists) +result_t ipod_set( + ipod_t* ipod, + const pmp_music_record_t* records, + int num_records, + const pmp_playlist_t* playlists, + int num_playlists, + const ucs2char_t* path_to_root + ) { int i; itunesdb_chunk_t *mhbd = NULL, *mhsd = NULL; @@ -659,7 +755,7 @@ itunesdb_init(mhit, "mhit", NULL); /* This will fill "mhit" chunk and create "mhod" chunks. */ - set_music_record(mhit, rec, i); + set_music_record(mhit, rec, i, path_to_root); } } } @@ -702,3 +798,59 @@ ipod->itunesdb = mhbd; return 0; } + +result_t ipod_get( + ipod_t* ipod, + pmp_music_record_t* records, + int *num_records, + pmp_playlist_t* playlists, + int *num_playlists, + const ucs2char_t* path_to_root + ) +{ + uint32_t i, j, k; + itunesdb_chunk_t* mhbd = ipod->itunesdb; + itunesdb_chunk_t *mhsd = NULL; + itunesdb_chunk_t *mhlt = NULL, *mhit = NULL; + itunesdb_chunk_t *mhlp = NULL, *mhyp = NULL; + + /* Initialize the numbers with zero. */ + if (!records) *num_records = 0; + if (!playlists) *num_playlists = 0; + + if (mhbd && strncmp(mhbd->id, "mhbd", 4) == 0) { + for (i = 0;i < mhbd->num_children;++i) { + mhsd = &mhbd->childlen[i]; + if (mhsd && strncmp(mhsd->id, "mhsd", 4) == 0) { + chunk_mhsd_t* mhsd_data = (chunk_mhsd_t*)mhsd->data; + if (mhsd_data->type == 1) { + /* Track list. */ + for (j = 0;j < mhsd->num_children;++j) { + mhlt = &mhsd->childlen[j]; + if (mhlt && strncmp(mhlt->id, "mhlt", 4) == 0) { + if (records) { + /* Make sure the array has sufficient entries. */ + if (*num_records < (int)mhlt->num_children) { + return PMPERR_INSUFFICIENTMEMORY; + } + /* Obtain media records. */ + for (k = 0;k < mhlt->num_children;++k) { + mhit = &mhlt->childlen[k]; + if (mhit && strncmp(mhit->id, "mhit", 4) == 0) { + get_music_record(mhit, &records[k], k, path_to_root); + } + } + } else { + /* Return the number of records. */ + *num_records = mhlt->num_children; + } + } + } + } else if (mhsd_data->type == 2) { + /* Playlist list. */ + } + } + } + } + return 0; +} Modified: trunk/pmplib/lib/pmp_ipod/ipod.h =================================================================== --- trunk/pmplib/lib/pmp_ipod/ipod.h 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/ipod.h 2007-02-28 12:21:46 UTC (rev 402) @@ -58,9 +58,24 @@ void ipod_init(ipod_t* ipod); void ipod_finish(ipod_t* ipod); -result_t ipod_set(ipod_t* ipod, const pmp_music_record_t* records, int num_records, const pmp_playlist_t* playlists, int num_playlists); result_t ipod_read(ipod_t* ipod, const ucs2char_t* itunesdb, const ucs2char_t* playcounts); result_t ipod_write(ipod_t* ipod, const ucs2char_t* itunesdb); result_t ipod_dump(ipod_t* ipod, FILE *fpo); +result_t ipod_set( + ipod_t* ipod, + const pmp_music_record_t* records, + int num_records, + const pmp_playlist_t* playlists, + int num_playlists, + const ucs2char_t* path_to_root + ); +result_t ipod_get( + ipod_t* ipod, + pmp_music_record_t* records, + int *num_records, + pmp_playlist_t* playlists, + int *num_playlists, + const ucs2char_t* path_to_root + ); #endif/*__IPOD_H__*/ Modified: trunk/pmplib/lib/pmp_ipod/itunesdb.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/itunesdb.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/itunesdb.c 2007-02-28 12:21:46 UTC (rev 402) @@ -633,6 +633,17 @@ } } +int itunesdb_ischunk(itunesdb_chunk_t* chunk, const char *name, const char *subtype) +{ + if (strncmp(name, "mhod", 4) == 0) { + chunk_mhod_t* mhod = (chunk_mhod_t*)chunk->data; + const itunesdb_mhoddecl_t* decl = find_mhoddecl(chunk); + return (decl && strcmp(decl->name, subtype) == 0) ? 1 : 0; + } else { + return (strncmp(chunk->id, name, 4) == 0); + } +} + void itunesdb_finish(itunesdb_chunk_t* chunk) { uint32_t i; @@ -847,6 +858,24 @@ return 0; } +int itunesdb_get_mhod_string(itunesdb_chunk_t* chunk, ucs2char_t** value) +{ + chunk_mhod_t* mhod = (chunk_mhod_t*)chunk->data; + chunk_mhod_string_t* str = &mhod->data.str; + + /* Make sure this is an "mhod" chunk. */ + if (strncmp(chunk->id, "mhod", 4) != 0) { + return 1; + } + + /* Store the string value. */ + ucs2free(*value); + *value = (ucs2char_t*)ucs2calloc(str->size + sizeof(ucs2char_t)); + ucs2ncpy(*value, str->value, str->size / sizeof(ucs2char_t)); + return 0; +} + + int itunesdb_set_mhod_index(itunesdb_chunk_t* chunk, uint32_t type, sorted_index_t* si, uint32_t n) { uint32_t i; Modified: trunk/pmplib/lib/pmp_ipod/itunesdb.h =================================================================== --- trunk/pmplib/lib/pmp_ipod/itunesdb.h 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/itunesdb.h 2007-02-28 12:21:46 UTC (rev 402) @@ -19,7 +19,7 @@ * */ -/* $Id:$ */ +/* $Id$ */ #ifndef __ITUNESDB_H__ #define __ITUNESDB_H__ @@ -253,6 +253,8 @@ */ int itunesdb_init(itunesdb_chunk_t* chunk, const char *identifer, const char *subtype); +int itunesdb_ischunk(itunesdb_chunk_t* chunk, const char *name, const char *subtype); + /** * Create a new chunk and append it to the children of the parent chunk. * @param chunk The chunk where a new child will be appended. @@ -274,6 +276,8 @@ */ int itunesdb_set_mhod_string(itunesdb_chunk_t* chunk, const ucs2char_t* str); +int itunesdb_get_mhod_string(itunesdb_chunk_t* chunk, ucs2char_t** str); + /** * Set sorted index to "mhod" chunk. * @param chunk The pointer to "mhod" chunk. Modified: trunk/pmplib/lib/pmp_ipod/pmp_ipod.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/pmp_ipod.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/pmp_ipod.c 2007-02-28 12:21:46 UTC (rev 402) @@ -327,83 +327,63 @@ static uint32_t pmpmusic_open(pmp_music_t* music) { - //ip3db_t ip3db; + ipod_t ipod; result_t ret = 0; pmp_t* pmp = music->pmp; pmp_music_internal_t* pmpmi = (pmp_music_internal_t*)music->instance; + ucs2char_t itunesdb[MAX_PATH], playcounts[MAX_PATH]; - /* - // Initialize IP3DB. - ip3db_init(&ip3db); + // Initialize ipod library. + ipod_init(&ipod); - // Free the existing records. - pmplib_records_finish(pmpmi->records, pmpmi->num_records); - pmpmi->records = 0; - pmpmi->num_records = 0; + // Read the music database. + set_filenames(itunesdb, playcounts, music->pmp); - // Open the music database if necessary. - if (pmp->flag & PMPOF_MUSIC_DB_READ) { - int i; - ucs2char_t dat[MAX_PATH], dic[MAX_PATH], idx[MAX_PATH]; - pmp_music_internal_t* pmpmi = (pmp_music_internal_t*)pmp->music->instance; + if (pmp->flag & (PMPOF_MUSIC_DB_READ|PMPOF_MUSIC_PL_READ)) { + int num_records = 0, num_playlists = 0; - // Read the music database. - set_filenames(dat, dic, idx, pmp); - ret = ip3db_read(&ip3db, dat, dic, idx); - if (ret) { - goto exit_this; + ipod_read(&ipod, itunesdb, playcounts); + ipod_get(&ipod, NULL, &num_records, NULL, &num_playlists, pmp->info.path_to_root); + + // Allocate records. + if (pmp->flag & PMPOF_MUSIC_DB_READ) { + if (0 < num_records) { + ucs2free(pmpmi->records); + pmpmi->records = (pmp_music_record_t*)ucs2calloc(sizeof(pmp_music_record_t) * num_records); + if (!pmpmi->records) { + ret = PMPERR_INSUFFICIENTMEMORY; + goto exit_this; + } + pmpmi->num_records = num_records; + } + } else { + ucs2free(pmpmi->records); + pmpmi->records = 0; + pmpmi->num_records = 0; } - // The number of music records. - pmpmi->num_records = ip3db_num_records(&ip3db); - - // Allocate an array of the records. - pmpmi->records = (pmp_music_record_t*)malloc(sizeof(pmp_music_record_t) * pmpmi->num_records); - - // Convert IP3DB records to a pmp_music_record_t array. - for (i = 0;i < pmpmi->num_records;++i) { - const ip3db_variant_t* src = (const ip3db_variant_t*)ip3db_get_record(&ip3db, i); - pmp_music_record_t* dst = &pmpmi->records[i]; - size_t length = 0; - - pmplib_record_init(dst); - - length = ucs2len(pmp->info.path_to_root); - length += ucs2len(src[IP3DBF_MUSIC_FILEPATH].value.str); - length += ucs2len(src[IP3DBF_MUSIC_FILENAME].value.str); - dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * (length+1)); - ucs2cpy(dst->filename, pmp->info.path_to_root); - ucs2cat(dst->filename, src[IP3DBF_MUSIC_FILEPATH].value.str+1); - ucs2cat(dst->filename, src[IP3DBF_MUSIC_FILENAME].value.str); - filepath_backslash(dst->filename); - - dst->title = ucs2dup(src[IP3DBF_MUSIC_TITLE].value.str); - dst->artist = ucs2dup(src[IP3DBF_MUSIC_ARTIST].value.str); - dst->album = ucs2dup(src[IP3DBF_MUSIC_ALBUM].value.str); - dst->genre = ucs2dup(src[IP3DBF_MUSIC_GENRE].value.str); - dst->date = ucs2dup(src[IP3DBF_MUSIC_ORGRELEASEDATE].value.str); - switch (src[IP3DBF_MUSIC_FILEFORMAT].value.word) { - case 0: - dst->codec = PMPCODEC_MPEGLAYER3; - break; - case 3: - dst->codec = PMPCODEC_VORBIS; - break; - case 5: - dst->codec = PMPCODEC_WMA; - break; + // Allocate playlists. + if (pmp->flag & PMPOF_MUSIC_PL_READ) { + if (0 < num_playlists) { + ucs2free(pmpmi->playlists); + pmpmi->playlists = (pmp_playlist_t*)ucs2calloc(sizeof(pmp_playlist_t) * num_playlists); + if (!pmpmi->playlists) { + ret = PMPERR_INSUFFICIENTMEMORY; + goto exit_this; + } + pmpmi->num_playlists = num_playlists; } - dst->track_number = src[IP3DBF_MUSIC_TRACKNUMBER].value.word; - dst->bitrate = src[IP3DBF_MUSIC_BITRATE].value.dword; - dst->duration = src[IP3DBF_MUSIC_DURATION].value.dword; - dst->ts_update = src[IP3DBF_MUSIC_CLUSA].value.dword; - dst->rating = src[IP3DBF_MUSIC_RATING].value.word; + } else { + ucs2free(pmpmi->playlists); + pmpmi->playlists = 0; + pmpmi->num_playlists = 0; } + + ipod_get(&ipod, pmpmi->records, &num_records, pmpmi->playlists, &num_playlists, pmp->info.path_to_root); } - */ exit_this: - //ip3db_finish(&ip3db); + ipod_finish(&ipod); return ret; } @@ -422,7 +402,7 @@ set_filenames(itunesdb, playcounts, music->pmp); if (pmp->flag & PMPOF_MUSIC_DB_WRITE) { - ipod_set(&ipod, pmpmi->records, pmpmi->num_records, pmpmi->playlists, pmpmi->num_playlists); + ipod_set(&ipod, pmpmi->records, pmpmi->num_records, pmpmi->playlists, pmpmi->num_playlists, pmp->info.path_to_root); ipod_write(&ipod, itunesdb); } Modified: trunk/pmplib/lib/pmp_ipod/util.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/util.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/util.c 2007-02-28 12:21:46 UTC (rev 402) @@ -19,7 +19,7 @@ * */ -/* $Id:$ */ +/* $Id$ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -153,23 +153,12 @@ return 0; } -void filepath_slash(ucs2char_t* path) +time_t to_time(uint64_t t) { - while (*path) { - if (*path == 0x005C) { - *path = 0x002F; - } - path++; - } + return (time_t)((2082844800 < t) ? (t - 2082844800) : 0); } -void filepath_backslash(ucs2char_t* path) +uint64_t from_time(time_t t) { - while (*path) { - if (*path == 0x002F) { - *path = 0x005C; - } - path++; - } + return (uint64_t)t + 2082844800; } - Modified: trunk/pmplib/lib/pmp_ipod/util.h =================================================================== --- trunk/pmplib/lib/pmp_ipod/util.h 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_ipod/util.h 2007-02-28 12:21:46 UTC (rev 402) @@ -35,7 +35,7 @@ int fread_all(FILE *fp, uint8_t** ptr_buffer, long* ptr_size); -void filepath_slash(ucs2char_t* path); -void filepath_backslash(ucs2char_t* path); +time_t to_time(uint64_t t); +uint64_t from_time(time_t t); #endif/*__IP3DB_UTIL_H__*/ Modified: trunk/pmplib/lib/pmp_iriverplus2/ip2db.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus2/ip2db.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_iriverplus2/ip2db.c 2007-02-28 12:21:46 UTC (rev 402) @@ -196,7 +196,7 @@ } dst->entry_number = j+1; - dst->pathname = ucs2dup(filepath_changeroot(src->filename, path_to_root)); + dst->pathname = ucs2dup(filepath_skiproot(src->filename, path_to_root, 1)); filepath_remove_filespec(dst->pathname); filepath_encode(dst->pathname); dst->filename = ucs2dup(filepath_skippath(src->filename)); @@ -206,7 +206,7 @@ dst->genre = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); dst->rating = src->rating; dst->play_count = src->play_count; - dst->recent_play = src->ts_playback; + dst->recent_play = (uint32_t)src->ts_playback; dst->track_number = src->track_number; if (src->date) { dst->year = ucs2toi(src->date); @@ -215,7 +215,7 @@ dst->duration = src->duration / 1000; dst->sample_rate = src->sample_rate; dst->bitrate = src->bitrate; - dst->timestamp = src->ts_update; + dst->timestamp = (uint32_t)src->ts_update; ++j; } Modified: trunk/pmplib/lib/pmp_iriverplus2/playlist.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus2/playlist.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_iriverplus2/playlist.c 2007-02-28 12:21:46 UTC (rev 402) @@ -58,7 +58,7 @@ filepath_decode(decoded_filename); // 2. As above, with mount point prefix stripped. - ucs2cpy(decoded_filepathname, filepath_changeroot(decoded_filename, path_to_root)); + ucs2cpy(decoded_filepathname, filepath_skiproot(decoded_filename, path_to_root, 1)); // 3. As above, but with filename stripped. ucs2cpy(decoded_pathname, decoded_filepathname); Modified: trunk/pmplib/lib/pmp_iriverplus3/dat.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/dat.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_iriverplus3/dat.c 2007-02-28 12:21:46 UTC (rev 402) @@ -305,7 +305,7 @@ static sort_index_t* dat_uidmap_create(dat_list_t* list) { - int i; + uint32_t i; sort_index_t* si = (sort_index_t*)malloc(sizeof(sort_index_t) * list->num_entries); if (si) { @@ -574,7 +574,7 @@ static uint32_t findfile(dat_t* dat, const ucs2char_t *filename) { - int i; + uint32_t i; const ucs2char_t *filepart = NULL; ucs2char_t *pathname = alloca(sizeof(ucs2char_t) * (ucs2len(filename) + 1)); @@ -767,7 +767,7 @@ qsort(objects, num_objects, sizeof(objects[0]), comp_pathname); /* Loop for the records. */ - for (i = 0;i < num_objects;++i) { + for (i = 0;i < (int)num_objects;++i) { /* * Split a path name into two parts: a prefix that have already been * registered in the Object table: and a postfix that is being registered Modified: trunk/pmplib/lib/pmp_iriverplus3/dic.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/dic.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_iriverplus3/dic.c 2007-02-28 12:21:46 UTC (rev 402) @@ -145,7 +145,8 @@ static size_t dic_table_serialize(uint8_t* buffer, uint32_t start, dic_table_t* list, int is_storing) { - uint32_t i, next; + int i; + uint32_t next; uint8_t *p = buffer + start; p += serialize_uint32be(p, &list->unknown0, is_storing); Modified: trunk/pmplib/lib/pmp_iriverplus3/idx.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/idx.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_iriverplus3/idx.c 2007-02-28 12:21:46 UTC (rev 402) @@ -160,7 +160,7 @@ static uint32_t avlnode_new(avl_t* avl, size_t keysize) { - uint32_t offset = avl_allocate(avl, sizeof(avlnode_t) + keysize); + uint32_t offset = (uint32_t)avl_allocate(avl, sizeof(avlnode_t) + keysize); avlnode_t* a = avlnode(avl, offset); a->left = 0; a->right = 0; Modified: trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-02-28 12:21:46 UTC (rev 402) @@ -576,7 +576,7 @@ ip3db_variant_t* dst = records[i]; ip3db_record_init(&ip3db, &records[i]); - ip3db_variant_set_str(&dst[IP3DBF_MUSIC_FILEPATH], filepath_changeroot(src->filename, pmp->info.path_to_root)); + ip3db_variant_set_str(&dst[IP3DBF_MUSIC_FILEPATH], filepath_skiproot(src->filename, pmp->info.path_to_root, 1)); filepath_remove_filespec(dst[IP3DBF_MUSIC_FILEPATH].value.str); filepath_addslash(dst[IP3DBF_MUSIC_FILEPATH].value.str); filepath_slash(dst[IP3DBF_MUSIC_FILEPATH].value.str); @@ -600,7 +600,7 @@ } ip3db_variant_set_word(&dst[IP3DBF_MUSIC_TRACKNUMBER], (uint16_t)src->track_number); ip3db_variant_set_dword(&dst[IP3DBF_MUSIC_BITRATE], src->bitrate); - ip3db_variant_set_dword(&dst[IP3DBF_MUSIC_CLUSA], src->ts_update); + ip3db_variant_set_dword(&dst[IP3DBF_MUSIC_CLUSA], (uint32_t)src->ts_update); ip3db_variant_set_dword(&dst[IP3DBF_MUSIC_UID], (uint32_t)i+1); } @@ -708,7 +708,7 @@ static result_t pmpmusic_set_playlists(pmp_music_t* music, const pmp_playlist_t* playlists, uint32_t num_playlists) { - uint32_t i, j; + int i, j; static const ucs2char_t rootdir[] = {PATHCHAR,0}; static const ucs2char_t plp_ext[] = {'.','p','l','p',0}; pmp_music_internal_t* pmpmi = (pmp_music_internal_t*)music->instance; @@ -724,7 +724,7 @@ pmpmi->num_playlists = num_playlists; // Copy the content of the playlists. - for (i = 0;i < num_playlists;++i) { + for (i = 0;i < (int)num_playlists;++i) { ucs2char_t filepath[MAX_PATH]; const pmp_playlist_t* src = &playlists[i]; ip3db_playlist_t* dst = &pmpmi->playlists[i]; @@ -735,7 +735,7 @@ filepath_combinepath(filepath, MAX_PATH, rootdir, music->pmp->info.path_to_playlist); filepath_addslash(filepath); - dst->filepath = ucs2dup(filepath_changeroot(filepath, music->pmp->info.path_to_root)); + dst->filepath = ucs2dup(filepath_skiproot(filepath, music->pmp->info.path_to_root, 1)); filepath_slash(dst->filepath); dst->num_entries = src->num_entries; @@ -743,7 +743,7 @@ for (j = 0;j < src->num_entries;++j) { ucs2char_t filename[MAX_PATH]; - ucs2cpy(filename, filepath_changeroot(src->entries[j], music->pmp->info.path_to_root)); + ucs2cpy(filename, filepath_skiproot(src->entries[j], music->pmp->info.path_to_root, 1)); filepath_slash(filename); dst->entries[j] = ucs2dup(filename); } Modified: trunk/pmplib/lib/pmp_irivnavi/playlist.c =================================================================== --- trunk/pmplib/lib/pmp_irivnavi/playlist.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_irivnavi/playlist.c 2007-02-28 12:21:46 UTC (rev 402) @@ -63,7 +63,7 @@ if (mediafiles[i][0]) { char *mbs = NULL; ucs2char_t filename[MAX_PATH]; - ucs2cpy(filename, filepath_changeroot(mediafiles[i], path_to_root)); + ucs2cpy(filename, filepath_skiproot(mediafiles[i], path_to_root, 1)); filepath_encode(filename); Modified: trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-02-28 12:21:46 UTC (rev 402) @@ -478,12 +478,12 @@ // Set record fields. record_init(dst); - dst->filename = ucs2dupmbs(filepath_changeroot(src->filename, music->pmp->info.path_to_root)); + dst->filename = ucs2dupmbs(filepath_skiproot(src->filename, music->pmp->info.path_to_root, 1)); dst->title = src->title ? ucs2dupmbs(src->title) : ucs2dupmbs(filepath_skippath(src->filename));; dst->artist = ucs2dupmbs(src->artist ? src->artist : ucs2cs_unknown); dst->album = ucs2dupmbs(src->album ? src->album : ucs2cs_unknown); dst->genre = ucs2dupmbs(src->genre ? src->genre : ucs2cs_unknown); - dst->timestamp = src->ts_update; + dst->timestamp = (uint32_t)src->ts_update; ++j; } Modified: trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-02-28 12:21:46 UTC (rev 402) @@ -100,7 +100,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); @@ -112,7 +112,7 @@ dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); dst->fields[PP1DB_DATFIELD_RATING].value.dword = src->rating; dst->fields[PP1DB_DATFIELD_PLAYCOUNT].value.dword = src->play_count; - dst->fields[PP1DB_DATFIELD_RECENTPLAY].value.dword = src->ts_playback; + dst->fields[PP1DB_DATFIELD_RECENTPLAY].value.dword = (uint32_t)src->ts_playback; dst->fields[PP1DB_DATFIELD_UNKNOWN3].value.dword = 0; dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; if (src->date) { @@ -124,7 +124,7 @@ dst->fields[PP1DB_DATFIELD_BITRATE].value.dword = src->bitrate; dst->fields[PP1DB_DATFIELD_UNKNOWN4].value.dword = 0; dst->fields[PP1DB_DATFIELD_UNKNOWN5].value.str = ucs2dup(ucs2cs_empty); - dst->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword = src->ts_update; + dst->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword = (uint32_t)src->ts_update; dst->fields[PP1DB_DATFIELD_UNKNOWN7].value.str = ucs2dup(ucs2cs_empty); return 0; } Modified: trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2007-02-28 12:21:46 UTC (rev 402) @@ -86,7 +86,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2007-02-28 12:21:46 UTC (rev 402) @@ -74,7 +74,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-02-28 12:21:46 UTC (rev 402) @@ -85,7 +85,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c 2007-02-28 12:21:46 UTC (rev 402) @@ -90,7 +90,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c 2007-02-28 12:21:46 UTC (rev 402) @@ -92,7 +92,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); @@ -110,7 +110,7 @@ dst->fields[PP1DB_DATFIELD_YEAR].value.dword = ucs2toi(src->date); } dst->fields[PP1DB_DATFIELD_FILESIZE].value.dword = src->filesize; - dst->fields[PP1DB_DATFIELD_UNKNOWN4].value.dword = src->ts_update; + dst->fields[PP1DB_DATFIELD_UNKNOWN4].value.dword = (uint32_t)src->ts_update; dst->fields[PP1DB_DATFIELD_UNKNOWN5].value.str = ucs2dup(ucs2cs_empty); dst->fields[PP1DB_DATFIELD_UNKNOWN6].value.str = ucs2dup(ucs2cs_empty); dst->fields[PP1DB_DATFIELD_UNKNOWN7].value.str = ucs2dup(ucs2cs_empty); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c 2007-02-28 12:21:46 UTC (rev 402) @@ -105,7 +105,7 @@ // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root, 0)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/playlist.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/playlist.c 2007-02-28 08:17:04 UTC (rev 401) +++ trunk/pmplib/lib/pmp_portalplayer1/playlist.c 2007-02-28 12:21:46 UTC (rev 402) @@ -85,7 +85,7 @@ for (i = 0;i < num_mediafiles;i++) { if (mediafiles[i][0]) { ucs2char_t filename[MAX_PATH]; - ucs2cpy(filename, filepath_skiproot(mediafiles[i], path_to_root)); + ucs2cpy(filename, filepath_skiproot(mediafiles[i], path_to_root, 0)); filepath_encode(filename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-03-06 04:23:32
|
Revision: 403 http://svn.sourceforge.net/pmplib/?rev=403&view=rev Author: nyaochi Date: 2007-03-05 20:23:18 -0800 (Mon, 05 Mar 2007) Log Message: ----------- Make the SVN head build on POSIX for debugging iriver E10 database problem. Now libmp4v2 is necessary (but should be omittable later). Modified Paths: -------------- trunk/pmplib/configure.in trunk/pmplib/frontend/easypmp/cui/Makefile.am trunk/pmplib/lib/filepath/filepath_posix.c trunk/pmplib/lib/gmi/Makefile.am trunk/pmplib/lib/ucs2/ucs2char_iconv.c Modified: trunk/pmplib/configure.in =================================================================== --- trunk/pmplib/configure.in 2007-02-28 12:21:46 UTC (rev 402) +++ trunk/pmplib/configure.in 2007-03-06 04:23:18 UTC (rev 403) @@ -184,6 +184,19 @@ dnl Checks for vorbis AM_PATH_VORBIS +dnl Checks for libmp4v2 +AC_CHECK_HEADER( + mp4.h, + , + [AC_MSG_ERROR(mp4v2 header not found!)] +) +AC_CHECK_LIB( + mp4v2, + MP4Read, + [MP4V2_LIBS="-lmp4v2"], + AC_MSG_ERROR([mp4v2 library is not found!]) +) + dnl Check for libsmjs (SpiderMonkey JavaScript engine) AC_PATH_SPIDERMONKEY @@ -219,6 +232,7 @@ AC_SUBST(OGG_LIBS) AC_SUBST(VORBIS_LIBS) AC_SUBST(VORBISFILE_LIBS) +AC_SUBST(MP4V2_LIBS) AC_SUBST(JS_CFLAGS) AC_SUBST(JS_LIBS) AC_SUBST(JS_RPATH) Modified: trunk/pmplib/frontend/easypmp/cui/Makefile.am =================================================================== --- trunk/pmplib/frontend/easypmp/cui/Makefile.am 2007-02-28 12:21:46 UTC (rev 402) +++ trunk/pmplib/frontend/easypmp/cui/Makefile.am 2007-03-06 04:23:18 UTC (rev 403) @@ -13,6 +13,7 @@ ../common/database.c \ ../common/enumerate.c \ ../common/playlist.c \ + ../common/settle.c \ device.c \ option.c \ option.h \ @@ -35,4 +36,5 @@ easypmp_LDADD = \ $(top_builddir)/lib/pmp/libpmp.la \ $(top_builddir)/lib/gmi/libgmi.la \ - $(top_builddir)/lib/playlist/libplaylist.la + $(top_builddir)/lib/playlist/libplaylist.la \ + $(JS_LIBS) Modified: trunk/pmplib/lib/filepath/filepath_posix.c =================================================================== --- trunk/pmplib/lib/filepath/filepath_posix.c 2007-02-28 12:21:46 UTC (rev 402) +++ trunk/pmplib/lib/filepath/filepath_posix.c 2007-03-06 04:23:18 UTC (rev 403) @@ -37,6 +37,8 @@ #include <pmplib/filepath.h> #include "rel2abs.h" +static const ucs2char_t ucs2cs_link_ext[] = {'.','m','3','u','8',0}; + static int _decode(char* path) { while (*path) { @@ -189,10 +191,17 @@ return dst; } -const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root) +const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root, int pathchar) { - if (ucs2ncmp(path, root, ucs2len(root)) == 0) { - return path + ucs2len(root); + /* Make sure the _root ends with a PATHCHAR. */ + ucs2char_t* _root = alloca(sizeof(ucs2char_t) * (ucs2len(root) + 2)); + ucs2cpy(_root, root); + filepath_addslash(_root); + + if (ucs2ncmp(path, _root, ucs2len(_root)) == 0) { + const ucs2char_t* p = path + ucs2len(_root); + if (pathchar) --p; + return p < path ? path : p; } else { return path; } @@ -204,22 +213,18 @@ return p ? p+1 : path; } -const ucs2char_t* filepath_changeroot(const ucs2char_t* path, const ucs2char_t* root) -{ - const ucs2char_t* p = filepath_skiproot(path, root); - if (p == NULL) p = path; - if (path < p && p[-1] == PATHCHAR) { - --p; - } - return p; -} - const ucs2char_t* filepath_skipadirectory(const ucs2char_t* path) { ucs2char_t* p = ucs2chr(path, PATHCHAR); return p ? p+1 : NULL; } +const ucs2char_t* filepath_extract_extension(const ucs2char_t* path) +{ + ucs2char_t* p = ucs2rchr(path, '.'); + return p ? p : path; +} + void filepath_strippath(ucs2char_t* path) { ucs2char_t* p = path + ucs2len(path) - 1; @@ -316,6 +321,18 @@ return (ret1 - ret2); } +int filepath_createdirs(const ucs2char_t* filename) +{ + ucs2char_t* dirname = (ucs2char_t*)alloca(sizeof(ucs2char_t) * (ucs2len(filename) + 1)); + filepath_removeslash(dirname); + if (filepath_file_exists(dirname)) { + return 0; + } else { + filepath_remove_filespec(dirname); + return filepath_createdirs(dirname); + } +} + int filepath_copyfile(const ucs2char_t* src, const ucs2char_t* dst) { int ret = 0; @@ -354,6 +371,79 @@ return ret; } +int filepath_movefile(const ucs2char_t* src, const ucs2char_t* dst) +{ + int ret = 0; + char *_src = ucs2dupmbs(src); + char *_dst = ucs2dupmbs(dst); + ret = (rename(_src, _dst) == 0); + ucs2free(_dst); + ucs2free(_src); + return ret; +} + +int filepath_linkfile(const ucs2char_t* target, const ucs2char_t* link) +{ + /* Create a m3u8 playlist with the target file. */ + FILE *fp = NULL; + ucs2char_t* _link = alloca(sizeof(ucs2char_t) * (ucs2len(link) + ucs2len(ucs2cs_link_ext) + 1)); + + /* Add ".m3u8" extension. */ + ucs2cpy(_link, link); + ucs2cat(_link, ucs2cs_link_ext); + + /* Write the */ + fp = ucs2fopen(_link, "w"); + if (fp) { + char *utf8 = ucs2duputf8(target); + fputc('\\', fp); + fputs(utf8, fp); + ucs2free(utf8); + fclose(fp); + return 0; + } else { + return -1; + } +} + +int filepath_followlink(const ucs2char_t* link, ucs2char_t* org) +{ + /* Create a m3u8 playlist with the target file. */ + FILE *fp = NULL; + ucs2char_t* _link = (ucs2char_t*)alloca( + sizeof(ucs2char_t) * (ucs2len(link) + ucs2len(ucs2cs_link_ext) + 1)); + + /* Add ".m3u8" extension. */ + ucs2cpy(_link, link); + ucs2cat(_link, ucs2cs_link_ext); + + /* Write the */ + fp = ucs2fopen(_link, "r"); + if (fp) { + char buff[MAX_PATH*4]; + ucs2char_t target[MAX_PATH]; + fgets(buff, sizeof(buff)-1, fp); + utf8toucs2(target, MAX_PATH, buff, strlen(buff)+1); + filepath_combinepath(org, MAX_PATH, link, target); + fclose(fp); + return 0; + } else { + return -1; + } +} + +int filepath_removelinkfile(const ucs2char_t* file) +{ + ucs2char_t* _link = (ucs2char_t*)alloca( + sizeof(ucs2char_t) * (ucs2len(file) + ucs2len(ucs2cs_link_ext) + 1)); + + /* Add ".m3u8" extension. */ + ucs2cpy(_link, file); + ucs2cat(_link, ucs2cs_link_ext); + + return filepath_removefile(_link); +} + int filepath_encode(ucs2char_t* path) { while (*path) { @@ -426,3 +516,8 @@ } return 0; } + +int filepath_is_link(const ucs2char_t *path) +{ + return filepath_hasext(path, ucs2cs_link_ext); +} Modified: trunk/pmplib/lib/gmi/Makefile.am =================================================================== --- trunk/pmplib/lib/gmi/Makefile.am 2007-02-28 12:21:46 UTC (rev 402) +++ trunk/pmplib/lib/gmi/Makefile.am 2007-03-06 04:23:18 UTC (rev 403) @@ -5,6 +5,7 @@ libgmi_la_SOURCES = \ ../../include/gmi.h \ gmi_mp3.c \ + gmi_mp4v2.c \ gmi_wma.c \ gmi_wav.c \ gmi_vorbis.c \ @@ -12,7 +13,7 @@ libgmi_la_LDFLAGS = \ @ID3TAG_LIBS@ @OGG_LIBS@ @VORBIS_LIBS@ @VORBISFILE_LIBS@ \ - -no-undefined + @MP4V2_LIBS@ -no-undefined AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ Modified: trunk/pmplib/lib/ucs2/ucs2char_iconv.c =================================================================== --- trunk/pmplib/lib/ucs2/ucs2char_iconv.c 2007-02-28 12:21:46 UTC (rev 402) +++ trunk/pmplib/lib/ucs2/ucs2char_iconv.c 2007-03-06 04:23:18 UTC (rev 403) @@ -237,6 +237,13 @@ return ret; } +size_t ucs2toutf8(char *mbstr, size_t mbs_size, const ucs2char_t *ucs2str, size_t ucs_size) +{ + iconv_t cd = iconv_open("UTF-8", g_ucs2encoding); + size_t ret = iconv_convert(cd, (char **)&mbstr, mbs_size, (char **)&ucs2str, ucs_size * sizeof(ucs2char_t)); + iconv_close(cd); + return ret; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2007-04-08 16:42:22
|
Revision: 406 http://svn.sourceforge.net/pmplib/?rev=406&view=rev Author: sucknblow Date: 2007-04-08 09:42:23 -0700 (Sun, 08 Apr 2007) Log Message: ----------- * Make use of the mp4v2 library optional, via --without-mp4v2 configure option. * Run autoupdate - adds a little extra quoting to configure.in, bumps AC_PREREQ, and remove obsolete AM_PROG_CC_STDC. * Add libmp4v2-dev to list of Debian build dependencies. Modified Paths: -------------- trunk/pmplib/configure.in trunk/pmplib/debian/control trunk/pmplib/lib/gmi/Makefile.am trunk/pmplib/lib/gmi/gmi.c Added Paths: ----------- trunk/pmplib/m4/mp4v2.m4 Modified: trunk/pmplib/configure.in =================================================================== --- trunk/pmplib/configure.in 2007-04-08 14:52:22 UTC (rev 405) +++ trunk/pmplib/configure.in 2007-04-08 16:42:23 UTC (rev 406) @@ -10,7 +10,7 @@ dnl ------------------------------------------------------------------ dnl Initialization for autoconf dnl ------------------------------------------------------------------ -AC_PREREQ(2.53) +AC_PREREQ(2.61) AC_INIT AC_CONFIG_SRCDIR([frontend/easypmp/cui/main.c]) @@ -36,7 +36,6 @@ dnl ------------------------------------------------------------------ dnl Checks for program dnl ------------------------------------------------------------------ -AM_PROG_CC_STDC AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S @@ -127,7 +126,7 @@ dnl ------------------------------------------------------------------ AC_ARG_ENABLE( debug, - [AC_HELP_STRING(--enable-debug, [Turn on debugging])] + [AS_HELP_STRING([--enable-debug],[Turn on debugging])] ) if test "$enable_debug" = "yes"; then @@ -156,13 +155,13 @@ dnl Checks for id3tag AC_ARG_WITH( id3tag-header, - [AC_HELP_STRING(--with-id3tag-header=DIR, [id3tag header directory])], + [AS_HELP_STRING([--with-id3tag-header=DIR],[id3tag header directory])], [CFLAGS="-I$withval ${CFLAGS}"] ) AC_ARG_WITH( id3tag-library, - [AC_HELP_STRING(--with-id3tag-library=DIR, [id3tag library directory])], + [AS_HELP_STRING([--with-id3tag-library=DIR],[id3tag library directory])], [LDFLAGS="-L$withval ${LDFLAGS}"] ) @@ -184,18 +183,8 @@ dnl Checks for vorbis AM_PATH_VORBIS -dnl Checks for libmp4v2 -AC_CHECK_HEADER( - mp4.h, - , - [AC_MSG_ERROR(mp4v2 header not found!)] -) -AC_CHECK_LIB( - mp4v2, - MP4Read, - [MP4V2_LIBS="-lmp4v2"], - AC_MSG_ERROR([mp4v2 library is not found!]) -) +dnl Checks for mp4v2 +PMP_PATH_MP4V2 dnl Check for libsmjs (SpiderMonkey JavaScript engine) AC_PATH_SPIDERMONKEY @@ -245,7 +234,7 @@ dnl ------------------------------------------------------------------ AC_ARG_ENABLE( versioned-libdir, - [AC_HELP_STRING(--enable-versioned-libdir, [Include version number in plugins path])] + [AS_HELP_STRING([--enable-versioned-libdir],[Include version number in plugins path])] ) if test "$enable_versioned_libdir" = "yes" ; then PLUGIN_DIR=$PACKAGE-$VERSION @@ -259,7 +248,7 @@ dnl ------------------------------------------------------------------ AC_ARG_ENABLE( versioned-jspldir, - [AC_HELP_STRING(--enable-versioned-jspldir, [Include version number in JSPL path])] + [AS_HELP_STRING([--enable-versioned-jspldir],[Include version number in JSPL path])] ) if test "$enable_versioned_jspldir" = "yes" ; then JSPL_DIR=$PACKAGE-$VERSION @@ -280,9 +269,17 @@ AC_OUTPUT if test -z "$JS_CFLAGS" ; then + echo if test "$enable_js" != no ; then - echo echo " Warning: JavaScript interpreter engine not found" fi echo " pmplib will be build without support for JavaScript playlists." fi + +if test -z "$HAVE_MP4V2" ; then + echo + if test "$with_mp4v2" != no ; then + echo " Warning: mp4v2 development files not found" + fi + echo " pmplib will be build without support for MP4 files." +fi Modified: trunk/pmplib/debian/control =================================================================== --- trunk/pmplib/debian/control 2007-04-08 14:52:22 UTC (rev 405) +++ trunk/pmplib/debian/control 2007-04-08 16:42:23 UTC (rev 406) @@ -2,7 +2,7 @@ Section: sound Priority: extra Maintainer: Martin Ellis <ma...@do...> -Build-Depends: debhelper (>= 5), libvorbis-dev, libid3tag0-dev, libmozjs-dev +Build-Depends: debhelper (>= 5), libvorbis-dev, libid3tag0-dev, libmp4v2-dev, libmozjs-dev Standards-Version: 3.7.2 Package: easypmp Modified: trunk/pmplib/lib/gmi/Makefile.am =================================================================== --- trunk/pmplib/lib/gmi/Makefile.am 2007-04-08 14:52:22 UTC (rev 405) +++ trunk/pmplib/lib/gmi/Makefile.am 2007-04-08 16:42:23 UTC (rev 406) @@ -2,10 +2,13 @@ noinst_LTLIBRARIES = libgmi.la +if have_mp4v2 + gmi_mp4v2_c=gmi_mp4v2.c +endif libgmi_la_SOURCES = \ ../../include/gmi.h \ gmi_mp3.c \ - gmi_mp4v2.c \ + $(gmi_mp4v2_c) \ gmi_wma.c \ gmi_wav.c \ gmi_vorbis.c \ Modified: trunk/pmplib/lib/gmi/gmi.c =================================================================== --- trunk/pmplib/lib/gmi/gmi.c 2007-04-08 14:52:22 UTC (rev 405) +++ trunk/pmplib/lib/gmi/gmi.c 2007-04-08 16:42:23 UTC (rev 406) @@ -39,8 +39,10 @@ int gmi_mp3(media_info_t* info, const ucs2char_t *filename, const char *charset); static const ucs2char_t ucs2cs_ext_mp3[] = {'.','m','p','3',0}; +#if HAVE_MP4V2 int gmi_mp4v2(media_info_t* info, const ucs2char_t *filename, const char *charset); static const ucs2char_t ucs2cs_ext_m4a[] = {'.','m','4','a',0}; +#endif int gmi_wma(media_info_t* info, const ucs2char_t *filename, const char *charset); static const ucs2char_t ucs2cs_ext_wma[] = {'.','w','m','a',0}; @@ -58,7 +60,9 @@ static gmi_exports_t gmi_exports[] = { {gmi_mp3, ucs2cs_ext_mp3}, +#if HAVE_MP4V2 {gmi_mp4v2, ucs2cs_ext_m4a}, +#endif {gmi_wma, ucs2cs_ext_wma}, {gmi_vorbis, ucs2cs_ext_ogg}, {gmi_wav, ucs2cs_ext_wav}, Added: trunk/pmplib/m4/mp4v2.m4 =================================================================== --- trunk/pmplib/m4/mp4v2.m4 (rev 0) +++ trunk/pmplib/m4/mp4v2.m4 2007-04-08 16:42:23 UTC (rev 406) @@ -0,0 +1,32 @@ +AC_DEFUN([PMP_PATH_MP4V2],[ +dnl Checks for libmp4v2 + AC_ARG_WITH( + mp4v2, + [AS_HELP_STRING([--without-mp4v2],[do not try to use mp4v2 for MP4 file support])] + ) + + if test "$with_mp4v2" != "no" ; then + + AC_CHECK_HEADER( + [mp4.h], + [HAVE_MP4V2_HEADER="yes"], + AC_MSG_WARN(mp4v2 header not found!) + ) + + AC_CHECK_LIB( + mp4v2, + MP4Read, + [MP4V2_LIBS="-lmp4v2"], + AC_MSG_WARN([mp4v2 library is not found!]) + ) + fi + + if test "$HAVE_MP4V2_HEADER" = "yes" -a "MP4V2_LIBS" != "" ; then + HAVE_MP4V2=yes + AC_DEFINE([HAVE_MP4_H], 1, [Define if you have the mp4.h header]) + AC_SUBST(MP4V2_LIBS) + fi + + AM_CONDITIONAL(have_mp4v2, test "$HAVE_MP4V2" = "yes") +]) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-05-12 02:26:40
|
Revision: 408 http://svn.sourceforge.net/pmplib/?rev=408&view=rev Author: nyaochi Date: 2007-05-11 19:26:41 -0700 (Fri, 11 May 2007) Log Message: ----------- - Make easypmp_cui work again on Win32 environments. - Minor bug fix. Modified Paths: -------------- trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj trunk/pmplib/lib/gmi/gmi.vcproj trunk/pmplib/lib/pmp_ipod/ipod.c trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj Added Paths: ----------- trunk/pmplib/include/win32/ trunk/pmplib/include/win32/config.h Modified: trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj =================================================================== --- trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj 2007-05-12 01:28:22 UTC (rev 407) +++ trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj 2007-05-12 02:26:41 UTC (rev 408) @@ -41,8 +41,8 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)include,..\common" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,..\common" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -119,8 +119,8 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SolutionDir)include,..\common" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,..\common" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Added: trunk/pmplib/include/win32/config.h =================================================================== --- trunk/pmplib/include/win32/config.h (rev 0) +++ trunk/pmplib/include/win32/config.h 2007-05-12 02:26:41 UTC (rev 408) @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define HAVE_MP4V2 1 + +#endif/*__CONFIG_H__*/ Property changes on: trunk/pmplib/include/win32/config.h ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: trunk/pmplib/lib/gmi/gmi.vcproj =================================================================== --- trunk/pmplib/lib/gmi/gmi.vcproj 2007-05-12 01:28:22 UTC (rev 407) +++ trunk/pmplib/lib/gmi/gmi.vcproj 2007-05-12 02:26:41 UTC (rev 408) @@ -41,8 +41,8 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)include,contrib,contrib\id3tag,contrib\mp4v2" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GMI_EXPORTS" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,contrib,contrib\id3tag,contrib\mp4v2" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GMI_EXPORTS;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -121,8 +121,8 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SolutionDir)include,contrib,contrib\id3tag" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GMI_EXPORTS" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,contrib,contrib\id3tag,contrib\mp4v2" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GMI_EXPORTS;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" @@ -140,7 +140,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies=".\contrib\id3tag\win32\libid3tag.lib .\contrib\id3tag\win32\zlib.lib .\contrib\ogg\win32\ogg_static.lib .\contrib\vorbis\win32\vorbis_static.lib .\contrib\vorbis\win32\vorbisfile_static.lib" + AdditionalDependencies=".\contrib\id3tag\win32\libid3tag.lib .\contrib\id3tag\win32\zlib.lib .\contrib\ogg\win32\ogg_static.lib .\contrib\vorbis\win32\vorbis_static.lib .\contrib\vorbis\win32\vorbisfile_static.lib .\contrib\mp4v2\win32\libmp4v260.lib" OutputFile="$(OutDir)/gmi.dll" LinkIncremental="1" GenerateDebugInformation="true" Modified: trunk/pmplib/lib/pmp_ipod/ipod.c =================================================================== --- trunk/pmplib/lib/pmp_ipod/ipod.c 2007-05-12 01:28:22 UTC (rev 407) +++ trunk/pmplib/lib/pmp_ipod/ipod.c 2007-05-12 02:26:41 UTC (rev 408) @@ -659,7 +659,7 @@ /* */ for (i = 0;i < num_records;++i) { mhip = itunesdb_new_child(mhyp); - if (!mhip) { + if (mhip) { chunk_mhip_t* mhip_data = NULL; if (ret = itunesdb_init(mhip, "mhip", NULL)) return ret; mhip_data = (chunk_mhip_t*)mhip->data; Modified: trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj =================================================================== --- trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj 2007-05-12 01:28:22 UTC (rev 407) +++ trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj 2007-05-12 02:26:41 UTC (rev 408) @@ -136,6 +136,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalDependencies=".\win32spti\ipodprop_win32spti.lib shlwapi.lib" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="2" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-10-08 08:40:36
|
Revision: 427 http://pmplib.svn.sourceforge.net/pmplib/?rev=427&view=rev Author: nyaochi Date: 2007-10-08 01:40:37 -0700 (Mon, 08 Oct 2007) Log Message: ----------- Updated the build system for Win32 with the latest library dependencies. Modified Paths: -------------- trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj trunk/pmplib/lib/gmi/gmi.vcproj trunk/pmplib/lib/playlist/playlist.vcproj trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj Modified: trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj =================================================================== --- trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj 2007-10-08 07:59:18 UTC (rev 426) +++ trunk/pmplib/frontend/easypmp/cui/easypmp_cui.vcproj 2007-10-08 08:40:37 UTC (rev 427) @@ -41,7 +41,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,..\common,..\contrib" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,$(SolutionDir)win32,..\common" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -65,7 +65,7 @@ AdditionalDependencies="bgd.lib" OutputFile="$(OutDir)/easypmp_cui.exe" LinkIncremental="2" - AdditionalLibraryDirectories="..\contrib\gd" + AdditionalLibraryDirectories="$(SolutionDir)win32\gd" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/easypmp_cui.pdb" SubSystem="1" @@ -121,7 +121,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,..\common,..\contrib" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,$(SolutionDir)win32,..\common" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" @@ -143,7 +143,7 @@ AdditionalDependencies="bgd.lib" OutputFile="$(OutDir)/easypmp_cui.exe" LinkIncremental="1" - AdditionalLibraryDirectories="..\contrib\gd" + AdditionalLibraryDirectories="$(SolutionDir)win32\gd" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" Modified: trunk/pmplib/lib/gmi/gmi.vcproj =================================================================== --- trunk/pmplib/lib/gmi/gmi.vcproj 2007-10-08 07:59:18 UTC (rev 426) +++ trunk/pmplib/lib/gmi/gmi.vcproj 2007-10-08 08:40:37 UTC (rev 427) @@ -41,7 +41,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,contrib,contrib\id3tag,contrib\mp4v2" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,$(SolutionDir)win32,$(SolutionDir)win32\id3tag,$(SolutionDir)win32\mp4v2" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GMI_EXPORTS;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -62,9 +62,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies=".\contrib\id3tag\win32\libid3tagd.lib .\contrib\id3tag\win32\zlibd.lib .\contrib\ogg\win32\ogg_static_d.lib .\contrib\vorbis\win32\vorbis_static_d.lib .\contrib\vorbis\win32\vorbisfile_static_d.lib .\contrib\mp4v2\win32\libmp4v2d.lib" + AdditionalDependencies="libid3tagd.lib zlibd.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib libmp4v2d.lib" OutputFile="$(OutDir)/gmi.dll" LinkIncremental="2" + AdditionalLibraryDirectories="$(SolutionDir)win32\zlib;$(SolutionDir)win32\id3tag;$(SolutionDir)win32\ogg;$(SolutionDir)win32\vorbis;$(SolutionDir)win32\mp4v2" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/gmi.pdb" SubSystem="2" @@ -121,7 +122,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,contrib,contrib\id3tag,contrib\mp4v2" + AdditionalIncludeDirectories="$(SolutionDir)include\win32,$(SolutionDir)include,$(SolutionDir)win32,$(SolutionDir)win32\id3tag,$(SolutionDir)win32\mp4v2" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GMI_EXPORTS;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" @@ -140,9 +141,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies=".\contrib\id3tag\win32\libid3tag.lib .\contrib\id3tag\win32\zlib.lib .\contrib\ogg\win32\ogg_static.lib .\contrib\vorbis\win32\vorbis_static.lib .\contrib\vorbis\win32\vorbisfile_static.lib .\contrib\mp4v2\win32\libmp4v2.lib" + AdditionalDependencies="libid3tag.lib zlib.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib libmp4v2.lib" OutputFile="$(OutDir)/gmi.dll" LinkIncremental="1" + AdditionalLibraryDirectories="$(SolutionDir)win32\zlib;$(SolutionDir)win32\id3tag;$(SolutionDir)win32\ogg;$(SolutionDir)win32\vorbis;$(SolutionDir)win32\mp4v2" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" Modified: trunk/pmplib/lib/playlist/playlist.vcproj =================================================================== --- trunk/pmplib/lib/playlist/playlist.vcproj 2007-10-08 07:59:18 UTC (rev 426) +++ trunk/pmplib/lib/playlist/playlist.vcproj 2007-10-08 08:40:37 UTC (rev 427) @@ -40,7 +40,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)include,.\contrib\js" + AdditionalIncludeDirectories="$(SolutionDir)include,$(SolutionDir)win32\js" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLAYLIST_EXPORTS;XP_WIN;HAVE_JSAPI_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -61,9 +61,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies=".\contrib\js\win32\js32d.lib" + AdditionalDependencies="js32d.lib" OutputFile="$(OutDir)/playlist.dll" LinkIncremental="2" + AdditionalLibraryDirectories="$(SolutionDir)win32\js\debug" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/playlist.pdb" SubSystem="2" @@ -120,7 +121,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SolutionDir)include,.\contrib\js" + AdditionalIncludeDirectories="$(SolutionDir)include,$(SolutionDir)win32\js" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLAYLIST_EXPORTS;XP_WIN;HAVE_JSAPI_H" RuntimeLibrary="2" UsePrecompiledHeader="0" @@ -139,9 +140,10 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies=".\contrib\js\win32\js32.lib" + AdditionalDependencies="js32.lib" OutputFile="$(OutDir)/playlist.dll" LinkIncremental="1" + AdditionalLibraryDirectories="$(SolutionDir)win32\js\release" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" Modified: trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj =================================================================== --- trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj 2007-10-08 07:59:18 UTC (rev 426) +++ trunk/pmplib/lib/pmp_ipod/pmp_ipod.vcproj 2007-10-08 08:40:37 UTC (rev 427) @@ -139,7 +139,7 @@ Name="VCLinkerTool" AdditionalDependencies=".\win32\usbinfo_win32.lib .\win32spti\ipodprop_win32spti.lib shlwapi.lib bgd.lib libexpat.lib" LinkIncremental="1" - AdditionalLibraryDirectories="$(SolutionDir)win32\gd;$(SolutionDir)win32\expat" + AdditionalLibraryDirectories="$(SolutionDir)win32\gd;$(SolutionDir)win32\expat\release" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |