- SEE ALSO
- CONFIGURATION AND ENVIRONMENT
- BUGS AND LIMITATIONS
- COPYRIGHT AND LICENSE
- DISCLAIMER OF WARRANTY
Media::LibMTP::API - Low-level interface to libmtp
This document describes version 0.04 of Media::LibMTP::API, released May 31, 2014 as part of Media-LibMTP-API version 0.04.
use Media::LibMTP::API qw(Get_First_Device); my $device = Get_First_Device() or die; say $device->Get_Friendlyname;
Media::LibMTP::API provides a low-level interface to libmtp (http://libmtp.sourceforge.net), which is an Initiator implementation of the Media Transfer Protocol (MTP) in the form of a library suitable primarily for POSIX compliant operating systems.
libmtp is not included with Media::LibMTP::API; you must install it separately.
Media::LibMTP::API is a thin wrapper around libmtp. It follows the libmtp API closely, even when that's not very Perlish. For example, many functions return 0 on success. Media::LibMTP will be a higher-level, more Perl-like interface built on top of Media::LibMTP::API, but it's not yet ready for release. You can follow or help with Media::LibMTP's development at https://github.com/madsen/media-libmtp.
This module is not well documented. Consult the libmtp documentation (which can be generated by Doxygen, and should have been installed along with libmtp). All functions that take a pointer to a libmtp struct as their first parameter are implemented as a method on the corresponding Perl object. Not all functions are currently implemented; consult the source for details.
Many libmtp functions return a linked list of structures. In Media::LibMTP::API, this is managed by having two classes for each type of object. The initial structure represents the entire list, and will be one of these subclasses: AlbumList, FileList, FolderList, MTPDeviceList, PlaylistList, or TrackList. These are exactly the same as the non-List types, except that their destructor cleans up the list. The non-List types keep a hidden reference to their parent List object, so you don't need to worry about the list being freed too soon. No memory is released as long as any object in the list is still referenced. (e.g., if you get a 10,000 object list, and keep a reference to only 1 object, the entire list is kept in memory until you're done with that 1 object.)
The libmtp documentation generated by Doxygen.
Media::LibMTP::API requires no configuration files or environment variables.
libmtp 1.1.0 or later
No bugs have been reported.
Christopher J. Madsen
<perl AT cjmweb.net>
Please report any bugs or feature requests to
<bug-Media-LibMTP-API AT rt.cpan.org> or through the web interface at http://rt.cpan.org/Public/Bug/Report.html?Queue=Media-LibMTP-API.
You can follow or contribute to Media-LibMTP-API's development at https://github.com/madsen/media-libmtp-api.
This software is copyright (c) 2014 by Christopher J. Madsen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.