Mercurial > audlegacy-plugins
changeset 1696:1ac047826c64
Fix some tuple function calls to conform with new API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 09 Sep 2007 23:22:52 +0300 |
parents | c306cdaf648c |
children | f35f9d6fcb6d |
files | src/mtp_up/mtp.c src/wav/wav.c |
diffstat | 2 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mtp_up/mtp.c Sun Sep 09 05:44:18 2007 +0300 +++ b/src/mtp_up/mtp.c Sun Sep 09 23:22:52 2007 +0300 @@ -135,7 +135,7 @@ uint32_t parent_id = 0; struct stat sb; - from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, "file-path"), tuple_get_string(from_tuple, "file-name")); + from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), tuple_get_string(from_tuple, FIELD_FILE_NAME)); gchar *tmp; tmp = g_strescape(from_path,NULL); filename=g_filename_from_uri(tmp,NULL,NULL); @@ -162,15 +162,15 @@ /* track metadata*/ tr = LIBMTP_new_track_t(); - tr->title =g_strdup((gchar*) tuple_get_string(from_tuple, "title")); - tr->artist =g_strdup((gchar*) tuple_get_string(from_tuple,"artist")); - tr->album = g_strdup((gchar*)tuple_get_string(from_tuple,"album")); + tr->title = g_strdup((gchar*) tuple_get_string(from_tuple, FIELD_TITLE, NULL)); + tr->artist = g_strdup((gchar*) tuple_get_string(from_tuple, FIELD_ARTIST, NULL)); + tr->album = g_strdup((gchar*)tuple_get_string(from_tuple, FIELD_ALBUM, NULL)); tr->filesize = filesize; - tr->filename = g_strdup(tuple_get_string(from_tuple, "file-name")); - tr->duration = (uint32_t)tuple_get_int(from_tuple, "length"); + tr->filename = g_strdup(tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL)); + tr->duration = (uint32_t)tuple_get_int(from_tuple, FIELD_LENGTH, NULL); tr->filetype = find_filetype (from_path); - tr->genre = g_strdup((gchar*)tuple_get_string(from_tuple, "genre")); - tr->date = g_strdup_printf("%d",tuple_get_int(from_tuple, "year")); + tr->genre = g_strdup((gchar*)tuple_get_string(from_tuple, FIELD_GENRE, NULL)); + tr->date = g_strdup_printf("%d",tuple_get_int(from_tuple, FIELD_YEAR, NULL)); g_free(filename); g_free(from_path); g_free(tmp); @@ -184,7 +184,7 @@ uint32_t parent_id = 0; LIBMTP_track_t *gentrack; gentrack = track_metadata(from_tuple); - from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, "file-path"), tuple_get_string(from_tuple, "file-name")); + from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL)); if(gentrack == NULL) return 1; comp = g_strescape(from_path,NULL); g_free(from_path);
--- a/src/wav/wav.c Sun Sep 09 05:44:18 2007 +0300 +++ b/src/wav/wav.c Sun Sep 09 23:22:52 2007 +0300 @@ -193,14 +193,14 @@ tuple = tuple_new_from_filename(filename); - tuple_associate_string(tuple, "codec", "RIFF/WAV Audio (ADPCM)"); - tuple_associate_string(tuple, "quality", "lossless"); + tuple_associate_string(tuple, FIELD_CODEC, NULL, "RIFF/WAV Audio (ADPCM)"); + tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossless"); title = tuple_formatter_make_title_string(tuple, get_gentitle_format()); if (*title == '\0') { g_free(title); - title = g_strdup(tuple_get_string(tuple, "file-name")); + title = g_strdup(tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); } tuple_free(tuple);