home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / immcdda.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  8.6 KB  |  280 lines

  1. #ifndef _IMMCDDA_
  2.    #define _IMMCDDA_
  3. /*******************************************************************************
  4. * FILE NAME: immcdda.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IMMAudioCD                                                               *
  9. *     IMMAudioCDContents                                                       *
  10. *     IMMAudioCDContents::Cursor                                               *
  11. *                                                                              *
  12. * COPYRIGHT:                                                                   *
  13. *   IBM Open Class Library                                                     *
  14. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  15. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  16. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  17. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  18. *                                                                              *
  19. *******************************************************************************/
  20. #include <immremed.hpp>
  21. #include <iprofile.hpp>
  22. #include <immtime.hpp>
  23. #include <istring.hpp>
  24. #include <inotify.hpp>
  25. #include <immttime.hpp>
  26.  
  27. class IMMTMSFTime;
  28. class ITimer;
  29. class IMMCursorData;
  30. class IMMAudioCDContentsData;
  31. class IMMAudioCDData;
  32.  
  33. #pragma pack(4)
  34.  
  35.  
  36. class IMMAudioCDContents : public IVBase {
  37.  
  38. typedef IVBase
  39.   Inherited;
  40.  
  41. public:
  42. /*----------------------------- Constructors ---------------------------------*/
  43.   IMMAudioCDContents ( const IMMAudioCDContents& newToc);
  44.  
  45. virtual ~IMMAudioCDContents();
  46.  
  47. IMMAudioCDContents
  48.   &operator =        (const IMMAudioCDContents& newContents);
  49.  
  50. class Cursor : public IVBase {
  51. public:
  52. /*----------------------------- Constructors --------------------------------*/
  53.   Cursor        ();
  54.  
  55.   Cursor        (const IMMAudioCDContents& contents);
  56.  
  57.   Cursor        (const Cursor& cursor);
  58.  
  59. virtual ~Cursor ();
  60.  
  61. Cursor
  62.   &operator =   (const Cursor& newCursor);
  63.  
  64. /*--------------- Cursor Validation and Cursor Movement ----------------------*/
  65. virtual Cursor
  66.   &invalidate(),
  67.   &setToFirst(),
  68.   &setToNext(),
  69.   &setToPrevious(),
  70.   &setToLast(),
  71.   &setToIndex(unsigned long toIndex),
  72.   &operator ++(),
  73.   &operator --();
  74.  
  75. unsigned long
  76.   asIndex() const;
  77.  
  78. Boolean
  79.   isValid() const;
  80.  
  81.  
  82. private:
  83. friend class IMMAudioCDContents;
  84.  
  85. IMMCursorData*
  86.   fCursorData;
  87. }; // IMMAudioCDContents::Cursor
  88.  
  89. /*----------------------------- Track Information ----------------------------*/
  90. unsigned long
  91.   controlInformation (const Cursor& cursor) const,
  92.   country            (const Cursor& cursor) const,
  93.   owner              (const Cursor& cursor) const,
  94.   serialNumber       (const Cursor& cursor) const,
  95.   track              (const Cursor& cursor) const,
  96.   numberOfTracks     () const;
  97.  
  98. IString
  99.   discId             () const;
  100.  
  101. Boolean
  102.   isValid            () const;
  103.  
  104. IMMTime
  105.   endOfTrack         (const Cursor& cursor) const,
  106.   startOfTrack       (const Cursor& cursor) const;
  107.  
  108. /*----------------------------- Entry Information ----------------------------*/
  109. unsigned long
  110.   numberOfEntries    () const;
  111. IMMAudioCDContents
  112.   &addEntryAsFirst   (unsigned long trackNumber),
  113.   &addEntryAsNext    (unsigned long trackNumber,
  114.                       const Cursor& cursor),
  115.   &replaceEntryAt    (unsigned long newTrackNumber,
  116.                       const Cursor& cursor),
  117.   &removeEntryAt     (const Cursor& cursor);
  118.  
  119. protected:
  120. /*----------------------------- Constructors ---------------------------------*/
  121.   IMMAudioCDContents ( void* newContents,
  122.                        const IString& identifier,
  123.                        unsigned long tracks );
  124.   IMMAudioCDContents ();
  125.  
  126. private:
  127. /*--------------------------------- Private ----------------------------------*/
  128. friend class IMMAudioCDContents::Cursor;
  129. friend class IMMAudioCD;
  130. friend class IMMTrackMinSecFrameTime;
  131. IMMTime
  132.   timeAt(unsigned long track,Boolean begin) const;
  133.  
  134. IMMAudioCDContentsData*
  135.   fContentsData;
  136. }; // IMMAudioCDContents
  137.  
  138.  
  139. class IMMAudioCD : public IMMRemovableMedia {
  140.  
  141. typedef IMMRemovableMedia
  142.   Inherited;
  143.  
  144. public:
  145. /*----------------------------- Constructors ---------------------------------*/
  146.   IMMAudioCD  ( IProfile* profile       = 0,
  147.                 Boolean openNow         = true,
  148.                 unsigned long instance  = 0,
  149.                 Boolean openShareable   = true);
  150. virtual
  151.   ~IMMAudioCD ();
  152.  
  153. /*-------------------------------- Compact Disc Information ------------------*/
  154. static const IString
  155.   IC_IMPORTM discTitleKey,
  156.   IC_IMPORTM discProgramKey;
  157.  
  158. unsigned long
  159.   numberOfTracks          (CallType call = wait) const,
  160.   currentTrack            () const ;
  161.  
  162. Boolean
  163.   isAutoPlayEnabled       () const,
  164.   isContinuousPlayEnabled () const;
  165.  
  166. IString
  167.   discId                  (CallType call = wait) const,
  168.   upc                     (CallType call = wait) const,
  169.   trackTitle              (unsigned long track) const,
  170.   discTitle               () const;
  171.  
  172. IMMAudioCD
  173.   &enableContinuousPlay   (Boolean continuousPlay = true),
  174.   &disableContinuousPlay  (),
  175.   &enableAutoPlay         (Boolean autoPlay = true),
  176.   &disableAutoPlay        (),
  177.   &setDiscTitle           (const IString& title),
  178.   &setTrackTitle          (const IString& title,
  179.                            unsigned long track);
  180.  
  181. /*-------------------------------- Profile -----------------------------------*/
  182. IProfile
  183.   profile              () const;
  184.  
  185. IMMAudioCDContents
  186.   contents             () const;
  187. unsigned long
  188.   currentContentsEntry () const ;
  189.  
  190. IMMAudioCD
  191.   &setProfile          (IProfile& profile),
  192.   &setProgram          (const IMMAudioCDContents& program);
  193.  
  194. /*-------------------------------- Play, Stop, and Scan ----------------------*/
  195. virtual IMMAudioCD
  196.   &pause               (CallType call = wait),
  197.   &play                (const IMMTime& from = IMMTime(),
  198.                         const IMMTime& to   = IMMTime(),
  199.                         Boolean resumeIfPaused = true,
  200.                         CallType call = nowait),
  201.   &stop                (CallType call = wait),
  202.   &resume              (Boolean resume = true, CallType call = wait),
  203.   &goToEntry           (unsigned long index),
  204.   &goToEntry           (IMMAudioCDContents::Cursor cursor);
  205.  
  206. IMMAudioCD
  207.   &trackBackward       (unsigned long decrement = 1),
  208.   &trackForward        (unsigned long increment = 1),
  209.   &startScanningForward(),
  210.   &startScanningBackward();
  211.  
  212. /*----------------------- Notification Event Descriptions --------------------*/
  213. static INotificationId const
  214.   IC_IMPORTM positionTimerId,
  215.   IC_IMPORTM trackStartedId;
  216.  
  217. /*----------------------------- Audio Overrides -----------------------------*/
  218. virtual IMMAudioCD
  219.   &setVolume   (unsigned long volume,
  220.                 AudioChannel channel = all,
  221.                 const IMMMillisecondTime& over = IMMMillisecondTime(),
  222.                 CallType call = wait);
  223. virtual unsigned long
  224.   volume       (AudioChannel channel = left,
  225.                 CallType call = wait) const;
  226.  
  227. protected:
  228. /*----------------------------- Constructors ---------------------------------*/
  229.   IMMAudioCD ( unsigned long deviceIdentifier,
  230.                const IString& newAlias = IString() );
  231.  
  232. virtual Boolean
  233.   isOpenStringValid  (const IString& deviceName) const;
  234.  
  235. virtual IString
  236.   uniqueDiscIdentifier () const;
  237.  
  238. /*----------------------------- Table ----------------------------------------*/
  239. IMMAudioCDContents
  240.   getTableFromDisc   ();
  241.  
  242. private:
  243. /*--------------------------------- Private ----------------------------------*/
  244. IMMAudioCD
  245.   &setTableOfContents (const IMMAudioCDContents& newContents),
  246.   &stopT              (),
  247.   &processInternal    (const IMMNotifyEvent &evt);
  248. Boolean
  249.   moveOneTrack        (Boolean forward, unsigned long number),
  250.   goToCursor          (),
  251.   playing             ();
  252. void
  253.   putInPlayingState   (),
  254.   putInStoppedState   (),
  255.   changeTable         (),
  256.   handleScan          (unsigned long id),
  257.   handleUpdate        (unsigned long id);
  258.  
  259. enum ScanStatus
  260. {
  261.   notScanning,
  262.   scanningForward,
  263.   scanningBackward
  264. };
  265.  
  266. IMMAudioCDData*
  267.   fAudioCDData;
  268.  
  269. Boolean
  270.   fDelay;
  271.  
  272. friend class IMMAudioCDData;
  273. friend class IMMAudioCDHandler;
  274. }; // IMMAudioCD
  275.  
  276.  
  277. #pragma pack()
  278.  
  279. #endif /* _IMMCDDA_ */
  280.