Lines Matching +full:- +full:- +full:quiet
8 * Copyright (C) 2003-2010 Linus Walleij <triad@df.lth.se>
9 * Copyright (C) 2003-2005 Shaun Jackman
10 * Copyright (C) 2003-2005 Enrique Jorrete Ledesma
27 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 * Boston, MA 02111-1307, USA.
55 fprintf(stderr, "usage: sendtr [ -D debuglvl ] [ -q ]\n"); in sendtrack_usage()
56 fprintf(stderr, "-t <title> -a <artist> -A <Album artist> -w <writer or composer>\n"); in sendtrack_usage()
57 fprintf(stderr, " -l <album> -c <codec> -g <genre> -n <track number> -y <year>\n"); in sendtrack_usage()
58 fprintf(stderr, " -d <duration in seconds> -s <storage_id> <local path> <remote path>\n"); in sendtrack_usage()
59 fprintf(stderr, "(-q means the program will not ask for missing information.)\n"); in sendtrack_usage()
101 if ((album->name != NULL && in add_track_to_album()
102 album->artist != NULL && in add_track_to_album()
103 !strcmp(album->name, albuminfo->name) && in add_track_to_album()
104 !strcmp(album->artist, albuminfo->artist)) || in add_track_to_album()
105 (album->name != NULL && in add_track_to_album()
106 album->composer != NULL && in add_track_to_album()
107 !strcmp(album->name, albuminfo->name) && in add_track_to_album()
108 !strcmp(album->composer, albuminfo->composer))) { in add_track_to_album()
111 album = album->next; in add_track_to_album()
112 found_album->next = NULL; in add_track_to_album()
114 album = album->next; in add_track_to_album()
122 if ((album->name != NULL) && in add_track_to_album()
123 !strcmp(album->name, albuminfo->name) ){ in add_track_to_album()
126 album = album->next; in add_track_to_album()
127 found_album->next = NULL; in add_track_to_album()
129 album = album->next; in add_track_to_album()
137 tracks = (uint32_t *)malloc((found_album->no_tracks+1) * sizeof(uint32_t)); in add_track_to_album()
138 printf("Album \"%s\" found: updating...\n", found_album->name); in add_track_to_album()
143 found_album->no_tracks++; in add_track_to_album()
144 if (found_album->tracks != NULL) { in add_track_to_album()
145 memcpy(tracks, found_album->tracks, found_album->no_tracks * sizeof(uint32_t)); in add_track_to_album()
146 free(found_album->tracks); in add_track_to_album()
148 tracks[found_album->no_tracks-1] = trackmeta->item_id; in add_track_to_album()
149 found_album->tracks = tracks; in add_track_to_album()
155 *trackid = trackmeta->item_id; in add_track_to_album()
156 albuminfo->tracks = trackid; in add_track_to_album()
157 albuminfo->no_tracks = 1; in add_track_to_album()
158 albuminfo->storage_id = trackmeta->storage_id; in add_track_to_album()
170 album = album->next; in add_track_to_album()
185 … *pcomposer, uint16_t tracknum, uint16_t length, uint16_t year, uint32_t storageid, uint16_t quiet) in sendtrack_function() argument
203 if (parent_id == -1) { in sendtrack_function()
211 if (stat(from_path, &sb) == -1) { in sendtrack_function()
226 trackmeta->filetype = find_filetype (from_path); in sendtrack_function()
227 if (!LIBMTP_FILETYPE_IS_TRACK(trackmeta->filetype)) { in sendtrack_function()
228 … printf("Not a valid track codec: \"%s\"\n", LIBMTP_Get_Filetype_Description(trackmeta->filetype)); in sendtrack_function()
234 if ((ptitle == NULL) && (quiet == 0)) { in sendtrack_function()
239 if ((palbum == NULL) && (quiet == 0)) { in sendtrack_function()
244 if ((palbumartist == NULL) && (quiet == 0)) { in sendtrack_function()
249 if ((partist == NULL) && (quiet == 0)) { in sendtrack_function()
254 if ((pcomposer == NULL) && (quiet == 0)) { in sendtrack_function()
259 if ((pgenre == NULL) && (quiet == 0)) { in sendtrack_function()
264 if ((tracknum == 0) && (quiet == 0)) { in sendtrack_function()
272 if ((year == 0) && (quiet == 0)) { in sendtrack_function()
280 if ((length == 0) && (quiet == 0)) { in sendtrack_function()
289 printf("Codec: %s\n", LIBMTP_Get_Filetype_Description(trackmeta->filetype)); in sendtrack_function()
292 trackmeta->title = strdup(ptitle); in sendtrack_function()
299 trackmeta->album = strdup(palbum); in sendtrack_function()
300 albuminfo->name = strdup(palbum); in sendtrack_function()
304 albuminfo->artist = strdup(palbumartist); in sendtrack_function()
308 trackmeta->artist = strdup(partist); in sendtrack_function()
310 albuminfo->artist = strdup(partist); in sendtrack_function()
314 trackmeta->composer = strdup(pcomposer); in sendtrack_function()
315 albuminfo->composer = strdup(pcomposer); in sendtrack_function()
319 trackmeta->genre = strdup(pgenre); in sendtrack_function()
320 albuminfo->genre = strdup(pgenre); in sendtrack_function()
325 snprintf(tmp, sizeof(tmp)-1, "%4d0101T0000.0", year); in sendtrack_function()
326 tmp[sizeof(tmp)-1] = '\0'; in sendtrack_function()
327 trackmeta->date = strdup(tmp); in sendtrack_function()
331 trackmeta->tracknumber = tracknum; in sendtrack_function()
336 trackmeta->duration = length * 1000; in sendtrack_function()
340 trackmeta->filename = strdup(filename); in sendtrack_function()
342 trackmeta->filesize = filesize; in sendtrack_function()
343 trackmeta->parent_id = parent_id; in sendtrack_function()
351 exit(-1); in sendtrack_function()
353 for (pds = device->storage; pds != NULL; pds = pds->next) { in sendtrack_function()
354 if (pds->id == storageid) { in sendtrack_function()
355 desc = strdup(pds->StorageDescription); in sendtrack_function()
364 trackmeta->storage_id = storageid; in sendtrack_function()
376 printf("New track ID: %d\n", trackmeta->item_id); in sendtrack_function()
404 uint16_t quiet = 0; in sendtrack_command() local
406 while ( (opt = getopt(argc, argv, "qD:t:a:A:w:l:c:g:n:d:y:s:")) != -1 ) { in sendtrack_command()
449 quiet = 1; in sendtrack_command()
455 argc -= optind; in sendtrack_command()
464 …v[1],partist,palbumartist,ptitle,pgenre,palbum,pcomposer,tracknum, length, year, storageid, quiet); in sendtrack_command()
465 …[1],partist,palbumartist,ptitle,pgenre,palbum,pcomposer, tracknum, length, year, storageid, quiet); in sendtrack_command()