From: <ny...@us...> - 2006-03-31 05:41:59
|
Revision: 5 Author: nyaochi Date: 2006-03-30 21:41:31 -0800 (Thu, 30 Mar 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=5&view=rev Log Message: ----------- Incremental commit: - clean-up an unused field in pmp.h - export added timestamp for JSPL Modified Paths: -------------- trunk/frontend/easypmp/common/database.c trunk/include/pmp.h trunk/lib/playlist/jspl.c trunk/lib/pmp_iriverplus2/ip2db.c trunk/lib/pmp_irivnavi/pmp_irivnavi.c trunk/lib/pmp_portalplayer1/model_iriver_h10.c trunk/lib/pmp_portalplayer1/model_medion_mdjuke220.c trunk/lib/pmp_portalplayer1/model_medion_mdjuke440.c trunk/lib/pmp_portalplayer1/model_sirius_s50.c Modified: trunk/frontend/easypmp/common/database.c =================================================================== --- trunk/frontend/easypmp/common/database.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/frontend/easypmp/common/database.c 2006-03-31 05:41:31 UTC (rev 5) @@ -228,7 +228,7 @@ if (find_mediafile(old_records, num_old_records, filename, &begin, &end)) { if (begin + 1 == end) { // If the time stamps are identical, let us skip this file. - if (old_records[begin].timestamp == timestamp) { + if (old_records[begin].ts_update == timestamp) { pmp_record_copy(record, &old_records[begin]); is_skipping = 1; } @@ -242,7 +242,7 @@ ++num_obtained; } else { } - record->timestamp = timestamp; + record->ts_update = timestamp; record->ts_import = ts_import; } } Modified: trunk/include/pmp.h =================================================================== --- trunk/include/pmp.h 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/include/pmp.h 2006-03-31 05:41:31 UTC (rev 5) @@ -79,26 +79,28 @@ const ucs2char_t* playlist_ext; } pmp_environment_t; +/** + * Structure of media record. + */ struct tag_pmp_record_t { - uint32_t unique_id; - ucs2char_t *filename; - ucs2char_t *title; - ucs2char_t *artist; - ucs2char_t *composer; - ucs2char_t *album; - ucs2char_t *genre; - ucs2char_t *date; - uint32_t codec; - uint32_t track_number; - uint32_t sample_rate; - uint32_t bitrate; - uint32_t duration; - uint32_t filesize; - uint32_t timestamp; - uint32_t rating; - uint32_t play_count; - uint32_t recent_play; - uint32_t ts_import; + ucs2char_t *filename; /**< Filename. */ + ucs2char_t *title; /**< Track title. */ + ucs2char_t *artist; /**< Artist name. */ + ucs2char_t *composer; /**< Composer name. */ + ucs2char_t *album; /**< Album name. */ + ucs2char_t *genre; /**< Genre name. */ + ucs2char_t *date; /**< Date. */ + uint32_t codec; /**< Codec FourCC. */ + uint32_t track_number; /**< Track number. */ + uint32_t sample_rate; /**< Sample rate in kHz. */ + uint32_t bitrate; /**< Bitrate in bps. */ + uint32_t duration; /**< Duration in seconds. */ + uint32_t filesize; /**< File size in bytes. */ + uint32_t ts_update; /**< Last update. */ + uint32_t rating; /**< Rating of the track. */ + uint32_t play_count; /**< The number of playback of the track. */ + uint32_t ts_playback; /**< Date/time of recent playback of the track. */ + uint32_t ts_import; /**< Date/time when the track was imported. */ }; typedef struct tag_pmp_record_t pmp_record_t; Modified: trunk/lib/playlist/jspl.c =================================================================== --- trunk/lib/playlist/jspl.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/playlist/jspl.c 2006-03-31 05:41:31 UTC (rev 5) @@ -272,10 +272,11 @@ set_property_int(jspl, obj, "sample_rate", (int)record->sample_rate); set_property_int(jspl, obj, "bitrate", (int)record->bitrate); set_property_int(jspl, obj, "duration", (int)record->duration); - set_property_int(jspl, obj, "timestamp", (int)record->timestamp); + set_property_int(jspl, obj, "update_timestamp", (int)record->ts_update); set_property_int(jspl, obj, "rating", (int)record->rating); set_property_int(jspl, obj, "play_count", (int)record->play_count); - set_property_int(jspl, obj, "recent_play", (int)record->recent_play); + set_property_int(jspl, obj, "playback_timestamp", (int)record->ts_playback); + set_property_int(jspl, obj, "import_timestamp", (int)record->ts_import); /* Register the object pointer to the record array. */ jspl->records[i] = obj; Modified: trunk/lib/pmp_iriverplus2/ip2db.c =================================================================== --- trunk/lib/pmp_iriverplus2/ip2db.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/pmp_iriverplus2/ip2db.c 2006-03-31 05:41:31 UTC (rev 5) @@ -203,7 +203,7 @@ dst->genre = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); dst->rating = src->rating; dst->play_count = src->play_count; - dst->recent_play = src->recent_play; + dst->recent_play = src->ts_playback; dst->track_number = src->track_number; if (src->date) { dst->year = ucs2toi(src->date); @@ -212,7 +212,7 @@ dst->duration = src->duration; dst->sample_rate = src->sample_rate; dst->bitrate = src->bitrate; - dst->timestamp = src->timestamp; + dst->timestamp = src->ts_update; ++j; } @@ -265,8 +265,6 @@ ip2db_get_record(db, i, &src); - dst->unique_id = j; - length = ucs2len(path_to_root); length += ucs2len(src.pathname); length += ucs2len(src.filename); @@ -295,10 +293,10 @@ dst->bitrate = src.bitrate; dst->duration = src.duration; dst->filesize = src.filesize; - dst->timestamp = src.timestamp; + dst->ts_update = src.timestamp; dst->rating = src.rating; dst->play_count = src.play_count; - dst->recent_play = src.recent_play; + dst->ts_playback = src.recent_play; ++j; } Modified: trunk/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- trunk/lib/pmp_irivnavi/pmp_irivnavi.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/pmp_irivnavi/pmp_irivnavi.c 2006-03-31 05:41:31 UTC (rev 5) @@ -473,7 +473,7 @@ 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->timestamp; + dst->timestamp = src->ts_update; ++j; } @@ -512,8 +512,6 @@ pmp_record_init(dst); - dst->unique_id = j; - tmp = mbsdupucs2(src->filename); length = ucs2len(path_to_root); length += ucs2len(tmp); @@ -537,7 +535,7 @@ dst->codec = PMPCODEC_WAV; } - dst->timestamp = src->timestamp; + dst->ts_update = src->timestamp; ucs2free(tmp); ++j; Modified: trunk/lib/pmp_portalplayer1/model_iriver_h10.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_iriver_h10.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/pmp_portalplayer1/model_iriver_h10.c 2006-03-31 05:41:31 UTC (rev 5) @@ -109,7 +109,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->recent_play; + dst->fields[PP1DB_DATFIELD_RECENTPLAY].value.dword = src->ts_playback; dst->fields[PP1DB_DATFIELD_UNKNOWN3].value.dword = 0; dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; if (src->date) { @@ -121,7 +121,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->timestamp; + dst->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword = src->ts_update; dst->fields[PP1DB_DATFIELD_UNKNOWN7].value.str = ucs2dup(ucs2cs_empty); return 0; } @@ -134,8 +134,6 @@ ucs2char_t tmp[128]; size_t length = 0; - dst->unique_id = 0; - length = ucs2len(path_to_root); length += ucs2len(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); @@ -169,10 +167,10 @@ dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; dst->duration = src->fields[PP1DB_DATFIELD_DURATION].value.dword; dst->filesize = src->fields[PP1DB_DATFIELD_FILESIZE].value.dword; - dst->timestamp = src->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword; + dst->ts_update = src->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword; dst->rating = src->fields[PP1DB_DATFIELD_RATING].value.dword; dst->play_count = src->fields[PP1DB_DATFIELD_PLAYCOUNT].value.dword; - dst->recent_play = src->fields[PP1DB_DATFIELD_RECENTPLAY].value.dword; + dst->ts_playback = src->fields[PP1DB_DATFIELD_RECENTPLAY].value.dword; return 0; } Modified: trunk/lib/pmp_portalplayer1/model_medion_mdjuke220.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2006-03-31 05:41:31 UTC (rev 5) @@ -117,8 +117,6 @@ ucs2char_t tmp[128]; size_t length = 0; - dst->unique_id = 0; - length = ucs2len(path_to_root); length += ucs2len(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); Modified: trunk/lib/pmp_portalplayer1/model_medion_mdjuke440.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2006-03-31 05:41:31 UTC (rev 5) @@ -98,8 +98,6 @@ static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; size_t length = 0; - dst->unique_id = 0; - length = ucs2len(path_to_root); length += ucs2len(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); Modified: trunk/lib/pmp_portalplayer1/model_sirius_s50.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_sirius_s50.c 2006-03-18 03:34:03 UTC (rev 4) +++ trunk/lib/pmp_portalplayer1/model_sirius_s50.c 2006-03-31 05:41:31 UTC (rev 5) @@ -143,8 +143,6 @@ static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; size_t length = 0; - dst->unique_id = 0; - length = ucs2len(path_to_root); length += ucs2len(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |