Nmsdk.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. /////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: nmsdk.h
  4. //
  5. // Purpose: Combination of the Jukebox SDK2 header file and the NomadII SDK2 header file.
  6. //
  7. // Notes: Please make sure to include the COM Stuffs <Objbase.h> and <initguid.h>
  8. // at the beginning of the application programs. Otherwise, it will get Link Errors.
  9. //
  10. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  11. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  12. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  13. // PARTICULAR PURPOSE.
  14. //
  15. // Copyright (c) Creative Technology Ltd., 2001. All rights reserved.
  16. //
  17. /////////////////////////////////////////////////////////////////////////////////////
  18. /////////////////////////////////////////////////////////////////////////////
  19. // nmsdk.h : main header file for export
  20. // Version: 1.0.7.0
  21. /////////////////////////////////////////////////////////////////////////////
  22. #ifndef __nmsdk_h__
  23. #define __nmsdk_h__
  24. //
  25. // COM Interface Declaration
  26. //
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif // __cplusplus
  30. //////////////////////////////////////////////////////////////////////////
  31. // Class ID //
  32. //////////////////////////////////////////////////////////////////////////
  33. //CLSID CLSID_CTJukeBox2:
  34. // {BD1A6357-3E9B-4f1b-8375-AEE989ED6C5E}
  35. DEFINE_GUID(CLSID_CTJukeBox2,
  36. 0xbd1a6357, 0x3e9b, 0x4f1b, 0x83, 0x75, 0xae, 0xe9, 0x89, 0xed, 0x6c, 0x5e);
  37. //CLSID CLSID_CTNOMAD2:
  38. // {0EBE3156-FD3A-4f5c-ABDB-71E3BEEAD091}
  39. DEFINE_GUID(CLSID_CTNOMAD2,
  40. 0xebe3156, 0xfd3a, 0x4f5c, 0xab, 0xdb, 0x71, 0xe3, 0xbe, 0xea, 0xd0, 0x91);
  41. //////////////////////////////////////////////////////////////////////////
  42. // return codes //
  43. //////////////////////////////////////////////////////////////////////////
  44. //////////////////////////////////////////////////////
  45. // JukeBox & NomadII shared stuffs //
  46. //////////////////////////////////////////////////////
  47. // Additional Error codes
  48. #define DAPSDK_SUCCESS 0x00
  49. // General Error
  50. #define DAPSDK_FAILED 0x01
  51. #define DAPSDK_E_DEVICE_BUSY 0x02
  52. #define DAPSDK_E_STORAGE_FULL 0x03
  53. #define DAPSDK_E_SETTIME_REJECTED 0x05
  54. #define DAPSDK_E_ITEM_SIZE_MISSING 0x14 //NMJB_E_TRACK_SIZE_MISSING
  55. #define DAPSDK_E_ITEM_UPLOAD_DENIED 0x18 //NMJB_E_TRACK_UPLOAD_DENIED
  56. #define DAPSDK_E_PLAYER_NOT_CONNECTED 0x80
  57. #define DAPSDK_E_CANCELLED 0x81
  58. #define DAPSDK_E_PORT_UNAVAILABLE 0x82
  59. #define DAPSDK_E_OUT_OF_MEMORY 0x83
  60. #define DAPSDK_E_FILEOPEN_ERR 0x84
  61. #define DAPSDK_E_ITEM_NOT_FOUND 0x85
  62. #define DAPSDK_E_LOAD_COMPONENTS_FAILED 0x86
  63. #define DAPSDK_E_ID_INVALID 0x87
  64. #define DAPSDK_E_FILETYPE_ILLEGAL 0x88
  65. #define DAPSDK_E_LOADRES_FAIL 0x89
  66. #define DAPSDK_E_FORMAT_NOT_FOUND 0x8a
  67. #define DAPSDK_E_FILE_ALREADY_EXISTS 0x8b
  68. #define DAPSDK_E_LIB_CORRUPTED 0x8c
  69. #define DAPSDK_E_LIB_BUSY 0x8d
  70. #define DAPSDK_E_FILE_READ_WRITE_FAILED 0x8e //NMJB_E_FILE_WRITE_FAILED
  71. #define DAPSDK_E_INVALID_FILEPATH 0x8f
  72. #define DAPSDK_E_UNSUPPORTED 0x91
  73. #define DAPSDK_E_NORIGHTS 0x95
  74. #define DAPSDK_E_UNDEFINED_ERR 0xff
  75. //////////////////////////////////////////////////////
  76. // NomadII stuffs //
  77. //////////////////////////////////////////////////////
  78. #define DAPSDK_E_SMARTMEDIA_WRITE_PROTECTED 0x98
  79. #define DAPSDK_E_NO_STORAGE 0x99 //No internal media or smart media
  80. //////////////////////////////////////////////////////
  81. // JukeBox stuffs //
  82. //////////////////////////////////////////////////////
  83. // General Error
  84. #define DAPSDK_E_HD_GENERAL_ERROR 0x04
  85. // Track Management Error
  86. #define DAPSDK_E_TRACK_NOT_FOUND 0x10
  87. #define DAPSDK_E_TRACK_ALREADY_EXIST 0x11
  88. #define DAPSDK_E_TRACK_TITLE_MISSING 0x12
  89. #define DAPSDK_E_TRACK_CODEC_MISSING 0x13
  90. #define DAPSDK_E_TRACK_IO_OPERATION_ABORTED 0x15
  91. #define DAPSDK_E_TRACK_READ_WRITE_ERROR 0x16
  92. #define DAPSDK_E_TRACK_NOT_OPENED 0x17
  93. // Playlist Error
  94. #define DAPSDK_E_PL_NOT_FOUND 0x20
  95. #define DAPSDK_E_PL_ALREADY_EXIST 0x21
  96. #define DAPSDK_E_PL_ITEM_NOT_FOUND 0x22
  97. #define DAPSDK_E_PL_ITEM_ALREADY_EXIST 0x23
  98. //Additional
  99. #define DAPSDK_E_DISKFULL_FOR_DOWNLOAD 0x90
  100. #define DAPSDK_E_STATUS_TIMEOUT 0x06
  101. // Transport Control Error
  102. #define DAPSDK_E_END_OF_TRACK 0x30
  103. #define DAPSDK_E_END_OF_LIST 0x31
  104. #define DAPSDK_E_CODEC_NOT_SUPPORTED 0x32
  105. #define DAPSDK_E_DATA_CORRUPTED 0x33
  106. #define DAPSDK_E_SAMPLING_RATE_NOT_SUPPORTED 0x34
  107. #define DAPSDK_E_DECODING_ERROR 0x35
  108. #define DAPSDK_E_POSITION_OUTOF_RANGE 0x36
  109. #define DAPSDK_E_NOT_STOPPED 0x37
  110. // Audio Control Error
  111. #define DAPSDK_E_UNKNOW_PROPERTY 0x40
  112. #define DAPSDK_E_VALUE_OUTOF_RANGE 0x41
  113. // USB Transaction Error
  114. #define DAPSDK_E_DATA_FILE_NOT_FOUND 0x60
  115. #define DAPSDK_E_DATA_FILE_TOO_BIG 0x61
  116. #define DAPSDK_E_DATA_FILE_ALREADY_EXIST 0x62
  117. #define DAPSDK_E_TOO_MANY_DATA_FILES 0x63
  118. //additional
  119. #define DAPSDK_E_WMDM_INIT_FAILED 0x92
  120. #define DAPSDK_E_INVALID_ARGUMENT 0x93
  121. #define DAPSDK_E_PARENTNODE_NOT_EXIST 0x94
  122. #define DAPSDK_E_NORIGHTS 0x95
  123. #define DAPSDK_E_PATH_EXCESS_LEN 0x96
  124. #define DAPSDK_E_LOAD_PROC_FAILED 0x97
  125. // New Error code for MultiApplication assess of Nomad Jukebox 2/3/Zen
  126. #define DAPSDK_E_PMSMAN_CREATEDIRECTORY_FAILED 0x0100
  127. #define DAPSDK_E_DEVICE_WRITE_FAILED 0x0200
  128. #define DAPSDK_E_DEVICE_READ_FAILED 0x0300
  129. #define DAPSDK_E_DB_INVALID_REQUEST_ID 0x0400
  130. #define DAPSDK_E_DB_INVALID_NODE_ID 0x0500
  131. #define DAPSDK_E_DWNTHRD_CREATEMETADATA_FAILED 0x0600
  132. #define DAPSDK_E_DEVINFO_INVALID_INDEX 0x0700
  133. #define DAPSDK_E_INVALID_DEVICESETTINGTYPE 0x0800
  134. #define DAPSDK_E_FILESIZE_TOO_BIG 0x0900
  135. #define DAPSDK_E_AUDIOFILE_FORMAT 0x0A00
  136. #define DAPSDK_E_AUDIOFILE_INVALID 0x0B00
  137. #define DAPSDK_E_ACCESS_DENIED 0x0C00
  138. #define DAPSDK_E_FILE_NOT_FOUND 0x0D00
  139. #define DAPSDK_E_EOF 0x0E00
  140. #define DAPSDK_E_COOKIE 0x0F00
  141. #define DAPSDK_E_PLAYBACK_INPROGRESS 0x1000
  142. #define DAPSDK_E_TRANSFER_INPROGRESS 0x1100
  143. #define DAPSDK_E_BUFFER_NOT_ENOUGH 0x1200
  144. // New Error code for Data Folder of Nomad Jukebox 2/3/Zen
  145. #define DAPSDK_E_NOT_A_FOLDER 0x1400 // the target file is not a folder
  146. #define DAPSDK_E_FOLDER_NOT_EMPTY 0x1600 // the target folder is not empty
  147. #define DAPSDK_E_FOLDER_EXIST 0x1700 // the target folder exist
  148. #define DAPSDK_E_FOLDER_NOTEXIST 0x1800 // the target folder does not exist
  149. #define DAPSDK_E_PARENTFOLDER_NOTEXIST 0x1900 // the target parent folder does not exist
  150. #define DAPSDK_E_FILEPATH_TOOLONG 0x1A00 // the target file path is too long
  151. #define DAPSDK_E_FILENAME_TOOLONG 0x1B00 // the target file name is too long
  152. #define DAPSDK_E_INVALID_OPERATION 0x1E00 // the operation cannot be perform
  153. //////////////////////////////////////////////////////////////////////////
  154. // Definitions for WM Messages //
  155. //////////////////////////////////////////////////////////////////////////
  156. //////////////////////////////////////////////////////
  157. // JukeBox & NomadII shared stuffs //
  158. //////////////////////////////////////////////////////
  159. // Download message
  160. #define WM_DAPSDK_DOWNLOAD_PROGRESS WM_USER+500
  161. #define WM_DAPSDK_DOWNLOAD_COMPLETE WM_USER+501
  162. // Upload message
  163. #define WM_DAPSDK_GETITEM_PROGRESS WM_USER+502
  164. #define WM_DAPSDK_GETITEM_COMPLETE WM_USER+503
  165. //////////////////////////////////////////////////////
  166. // JukeBox stuffs //
  167. //////////////////////////////////////////////////////
  168. // Device change message
  169. #define WM_DAPSDK_JUKEBOX_REMOVAL WM_USER+508
  170. #define WM_DAPSDK_JUKEBOX_ARRIVAL WM_USER+509
  171. // Playback message
  172. #define WM_DAPSDK_PLAYBACK_COMPLETE WM_USER+504
  173. #define WM_DAPSDK_PLAYLIST_COMPLETE WM_USER+505
  174. #define WM_DAPSDK_PLAYBACK_ERROR WM_USER+506
  175. #define WM_DAPSDK_PLAYBACK_PROGRESS WM_USER+507
  176. // New callback messages for MultiApplication assess of Hotcake
  177. // Notification Messages for database change
  178. #define WM_DAPSDK_CHANGE_BASE WM_USER + 200
  179. #define WM_DAPSDK_MUSIC_ADD_FILE WM_DAPSDK_CHANGE_BASE + 0 // wParam = NodeId added, lParam = nil
  180. #define WM_DAPSDK_MUSIC_DEL_FILE WM_DAPSDK_CHANGE_BASE + 1 // wParam = NodeId deleted, lParam = nil
  181. #define WM_DAPSDK_MUSIC_SETATTR_FILE WM_DAPSDK_CHANGE_BASE + 2 // wParam = NodeId edited, lParam = nil
  182. #define WM_DAPSDK_DATA_ADD_FILE WM_DAPSDK_CHANGE_BASE + 3 // wParam = NodeId added, lParam = nil
  183. #define WM_DAPSDK_DATA_DEL_FILE WM_DAPSDK_CHANGE_BASE + 4 // wParam = NodeId deleted, lParam = nil
  184. #define WM_DAPSDK_DATA_SETATTR_FILE WM_DAPSDK_CHANGE_BASE + 5 // wParam = NodeId edited, lParam = nil
  185. #define WM_DAPSDK_PLAYLIST_ADD_FILE WM_DAPSDK_CHANGE_BASE + 6 // wParam = NodeId added, lParam = nil
  186. #define WM_DAPSDK_PLAYLIST_DEL_FILE WM_DAPSDK_CHANGE_BASE + 7 // wParam = NodeId deleted, lParam = nil
  187. #define WM_DAPSDK_PLAYLIST_SETATTR_FILE WM_DAPSDK_CHANGE_BASE + 8 // wParam = NodeId edited, lParam = nil
  188. #define WM_DAPSDK_PLAYLIST_ITEM_CHANGE WM_DAPSDK_CHANGE_BASE + 9 // wParam = PlaylistNodeId affected, lParam = nil
  189. #define WM_DAPSDK_STORAGEINFO_CHANGE WM_DAPSDK_CHANGE_BASE + 10 // wParam = deviceIndex that change occurred, lParam = nil
  190. #define WM_DAPSDK_ADDITEM_PROGRESS WM_USER+500
  191. #define WM_DAPSDK_ADDITEM_COMPLETE WM_USER+501
  192. /////////////////////////////////////////////////////////////////////////
  193. // struct defines //
  194. //////////////////////////////////////////////////////////////////////////
  195. //////////////////////////////////////////////////////
  196. // JukeBox & NomadII shared stuffs //
  197. //////////////////////////////////////////////////////
  198. typedef struct _DAPSDK_DATE_TIME
  199. {
  200. short Year, Month, Day, DayOfWeek;
  201. short Hour, Min, Sec, MilliSec;
  202. } DATE_TIME, *PDATE_TIME;
  203. typedef struct _DAPSDK_FORMAT_INFO
  204. {
  205. long lCodecID;
  206. UCHAR szCodecName[128];
  207. long lSamplingRate;
  208. long lNumChannel;
  209. } FORMAT_INFO, *PFORMAT_INFO;
  210. //-- SDK and firmware version info structure --//
  211. //
  212. // used in GetSDKVersion()
  213. // used in GetDeviceProperties( kFirmwareVersion, kHardwareVersion)
  214. typedef struct _DAPSDK_VERSION
  215. {
  216. WORD major;
  217. WORD minor;
  218. WORD build;
  219. WORD specialBuild;
  220. } DAPSDK_VERSION, *PDAPSDK_VERSION;
  221. //-- Memory Storage Information Structure --//
  222. typedef struct _DAPSDK_STORAGE_INFO
  223. {
  224. ULONG totalH;
  225. ULONG totalL;
  226. ULONG freeH;
  227. ULONG freeL;
  228. } DAPSDK_STORAGE_INFO, *PDAPSDK_STORAGE_INFO;
  229. //-- Identification structure --//
  230. // same for RootItem, ParentItem and Item now //
  231. typedef struct _DAPSDK_ID
  232. {
  233. long lID; // stores the unique ID
  234. long lType; // stores the type (see enum above)
  235. BSTR bstrName; // stores the name
  236. } DAPSDK_ID, *PDAPSDK_ID;
  237. //////////////////////////////////////////////////////
  238. // NomadII stuffs //
  239. //////////////////////////////////////////////////////
  240. typedef struct _DAPSDK_RADIOPRESET
  241. {
  242. DWORD dwPresetIndex;
  243. DWORD dwPresetValue;
  244. } RADIOPRESET, *PRADIOPRESET;
  245. // device info struct
  246. typedef struct _DAPSDK_DEVICE_INFO
  247. {
  248. BYTE cDeviceId[16]; // player's ID
  249. long dwFirmwareVersion; // player's firmware version
  250. long dwHardwareVersion; // player's hardware version
  251. char cDeviceName[32]; // player's name w/o NULL terminator
  252. BYTE byPowerSource; // player's power source status in percent
  253. } DAPSDK_DEVICE_INFO, *PDAPSDK_DEVICE_INFO;
  254. enum
  255. {
  256. kASCII = 0,
  257. kBINARY,
  258. kUNICODE,
  259. };
  260. //////////////////////////////////////////////////////
  261. // Item type for Jukebox (used by lRootItemType, //
  262. // lParentItemType, lItemType parameter) //
  263. //////////////////////////////////////////////////////
  264. enum
  265. {
  266. kAudioTrackType = 1, // this is a audio track
  267. kPlaylistType, // this is a track in the playlist
  268. kDataFileType, // this is a data file
  269. kDataFolderType, // this is a data file folder
  270. };
  271. /////////////////////////////////////////////////////////
  272. // Item type for NomadII (used in lItemType parameter) //
  273. /////////////////////////////////////////////////////////
  274. enum
  275. {
  276. kInternalMemType = 0, // this item resides in internal memory
  277. kExternalMemType, // this item resides in external (removeable) media
  278. };
  279. // Device Property Type Constant
  280. //-- Device Property type (used by lDevicePropertyType parameter in --//
  281. // GetDeviceProperties/SetDeviceProperties --//
  282. enum
  283. {
  284. //////////////////////////////////////////////////////
  285. // JukeBox & NomadII shared stuffs //
  286. //////////////////////////////////////////////////////
  287. kDeviceSerialNumberValue = 1, // GET, <NOMAD II>given the Item type
  288. // in "lpValue" parameter, the return value
  289. // is a pointer to the serial number
  290. // of the specified media.
  291. kFirmwareVersion, // GET, return value is a pointer to
  292. // DAPSDK_VERSION structure indicating the
  293. // current firmware version in the device.
  294. kDeviceNameString, // GET, return value is a pointer to
  295. // BSTR string.
  296. kPowerSourceValue,
  297. kStorageInfoStruct, // GET, return value is a pointer to
  298. // DAPSDK_STORAGE_INFO structure indicating
  299. // the current memory usage.
  300. kDateTimeStruct, // GET/SET, return/set value is a pointer to
  301. // DATE_TIME structure (defined in SDK 1.0)
  302. kOwnerNameString, // GET/SET, return/set value is a pointer to BSTR
  303. // string.
  304. kAudioFormatCount, // GET, return value is a pointer to the number of
  305. // audio format supported by device.
  306. kAudioFormatInfoStruct, // GET, given the index value in "lpValue"
  307. // parameter, the return value is a pointer to
  308. // FORMATINFO structure (defined in SDK 1.0).
  309. kLangEncodeSupport, // GET, returns unsigned long value
  310. // 0x01 == Latin 1(CP1252), 0x80000000 == UNICODE
  311. //////////////////////////////////////////////////////
  312. // JukeBox stuffs //
  313. //////////////////////////////////////////////////////
  314. kHardwareVersion, // GET, return value is a pointer to
  315. // DAPSDK_VERSION structure indicating the
  316. // current hardware version in the device.
  317. kAudioVolumeValue, // GET/SET, return/set value is the pointer to the
  318. // volume level in percentage.
  319. kAudioMuteValue, // GET/SET, return/set value is the pointer to the
  320. // Mute status (1=on, 0=off).
  321. // Treble level in percentage.
  322. kEAXCount, // GET, return value is the pointer to the number
  323. // of EAX settings.
  324. kEAXNameString, // GET, given the index value in "lpValue"
  325. // parameter, the return value is a pointer to
  326. // a BSTR string.
  327. kEAXAmountValue, // GET/SET, given the index value in "lpValue"
  328. // parameter, the return value is the effect
  329. // amount in percentage.
  330. kEAXCurrentIndex, // GET/SET, the value in "lpValue" is used to set
  331. // or retrieve the current EAX selection.
  332. kAudioEQPresetCount, // GET, return value is the pointer to the number
  333. // of EQ settings.
  334. kAudioEQNameString, // GET, given the index value in "lpValue"
  335. // parameter, the return value is a pointer to
  336. // a BSTR string.
  337. kAudioEQAmountValue, // GET/SET, return/set value is the pointer to the
  338. // EQ amount in percentage.
  339. kAudioEQCurrentIndex, // GET/SET, the value in "lpValue" is used to set
  340. // or retrieve the current EQ selection.
  341. //////////////////////////////////////////////////////
  342. // NomadII stuffs //
  343. //////////////////////////////////////////////////////
  344. kFMRadioPresetCount, // GET, returns pointer to number of FM radio
  345. // presets available in the player.
  346. kFMRadioPresetValue, // GET/SET, given the preset index value,
  347. // returns an existing value or sets a new
  348. // preset FM preset. Value in kHz.
  349. kFormatStorage // SET, Do format storage.
  350. };
  351. //Note that all index value is zero-based. Client should call the "kxxxxxxCount" property first before trying to get the value for individual settings in list-type of properties, i.e. kEAXNameString, kAudioFormatInfoStruct...
  352. //Not all properties are readable and writable, some are read-only attributes. Those properties that are read-only are marked with the "GET" strings and those that are read and writable are marked as "GET/SET". Client should not call SetDeviceProperties() with the read-only property type, such call would fail.
  353. //New Property types maybe supported in future by simply adding into the enum list, and publish to developers.
  354. //////////////////////////////////////////////////////
  355. // JukeBox stuffs //
  356. //////////////////////////////////////////////////////
  357. //-- Playback operation type (used by lPlayOperationType parameter in --//
  358. //-- PlayControl() & QueueControl()) --//
  359. enum
  360. {
  361. kPlayTrack = 1, // lpValue stores the pointer to the
  362. // DAPSDK_ITEM_ID structure.
  363. kStopTrack, // lpValue is not used, stop current track, no op
  364. // if no track is currently playing.
  365. kPauseTrack, // lpValue is not used, pause current track, no op
  366. // if no track is currently playing.
  367. kSetPlaybackPosition, // lpValue stores the pointer to the new playback
  368. // position.
  369. kQueueTrack, // lpValue stores the pointer to the
  370. // DAPSDK_ITEM_ID structure.
  371. kClearQueue, // lpValue is not used, clear existing queue.
  372. };
  373. #define TITLE "TITLE"
  374. #define FILESIZE "FILE SIZE"
  375. #define CODEC "CODEC"
  376. #define ALBUM "ALBUM"
  377. #define ARTIST "ARTIST"
  378. #define GENRE "GENRE"
  379. #define LENGTH "LENGTH"
  380. #define TRACKNUM "TRACK NUM"
  381. #define YEAR "YEAR"
  382. #define PLAYONLY "PLAYONLY"
  383. #define TRACKID "TRACK ID"
  384. // new attribute for datafile and datafolder
  385. #define MOD_FILETIME "MODIFIED FILETIME"
  386. #define FILE_ATTRIB "FILE ATTRIB"
  387. #define PARENT_FOLDER "PARENT FOLDER"
  388. #define FOLDERNAME "FOLDER NAME" // data folder name for Nomad Jukebox
  389. #define MULTI_ATTRIB "MULTI ATTRIB" // this is for user to change multiple file attribute at one time.
  390. #define FILENAME "FILE NAME" // file name for Nomad II, data file name for Nomad Jukebox
  391. #define ALLTRACKSKEY -1
  392. //////////////////////////////////////////////////////
  393. // NomadII stuffs //
  394. //////////////////////////////////////////////////////
  395. #define DOS_FILEATTRIB "DOS_FILEATTRIB"
  396. #define DOS_DATETIME "DOS_DATETIME"
  397. //////////////////////////////////////////////////////////////////////////
  398. // ICTJukebox (Interface 1) Methods //
  399. //////////////////////////////////////////////////////////////////////////
  400. // {DFC9207F-4B64-11D4-A4ED-00A0C98E46CC}
  401. DEFINE_GUID(IID_ICTJukebox,
  402. 0xdfc9207f, 0x4b64, 0x11d4, 0xa4, 0xed, 0x00, 0xa0, 0xc9, 0x8e, 0x46, 0xcc);
  403. interface ICTJukebox : public IUnknown
  404. {
  405. virtual HRESULT STDMETHODCALLTYPE CancelTransfer(
  406. /*[in]*/long lDeviceID) = 0;
  407. virtual HRESULT STDMETHODCALLTYPE RenamePlaylist(
  408. /*[in]*/long lDeviceID,
  409. /*[in]*/long lPlaylistID,
  410. /*[in]*/BSTR bstrName) = 0;
  411. virtual HRESULT STDMETHODCALLTYPE RemoveTracksFromPlaylist(
  412. /*[in]*/long lDeviceID,
  413. /*[in]*/long lTrackCount,
  414. /*[in]*/long* lpTrackList,
  415. /*[in]*/long lPlaylist) = 0;
  416. virtual HRESULT STDMETHODCALLTYPE AddTracksToPlaylist(
  417. /*[in]*/long lDeviceID,
  418. /*[in]*/long lTrackCount,
  419. /*[in]*/long* lpTrackList,
  420. /*[in]*/long lPlaylist) = 0;
  421. virtual HRESULT STDMETHODCALLTYPE InsertPlaylist(
  422. /*[in]*/long lDeviceID,
  423. /*[in]*/BSTR bstrPlaylistName,
  424. /*[out]*/long* lpPlaylistID) = 0;
  425. virtual HRESULT STDMETHODCALLTYPE DeletePlaylist(
  426. /*[in]*/long lDeviceID,
  427. /*[in]*/long lPlaylistID) = 0;
  428. virtual HRESULT STDMETHODCALLTYPE FindNextTrackInPlaylist(
  429. /*[in]*/long lDeviceID,
  430. /*[in]*/long lPlaylistID,
  431. /*[out]*/long* lpTrackID,
  432. /*[out]*/BSTR* lpbstrTrackName) = 0;
  433. virtual HRESULT STDMETHODCALLTYPE FindFirstTrackInPlaylist(
  434. /*[in]*/long lDeviceID,
  435. /*[in]*/long lPlaylistID,
  436. /*[out]*/long* lpTrackID,
  437. /*[out]*/BSTR* lpbstrTrackName) = 0;
  438. virtual HRESULT STDMETHODCALLTYPE FindNextPlaylist(
  439. /*[in]*/long lDeviceID,
  440. /*[out]*/long* lpPlaylistID,
  441. /*[out]*/BSTR* lpbstrPlaylistName) = 0;
  442. virtual HRESULT STDMETHODCALLTYPE FindFirstPlaylist(
  443. /*[in]*/long lDeviceID,
  444. /*[out]*/long* lpPlaylistID,
  445. /*[out]*/BSTR* lpbstrPlaylistName) = 0;
  446. virtual HRESULT STDMETHODCALLTYPE ChangeTrackInfo(
  447. /*[in]*/long lDeviceID,
  448. /*[in]*/long lTarckID,
  449. /*[in]*/long lSize,
  450. /*[in]*/IUnknown* lpTrackInfo) = 0;
  451. virtual HRESULT STDMETHODCALLTYPE DeleteTrack(
  452. /*[in]*/long lDeviceID,
  453. /*[in]*/long lTrackID) = 0;
  454. virtual HRESULT STDMETHODCALLTYPE InsertTrack(
  455. /*[in]*/long lDeviceID,
  456. /*[in]*/BSTR bstrFilePath,
  457. /*[in]*/long lSize,
  458. /*[in]*/IUnknown* lpTrackInfo,
  459. /*[out]*/long* lpTrackID) = 0;
  460. virtual HRESULT STDMETHODCALLTYPE GetTrackInfo(
  461. /*[in]*/long lDeviceID,
  462. /*[in]*/long lTrackID,
  463. /*[in]*/long lInSize,
  464. /*[out]*/long* lpOutSize,
  465. /*[out]*/IUnknown* lpTrackInfo) = 0;
  466. virtual HRESULT STDMETHODCALLTYPE FindNextTrack(
  467. /*[in]*/long lDeviceID,
  468. /*[in]*/long lKeyID,
  469. /*[out]*/long* lpTrackID,
  470. /*[out]*/BSTR* lpbstrName) = 0;
  471. virtual HRESULT STDMETHODCALLTYPE FindFirstTrack(
  472. /*[in]*/long lDeviceID,
  473. /*[in]*/long lKeyID,
  474. /*[out]*/long* lpTrackID,
  475. /*[out]*/BSTR* lpbstrName) = 0;
  476. virtual HRESULT STDMETHODCALLTYPE FindNextKey(
  477. /*[in]*/long lDeviceID,
  478. /*[in]*/long lRootKeyID,
  479. /*[out]*/long* lpKeyID,
  480. /*[out]*/BSTR* lpbstrName) = 0;
  481. virtual HRESULT STDMETHODCALLTYPE FindFirstKey(
  482. /*[in]*/long lDeviceID,
  483. /*[in]*/long lRootKeyID,
  484. /*[out]*/long* lpKeyID,
  485. /*[out]*/BSTR* lpbstrName) = 0;
  486. virtual HRESULT STDMETHODCALLTYPE FindNextRootKey(
  487. /*[in]*/long lDeviceID,
  488. /*[out]*/long* lpRootKeyID,
  489. /*[out]*/BSTR* lpbstrName) = 0;
  490. virtual HRESULT STDMETHODCALLTYPE FindFirstRootKey(
  491. /*[in]*/long lDeviceID,
  492. /*[out]*/long* lpRootKeyID,
  493. /*[out]*/BSTR* lpbstrName) = 0;
  494. virtual HRESULT STDMETHODCALLTYPE SetOwnerName(
  495. /*[in]*/long lDeviceID,
  496. /*[in]*/BSTR bstrName) = 0;
  497. virtual HRESULT STDMETHODCALLTYPE GetOwnerName(
  498. /*[in]*/long lDeviceID,
  499. /*[out]*/BSTR* lpbstrName) = 0;
  500. virtual HRESULT STDMETHODCALLTYPE SetDateTime(
  501. /*[in]*/long lDeviceID,
  502. /*[out]*/IUnknown* lpDateTime) = 0;
  503. virtual HRESULT STDMETHODCALLTYPE GetDateTime(
  504. /*[in]*/long lDeviceID,
  505. /*[out]*/IUnknown* lpDateTime) = 0;
  506. virtual HRESULT STDMETHODCALLTYPE FindNextFormatSupport(
  507. /*[in]*/long lDeviceID,
  508. /*[out]*/IUnknown* lpFormatInfo) = 0;
  509. virtual HRESULT STDMETHODCALLTYPE FindFirstFormatSupport(
  510. /*[in]*/long lDeviceID,
  511. /*[out]*/IUnknown* lpFormatInfo) = 0;
  512. virtual HRESULT STDMETHODCALLTYPE GetStorageInfo(
  513. /*[in]*/long lDeviceID,
  514. /*[out]*/unsigned long* lpTotalMemHigh,
  515. /*[out]*/unsigned long* lpTotalMemLow,
  516. /*[out]*/unsigned long* lpFreeMemHigh,
  517. /*[out]*/unsigned long* lpFreeMemLow ) = 0;
  518. virtual HRESULT STDMETHODCALLTYPE GetDeviceInfo(
  519. /*[in]*/long lDeviceID,
  520. /*[out]*/IUnknown* lpDeviceInfo) = 0;
  521. virtual HRESULT STDMETHODCALLTYPE GetDeviceCount(
  522. /*[out]*/long* lpDeviceCount) = 0;
  523. virtual HRESULT STDMETHODCALLTYPE SetCallbackWindow(
  524. /*[in]*/long lDeviceID,
  525. /*[in]*/long hWnd) = 0;
  526. virtual HRESULT STDMETHODCALLTYPE GetSDKVersion(
  527. /*[out]*/long* lpVersion) = 0;
  528. virtual HRESULT STDMETHODCALLTYPE ShutDown() = 0;
  529. virtual HRESULT STDMETHODCALLTYPE Initialize() = 0;
  530. };
  531. //////////////////////////////////////////////////////////////////////////
  532. // ICTJukebox2 (Interface 2) Methods //
  533. //////////////////////////////////////////////////////////////////////////
  534. DEFINE_GUID(IID_ICTJukebox2,
  535. 0xdfc92080, 0x4b64, 0x11d4, 0xa4, 0xed, 0x00, 0xa0, 0xc9, 0x8e, 0x46, 0xcc);
  536. interface ICTJukebox2 : public IUnknown
  537. {
  538. virtual HRESULT STDMETHODCALLTYPE Initialize2() = 0;
  539. virtual HRESULT STDMETHODCALLTYPE ShutDown2() = 0;
  540. virtual HRESULT STDMETHODCALLTYPE SetCallbackWindow2(
  541. long lDeviceID,
  542. long hWnd ) = 0;
  543. virtual HRESULT STDMETHODCALLTYPE GetDeviceCount2(
  544. long* lpDeviceCount ) = 0;
  545. //-- Canceling I/O --//
  546. virtual HRESULT STDMETHODCALLTYPE CancelTransfer2(
  547. long lDeviceID ) = 0;
  548. //-- GetSDKVersion2() Fucntion Descriptions --//
  549. // This function overides the same function in interface 1, this is to
  550. // return a more meaningful version information to the client which is
  551. // clearly specified in the DAPSDK_VERSION structure
  552. virtual HRESULT STDMETHODCALLTYPE GetSDKVersion2(
  553. IUnknown* lpSDKVersion ) = 0;
  554. //_______________________ Querying RootItem __________________________//
  555. virtual HRESULT STDMETHODCALLTYPE FindFirstRootItem (
  556. long lDeviceID,
  557. IUnknown* lpRootItemID ) = 0;
  558. virtual HRESULT STDMETHODCALLTYPE FindNextRootItem (
  559. long lDeviceID,
  560. IUnknown* lpRootItemID ) = 0;
  561. //______________________ Querying ParentItem __________________________//
  562. virtual HRESULT STDMETHODCALLTYPE FindFirstParentItem (
  563. long lDeviceID,
  564. IUnknown* lRootItemID,
  565. IUnknown* lpParentItemID ) = 0;
  566. virtual HRESULT STDMETHODCALLTYPE FindNextParentItem (
  567. long lDeviceID,
  568. IUnknown* lRootItemID,
  569. IUnknown* lpParentItemID ) = 0;
  570. //______________________ ParentItem Management __________________________ //
  571. //-- AddParentItem() Fucntion Descriptions --//
  572. // Client can only add Parent Item of the same type as the RootItem. For
  573. // example, client cannot add a kDataFileType Parent item into a RootItem
  574. // type of kAudioTrackType.
  575. //
  576. // As of current firmware implementation, client can only add ParentItem
  577. // into a RootItem that has a type of kPlaylistType. Adding ParentItem into
  578. // other RootItem type will fail.
  579. virtual HRESULT STDMETHODCALLTYPE AddParentItem (
  580. long lDeviceID,
  581. IUnknown* lRootItemID,
  582. IUnknown* lParentItemID ) = 0;
  583. //-- DeleteParentItem() Function Description --//
  584. // Client can only delete ParentItem of type kPlaylistType. Deleting other
  585. // ParentItem type will fail.
  586. virtual HRESULT STDMETHODCALLTYPE DeleteParentItem (
  587. long lDeviceID,
  588. IUnknown* lParentItemID ) = 0;
  589. //-- RenameParentItem() Function Description --//
  590. // Client can only rename ParentItem of type kPlaylistType. Renaming other
  591. // ParentItem type will fail.
  592. //
  593. // The updated DAPSDK_PARENTITEM_ID structure is returned in lParentItemID
  594. // parameter.
  595. virtual HRESULT STDMETHODCALLTYPE RenameParentItem (
  596. long lDeviceID,
  597. IUnknown* lParentItemID,
  598. BSTR bstrNewParentItemName ) = 0;
  599. //__________________________ Querying Item ______________________________//
  600. virtual HRESULT STDMETHODCALLTYPE FindFirstItem (
  601. long lDeviceID,
  602. IUnknown* lParentItemID,
  603. IUnknown* lpItemID ) = 0;
  604. virtual HRESULT STDMETHODCALLTYPE FindNextItem (
  605. long lDeviceID,
  606. IUnknown* lParentItemID,
  607. IUnknown* lpItemID ) = 0;
  608. //_____________________ Getting Item Attributes __________________________//
  609. //-- GetItemAttribute() Function Description --//
  610. // This function returns the TrackInfo data for all Item type. But for
  611. // kDataFileType and kPlaylistFileType, the TrackInfo data contain only
  612. // file name, file type and file size. In contrast, the item attribute
  613. // for a kAudioTrackType may contain all information similar to the ID3tag
  614. // information that a typical MP3 file has.
  615. virtual HRESULT STDMETHODCALLTYPE GetItemAttribute (
  616. long lDeviceID,
  617. IUnknown* lpItemID,
  618. long lInItemInfoSize,
  619. long* lOutItemInfoSize,
  620. IUnknown* lpItemInfo ) = 0;
  621. //-- SetItemAttribute() Function Description --//
  622. // This function allows client to set TrackInfo attributes of a
  623. // kAudioTrackItem only. Setting other item type will fail.
  624. //
  625. // It allows client to set a particular attribute data according to the name
  626. // and type given in the parameters. Note that only one attribute can be set
  627. // at a time.
  628. virtual HRESULT STDMETHODCALLTYPE SetItemAttribute (
  629. long lDeviceID,
  630. IUnknown* lpItemID,
  631. BSTR bstrAttributeName,
  632. long lAttributeType,
  633. long lAttributeDataSize,
  634. IUnknown* lpAttributeData ) = 0;
  635. //____________________________ Item Management ___________________________//
  636. //-- AddItem() Function Description --//
  637. // This function initiates the file download from the computer to the
  638. // device. Client should call this function to download audio tracks
  639. // like MP3, WMA and WAVE and data files. Client are not allow
  640. // to download an item of kPlaylistType, use AddItemsToParentItem to add
  641. // item of type kPlaylistType.
  642. virtual HRESULT STDMETHODCALLTYPE AddItem (
  643. long lDeviceID,
  644. long lItemType,
  645. BSTR bstrSrcFileName,
  646. long lItemInfoSize,
  647. IUnknown* lpItemInfo) = 0;
  648. //-- AddItemsToParentItem() Function Description --//
  649. // Client call this function to add kAudioTrackType item into the ParentItem
  650. // of type kPlaylistType. Only kAudioTrackType items are accepted, and only
  651. // ParentItem of type kPlaylistType can accept such addition.
  652. virtual HRESULT STDMETHODCALLTYPE AddItemsToParentItem(
  653. long lDeviceID,
  654. IUnknown* lpParentItemID,
  655. long lItemIDCount,
  656. IUnknown* lpItemIDList ) = 0;
  657. //-- DeleteItem() Function Description --//
  658. // Client can call this function to remove item of type kAudioTrackType and
  659. // kDataFileType. You cannot remove kPlaylistType item here.
  660. virtual HRESULT STDMETHODCALLTYPE DeleteItem (
  661. long lDeviceID,
  662. IUnknown* lpItemID ) = 0;
  663. //-- GetItem() Function Description --//
  664. // Client can call this function to retrieve item that are kAudioTrackType
  665. // and kDataFileType from the device to the computer. Note that client
  666. // cannot retrieve item of type kPlaylistItem
  667. virtual HRESULT STDMETHODCALLTYPE GetItem (
  668. long lDeviceID,
  669. BSTR bstrDestinationFileName,
  670. IUnknown* lpItemID ) = 0;
  671. //________________________ Device Properties ____________________________//
  672. virtual HRESULT STDMETHODCALLTYPE GetDeviceProperties (
  673. long lDeviceID,
  674. long lDevicePropertyType,
  675. IUnknown* lpValue ) = 0;
  676. virtual HRESULT STDMETHODCALLTYPE SetDeviceProperties (
  677. long lDeviceID,
  678. long lDevicePropertyType,
  679. IUnknown* lpValue ) = 0;
  680. //_______________________ Playback control ______________________________//
  681. virtual HRESULT STDMETHODCALLTYPE PlayControl (
  682. long lDeviceID,
  683. long lPlayOperationType,
  684. IUnknown* lpValue ) = 0;
  685. virtual HRESULT STDMETHODCALLTYPE QueueControl (
  686. long lDeviceID,
  687. long lQueueOperationType,
  688. IUnknown* lpValue ) = 0;
  689. };
  690. //////////////////////////////////////////////////////////////
  691. // ICTNomad2 Methods //
  692. //////////////////////////////////////////////////////////////
  693. // {368953D4-6A2F-4787-BC6F-4047A39A7557}
  694. DEFINE_GUID(IID_ICTNomad2,
  695. 0x368953d4, 0x6a2f, 0x4787, 0xbc, 0x6f, 0x40, 0x47, 0xa3, 0x9a, 0x75, 0x57);
  696. interface ICTNomad2 : public IUnknown
  697. {
  698. virtual HRESULT STDMETHODCALLTYPE Initialize() = 0;
  699. virtual HRESULT STDMETHODCALLTYPE ShutDown() = 0;
  700. virtual HRESULT STDMETHODCALLTYPE SetCallbackWindow(
  701. /*[in]*/long lDeviceID,
  702. /*[in]*/long hWnd) = 0;
  703. virtual HRESULT STDMETHODCALLTYPE GetDeviceCount(
  704. /*[out]*/long* lpDeviceCount) = 0;
  705. virtual HRESULT STDMETHODCALLTYPE CancelTransfer(
  706. /*[in]*/long lDeviceID) = 0;
  707. virtual HRESULT STDMETHODCALLTYPE GetSDKVersion(
  708. /*[out]*/IUnknown* lpVersion) = 0;
  709. //__________________________ Querying Item ______________________________//
  710. virtual HRESULT STDMETHODCALLTYPE FindFirstItem (
  711. long lDeviceID,
  712. IUnknown* lParentItemID,
  713. IUnknown* lpItemID ) = 0;
  714. virtual HRESULT STDMETHODCALLTYPE FindNextItem (
  715. long lDeviceID,
  716. IUnknown* lParentItemID,
  717. IUnknown* lpItemID ) = 0;
  718. //_____________________ Getting Item Attributes __________________________//
  719. //-- GetItemAttribute() Function Description --//
  720. // This function returns the TrackInfo data for all Item type. But for
  721. // kDataFileType and kPlaylistFileType, the TrackInfo data contain only
  722. // file name, file type and file size. In contrast, the item attribute
  723. // for a kAudioTrackType may contain all information similar to the ID3tag
  724. // information that a typical MP3 file has.
  725. virtual HRESULT STDMETHODCALLTYPE GetItemAttribute (
  726. long lDeviceID,
  727. IUnknown* lpItemID,
  728. long lInItemInfoSize,
  729. long* lOutItemInfoSize,
  730. IUnknown* lpItemInfo ) = 0;
  731. //____________________________ Item Management ___________________________//
  732. //-- AddItem() Function Description --//
  733. // This function initiates the file download from the computer to the
  734. // device. Client should call this function to download audio tracks
  735. // like MP3, WMA and WAVE and data files. Client are not allow
  736. // to download an item of kPlaylistType, use AddItemsToParentItem to add
  737. // item of type kPlaylistType.
  738. virtual HRESULT STDMETHODCALLTYPE AddItem (
  739. long lDeviceID,
  740. long lItemType,
  741. BSTR bstrSrcFileName,
  742. long lItemInfoSize,
  743. IUnknown* lpItemInfo) = 0;
  744. //-- DeleteItem() Function Description --//
  745. // Client can call this function to remove item of type kAudioTrackType and
  746. // kDataFileType. You cannot remove kPlaylistType item here.
  747. virtual HRESULT STDMETHODCALLTYPE DeleteItem (
  748. long lDeviceID,
  749. IUnknown* lpItemID ) = 0;
  750. //-- GetItem() Function Description --//
  751. // Client can call this function to retrieve item that are kAudioTrackType
  752. // and kDataFileType from the device to the computer. Note that client
  753. // cannot retrieve item of type kPlaylistItem
  754. virtual HRESULT STDMETHODCALLTYPE GetItem (
  755. long lDeviceID,
  756. BSTR bstrDestinationFileName,
  757. IUnknown* lpItemID ) = 0;
  758. //________________________ Device Properties ____________________________//
  759. virtual HRESULT STDMETHODCALLTYPE GetDeviceProperties (
  760. long lDeviceID,
  761. long lDevicePropertyType,
  762. IUnknown* lpValue ) = 0;
  763. virtual HRESULT STDMETHODCALLTYPE SetDeviceProperties (
  764. long lDeviceID,
  765. long lDevicePropertyType,
  766. IUnknown* lpValue ) = 0;
  767. };
  768. #ifdef __cplusplus
  769. }
  770. #endif // __cplusplus
  771. #endif