|
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 / Fifth Generation */ |
| 114 |
{"A004", GB * 2, MODEL_TYPE_NANO_WHITE, FIFTH_GENERATION}, |
| 115 |
{"A099", GB * 2, MODEL_TYPE_NANO_BLACK, FIFTH_GENERATION}, |
| 116 |
{"A005", GB * 4, MODEL_TYPE_NANO_WHITE, FIFTH_GENERATION}, |
| 117 |
{"A107", GB * 4, MODEL_TYPE_NANO_BLACK, FIFTH_GENERATION}, |
| 118 |
|
| 119 |
/* Video / Fifth Generation */ |
| 120 |
{"A002", GB * 30, MODEL_TYPE_VIDEO_WHITE, FIFTH_GENERATION}, |
| 121 |
{"A146", GB * 30, MODEL_TYPE_VIDEO_BLACK, FIFTH_GENERATION}, |
| 122 |
{"A003", GB * 60, MODEL_TYPE_VIDEO_WHITE, FIFTH_GENERATION}, |
| 123 |
{"A147", GB * 60, MODEL_TYPE_VIDEO_BLACK, FIFTH_GENERATION}, |
| 124 |
|
| 113 |
/* HP iPods, need contributions for this table */ |
125 |
/* HP iPods, need contributions for this table */ |
| 114 |
{"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION}, |
126 |
{"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION}, |
| 115 |
|
127 |
|
| 116 |
{NULL, 0, 0, 0} |
128 |
{NULL, 0, 0, 0} |
| 117 |
}; |
129 |
}; |
| 118 |
|
130 |
|
|
|
131 |
static const gchar *ipod_model_name_table [] = { |
| 132 |
"Invalid", |
| 133 |
"Unknown", |
| 134 |
"Color", |
| 135 |
"Color U2", |
| 136 |
"Grayscale", |
| 137 |
"Grayscale U2", |
| 138 |
"Mini (Silver)", |
| 139 |
"Mini (Blue)", |
| 140 |
"Mini (Pink)", |
| 141 |
"Mini (Green)", |
| 142 |
"Mini (Gold)", |
| 143 |
"Shuffle", |
| 144 |
"Nano (White)", |
| 145 |
"Nano (Black)", |
| 146 |
"Video (White)", |
| 147 |
"Video (Black)", |
| 148 |
NULL |
| 149 |
}; |
| 150 |
|
| 119 |
#define g_free_if_not_null(o) \ |
151 |
#define g_free_if_not_null(o) \ |
| 120 |
if(o != NULL) { \ |
152 |
if(o != NULL) { \ |
| 121 |
g_free(o); \ |
153 |
g_free(o); \ |
|
Lines 254-259
Link Here
|
| 254 |
g_value_set_uint(value, |
286 |
g_value_set_uint(value, |
| 255 |
ipod_model_table[device->priv->model_index].model_type); |
287 |
ipod_model_table[device->priv->model_index].model_type); |
| 256 |
break; |
288 |
break; |
|
|
289 |
case PROP_DEVICE_MODEL_STRING: |
| 290 |
g_value_set_string(value, |
| 291 |
ipod_model_name_table[ipod_model_table[ |
| 292 |
device->priv->model_index].model_type]); |
| 293 |
break; |
| 257 |
case PROP_DEVICE_GENERATION: |
294 |
case PROP_DEVICE_GENERATION: |
| 258 |
g_value_set_uint(value, |
295 |
g_value_set_uint(value, |
| 259 |
ipod_model_table[device->priv->model_index].generation); |
296 |
ipod_model_table[device->priv->model_index].generation); |
|
Lines 377-382
Link Here
|
| 377 |
GParamSpec *device_path_param; |
414 |
GParamSpec *device_path_param; |
| 378 |
GParamSpec *control_path_param; |
415 |
GParamSpec *control_path_param; |
| 379 |
GParamSpec *device_model_param; |
416 |
GParamSpec *device_model_param; |
|
|
417 |
GParamSpec *device_model_string_param; |
| 380 |
GParamSpec *device_name_param; |
418 |
GParamSpec *device_name_param; |
| 381 |
GParamSpec *user_name_param; |
419 |
GParamSpec *user_name_param; |
| 382 |
GParamSpec *host_name_param; |
420 |
GParamSpec *host_name_param; |
|
Lines 421-426
Link Here
|
| 421 |
device_model_param = g_param_spec_uint("device-model", "Device Model", |
459 |
device_model_param = g_param_spec_uint("device-model", "Device Model", |
| 422 |
"Type of iPod (Regular, Photo, Shuffle)", 0, 2, 0, G_PARAM_READABLE); |
460 |
"Type of iPod (Regular, Photo, Shuffle)", 0, 2, 0, G_PARAM_READABLE); |
| 423 |
|
461 |
|
|
|
462 |
device_model_string_param = g_param_spec_string("device-model-string", |
| 463 |
"Device Model String", "String type of iPod (Regular, Shuffle)", |
| 464 |
NULL, G_PARAM_READABLE); |
| 465 |
|
| 424 |
device_name_param = g_param_spec_string("device-name", "Device Name", |
466 |
device_name_param = g_param_spec_string("device-name", "Device Name", |
| 425 |
"The user-assigned name of their iPod", NULL, G_PARAM_READWRITE); |
467 |
"The user-assigned name of their iPod", NULL, G_PARAM_READWRITE); |
| 426 |
|
468 |
|
|
Lines 504-509
Link Here
|
| 504 |
g_object_class_install_property(class, PROP_DEVICE_MODEL, |
546 |
g_object_class_install_property(class, PROP_DEVICE_MODEL, |
| 505 |
device_model_param); |
547 |
device_model_param); |
| 506 |
|
548 |
|
|
|
549 |
g_object_class_install_property(class, PROP_DEVICE_MODEL_STRING, |
| 550 |
device_model_string_param); |
| 551 |
|
| 507 |
g_object_class_install_property(class, PROP_DEVICE_NAME, |
552 |
g_object_class_install_property(class, PROP_DEVICE_NAME, |
| 508 |
device_name_param); |
553 |
device_name_param); |
| 509 |
|
554 |
|
|
Lines 1496-1517
Link Here
|
| 1496 |
|
1541 |
|
| 1497 |
void |
1542 |
void |
| 1498 |
ipod_device_debug(IpodDevice *device) |
1543 |
ipod_device_debug(IpodDevice *device) |
| 1499 |
{ |
1544 |
{ |
| 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 [] = { |
1545 |
static const gchar *generation_names [] = { |
| 1516 |
"Unknown", |
1546 |
"Unknown", |
| 1517 |
"First", |
1547 |
"First", |
|
Lines 1521-1527
Link Here
|
| 1521 |
}; |
1551 |
}; |
| 1522 |
|
1552 |
|
| 1523 |
gchar *device_path, *mount_point, *control_path, *hal_id; |
1553 |
gchar *device_path, *mount_point, *control_path, *hal_id; |
| 1524 |
gchar *model_number, *adv_capacity; |
1554 |
gchar *model_number, *adv_capacity, *model_string; |
| 1525 |
guint model, generation; |
1555 |
guint model, generation; |
| 1526 |
gboolean is_new, can_write; |
1556 |
gboolean is_new, can_write; |
| 1527 |
gchar *serial_number, *firmware_version; |
1557 |
gchar *serial_number, *firmware_version; |
|
Lines 1538-1543
Link Here
|
| 1538 |
"hal-volume-id", &hal_id, |
1568 |
"hal-volume-id", &hal_id, |
| 1539 |
"model-number", &model_number, |
1569 |
"model-number", &model_number, |
| 1540 |
"device-model", &model, |
1570 |
"device-model", &model, |
|
|
1571 |
"device-model-string", &model_string, |
| 1541 |
"device-generation", &generation, |
1572 |
"device-generation", &generation, |
| 1542 |
"advertised-capacity", &adv_capacity, |
1573 |
"advertised-capacity", &adv_capacity, |
| 1543 |
"is-new", &is_new, |
1574 |
"is-new", &is_new, |
|
Lines 1562-1568
Link Here
|
| 1562 |
|
1593 |
|
| 1563 |
g_printf("Device Info\n"); |
1594 |
g_printf("Device Info\n"); |
| 1564 |
g_printf(" Model Number: %s\n", model_number); |
1595 |
g_printf(" Model Number: %s\n", model_number); |
| 1565 |
g_printf(" Device Model: %s\n", model_type_names[model]); |
1596 |
g_printf(" Device Model: %s\n", model_string); |
| 1566 |
g_printf(" iPod Generation: %s\n", generation_names[generation]); |
1597 |
g_printf(" iPod Generation: %s\n", generation_names[generation]); |
| 1567 |
g_printf(" Adv. Capacity: %s\n", adv_capacity); |
1598 |
g_printf(" Adv. Capacity: %s\n", adv_capacity); |
| 1568 |
g_printf(" Is New: %s\n", is_new ? "YES" : "NO"); |
1599 |
g_printf(" Is New: %s\n", is_new ? "YES" : "NO"); |