comparison src/audacious/tuple.c @ 3504:04ecdd1b0e12 trunk

Fixes.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 08 Sep 2007 17:27:58 +0300
parents b413aa0c939c
children 7d865b5f5a04
comparison
equal deleted inserted replaced
3503:1319e83dad6a 3504:04ecdd1b0e12
46 { "formatter", TUPLE_STRING }, 46 { "formatter", TUPLE_STRING },
47 { "performer", TUPLE_STRING }, 47 { "performer", TUPLE_STRING },
48 { "copyright", TUPLE_STRING }, 48 { "copyright", TUPLE_STRING },
49 { "date", TUPLE_STRING }, 49 { "date", TUPLE_STRING },
50 }; 50 };
51
52 static mowgli_heap_t *tuple_heap = NULL;
53 static mowgli_heap_t *tuple_value_heap = NULL;
54 static mowgli_object_class_t tuple_klass;
51 55
52 56
53 #define TUPLE_LOCKING 57 #define TUPLE_LOCKING
54 //#define TUPLE_DEBUG 58 //#define TUPLE_DEBUG
55 59
136 g_return_val_if_fail(tuple != NULL, NULL); 140 g_return_val_if_fail(tuple != NULL, NULL);
137 141
138 realfn = g_filename_from_uri(filename, NULL, NULL); 142 realfn = g_filename_from_uri(filename, NULL, NULL);
139 143
140 scratch = g_path_get_basename(realfn ? realfn : filename); 144 scratch = g_path_get_basename(realfn ? realfn : filename);
141 tuple_associate_string(tuple, "file-name", scratch); 145 tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);
142 g_free(scratch); 146 g_free(scratch);
143 147
144 scratch = g_path_get_dirname(realfn ? realfn : filename); 148 scratch = g_path_get_dirname(realfn ? realfn : filename);
145 tuple_associate_string(tuple, "file-path", scratch); 149 tuple_associate_string(tuple, FIELD_FILE_PATH, NULL, scratch);
146 g_free(scratch); 150 g_free(scratch);
147 151
148 g_free(realfn); realfn = NULL; 152 g_free(realfn); realfn = NULL;
149 153
150 ext = strrchr(filename, '.'); 154 ext = strrchr(filename, '.');
151 if (ext != NULL) { 155 if (ext != NULL) {
152 ++ext; 156 ++ext;
153 tuple_associate_string(tuple, "file-ext", scratch); 157 tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, scratch);
154 } 158 }
155 159
156 return tuple; 160 return tuple;
157 } 161 }
158 162
292 TupleValue *value; 296 TupleValue *value;
293 if ((value = mowgli_dictionary_retrieve(tuple->dict, field)) != NULL) 297 if ((value = mowgli_dictionary_retrieve(tuple->dict, field)) != NULL)
294 type = value->type; 298 type = value->type;
295 } else { 299 } else {
296 if (tuple->values[nfield]) 300 if (tuple->values[nfield])
297 value = tuple->values[nfield]->type; 301 type = tuple->values[nfield]->type;
298 } 302 }
299 303
300 TUPLE_UNLOCK_READ(); 304 TUPLE_UNLOCK_READ();
301 return type; 305 return type;
302 } 306 }