home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / cdinfo / ccdinfo.inl < prev    next >
Text File  |  1998-03-26  |  1KB  |  45 lines

  1. // CCDInfo.INL : inlines for CDInfo class
  2. //
  3. // This is a part of the Active Template Library.
  4. // Copyright (C) 1996-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Active Template Library Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Active Template Library product.
  12.  
  13. inline short CDInfo::GetNumberOfTracks()
  14. {
  15.     return m_nNumberOfTracks;
  16. }
  17.  
  18. inline void CDInfo::SetNumberOfTracks(short nTracks)
  19. {
  20.     m_nNumberOfTracks = nTracks;
  21. }
  22.  
  23. inline short CDInfo::GetTrackLength(short nTrack)
  24. {
  25.     if (nTrack>0 && nTrack<=m_nNumberOfTracks)
  26.         return m_nTrackLength[nTrack-1];
  27.     else
  28.         return 0;
  29. }
  30.  
  31. inline void CDInfo::SetTrackLength(short nTrack, short nNewLength)
  32. {
  33.     if (nTrack>0 && nTrack<=m_nNumberOfTracks)
  34.         m_nTrackLength[nTrack-1] = nNewLength;
  35. }
  36.  
  37. inline short CDInfo::GetTotalLength()
  38. {
  39.     short nTotalLength = 0;
  40.     short nTrack;
  41.     for (nTrack=0; nTrack<m_nNumberOfTracks; nTrack++)
  42.         nTotalLength = (short)(nTotalLength + m_nTrackLength[nTrack]);
  43.     return nTotalLength;
  44. }
  45.