libmtp.h | libmtp.h | |||
---|---|---|---|---|
/** | /** | |||
* \file libmtp.h | * \file libmtp.h | |||
* Interface to the Media Transfer Protocol library. | * Interface to the Media Transfer Protocol library. | |||
* | * | |||
* Copyright (C) 2005-2008 Linus Walleij <triad@df.lth.se> | * Copyright (C) 2005-2009 Linus Walleij <triad@df.lth.se> | |||
* Copyright (C) 2005-2008 Richard A. Low <richard@wentnet.com> | * Copyright (C) 2005-2008 Richard A. Low <richard@wentnet.com> | |||
* Copyright (C) 2007 Ted Bullock <tbullock@canada.com> | * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> | |||
* Copyright (C) 2008 Florent Mertens <flomertens@gmail.com> | * Copyright (C) 2008 Florent Mertens <flomertens@gmail.com> | |||
* | * | |||
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | * License as published by the Free Software Foundation; either | |||
* version 2 of the License, or (at your option) any later version. | * version 2 of the License, or (at your option) any later version. | |||
* | * | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
skipping to change at line 32 | skipping to change at line 32 | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
* Boston, MA 02111-1307, USA. | * Boston, MA 02111-1307, USA. | |||
* | * | |||
* <code> | * <code> | |||
* #include <libmtp.h> | * #include <libmtp.h> | |||
* </code> | * </code> | |||
*/ | */ | |||
#ifndef LIBMTP_H_INCLUSION_GUARD | #ifndef LIBMTP_H_INCLUSION_GUARD | |||
#define LIBMTP_H_INCLUSION_GUARD | #define LIBMTP_H_INCLUSION_GUARD | |||
#define LIBMTP_VERSION 1.0.1 | #define LIBMTP_VERSION 1.0.2 | |||
#define LIBMTP_VERSION_STRING "1.0.1" | #define LIBMTP_VERSION_STRING "1.0.2" | |||
/* This handles MSVC pecularities */ | /* This handles MSVC pecularities */ | |||
#ifdef _MSC_VER | #ifdef _MSC_VER | |||
#include <windows.h> | #include <windows.h> | |||
#define __WIN32__ | #define __WIN32__ | |||
#define snprintf _snprintf | #define snprintf _snprintf | |||
#define ssize_t SSIZE_T | #define ssize_t SSIZE_T | |||
/* | /* | |||
* Types that do not exist in Windows | * Types that do not exist in Windows | |||
* sys/types.h, but they exist in mingw32 | * sys/types.h, but they exist in mingw32 | |||
skipping to change at line 58 | skipping to change at line 58 | |||
typedef __int16 int16_t; | typedef __int16 int16_t; | |||
typedef unsigned __int16 uint16_t; | typedef unsigned __int16 uint16_t; | |||
typedef __int32 int32_t; | typedef __int32 int32_t; | |||
typedef unsigned __int32 uint32_t; | typedef unsigned __int32 uint32_t; | |||
typedef unsigned __int64 uint64_t; | typedef unsigned __int64 uint64_t; | |||
#endif | #endif | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <usb.h> | #include <usb.h> | |||
#include <stdint.h> | #include <stdint.h> | |||
/* We use time_t */ | ||||
#include <time.h> | ||||
/** | /** | |||
* @defgroup types libmtp global type definitions | * @defgroup types libmtp global type definitions | |||
* @{ | * @{ | |||
*/ | ||||
/** | ||||
* The debug flags defined here are the external flags used | ||||
* by the libmtp library interface. | ||||
*/ | ||||
#define LIBMTP_DEBUG_NONE 0x00 | ||||
#define LIBMTP_DEBUG_PTP 0x01 | ||||
#define LIBMTP_DEBUG_PLST 0x02 | ||||
#define LIBMTP_DEBUG_USB 0x04 | ||||
#define LIBMTP_DEBUG_DATA 0x08 | ||||
#define LIBMTP_DEBUG_ALL 0xFF | ||||
/** | ||||
* The filetypes defined here are the external types used | * The filetypes defined here are the external types used | |||
* by the libmtp library interface. The types used internally | * by the libmtp library interface. The types used internally | |||
* as PTP-defined enumerator types is something different. | * as PTP-defined enumerator types is something different. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
LIBMTP_FILETYPE_WAV, | LIBMTP_FILETYPE_WAV, | |||
LIBMTP_FILETYPE_MP3, | LIBMTP_FILETYPE_MP3, | |||
LIBMTP_FILETYPE_WMA, | LIBMTP_FILETYPE_WMA, | |||
LIBMTP_FILETYPE_OGG, | LIBMTP_FILETYPE_OGG, | |||
LIBMTP_FILETYPE_AUDIBLE, | LIBMTP_FILETYPE_AUDIBLE, | |||
skipping to change at line 726 | skipping to change at line 742 | |||
LIBMTP_devicestorage_t *prev; /**< Previous storage */ | LIBMTP_devicestorage_t *prev; /**< Previous storage */ | |||
}; | }; | |||
/** @} */ | /** @} */ | |||
/* Make functions available for C++ */ | /* Make functions available for C++ */ | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
extern int LIBMTP_debug; | ||||
/** | /** | |||
* @defgroup internals The libmtp internals API. | * @defgroup internals The libmtp internals API. | |||
* @{ | * @{ | |||
*/ | */ | |||
void LIBMTP_Set_Debug(int); | ||||
void LIBMTP_Init(void); | void LIBMTP_Init(void); | |||
int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const); | int LIBMTP_Get_Supported_Devices_List(LIBMTP_device_entry_t ** const, int * const); | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup basic The basic device management API. | * @defgroup basic The basic device management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
LIBMTP_error_number_t LIBMTP_Detect_Raw_Devices(LIBMTP_raw_device_t **, int *); | LIBMTP_error_number_t LIBMTP_Detect_Raw_Devices(LIBMTP_raw_device_t **, int *); | |||
LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device(LIBMTP_raw_device_t *); | LIBMTP_mtpdevice_t *LIBMTP_Open_Raw_Device(LIBMTP_raw_device_t *); | |||
/* Begin old, legacy interface */ | /* Begin old, legacy interface */ | |||
skipping to change at line 848 | skipping to change at line 867 | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup tracks The track management API. | * @defgroup tracks The track management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
LIBMTP_track_t *LIBMTP_new_track_t(void); | LIBMTP_track_t *LIBMTP_new_track_t(void); | |||
void LIBMTP_destroy_track_t(LIBMTP_track_t*); | void LIBMTP_destroy_track_t(LIBMTP_track_t*); | |||
LIBMTP_track_t *LIBMTP_Get_Tracklisting(LIBMTP_mtpdevice_t*); | LIBMTP_track_t *LIBMTP_Get_Tracklisting(LIBMTP_mtpdevice_t*); | |||
LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback(LIBMTP_mtpdevice_t*, | LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback(LIBMTP_mtpdevice_t*, | |||
LIBMTP_progressfunc_t const, void const * const); | LIBMTP_progressfunc_t const, void const * const); | |||
LIBMTP_track_t *LIBMTP_Get_Tracklisting_With_Callback_For_Storage(LIBMTP_mt | ||||
pdevice_t*, uint32_t const, | ||||
LIBMTP_progressfunc_t const, void const * const); | ||||
LIBMTP_track_t *LIBMTP_Get_Trackmetadata(LIBMTP_mtpdevice_t*, uint32_t cons t); | LIBMTP_track_t *LIBMTP_Get_Trackmetadata(LIBMTP_mtpdevice_t*, uint32_t cons t); | |||
int LIBMTP_Get_Track_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * co nst, | int LIBMTP_Get_Track_To_File(LIBMTP_mtpdevice_t*, uint32_t, char const * co nst, | |||
LIBMTP_progressfunc_t const, void const * const); | LIBMTP_progressfunc_t const, void const * const); | |||
int LIBMTP_Get_Track_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const , int const, | int LIBMTP_Get_Track_To_File_Descriptor(LIBMTP_mtpdevice_t*, uint32_t const , int const, | |||
LIBMTP_progressfunc_t const, void const * const); | LIBMTP_progressfunc_t const, void const * const); | |||
int LIBMTP_Get_Track_To_Handler(LIBMTP_mtpdevice_t *, uint32_t const, MTPDa taPutFunc, | int LIBMTP_Get_Track_To_Handler(LIBMTP_mtpdevice_t *, uint32_t const, MTPDa taPutFunc, | |||
void *, LIBMTP_progressfunc_t const, void const * const); | void *, LIBMTP_progressfunc_t const, void const * const); | |||
int LIBMTP_Send_Track_From_File(LIBMTP_mtpdevice_t *, | int LIBMTP_Send_Track_From_File(LIBMTP_mtpdevice_t *, | |||
char const * const, LIBMTP_track_t * const, | char const * const, LIBMTP_track_t * const, | |||
LIBMTP_progressfunc_t const, | LIBMTP_progressfunc_t const, | |||
skipping to change at line 907 | skipping to change at line 928 | |||
int LIBMTP_Set_Playlist_Name(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *, con st char *); | int LIBMTP_Set_Playlist_Name(LIBMTP_mtpdevice_t *, LIBMTP_playlist_t *, con st char *); | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup albums The audio/video album management API. | * @defgroup albums The audio/video album management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
LIBMTP_album_t *LIBMTP_new_album_t(void); | LIBMTP_album_t *LIBMTP_new_album_t(void); | |||
void LIBMTP_destroy_album_t(LIBMTP_album_t *); | void LIBMTP_destroy_album_t(LIBMTP_album_t *); | |||
LIBMTP_album_t *LIBMTP_Get_Album_List(LIBMTP_mtpdevice_t *); | LIBMTP_album_t *LIBMTP_Get_Album_List(LIBMTP_mtpdevice_t *); | |||
LIBMTP_album_t *LIBMTP_Get_Album_List_For_Storage(LIBMTP_mtpdevice_t *, uin t32_t const); | ||||
LIBMTP_album_t *LIBMTP_Get_Album(LIBMTP_mtpdevice_t *, uint32_t const); | LIBMTP_album_t *LIBMTP_Get_Album(LIBMTP_mtpdevice_t *, uint32_t const); | |||
int LIBMTP_Create_New_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t * const); | int LIBMTP_Create_New_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t * const); | |||
int LIBMTP_Update_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t const * const) ; | int LIBMTP_Update_Album(LIBMTP_mtpdevice_t *, LIBMTP_album_t const * const) ; | |||
int LIBMTP_Set_Album_Name(LIBMTP_mtpdevice_t *, LIBMTP_album_t *, const cha r *); | int LIBMTP_Set_Album_Name(LIBMTP_mtpdevice_t *, LIBMTP_album_t *, const cha r *); | |||
/** | /** | |||
* @} | * @} | |||
* @defgroup objects The object management API. | * @defgroup objects The object management API. | |||
* @{ | * @{ | |||
*/ | */ | |||
End of changes. 8 change blocks. | ||||
3 lines changed or deleted | 26 lines changed or added | |||