예제 #1
0
        public static BASS_CD_TOC BASS_CD_GetTOC(int drive, BASSCDTOCMode mode)
        {
            BASS_CD_TOC_INTERNAL bass_CD_TOC_INTERNAL = default(BASS_CD_TOC_INTERNAL);

            bass_CD_TOC_INTERNAL.tracks = new BASS_CD_TOC_TRACK[100];
            if (BassCd.BASS_CD_GetTOC(drive, mode, ref bass_CD_TOC_INTERNAL))
            {
                BASS_CD_TOC bass_CD_TOC = new BASS_CD_TOC();
                bass_CD_TOC.first = bass_CD_TOC_INTERNAL.first;
                bass_CD_TOC.last  = bass_CD_TOC_INTERNAL.last;
                if (bass_CD_TOC_INTERNAL.NumberOfTracks > 0)
                {
                    for (int i = 0; i < bass_CD_TOC_INTERNAL.NumberOfTracks; i++)
                    {
                        bass_CD_TOC.tracks.Add(bass_CD_TOC_INTERNAL.tracks[i]);
                    }
                }
                return(bass_CD_TOC);
            }
            return(null);
        }
예제 #2
0
        public static bool BASS_CD_GetTOC(int drive, BASSCDTOCMode mode, BASS_CD_TOC toc)
        {
            BASS_CD_TOC_INTERNAL bass_CD_TOC_INTERNAL = default(BASS_CD_TOC_INTERNAL);

            bass_CD_TOC_INTERNAL.tracks = new BASS_CD_TOC_TRACK[100];
            if (BassCd.BASS_CD_GetTOC(drive, mode, ref bass_CD_TOC_INTERNAL))
            {
                toc.first = bass_CD_TOC_INTERNAL.first;
                toc.last  = bass_CD_TOC_INTERNAL.last;
                toc.tracks.Clear();
                if (bass_CD_TOC_INTERNAL.NumberOfTracks > 0)
                {
                    for (int i = 0; i < bass_CD_TOC_INTERNAL.NumberOfTracks; i++)
                    {
                        toc.tracks.Add(bass_CD_TOC_INTERNAL.tracks[i]);
                    }
                }
                return(true);
            }
            toc.first = 0;
            toc.last  = 0;
            toc.tracks.Clear();
            return(false);
        }