Home | History | Annotate | Download | only in src

Lines Matching refs:track

152 			       LIBMTP_track_t *track);
534 register_property("Track", LIBMTP_PROPERTY_Track, PTP_OPC_Track);
2335 // This is some sort of unique ID so we can keep track of the track.
2467 // Add track to a list that will be returned afterwards.
3943 // This is some sort of unique ID so we can keep track of the track.
4026 // Add track to a list that will be returned afterwards.
4094 // This is some sort of unique ID so we can keep track of the file.
4147 * This creates a new track metadata structure and allocates memory
4154 * LIBMTP_track_t *track = LIBMTP_new_track_t();
4155 * track->title = strdup(titlestr);
4157 * LIBMTP_destroy_track_t(track);
4196 * This destroys a track metadata structure and deallocates the memory
4197 * used by it, including any strings. Never use a track metadata
4199 * @param track the track metadata to destroy.
4202 void LIBMTP_destroy_track_t(LIBMTP_track_t *track)
4204 if (track == NULL) {
4207 if (track->title != NULL)
4208 free(track->title);
4209 track->artist != NULL)
4210 free(track->artist);
4211 if (track->composer != NULL)
4212 free(track->composer);
4213 if (track->album != NULL)
4214 free(track->album);
4215 if (track->genre != NULL)
4216 free(track->genre);
4217 if (track->date != NULL)
4218 free(track->date);
4219 if (track->filename != NULL)
4220 free(track->filename);
4221 free(track);
4226 * This function maps and copies a property onto the track metadata if applicable.
4228 static void pick_property_to_track_metadata(LIBMTP_mtpdevice_t *device, MTPProperties *prop, LIBMTP_track_t *track)
4233 track->title = strdup(prop->propval.str);
4235 track->title = NULL;
4239 track->artist = strdup(prop->propval.str);
4241 track->artist = NULL;
4245 track->composer = strdup(prop->propval.str);
4247 track->composer = NULL;
4250 track->duration = prop->propval.u32;
4253 track->tracknumber = prop->propval.u16;
4257 track->genre = strdup(prop->propval.str);
4259 track->genre = NULL;
4263 track->album = strdup(prop->propval.str);
4265 track->album = NULL;
4269 track->date = strdup(prop->propval.str);
4271 track->date = NULL;
4275 track->samplerate = prop->propval.u32;
4278 track->nochannels = prop->propval.u16;
4281 track->wavecodec = prop->propval.u32;
4284 track->bitrate = prop->propval.u32;
4287 track->bitratetype = prop->propval.u16;
4290 track->rating = prop->propval.u16;
4293 track->usecount = prop->propval.u32;
4297 track->filesize = prop->propval.u64;
4299 track->filesize = prop->propval.u32;
4308 * This function retrieves the track metadata for a track
4310 * @param device a pointer to the device to get the track metadata off.
4311 * @param trackid the unique ID of the track.
4312 * @param objectformat the object format of this track, so we know what it supports.
4313 * @param track a metadata set to fill in.
4316 LIBMTP_track_t *track)
4327 ret = ptp_object_want(params, track->item_id, PTPOBJECT_MTPPROPLIST_LOADED, &ob);
4331 pick_property_to_track_metadata(device, prop, track);
4337 ret = ptp_mtp_getobjectpropssupported(params, map_libmtp_type_to_ptp_type(track->filetype), &propcnt, &props);
4346 track->title = get_string_from_object(device, track->item_id, PTP_OPC_Name);
4349 track->artist = get_string_from_object(device, track->item_id, PTP_OPC_Artist);
4352 track->composer = get_string_from_object(device, track->item_id, PTP_OPC_Composer);
4355 track->duration = get_u32_from_object(device, track->item_id, PTP_OPC_Duration, 0);
4358 track->tracknumber = get_u16_from_object(device, track->item_id, PTP_OPC_Track, 0);
4361 track->genre = get_string_from_object(device, track->item_id, PTP_OPC_Genre);
4364 track->album = get_string_from_object(device, track->item_id, PTP_OPC_AlbumName);
4367 track->date = get_string_from_object(device, track->item_id, PTP_OPC_OriginalReleaseDate);
4371 track->samplerate = get_u32_from_object(device, track->item_id, PTP_OPC_SampleRate, 0);
4374 track->nochannels = get_u16_from_object(device, track->item_id, PTP_OPC_NumberOfChannels, 0);
4377 track->wavecodec = get_u32_from_object(device, track->item_id, PTP_OPC_AudioWAVECodec, 0);
4380 track->bitrate = get_u32_from_object(device, track->item_id, PTP_OPC_AudioBitRate, 0);
4383 track->bitratetype = get_u16_from_object(device, track->item_id, PTP_OPC_BitRateType, 0);
4386 track->rating = get_u16_from_object(device, track->item_id, PTP_OPC_Rating, 0);
4389 track->usecount = get_u32_from_object(device, track->item_id, PTP_OPC_UseCount, 0);
4393 track->filesize = get_u64_from_object(device, track->item_id, PTP_OPC_ObjectSize, 0);
4395 track->filesize = (uint64_t) get_u32_from_object(device, track->item_id, PTP_OPC_ObjectSize, 0);
4436 * If you want to group your track listing by storage (per storage unit) or
4443 * @param device a pointer to the device to get the track listing for.
4474 LIBMTP_track_t *track;
4487 // all known track files?
4495 //printf("Not a music track (name: %s format: %d), skipping...\n", oi->Filename, oi->ObjectFormat);
4499 // Allocate a new track type
4500 track = LIBMTP_new_track_t();
4502 // This is some sort of unique ID so we can keep track of the track.
4503 track->item_id = ob->oid;
4504 track->parent_id = ob->oi.ParentObject;
4505 track->storage_id = ob->oi.StorageID;
4506 track->modificationdate = ob->oi.ModificationDate;
4508 track->filetype = mtptype;
4511 track->filesize = ob->oi.ObjectCompressedSize;
4513 track->filename = strdup(ob->oi.Filename);
4516 get_track_metadata(device, ob->oi.ObjectFormat, track);
4526 if (track->filetype == LIBMTP_FILETYPE_UNKNOWN &&
4527 track->filename != NULL) {
4530 has_ogg_extension(track->filename))
4531 track->filetype = LIBMTP_FILETYPE_OGG;
4533 has_flac_extension(track->filename))
4534 track->filetype = LIBMTP_FILETYPE_FLAC;
4537 LIBMTP_destroy_track_t(track);
4542 // Add track to a list that will be returned afterwards.
4544 retracks = track;
4545 curtrack = track;
4547 curtrack->next = track;
4548 curtrack = track;
4560 * This function retrieves the metadata for a single track off
4563 * Do not call this function repeatedly! The track handles are linearly
4568 * @param device a pointer to the device to get the track metadata from.
4569 * @param trackid the object ID of the track that you want the metadata for.
4570 * @return a track metadata entry on success or NULL on failure.
4578 LIBMTP_track_t *track;
4603 //printf("Not a music track (name: %s format: %d), skipping...\n", oi->Filename, oi->ObjectFormat);
4607 // Allocate a new track type
4608 track = LIBMTP_new_track_t();
4610 // This is some sort of unique ID so we can keep track of the track.
4611 track->item_id = ob->oid;
4612 track->parent_id = ob->oi.ParentObject;
4613 track->storage_id = ob->oi.StorageID;
4614 track->modificationdate = ob->oi.ModificationDate;
4616 track->filetype = mtptype;
4619 track->filesize = ob->oi.ObjectCompressedSize;
4621 track->filename = strdup(ob->oi.Filename);
4632 if (track->filetype == LIBMTP_FILETYPE_UNKNOWN &&
4633 track->filename != NULL) {
4636 has_ogg_extension(track->filename))
4637 track->filetype = LIBMTP_FILETYPE_OGG;
4639 has_flac_extension(track->filename))
4640 track->filetype = LIBMTP_FILETYPE_FLAC;
4643 LIBMTP_destroy_track_t(track);
4647 get_track_metadata(device, ob->oi.ObjectFormat, track);
4648 return track;
4702 * @param device a pointer to the device to get the track from.
4908 * This gets a track off the device to a file identified
4911 * @param device a pointer to the device to get the track from.
4912 * @param id the track ID of the track to retrieve.
4913 * @param path a filename to use for the retrieved track.
4932 * This gets a track off the device to a file identified
4935 * @param device a pointer to the device to get the track from.
4936 * @param id the track ID of the track to retrieve.
4937 * @param fd a file descriptor to write the track to.
4961 * This gets a track off the device to a handler function.
4964 * @param device a pointer to the device to get the track from.
4965 * @param id the track ID of the track to retrieve.
4989 * This function sends a track from a local file to an
4992 * @param device a pointer to the device to send the track to.
4994 * @param metadata a track metadata set to be written along with the file.
4996 * will contain the new track ID. Other fields such
5003 * (e.g. folder) to store this track in. Since some
5011 * presents) to store this track in. Setting this to 0 will store
5012 * the track on the primary storage.
5066 * This function sends a track from a file descriptor to an
5069 * @param device a pointer to the device to send the track to.
5071 * @param metadata a track metadata set to be written along with the file.
5073 * will contain the new track ID. Other fields such
5080 * (e.g. folder) to store this track in. Since some
5088 * presents) to store this track in. Setting this to 0 will store
5089 * the track on the primary storage.
5109 // Sanity check, is this really a track?
5113 "I don't think this is actually a track, strange filetype...");
5145 // Set track metadata for the new fine track
5161 * This function sends a track from a handler function to an
5164 * @param device a pointer to the device to send the track to.
5168 * @param metadata a track metadata set to be written along with the file.
5170 * will contain the new track ID. Other fields such
5177 * (e.g. folder) to store this track in. Since some
5185 * presents) to store this track in. Setting this to 0 will store
5186 * the track on the primary storage.
5206 // Sanity check, is this really a track?
5210 "I don't think this is actually a track, strange filetype...");
5243 // Set track metadata for the new fine track
5262 * @param device a pointer to the device to send the track to.
5819 * This function updates the MTP track object metadata on a
5821 * @param device a pointer to the device to update the track
5823 * @param metadata a track metadata set to be written to the file.
5829 * track will not be tagged with these blank values.
6036 "could not set track title.");
6044 "could not set track album name.");
6052 "could not set track artist name.");
6060 "could not set track composer name.");
6068 "could not set track genre name.");
6077 "could not set track duration.");
6082 // Update track number.
6087 "could not set track tracknumber.");
6096 "could not set track release date.");
6206 * This function deletes a single file, track, playlist, folder or
6378 * This function renames a single track.
6383 * @param track the track metadata of the track to rename.
6390 LIBMTP_track_t *track, const char* newname)
6394 ret = set_object_filename(device, track->item_id,
6395 map_libmtp_type_to_ptp_type(track->filetype),
6402 free(track->filename);
6403 track->filename = strdup(newname);
6513 * Helper function. This indicates if a track exists on the device
6514 * @param device a pointer to the device to get the track from.
6515 * @param id the track ID of the track to retrieve.
6516 * @return TRUE (!=0) if the track exists, FALSE (0) if not
6853 * used by it, including any strings. Never use a track metadata
6929 // Then get the track listing for this playlist
7004 // Then get the track listing for this playlist
7344 * This updates the metadata and track listing
7557 * contains a track listing, these tracks will be added to the
7565 * (e.g. folder) to store this track in. Since some
7573 * presents) to store this track in. Setting this to 0 will store
7574 * the track on the primary storage.
7618 * contains a track listing, these tracks will be added to the
7620 * previous track listing will be deleted. For Samsung devices the
7755 * @param device a pointer to the device to get the track metadata off.
7855 // Then get the track listing for this album
7911 // Then get the track listing for this album
7925 * contains a track listing, these tracks will be added to the
7933 * (e.g. folder) to store this track in. Since some
7941 * presents) to store this track in. Setting this to 0 will store
7942 * the track on the primary storage.
8336 * contains a track listing, these tracks will be added to the
8338 * previous track listing will be deleted.