|
Lines 110-121
Link Here
|
| 110 |
{"9724", GB / 2, MODEL_TYPE_SHUFFLE, FOURTH_GENERATION}, |
110 |
{"9724", GB / 2, MODEL_TYPE_SHUFFLE, FOURTH_GENERATION}, |
| 111 |
{"9725", GB, MODEL_TYPE_SHUFFLE, FOURTH_GENERATION}, |
111 |
{"9725", GB, MODEL_TYPE_SHUFFLE, FOURTH_GENERATION}, |
| 112 |
|
112 |
|
|
|
113 |
/* Nano / Fourth Generation */ |
| 114 |
{"A004", GB * 2, MODEL_TYPE_NANO_WHITE, FOURTH_GENERATION}, |
| 115 |
{"A099", GB * 2, MODEL_TYPE_NANO_BLACK, FOURTH_GENERATION}, |
| 116 |
{"A005", GB * 4, MODEL_TYPE_NANO_WHITE, FOURTH_GENERATION}, |
| 117 |
{"A107", GB * 4, MODEL_TYPE_NANO_BLACK, FOURTH_GENERATION}, |
| 118 |
|
| 113 |
/* HP iPods, need contributions for this table */ |
119 |
/* HP iPods, need contributions for this table */ |
| 114 |
{"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION}, |
120 |
{"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION}, |
| 115 |
|
121 |
|
| 116 |
{NULL, 0, 0, 0} |
122 |
{NULL, 0, 0, 0} |
| 117 |
}; |
123 |
}; |
| 118 |
|
124 |
|
|
|
125 |
static const gchar *ipod_model_name_table [] = { |
| 126 |
"Invalid", |
| 127 |
"Unknown", |
| 128 |
"Color", |
| 129 |
"Color U2", |
| 130 |
"Grayscale", |
| 131 |
"Grayscale U2", |
| 132 |
"Mini (Silver)", |
| 133 |
"Mini (Blue)", |
| 134 |
"Mini (Pink)", |
| 135 |
"Mini (Green)", |
| 136 |
"Mini (Gold)", |
| 137 |
"Shuffle", |
| 138 |
"Nano (White)", |
| 139 |
"Nano (Black)", |
| 140 |
NULL |
| 141 |
}; |
| 142 |
|
| 119 |
#define g_free_if_not_null(o) \ |
143 |
#define g_free_if_not_null(o) \ |
| 120 |
if(o != NULL) { \ |
144 |
if(o != NULL) { \ |
| 121 |
g_free(o); \ |
145 |
g_free(o); \ |
|
Lines 254-259
Link Here
|
| 254 |
g_value_set_uint(value, |
278 |
g_value_set_uint(value, |
| 255 |
ipod_model_table[device->priv->model_index].model_type); |
279 |
ipod_model_table[device->priv->model_index].model_type); |
| 256 |
break; |
280 |
break; |
|
|
281 |
case PROP_DEVICE_MODEL_STRING: |
| 282 |
g_value_set_string(value, |
| 283 |
ipod_model_name_table[ipod_model_table[ |
| 284 |
device->priv->model_index].model_type]); |
| 285 |
break; |
| 257 |
case PROP_DEVICE_GENERATION: |
286 |
case PROP_DEVICE_GENERATION: |
| 258 |
g_value_set_uint(value, |
287 |
g_value_set_uint(value, |
| 259 |
ipod_model_table[device->priv->model_index].generation); |
288 |
ipod_model_table[device->priv->model_index].generation); |
|
Lines 377-382
Link Here
|
| 377 |
GParamSpec *device_path_param; |
406 |
GParamSpec *device_path_param; |
| 378 |
GParamSpec *control_path_param; |
407 |
GParamSpec *control_path_param; |
| 379 |
GParamSpec *device_model_param; |
408 |
GParamSpec *device_model_param; |
|
|
409 |
GParamSpec *device_model_string_param; |
| 380 |
GParamSpec *device_name_param; |
410 |
GParamSpec *device_name_param; |
| 381 |
GParamSpec *user_name_param; |
411 |
GParamSpec *user_name_param; |
| 382 |
GParamSpec *host_name_param; |
412 |
GParamSpec *host_name_param; |
|
Lines 421-426
Link Here
|
| 421 |
device_model_param = g_param_spec_uint("device-model", "Device Model", |
451 |
device_model_param = g_param_spec_uint("device-model", "Device Model", |
| 422 |
"Type of iPod (Regular, Photo, Shuffle)", 0, 2, 0, G_PARAM_READABLE); |
452 |
"Type of iPod (Regular, Photo, Shuffle)", 0, 2, 0, G_PARAM_READABLE); |
| 423 |
|
453 |
|
|
|
454 |
device_model_string_param = g_param_spec_string("device-model-string", |
| 455 |
"Device Model String", "String type of iPod (Regular, Shuffle)", |
| 456 |
NULL, G_PARAM_READABLE); |
| 457 |
|
| 424 |
device_name_param = g_param_spec_string("device-name", "Device Name", |
458 |
device_name_param = g_param_spec_string("device-name", "Device Name", |
| 425 |
"The user-assigned name of their iPod", NULL, G_PARAM_READWRITE); |
459 |
"The user-assigned name of their iPod", NULL, G_PARAM_READWRITE); |
| 426 |
|
460 |
|
|
Lines 504-509
Link Here
|
| 504 |
g_object_class_install_property(class, PROP_DEVICE_MODEL, |
538 |
g_object_class_install_property(class, PROP_DEVICE_MODEL, |
| 505 |
device_model_param); |
539 |
device_model_param); |
| 506 |
|
540 |
|
|
|
541 |
g_object_class_install_property(class, PROP_DEVICE_MODEL_STRING, |
| 542 |
device_model_string_param); |
| 543 |
|
| 507 |
g_object_class_install_property(class, PROP_DEVICE_NAME, |
544 |
g_object_class_install_property(class, PROP_DEVICE_NAME, |
| 508 |
device_name_param); |
545 |
device_name_param); |
| 509 |
|
546 |
|
|
Lines 1496-1517
Link Here
|
| 1496 |
|
1533 |
|
| 1497 |
void |
1534 |
void |
| 1498 |
ipod_device_debug(IpodDevice *device) |
1535 |
ipod_device_debug(IpodDevice *device) |
| 1499 |
{ |
1536 |
{ |
| 1500 |
static const gchar *model_type_names [] = { |
|
|
| 1501 |
"Invalid", |
| 1502 |
"Unknown", |
| 1503 |
"Color", |
| 1504 |
"Color U2", |
| 1505 |
"Grayscale/Regular", |
| 1506 |
"Grayscale/Regular U2", |
| 1507 |
"Mini (Silver)", |
| 1508 |
"Mini (Blue)", |
| 1509 |
"Mini (Pink)", |
| 1510 |
"Mini (Green)", |
| 1511 |
"Mini (Gold)", |
| 1512 |
"Shuffle" |
| 1513 |
}; |
| 1514 |
|
| 1515 |
static const gchar *generation_names [] = { |
1537 |
static const gchar *generation_names [] = { |
| 1516 |
"Unknown", |
1538 |
"Unknown", |
| 1517 |
"First", |
1539 |
"First", |
|
Lines 1521-1527
Link Here
|
| 1521 |
}; |
1543 |
}; |
| 1522 |
|
1544 |
|
| 1523 |
gchar *device_path, *mount_point, *control_path, *hal_id; |
1545 |
gchar *device_path, *mount_point, *control_path, *hal_id; |
| 1524 |
gchar *model_number, *adv_capacity; |
1546 |
gchar *model_number, *adv_capacity, *model_string; |
| 1525 |
guint model, generation; |
1547 |
guint model, generation; |
| 1526 |
gboolean is_new, can_write; |
1548 |
gboolean is_new, can_write; |
| 1527 |
gchar *serial_number, *firmware_version; |
1549 |
gchar *serial_number, *firmware_version; |
|
Lines 1538-1543
Link Here
|
| 1538 |
"hal-volume-id", &hal_id, |
1560 |
"hal-volume-id", &hal_id, |
| 1539 |
"model-number", &model_number, |
1561 |
"model-number", &model_number, |
| 1540 |
"device-model", &model, |
1562 |
"device-model", &model, |
|
|
1563 |
"device-model-string", &model_string, |
| 1541 |
"device-generation", &generation, |
1564 |
"device-generation", &generation, |
| 1542 |
"advertised-capacity", &adv_capacity, |
1565 |
"advertised-capacity", &adv_capacity, |
| 1543 |
"is-new", &is_new, |
1566 |
"is-new", &is_new, |
|
Lines 1562-1568
Link Here
|
| 1562 |
|
1585 |
|
| 1563 |
g_printf("Device Info\n"); |
1586 |
g_printf("Device Info\n"); |
| 1564 |
g_printf(" Model Number: %s\n", model_number); |
1587 |
g_printf(" Model Number: %s\n", model_number); |
| 1565 |
g_printf(" Device Model: %s\n", model_type_names[model]); |
1588 |
g_printf(" Device Model: %s\n", model_string); |
| 1566 |
g_printf(" iPod Generation: %s\n", generation_names[generation]); |
1589 |
g_printf(" iPod Generation: %s\n", generation_names[generation]); |
| 1567 |
g_printf(" Adv. Capacity: %s\n", adv_capacity); |
1590 |
g_printf(" Adv. Capacity: %s\n", adv_capacity); |
| 1568 |
g_printf(" Is New: %s\n", is_new ? "YES" : "NO"); |
1591 |
g_printf(" Is New: %s\n", is_new ? "YES" : "NO"); |