[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Graveman-cvs] Changes to graveman/current/src/cdrdao.c
From: |
sylvain cresto |
Subject: |
[Graveman-cvs] Changes to graveman/current/src/cdrdao.c |
Date: |
Tue, 03 May 2005 21:31:15 -0400 |
Index: graveman/current/src/cdrdao.c
diff -u graveman/current/src/cdrdao.c:1.13 graveman/current/src/cdrdao.c:1.14
--- graveman/current/src/cdrdao.c:1.13 Mon Apr 4 01:37:42 2005
+++ graveman/current/src/cdrdao.c Wed May 4 01:31:06 2005
@@ -52,6 +52,7 @@
#define CDRDAO_OF "of "
#define CDRDAO_BUFFERS "Buffers "
#define CDRDAO_INCOMPATIBLE_MEDIUM "Medium in recorder device is not empty and
not appendable"
+#define CDRDAO_SESSIONS "Sessions "
/* detection des media */
#define CDRDAO_CDRW "CD-RW"
@@ -63,16 +64,7 @@
#define CDRDAO_APPENDABLE "Appendable"
#define CDRDAO_NA ": n/a"
#define CDRDAO_CD "CD"
-
-/*
-static gchar *get_blank_type(Tgrave *Ag, gint Atypemedia)
-{
- gboolean *Luseautoblank = (gboolean *) sc_grave_get_data(Ag, "useautoblank");
-
- if (!*Luseautoblank || (!(Atypemedia & _MEDIA_CDRW))) return g_strdup("");
-
- return g_strdup_printf("blank=%s", conf_get_boolean("fastblank") == TRUE ?
"fast" : "all");
-}*/
+#define SESSION_ZERO ": 0"
/* callback appele lorsque cdrdao grave les pistes */
gboolean cdrdao_grave_callback(GIOChannel *Astd, GIOCondition Acond, gpointer
Adata)
@@ -357,10 +349,6 @@
}
}
-/* Lbuftitle = get_title(Lnbrgravure, Lcurcd, Ldosimul);
- gtk_label_set_text(GTK_LABEL(Ltitle), Lbuftitle);
- g_free(Lbuftitle);*/
-
/* faut il ejecter le CD-R apres l'operation ?
* oui si l'utilisateur a cocher la case "ejecter le cd" ou
* si il faut realiser d'autre gravure sur d'autres CD-R */
@@ -490,11 +478,12 @@
gint *Lpid = (gint *)sc_grave_get_data(Ag, "pid");
GString *Loutput;
gchar *Lcdprg = conf_get_string("cdrdao");
+ gboolean Lskipnocd = FALSE;
if (!Lcdprg || !*Lcdprg) return 0;
g_snprintf(Lcommandline, sizeof(Lcommandline)-1, "%s disk-info --device %s",
Lcdprg, DRIVE_DEV(Adevice));
-_DEB("execution de [%s]\n", Lcommandline);
+_DEB("execution de [%s]", Lcommandline);
if (!g_shell_parse_argv(Lcommandline, &Lnbrarg, &Lcmd, Aerror)) return 0;
@@ -538,33 +527,45 @@
for (i=0; Larrbuf[i]; i++) {
if (!*Larrbuf[i]) continue;
if (!strncmp(Larrbuf[i], CDRDAO_CDRW, strlen(CDRDAO_CDRW))) {
+_DEB("cdrdao1 => '%s'", Larrbuf[i]);
if (strstr(Larrbuf[i], CDRDAO_YES)) {
Llu += _MEDIA_CDRW;
}
} else if (!strncmp(Larrbuf[i], CDRDAO_TOCTYPE, strlen(CDRDAO_TOCTYPE))) {
+_DEB("cdrdao2 => '%s'", Larrbuf[i]);
if (strstr(Larrbuf[i], CDRDAO_CD)) {
Llu += _MEDIA_CD;
}
} else if (!strncmp(Larrbuf[i], CDRDAO_CDR, strlen(CDRDAO_CDR))) {
+_DEB("cdrdao3 => '%s'", Larrbuf[i]);
if (!strstr(Larrbuf[i], CDRDAO_NA)) {
Llu += _MEDIA_CDR;
+ } else {
+ Lskipnocd = TRUE;
}
} else if (!strncmp(Larrbuf[i], CDRDAO_EMPTY, strlen(CDRDAO_EMPTY))) {
+_DEB("cdrdao4 => '%s'", Larrbuf[i]);
if (strstr(Larrbuf[i], CDRDAO_YES)) {
Llu += _MEDIA_BLANK;
} else {
Llu += _MEDIA_NOBLANK;
}
} else if (!strncmp(Larrbuf[i], CDRDAO_APPENDABLE,
strlen(CDRDAO_APPENDABLE))) {
+_DEB("cdrdao5 => '%s'", Larrbuf[i]);
if (!strstr(Larrbuf[i], CDRDAO_NO)) {
Llu += _MEDIA_APPENDABLE;
}
+ } else if (!strncmp(Larrbuf[i], CDRDAO_SESSIONS, strlen(CDRDAO_SESSIONS)))
{
+_DEB("cdrdao6 => '%s'", Larrbuf[i]);
+ if (!strstr(Larrbuf[i], SESSION_ZERO)) {
+ Lskipnocd = FALSE;
+ }
}
}
g_strfreev(Larrbuf);
- return Llu;
+ return Lskipnocd ? _MEDIA_NONE : Llu;
}
- [Graveman-cvs] Changes to graveman/current/src/cdrdao.c,
sylvain cresto <=