All pastes #29394 Raw Edit

twisted

public text v1 · immutable
#29394 ·published 2005-11-19 23:45 UTC
rendered paste body
Index: src/file.c 
=================================================================== 
RCS file: /cvsroot/gtkpod/gtkpod/src/file.c,v 
retrieving revision 1.144 
diff -u -p -r1.144 file.c 
--- src/file.c 15 Oct 2005 17:04:38 -0000 1.144 
+++ src/file.c 7 Nov 2005 18:39:49 -0000 
@@ -80,6 +80,19 
@@ gint determine_file_type (gchar *path) else if (g_strcasecmp (suf, ".m4p") == 0) type = FILE_TYPE_M4P; else if (g_strcasecmp (suf, ".m4b") == 0) type = FILE_TYPE_M4B; else if (g_strcasecmp (suf, ".wav") == 0) type = FILE_TYPE_WAV; 
+ /* TODO: Currently all video extensions are treated as m4v. */ 
+ else if (g_strcasecmp (suf, ".m4v") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".mp4") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".mpg") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".mpeg") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".avi") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".mov") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".M4V") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".MP4") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".MPG") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".MPEG") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".AVI") == 0) type = FILE_TYPE_M4V; 
+ else if (g_strcasecmp (suf, ".MOV") == 0) type = FILE_TYPE_M4V; else if (g_strcasecmp (suf, ".m3u") == 0) type = FILE_TYPE_M3U; else if (g_strcasecmp (suf, ".pls") == 0) type = FILE_TYPE_PLS; } 
@@ -148,6 +161,7 
@@ add_playlist_by_filename (iTunesDB *itdb case FILE_TYPE_M4P: case FILE_TYPE_M4B: case FILE_TYPE_WAV: 
+ case FILE_TYPE_M4V: gtkpod_warning (_("'%s' is a not a known playlist file.\n\n"), plfile); g_free(plname); 
@@ -838,6 +852,9 
@@ Track *get_track_info_from_file (gchar * case FILE_TYPE_WAV: nti = wav_get_file_info (name); break; 
+ case FILE_TYPE_M4V: 
+ nti = m4v_get_file_info (name); 
+ break; case FILE_TYPE_UNKNOWN: gtkpod_warning (_("The following track could not be processed (filetype unknown): '%s'\n"), name_utf8); g_free (name_utf8); 
@@ -1800,6 +1817,7 
@@ gboolean add_track_by_filename (iTunesDB case FILE_TYPE_M4A: case FILE_TYPE_M4P: case FILE_TYPE_M4B: 
+ case FILE_TYPE_M4V: /* TODO? */ case FILE_TYPE_UNKNOWN: break; } 
@@ -1953,6 +1971,7 
@@ static gboolean file_write_info (gchar * return mp4_write_file_info (name, track); case FILE_TYPE_WAV: return wav_write_file_info (name, track); 
+ case FILE_TYPE_M4V: /* TODO? */ case FILE_TYPE_M3U: case FILE_TYPE_PLS: case FILE_TYPE_UNKNOWN: 
@@ -2438,6 +2457,7 
@@ gboolean get_gain (Track *track) case FILE_TYPE_M4P: /* FIXME */ case FILE_TYPE_M4B: /* FIXME */ case FILE_TYPE_WAV: /* FIXME */ 
+ case FILE_TYPE_M4V: /* FIXME */ case FILE_TYPE_UNKNOWN: gtkpod_warning ( _("Normalization failed: file type not supported.\n")); 
Index: src/file.h 
=================================================================== 
RCS file: /cvsroot/gtkpod/gtkpod/src/file.h,v 
retrieving revision 1.45 
diff -u -p -r1.45 file.h 
--- src/file.h 20 Jun 2005 14:32:06 -0000 1.45 
+++ src/file.h 7 Nov 2005 18:39:49 -0000 
@@ -49,6 +49,7 
@@ typedef enum FILE_TYPE_M4P, FILE_TYPE_M4B, FILE_TYPE_WAV, + FILE_TYPE_M4V, FILE_TYPE_M3U, FILE_TYPE_PLS } FileType; 
Index: src/misc_track.c 
=================================================================== 
RCS file: /cvsroot/gtkpod/gtkpod/src/misc_track.c,v 
retrieving revision 1.27 
diff -u -p -r1.27 misc_track.c 
--- src/misc_track.c 24 Sep 2005 04:20:24 -0000 1.27 
+++ src/misc_track.c 7 Nov 2005 18:39:52 -0000 
@@ -803,6 +803,7 
@@ Playlist *add_text_plain_to_playlist (iT case FILE_TYPE_M4P: case FILE_TYPE_M4B: case FILE_TYPE_WAV: 
+ case FILE_TYPE_M4V: if (!pl) { /* no playlist yet -- create new one */ pl = add_new_pl_user_name (itdb, NULL, 
Index: src/wavfile.c 
=================================================================== 
RCS file: /cvsroot/gtkpod/gtkpod/src/wavfile.c,v 
retrieving revision 1.9 
diff -u -p -r1.9 wavfile.c 
--- src/wavfile.c 20 Sep 2005 09:50:13 -0000 1.9 
+++ src/wavfile.c 7 Nov 2005 18:39:52 -0000 
@@ -90,6 +90,14 
@@ static gint read_le_short(FILE * file, g } 
+Track *m4v_get_file_info (gchar *filename) 
+{ 
+ /* FIXME: this is a hack! Move somewhere more appropriate! */ 
+ Track *track = NULL; + track = gp_track_new (); 
+ track->filetype = g_strdup ("M4V video file"); + return track; 
+} Track *wav_get_file_info (gchar *filename) { 
Index: src/wavfile.h 
=================================================================== 
RCS file: /cvsroot/gtkpod/gtkpod/src/wavfile.h,v 
retrieving revision 1.6 
diff -u -p -r1.6 wavfile.h 
--- src/wavfile.h 17 Jun 2005 13:30:05 -0000 1.6 
+++ src/wavfile.h 7 Nov 2005 18:39:52 -0000 
@@ -34,4 +34,7 
@@ gboolean wav_write_file_info (gchar *filename, Track *track); Track *wav_get_file_info (gchar *name); 
+ 
+/* FIXME: this is a hack! Move somewhere more appropriate! */ 
+Track *m4v_get_file_info (gchar *name); #endif