summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2006-04-05 14:10:38 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2006-04-05 14:10:38 +0000
commit5605e446abae537bac1d5f8f90056cebbdb1c26f (patch)
tree10b41469d88eb359c88c26d348699cbbea803c30 /src
parent7b3e3b26fb63b542bc6225807009ec88e4b6233b (diff)
downloadlibgpod-5605e446abae537bac1d5f8f90056cebbdb1c26f.tar.gz
libgpod-5605e446abae537bac1d5f8f90056cebbdb1c26f.tar.xz
libgpod-5605e446abae537bac1d5f8f90056cebbdb1c26f.zip
2006-04-03 Jorg Schuler <jcsjcs at users.sourceforge.net>
* itdb.h: flag1 -> has_artwork * itdb_track.c: (itdb_track_set_thumbnails, itdb_remove_thumbnails) set has_artwork flag correctly. 2006-04-01 Jorg Schuler <jcsjcs at users.sourceforge.net> * itdb.h: unk178 -> mark_unplayed * itdb_itunesdb.c: reset the mark_unplayed flag when playcount is detected. 2006-03-31 Jorg Schuler <jcsjcs at users.sourceforge.net> * po/es.po: replaced with version from Alejandro Lamas who maintains the gtkpod translation as well. 2006-03-29 Jorg Schuler <jcsjcs at users.sourceforge.net> * itunesdb.c: set filetype identifier when transfering track to the iPod. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1227 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src')
-rw-r--r--src/itdb.h11
-rw-r--r--src/itdb_device.c21
-rw-r--r--src/itdb_itunesdb.c15
-rw-r--r--src/itdb_track.c16
4 files changed, 47 insertions, 16 deletions
diff --git a/src/itdb.h b/src/itdb.h
index 5237ef1..dec3296 100644
--- a/src/itdb.h
+++ b/src/itdb.h
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-03-24 00:38:39 jcs>
+/* Time-stamp: <2006-04-04 23:41:58 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -631,8 +631,9 @@ struct _Itdb_Track
(always 0x01010100?), zero otherwise */
guint32 unk152; /* unknown */
guint32 unk156, unk160;
- guint8 flag1; /* basically unknown. set to 0x02 for
- * podcasts, 0x00 otherwise. */
+ guint8 has_artwork; /* 0x01: artwork is present. 0x02: no artwork is
+ present for this track (used by the iPod to
+ decide whether to display Artwork or not) */
guint8 flag2; /* "Skip when shuffling" when set to 0x01, set
to 0x00 otherwise. .m4b and .aa files always
seem to be skipped when shuffling, however */
@@ -652,7 +653,9 @@ struct _Itdb_Track
("ULST"), 0x00 otherwise */
guint8 movie_flag; /* set to 0x01 if it's a movie file, 0x00
otherwise */
- guint8 unk178; /* unknown (sometimes 0x01) */
+ guint8 mark_unplayed; /* A value of 0x02 marks a podcast as unplayed
+ on the iPod (bullet) once played it is set to
+ 0x01. Non-podcasts have this set to 0x01. */
guint8 unk179; /* unknown (always 0x00 so far) */
guint32 unk180, unk184;
guint32 samplecount;/* Number of samples in the song. First observed
diff --git a/src/itdb_device.c b/src/itdb_device.c
index 91066ee..f8812e9 100644
--- a/src/itdb_device.c
+++ b/src/itdb_device.c
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-03-21 17:22:25 jcs>
+/* Time-stamp: <2006-04-05 22:53:35 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -45,18 +45,26 @@ static const Itdb_IpodModel ipod_model_table [] = {
{"Unknown", 0, MODEL_TYPE_UNKNOWN, UNKNOWN_GENERATION},
/* First Generation */
+ /* Mechanical buttons arranged around rotating "scroll wheel".
+ 8513, 8541 and 8709 are Mac types, 8697 is PC */
{"8513", 5 * GB, MODEL_TYPE_REGULAR, FIRST_GENERATION},
{"8541", 5 * GB, MODEL_TYPE_REGULAR, FIRST_GENERATION},
{"8697", 5 * GB, MODEL_TYPE_REGULAR, FIRST_GENERATION},
{"8709", 10 * GB, MODEL_TYPE_REGULAR, FIRST_GENERATION},
/* Second Generation */
+ /* Same buttons as First Generation but around touch-sensitive
+ * "touch wheel". 8737 and 8738 are Mac types, 8740 and 8741
+ are PC */
{"8737", 10 * GB, MODEL_TYPE_REGULAR, SECOND_GENERATION},
{"8740", 10 * GB, MODEL_TYPE_REGULAR, SECOND_GENERATION},
{"8738", 20 * GB, MODEL_TYPE_REGULAR, SECOND_GENERATION},
{"8741", 20 * GB, MODEL_TYPE_REGULAR, SECOND_GENERATION},
/* Third Generation */
+ /* Touch sensitive buttons and arranged in a line above "touch
+ wheel". Docking connector was introduced here, same models
+ for Mac and PC from now on. */
{"8976", 10 * GB, MODEL_TYPE_REGULAR, THIRD_GENERATION},
{"8946", 15 * GB, MODEL_TYPE_REGULAR, THIRD_GENERATION},
{"9460", 15 * GB, MODEL_TYPE_REGULAR, THIRD_GENERATION},
@@ -64,8 +72,8 @@ static const Itdb_IpodModel ipod_model_table [] = {
{"8948", 30 * GB, MODEL_TYPE_REGULAR, THIRD_GENERATION},
{"9245", 40 * GB, MODEL_TYPE_REGULAR, THIRD_GENERATION},
-
/* Fourth Generation */
+ /* Buttons are now integrated into the "touch wheel". */
{"9282", 20 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION},
{"9787", 25 * GB, MODEL_TYPE_REGULAR_U2, FOURTH_GENERATION},
{"9268", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION},
@@ -91,6 +99,7 @@ static const Itdb_IpodModel ipod_model_table [] = {
{"9807", 6 * GB, MODEL_TYPE_MINI_GREEN, SECOND_GENERATION},
/* Photo / Fourth Generation */
+ /* Buttons are integrated into the "touch wheel". */
{"9829", 30 * GB, MODEL_TYPE_COLOR, FOURTH_GENERATION},
{"9585", 40 * GB, MODEL_TYPE_COLOR, FOURTH_GENERATION},
{"9586", 60 * GB, MODEL_TYPE_COLOR, FOURTH_GENERATION},
@@ -101,6 +110,7 @@ static const Itdb_IpodModel ipod_model_table [] = {
{"9725", GB, MODEL_TYPE_SHUFFLE, FOURTH_GENERATION},
/* Nano / Fifth Generation */
+ /* Buttons are integrated into the "touch wheel". */
{"A350", GB * 1, MODEL_TYPE_NANO_WHITE, FIFTH_GENERATION},
{"A352", GB * 1, MODEL_TYPE_NANO_BLACK, FIFTH_GENERATION},
{"A004", GB * 2, MODEL_TYPE_NANO_WHITE, FIFTH_GENERATION},
@@ -109,20 +119,21 @@ static const Itdb_IpodModel ipod_model_table [] = {
{"A107", GB * 4, MODEL_TYPE_NANO_BLACK, FIFTH_GENERATION},
/* Video / Fifth Generation */
+ /* Buttons are integrated into the "touch wheel". */
{"A002", GB * 30, MODEL_TYPE_VIDEO_WHITE, FIFTH_GENERATION},
{"A146", GB * 30, MODEL_TYPE_VIDEO_BLACK, FIFTH_GENERATION},
{"A003", GB * 60, MODEL_TYPE_VIDEO_WHITE, FIFTH_GENERATION},
{"A147", GB * 60, MODEL_TYPE_VIDEO_BLACK, FIFTH_GENERATION},
/* HP iPods, need contributions for this table */
- {"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION},
- {"S492", 30 * GB, MODEL_TYPE_COLOR, FOURTH_GENERATION},
+ /* Buttons are integrated into the "touch wheel". */
+ {"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION},
+ {"S492", 30 * GB, MODEL_TYPE_COLOR, FOURTH_GENERATION},
/* No known model number -- create a Device/SysInfo file with
* one entry, e.g.:
ModelNumStr: Mmobile1
*/
-
{"mobile1", -1, MODEL_TYPE_MOBILE_1, MOBILE_GENERATION},
{NULL, 0, 0, 0}
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 7a4c768..0665d7c 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-03-24 00:40:16 jcs>
+/* Time-stamp: <2006-04-04 23:42:19 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -2063,14 +2063,14 @@ static glong get_mhit (FImport *fimp, glong mhit_seek)
{
track->unk156 = get32lint (cts, seek+156);
track->unk160 = get32lint (cts, seek+160);
- track->flag1 = get8int (cts, seek+164);
+ track->has_artwork = get8int (cts, seek+164);
track->flag2 = get8int (cts, seek+165);
track->flag3 = get8int (cts, seek+166);
track->flag4 = get8int (cts, seek+167);
track->dbid2 = get64lint (cts, seek+168);
track->lyrics_flag = get8int (cts, seek+176);
track->movie_flag = get8int (cts, seek+177);
- track->unk178 = get8int (cts, seek+178);
+ track->mark_unplayed = get8int (cts, seek+178);
track->unk179 = get8int (cts, seek+179);
track->unk180 = get32lint (cts, seek+180);
track->unk184 = get32lint (cts, seek+184);
@@ -2198,6 +2198,10 @@ static glong get_mhit (FImport *fimp, glong mhit_seek)
track->bookmark_time = playcount->bookmark_time;
track->playcount += playcount->playcount;
+ if (playcount->playcount != 0)
+ { /* unmark the 'unplayed' flag */
+ track->mark_unplayed = 0x01;
+ }
track->recent_playcount = playcount->playcount;
g_free (playcount);
}
@@ -2663,6 +2667,7 @@ Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error)
* should be modified by the repository name.
*/
ipod_parse_artwork_db (itdb);
+
}
g_free (filename);
}
@@ -3228,14 +3233,14 @@ static void mk_mhit (WContents *cts, Itdb_Track *track)
/* since iTunesDB version 0x0c */
put32lint (cts, track->unk156);
put32lint (cts, track->unk160);
- put8int (cts, track->flag1);
+ put8int (cts, track->has_artwork);
put8int (cts, track->flag2);
put8int (cts, track->flag3);
put8int (cts, track->flag4);
put64lint (cts, track->dbid2);
put8int (cts, track->lyrics_flag);
put8int (cts, track->movie_flag);
- put8int (cts, track->unk178);
+ put8int (cts, track->mark_unplayed);
put8int (cts, track->unk179);
put32lint (cts, track->unk180);
put32lint (cts, track->unk184);
diff --git a/src/itdb_track.c b/src/itdb_track.c
index 9f051a9..51d0929 100644
--- a/src/itdb_track.c
+++ b/src/itdb_track.c
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-03-23 23:30:34 jcs>
+/* Time-stamp: <2006-04-04 00:08:14 jcs>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -86,6 +86,14 @@ static void itdb_track_set_defaults (Itdb_Track *tr)
g_return_if_fail (tr);
g_return_if_fail (tr->itdb);
+ if (tr->mark_unplayed == 0)
+ {
+ /* don't have the iPod mark this track with a bullet as
+ unplayed. Should be set to 0x02 for podcasts that have not
+ yet been played. */
+ tr->mark_unplayed = 0x01;
+ }
+
/* The exact meaning of unk126 is unknown, but always seems to be
0xffff for MP3/AAC tracks, 0x0 for uncompressed tracks (like WAVE
format), 0x1 for Audible. */
@@ -346,10 +354,12 @@ gboolean itdb_track_set_thumbnails (Itdb_Track *track,
/* for some reason artwork->artwork_size is always
track->artwork_size + track->artwork_count */
track->artwork->artwork_size += track->artwork_count;
+ /* indicate artwork is present */
+ track->has_artwork = 0x01;
}
else
{
- itdb_artwork_remove_thumbnails (track->artwork);
+ itdb_track_remove_thumbnails (track);
}
return result;
@@ -362,6 +372,8 @@ void itdb_track_remove_thumbnails (Itdb_Track *track)
itdb_artwork_remove_thumbnails (track->artwork);
track->artwork_size = 0;
track->artwork_count = 0;
+ /* indicate no artwork is present */
+ track->has_artwork = 0x02;
}