From: <ny...@us...> - 2007-01-12 17:30:24
|
Revision: 260 http://svn.sourceforge.net/pmplib/?rev=260&view=rev Author: nyaochi Date: 2007-01-12 09:30:24 -0800 (Fri, 12 Jan 2007) Log Message: ----------- Separate pmp_device_description_t from pmp_environment_t. Modified Paths: -------------- trunk/pmplib/doc/Doxyfile trunk/pmplib/frontend/easypmp/cui/device.c trunk/pmplib/frontend/easypmp/win32gui/preference.h trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h trunk/pmplib/include/pmp.h trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c Modified: trunk/pmplib/doc/Doxyfile =================================================================== --- trunk/pmplib/doc/Doxyfile 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/doc/Doxyfile 2007-01-12 17:30:24 UTC (rev 260) @@ -83,10 +83,8 @@ #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = .. -FILE_PATTERNS = *.c \ - *.cpp \ - *.h \ +INPUT = ../include +FILE_PATTERNS = *.h \ *.dox RECURSIVE = YES EXCLUDE = ../libltdl \ Modified: trunk/pmplib/frontend/easypmp/cui/device.c =================================================================== --- trunk/pmplib/frontend/easypmp/cui/device.c 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/frontend/easypmp/cui/device.c 2007-01-12 17:30:24 UTC (rev 260) @@ -59,13 +59,13 @@ void device_show_information(pmp_t* pmp, FILE *fp) { - fprintf(fp, "Device identifier: %s\n", pmp->env.id); - fprintf(fp, " Product name: %s\n", pmp->env.name); - fprintf(fp, " Firmware mode: %s\n", pmp->env.mode); - fprintf(fp, " Firmware version: %s\n", pmp->env.version); - fprintf(fp, " Default language: %s\n", pmp->env.language); + fprintf(fp, "Device identifier: %s\n", pmp->decl.id); + fprintf(fp, " Product name: %s\n", pmp->decl.name); + fprintf(fp, " Firmware mode: %s\n", pmp->decl.mode); + fprintf(fp, " Firmware version: %s\n", pmp->decl.version); + fprintf(fp, " Default language: %s\n", pmp->decl.language); + fprints(fp, " Root directory: %s\n", pmp->env.path_to_root.path); - device_show_path(fp, " Music directory: %s\n", pmp->env.path_to_music.path); device_show_path(fp, " Playlist directory: %s\n", pmp->env.path_to_playlist.path); Modified: trunk/pmplib/frontend/easypmp/win32gui/preference.h =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/preference.h 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/frontend/easypmp/win32gui/preference.h 2007-01-12 17:30:24 UTC (rev 260) @@ -200,16 +200,16 @@ if (pmp) { strPlayerLocation = UCS2CT(pmp->env.path_to_root.path); - strPlayerIdentifier = A2CT(pmp->env.id); - strPlayerDescription = A2CT(pmp->env.name); + strPlayerIdentifier = A2CT(pmp->decl.id); + strPlayerDescription = A2CT(pmp->decl.name); strPlayerDescription += _T(""); - if (*pmp->env.version) { + if (*pmp->decl.version) { strPlayerDescription += _T(" "); - strPlayerDescription += A2CT(pmp->env.version); + strPlayerDescription += A2CT(pmp->decl.version); } - if (*pmp->env.mode) { + if (*pmp->decl.mode) { strPlayerDescription += _T(" "); - strPlayerDescription += A2CT(pmp->env.mode); + strPlayerDescription += A2CT(pmp->decl.mode); } } else { strPlayerIdentifier = _T(""); Modified: trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h =================================================================== --- trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/frontend/easypmp/win32gui/processingdlg.h 2007-01-12 17:30:24 UTC (rev 260) @@ -670,11 +670,11 @@ USES_CONVERSION; write_log(LL_INFO, _T("[Player information]")); - write_log(LL_INFO, _T("Device identifier: %s"), A2CT(pmp->env.id)); - write_log(LL_INFO, _T("Product name: %s"), A2CT(pmp->env.name)); - write_log(LL_TRACE, _T("Firmware mode: %s"), A2CT(pmp->env.mode)); - write_log(LL_INFO, _T("Firmware version: %s"), A2CT(pmp->env.version)); - write_log(LL_TRACE, _T("Default language: %s"), A2CT(pmp->env.language)); + write_log(LL_INFO, _T("Device identifier: %s"), A2CT(pmp->decl.id)); + write_log(LL_INFO, _T("Product name: %s"), A2CT(pmp->decl.name)); + write_log(LL_TRACE, _T("Firmware mode: %s"), A2CT(pmp->decl.mode)); + write_log(LL_INFO, _T("Firmware version: %s"), A2CT(pmp->decl.version)); + write_log(LL_TRACE, _T("Default language: %s"), A2CT(pmp->decl.language)); write_log(LL_TRACE, _T("Root directory: %s"), UCS2CT(pmp->env.path_to_root.path)); write_log(LL_TRACE, _T("Music directory: %s"), UCS2CT(pmp->env.path_to_music.path)); write_log(LL_TRACE, _T("Playlist directory: %s"), UCS2CT(pmp->env.path_to_playlist.path)); Modified: trunk/pmplib/include/pmp.h =================================================================== --- trunk/pmplib/include/pmp.h 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/include/pmp.h 2007-01-12 17:30:24 UTC (rev 260) @@ -132,7 +132,9 @@ char mode[128]; /**< Firmware mode. */ char language[128]; /**< Firmware language. */ char version[128]; /**< Firmware version. */ +} pmp_device_description_t; +typedef struct { pmp_pathenv_t path_to_root; /**< Path to the root directory */ pmp_pathenv_t path_to_music; /**< Path to the music files */ pmp_pathenv_t path_to_playlist; /**< Path to the playlist files */ @@ -176,6 +178,8 @@ */ uint32_t flag; + pmp_device_description_t decl; + /** * Portable media device environment. */ @@ -281,14 +285,15 @@ /** * @defgroup pmplib PMPlib Helper API * - * This API provides the utility for selecting a PMPlib driver from a number - * of installed ones. Because the PMPlib project implements a number of - * drivers for different portable media devices, an application must choose - * a suitable driver that matches to the target device. Using this API, an - * application can query a driver suitable for the portable media device - * specified by the mount location (root directory of the device) and/or - * string identifier. An application can also enumerate the string - * identifiers of the drivers installed in the system. + * The PMPlib Helper API provides the utility for choosing a suitable PMPlib + * driver from a number of installed drivers. Because the PMPlib project + * implements a number of drivers for different portable media devices, an + * application must choose a suitable driver that matches to the target + * device. By using this API, an application can query a driver suitable for + * the portable media device specified by the mount location (root directory + * of the device) and/or the string identifier of a driver. An application can + * also enumerate the string identifiers of the drivers available in the + * system. * * An application must call pmplib_init() function to initialize the API * and obtain the pointer to a ::pmplib_t instance that is used for subsequent @@ -353,7 +358,7 @@ * for this API. Call pmplib_init() function to obtain a pointer to this * structure and pmplib_finish() function to terminate this API. Access to * a member in this structure is prohibited since it is reserved for the - * internal use of the library implementation only. + * internal use of the library only. */ typedef struct tag_pmplib_t pmplib_t; @@ -398,11 +403,11 @@ * specified by the mount location and/or identifier, and returns the * interface to the driver (::pmp_t instance). An application must specify * parameter \a path_to_device. If parameter \a id is not \c NULL, this - * function constructs a ::pmp_t instance of the driver with the device - * identifier. If the parameter \a id is \c NULL, this function tries to - * recognize the model of the device based on the content under the location - * (\a path_to_device). If successful, the interface to the driver will be - * returned to the \a pmp argument. + * function obtains the interface to the driver with the device identifier + * specified in \a id parameter. If the parameter \a id is \c NULL, this + * function tries to recognize the model of the device based on the content + * of the files located under \a path_to_device. If successful, the interface + * to the driver will be returned in the \a pmp argument. * * @param pmplib The pointer to the ::pmplib_t instance. * @param path_to_device A UCS-2 string representing the location of the @@ -432,8 +437,7 @@ * @param callback The pointer to the callback function to receive * device identifiers. * @param instance A user-defined instance value. The callback - * function will receive the same value so that it can - * distinguish the caller. + * function will receive the same value. * @retval result_t The status code. * * @assert Modified: trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/lib/pmp_iriverplus2/pmp_iriverplus2.c 2007-01-12 17:30:24 UTC (rev 260) @@ -345,12 +345,12 @@ memcpy(&pmpi->env, &env, sizeof(env)); // Initialize the (exportable) env. + strcpy(pmp->decl.id, md->id); + strcpy(pmp->decl.name, md->name); + strcpy(pmp->decl.mode, md->mode); + strcpy(pmp->decl.language, pmpi->env.language); + strcpy(pmp->decl.version, pmpi->env.version); pmpenv = &pmp->env; - strcpy(pmpenv->id, md->id); - strcpy(pmpenv->name, md->name); - strcpy(pmpenv->mode, md->mode); - strcpy(pmpenv->language, pmpi->env.language); - strcpy(pmpenv->version, pmpi->env.version); pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; ucs2cpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); pmpenv->path_to_music.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; Modified: trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c =================================================================== --- trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/lib/pmp_iriverplus3/pmp_iriverplus3.c 2007-01-12 17:30:24 UTC (rev 260) @@ -356,12 +356,12 @@ memcpy(&pmpi->env, &env, sizeof(env)); // Initialize the (exportable) env. + strcpy(pmp->decl.id, md->id); + strcpy(pmp->decl.name, md->name); + strcpy(pmp->decl.mode, md->mode); + strcpy(pmp->decl.language, pmpi->env.language); + strcpy(pmp->decl.version, pmpi->env.version); pmpenv = &pmp->env; - strcpy(pmpenv->id, md->id); - strcpy(pmpenv->name, md->name); - strcpy(pmpenv->mode, md->mode); - strcpy(pmpenv->language, pmpi->env.language); - strcpy(pmpenv->version, pmpi->env.version); pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; ucs2cpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); pmpenv->path_to_music.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; Modified: trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/lib/pmp_irivnavi/pmp_irivnavi.c 2007-01-12 17:30:24 UTC (rev 260) @@ -197,17 +197,17 @@ // Set model information. switch (model) { case MODEL_IRIVER_H100: - strcpy(pmp->env.id, MODELID_H100); - strcpy(pmp->env.name, "iRiver H100 series"); + strcpy(pmp->decl.id, MODELID_H100); + strcpy(pmp->decl.name, "iRiver H100 series"); break; case MODEL_IRIVER_H300: - strcpy(pmp->env.id, MODELID_H300); - strcpy(pmp->env.name, "iRiver H300 series"); + strcpy(pmp->decl.id, MODELID_H300); + strcpy(pmp->decl.name, "iRiver H300 series"); break; } - strcpy(pmp->env.mode, "UM"); - strcpy(pmp->env.language, "N/A"); - pmp->env.version[0] = 0; // Unknown version + strcpy(pmp->decl.mode, "UM"); + strcpy(pmp->decl.language, "N/A"); + strcpy(pmp->decl.version, "Unknown"); // Set enviroments. pmpenv = &pmp->env; Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-11 17:11:53 UTC (rev 259) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-12 17:30:24 UTC (rev 260) @@ -408,14 +408,16 @@ // Initialize the internal variables. memcpy(&pmpi->env, &env, sizeof(env)); - + + // Initialize the device description. + strcpy(pmp->decl.id, md->id); + strcpy(pmp->decl.name, pmpi->env.model.name); + strcpy(pmp->decl.mode, pmpi->env.model.mode); + strcpy(pmp->decl.language, pmpi->env.model.language); + strcpy(pmp->decl.version, pmpi->env.model.version); + // Initialize the (exportable) env. pmpenv = &pmp->env; - strcpy(pmpenv->id, md->id); - strcpy(pmpenv->name, pmpi->env.model.name); - strcpy(pmpenv->mode, pmpi->env.model.mode); - strcpy(pmpenv->language, pmpi->env.model.language); - strcpy(pmpenv->version, pmpi->env.model.version); pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; ucs2cpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); pmpenv->path_to_music.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |