/*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ static bool read_toc_win32 (void *p_user_data) { _img_private_t *p_env = p_user_data; bool ret; #if !(defined (WIN32) || defined (_XBOX)) if( p_env->hASPI ) { ret = read_toc_aspi( p_env ); } else { ret = read_toc_win32ioctl( p_env ); } #else ret = read_toc_win32ioctl( p_env ); #endif if (ret) p_env->gen.toc_init = true ; return ret; }
/*! Read and cache the CD's Track Table of Contents and track info. Return true if successful or false if an error. */ static bool read_toc_win32 (void *p_user_data) { _img_private_t *p_env = p_user_data; bool ret; ret = read_toc_win32ioctl( p_env ); if (ret) p_env->gen.toc_init = true ; return ret; }
/*! Get disc type associated with cd object. */ discmode_t get_discmode_win32ioctl (_img_private_t *p_env) { track_t i_track; discmode_t discmode; if (!p_env) return CDIO_DISC_MODE_ERROR; discmode = dvd_discmode_win32ioctl(p_env); if (CDIO_DISC_MODE_NO_INFO != discmode) return discmode; if (!p_env->gen.toc_init) read_toc_win32ioctl (p_env); if (!p_env->gen.toc_init) return CDIO_DISC_MODE_ERROR; for (i_track = p_env->gen.i_first_track; i_track < p_env->gen.i_first_track + p_env->gen.i_tracks ; i_track ++) { track_format_t track_fmt=get_track_format_win32ioctl(p_env, i_track); switch(track_fmt) { case TRACK_FORMAT_AUDIO: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DA; break; case CDIO_DISC_MODE_CD_DA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_XA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_XA; break; case CDIO_DISC_MODE_CD_XA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_DATA: switch(discmode) { case CDIO_DISC_MODE_NO_INFO: discmode = CDIO_DISC_MODE_CD_DATA; break; case CDIO_DISC_MODE_CD_DATA: case CDIO_DISC_MODE_CD_MIXED: case CDIO_DISC_MODE_ERROR: /* No change*/ break; default: discmode = CDIO_DISC_MODE_CD_MIXED; } break; case TRACK_FORMAT_ERROR: default: discmode = CDIO_DISC_MODE_ERROR; } } return discmode; }