libnjb.h | libnjb.h | |||
---|---|---|---|---|
skipping to change at line 17 | skipping to change at line 17 | |||
* | * | |||
* <code> | * <code> | |||
* #include <libnjb.h> | * #include <libnjb.h> | |||
* </code> | * </code> | |||
*/ | */ | |||
#ifndef __LIBNJB__H | #ifndef __LIBNJB__H | |||
#define __LIBNJB__H | #define __LIBNJB__H | |||
/** The version of this installation of libnjb */ | /** The version of this installation of libnjb */ | |||
#define LIBNJB_VERSION 2.1.2 | #define LIBNJB_VERSION 2.2 | |||
/** A legacy definition - nowadays we always compile for libusb */ | /** A legacy definition - nowadays we always compile for libusb */ | |||
#define LIBNJB_COMPILED_FOR_LIBUSB 1 | #define LIBNJB_COMPILED_FOR_LIBUSB 1 | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#ifdef __WIN32__ | #ifdef __WIN32__ | |||
/* Windows specific code, types that do not exist in Windows | /* Windows specific code, types that do not exist in Windows | |||
* sys/types.h | * sys/types.h | |||
*/ | */ | |||
typedef char int8_t; | typedef char int8_t; | |||
typedef unsigned char u_int8_t; | typedef unsigned char u_int8_t; | |||
skipping to change at line 75 | skipping to change at line 75 | |||
#define NJB_DEVICE_NJBZENNX 0x05 /**< Nomad Jukebox Zen NX */ | #define NJB_DEVICE_NJBZENNX 0x05 /**< Nomad Jukebox Zen NX */ | |||
#define NJB_DEVICE_NJBZENXTRA 0x06 /**< Nomad Jukebox Zen Xtra */ | #define NJB_DEVICE_NJBZENXTRA 0x06 /**< Nomad Jukebox Zen Xtra */ | |||
#define NJB_DEVICE_DELLDJ 0x07 /**< Dell Digital DJ "Dell DJ" */ | #define NJB_DEVICE_DELLDJ 0x07 /**< Dell Digital DJ "Dell DJ" */ | |||
#define NJB_DEVICE_NJBZENTOUCH 0x08 /**< Nomad Jukebox Zen Touch */ | #define NJB_DEVICE_NJBZENTOUCH 0x08 /**< Nomad Jukebox Zen Touch */ | |||
#define NJB_DEVICE_NJBZENMICRO 0x09 /**< Nomad Jukebox Zen Micro */ | #define NJB_DEVICE_NJBZENMICRO 0x09 /**< Nomad Jukebox Zen Micro */ | |||
#define NJB_DEVICE_DELLDJ2 0x0a /**< Second Generation Dell DJ */ | #define NJB_DEVICE_DELLDJ2 0x0a /**< Second Generation Dell DJ */ | |||
#define NJB_DEVICE_POCKETDJ 0x0b /**< Dell Pocket DJ */ | #define NJB_DEVICE_POCKETDJ 0x0b /**< Dell Pocket DJ */ | |||
/** @} */ | /** @} */ | |||
/** | /** | |||
* @defgroup power Power connection and status | ||||
* | ||||
* These defines are only applicable to the NJB1 and is found by dereferenc | ||||
ing | ||||
* <code>u_int8_t power = njb->njbid->power</code> The series 3 devices | ||||
* should rely on the <code>NJB_Get_Battery_Level()</code> function instead | ||||
* of these defines. | ||||
* | ||||
* @{ | ||||
*/ | ||||
#define NJB_POWER_BATTERY 0x00 /**< If the device is running on batte | ||||
ry */ | ||||
#define NJB_POWER_AC_CHARGED 0x01 /**< If the device is running on DC | ||||
and the battery is fully charged * | ||||
/ | ||||
#define NJB_POWER_AC_CHARGING 0x03 /**< If the device is running on DC | ||||
and the battery is being charged * | ||||
/ | ||||
/** @} */ | ||||
/** | ||||
* @defgroup frametypes Frame types for different song ID frames | * @defgroup frametypes Frame types for different song ID frames | |||
* @{ | * @{ | |||
*/ | */ | |||
#define NJB_TYPE_STRING 0x00 /**< A string type song ID fram e */ | #define NJB_TYPE_STRING 0x00 /**< A string type song ID fram e */ | |||
#define NJB_TYPE_UINT16 0x02 /**< An unsigned 16 bit integer type song ID frame */ | #define NJB_TYPE_UINT16 0x02 /**< An unsigned 16 bit integer type song ID frame */ | |||
#define NJB_TYPE_UINT32 0x03 /**< An unsigned 32 bit integer type song ID frame */ | #define NJB_TYPE_UINT32 0x03 /**< An unsigned 32 bit integer type song ID frame */ | |||
/** @} */ | /** @} */ | |||
/** | /** | |||
* @defgroup codecs Codec types | * @defgroup codecs Codec types | |||
* @{ | * @{ | |||
*/ | */ | |||
#define NJB_CODEC_MP3 "MP3" /**< The MPEG audio level 3 codec */ | #define NJB_CODEC_MP3 "MP3" /**< The MPEG audio level 3 codec */ | |||
#define NJB_CODEC_WMA "WMA" /**< The Windows Media Audio codec */ | #define NJB_CODEC_WMA "WMA" /**< The Windows Media Audio codec */ | |||
#define NJB_CODEC_WAV "WAV" /**< The RIFF waveform codec */ | #define NJB_CODEC_WAV "WAV" /**< The RIFF waveform codec */ | |||
#define NJB_CODEC_AA "AA" /**< The Audible.com codec */ | ||||
/** @} */ | /** @} */ | |||
/** | /** | |||
* @defgroup frames Song ID frame types | * @defgroup frames Song ID frame types | |||
* @{ | * @{ | |||
*/ | */ | |||
#define FR_SIZE "FILE SIZE" /**< Filesize metadata frame */ | #define FR_SIZE "FILE SIZE" /**< Filesize metadata frame */ | |||
#define FR_LENGTH "LENGTH" /**< Length metadata frame (in seconds) */ | #define FR_LENGTH "LENGTH" /**< Length metadata frame (in seconds) */ | |||
#define FR_CODEC "CODEC" /**< Codec metadata frame */ | #define FR_CODEC "CODEC" /**< Codec metadata frame */ | |||
#define FR_TITLE "TITLE" /**< Title metadata frame */ | #define FR_TITLE "TITLE" /**< Title metadata frame */ | |||
skipping to change at line 159 | skipping to change at line 143 | |||
#define OWNER_STRING_LENGTH 128 /**< The fixed length of the owner strin g */ | #define OWNER_STRING_LENGTH 128 /**< The fixed length of the owner strin g */ | |||
/** A type defined for owner strings */ | /** A type defined for owner strings */ | |||
typedef unsigned char owner_string[OWNER_STRING_LENGTH + 1]; | typedef unsigned char owner_string[OWNER_STRING_LENGTH + 1]; | |||
/** | /** | |||
* @defgroup types libnjb global type definitions | * @defgroup types libnjb global type definitions | |||
* @{ | * @{ | |||
*/ | */ | |||
typedef struct njb_struct njb_t; /**< @see njb_struct */ | typedef struct njb_struct njb_t; /**< @see njb_struct */ | |||
typedef struct njbid_struct njbid_t; /**< See struct definition */ | ||||
typedef struct njb_songid_frame_struct njb_songid_frame_t; /**< See struct definition */ | typedef struct njb_songid_frame_struct njb_songid_frame_t; /**< See struct definition */ | |||
typedef struct njb_songid_struct njb_songid_t; /**< See struct definition * / | typedef struct njb_songid_struct njb_songid_t; /**< See struct definition * / | |||
typedef struct njb_playlist_track_struct njb_playlist_track_t; /**< See str uct definition */ | typedef struct njb_playlist_track_struct njb_playlist_track_t; /**< See str uct definition */ | |||
typedef struct njb_playlist_struct njb_playlist_t; /**< See struct definiti on */ | typedef struct njb_playlist_struct njb_playlist_t; /**< See struct definiti on */ | |||
typedef struct njb_datafile_struct njb_datafile_t; /**< See struct definiti on */ | typedef struct njb_datafile_struct njb_datafile_t; /**< See struct definiti on */ | |||
typedef struct njb_eax_struct njb_eax_t; /**< See struct definition */ | typedef struct njb_eax_struct njb_eax_t; /**< See struct definition */ | |||
typedef struct njb_time_struct njb_time_t; /**< See struct definition */ | typedef struct njb_time_struct njb_time_t; /**< See struct definition */ | |||
typedef struct njb_keyval_struct njb_keyval_t; /**< See struct definition * / | typedef struct njb_keyval_struct njb_keyval_t; /**< See struct definition * / | |||
/** @} */ | /** @} */ | |||
/** | /** | |||
* Main NJB object struct | * Main NJB object struct | |||
*/ | */ | |||
struct njb_struct { | struct njb_struct { | |||
njbid_t *njbid; /**< The ID for this jukebox */ | ||||
struct usb_device *device; /**< The libusb device for this jukebox * / | struct usb_device *device; /**< The libusb device for this jukebox * / | |||
usb_dev_handle *dev; /**< The libusb device handle for this jukebox */ | usb_dev_handle *dev; /**< The libusb device handle for this jukebox */ | |||
u_int8_t usb_config; /**< The libusb config for this jukebox */ | u_int8_t usb_config; /**< The libusb config for this jukebox */ | |||
u_int8_t usb_interface; /**< The libusb interface for this jukebox * / | u_int8_t usb_interface; /**< The libusb interface for this jukebox * / | |||
u_int8_t usb_bulk_in_ep; /**< The BULK IN endpoint for this jukebox */ | u_int8_t usb_bulk_in_ep; /**< The BULK IN endpoint for this jukebox */ | |||
u_int8_t usb_bulk_out_ep; /**< The BULK OUT endpoint for this jukebo x */ | u_int8_t usb_bulk_out_ep; /**< The BULK OUT endpoint for this jukebo x */ | |||
int device_type; /**< what kind of jukebox this is */ | int device_type; /**< what kind of jukebox this is */ | |||
int updated; /**< If the device has been updated with some metadata */ | int updated; /**< If the device has been updated with some metadata */ | |||
u_int32_t xfersize; /**< The transfer size for endpoints */ | u_int32_t xfersize; /**< The transfer size for endpoints */ | |||
void *protocol_state; /**< dereferenced and maintained individually by protocol implementations */ | void *protocol_state; /**< dereferenced and maintained individually by protocol implementations */ | |||
void *error_stack; /**< Error stack, used inside libnjb */ | void *error_stack; /**< Error stack, used inside libnjb */ | |||
}; | }; | |||
/** | ||||
* Jukebox identification struct | ||||
*/ | ||||
struct njbid_struct { | ||||
unsigned char id[16]; /**< The SDMI device ID for this device, 16 by | ||||
tes */ | ||||
u_int8_t fwMajor; /**< Firmware major revision */ | ||||
u_int8_t fwMinor; /**< Firmware minor revision */ | ||||
u_int8_t fwRel; /**< Firmware release */ | ||||
u_int8_t hwMajor; /**< Hardware major revision */ | ||||
u_int8_t hwMinor; /**< Hardware minor revision */ | ||||
u_int8_t hwRel; /**< Hardware release */ | ||||
char productName[33]; /**< A string with the product name */ | ||||
u_int8_t power; /**< If the power cord is plugged in or not */ | ||||
}; | ||||
/* Song/track tag definitions */ | /* Song/track tag definitions */ | |||
/** | /** | |||
* The song ID frame struct, one song ID has many | * The song ID frame struct, one song ID has many | |||
* such frames, stored as a linked list. | * such frames, stored as a linked list. | |||
*/ | */ | |||
struct njb_songid_frame_struct { | struct njb_songid_frame_struct { | |||
char *label; /**< terminated string with frame type */ | char *label; /**< terminated string with frame type */ | |||
u_int8_t type; /**< this tells us which subtype it is */ | u_int8_t type; /**< this tells us which subtype it is */ | |||
/** | /** | |||
skipping to change at line 470 | skipping to change at line 437 | |||
void NJB_Ping(njb_t *njb); | void NJB_Ping(njb_t *njb); | |||
int NJB_Get_Disk_Usage (njb_t *njb, u_int64_t *btotal, u_int64_t *bfree); | int NJB_Get_Disk_Usage (njb_t *njb, u_int64_t *btotal, u_int64_t *bfree); | |||
char *NJB_Get_Owner_String (njb_t *njb); | char *NJB_Get_Owner_String (njb_t *njb); | |||
int NJB_Set_Owner_String (njb_t *njb, const char *name); | int NJB_Set_Owner_String (njb_t *njb, const char *name); | |||
int NJB_Get_Bitmap_Dimensions(njb_t *njb, int *x, int *y, int *bytes); | int NJB_Get_Bitmap_Dimensions(njb_t *njb, int *x, int *y, int *bytes); | |||
int NJB_Set_Bitmap(njb_t *njb, const unsigned char *bitmap); | int NJB_Set_Bitmap(njb_t *njb, const unsigned char *bitmap); | |||
njb_keyval_t *NJB_Get_Keys(njb_t *njb); | njb_keyval_t *NJB_Get_Keys(njb_t *njb); | |||
u_int64_t NJB_Get_NJB1_Libcounter(njb_t *njb); | u_int64_t NJB_Get_NJB1_Libcounter(njb_t *njb); | |||
int NJB_Send_Firmware (njb_t *njb, const char *path, NJB_Xfer_Callback *cal lback, void *data); | int NJB_Send_Firmware (njb_t *njb, const char *path, NJB_Xfer_Callback *cal lback, void *data); | |||
int NJB_Get_Battery_Level (njb_t *njb); | int NJB_Get_Battery_Level (njb_t *njb); | |||
int NJB_Get_Battery_Charging (njb_t *njb); | ||||
int NJB_Get_Auxpower (njb_t *njb); | ||||
int NJB_Get_SDMI_ID(njb_t *njb, u_int8_t *sdmiid); | ||||
const char *NJB_Get_Device_Name(njb_t *njb, int type); | ||||
int NJB_Get_Firmware_Revision(njb_t *njb, u_int8_t *major, u_int8_t *minor, | ||||
u_int8_t *release); | ||||
int NJB_Get_Hardware_Revision(njb_t *njb, u_int8_t *major, u_int8_t *minor, | ||||
u_int8_t *release); | ||||
/** | /** | |||
* @} | * @} | |||
* @defgroup tagapi The track and tag (song ID metadata) manipulation API | * @defgroup tagapi The track and tag (song ID metadata) manipulation API | |||
* @{ | * @{ | |||
*/ | */ | |||
njb_songid_t *NJB_Songid_New(void); | njb_songid_t *NJB_Songid_New(void); | |||
void NJB_Songid_Destroy(njb_songid_t *song); | void NJB_Songid_Destroy(njb_songid_t *song); | |||
void NJB_Songid_Addframe(njb_songid_t *song, njb_songid_frame_t *frame); | void NJB_Songid_Addframe(njb_songid_t *song, njb_songid_frame_t *frame); | |||
void NJB_Songid_Reset_Getframe(njb_songid_t *song); | void NJB_Songid_Reset_Getframe(njb_songid_t *song); | |||
njb_songid_frame_t *NJB_Songid_Getframe(njb_songid_t *song); | njb_songid_frame_t *NJB_Songid_Getframe(njb_songid_t *song); | |||
End of changes. 7 change blocks. | ||||
40 lines changed or deleted | 10 lines changed or added | |||