home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / mmstereo / mltcd.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.3 KB  |  143 lines

  1. /******************************************************************************
  2. * .FILE:         mltcd.hpp                                                    *
  3. *                                                                             *
  4. * .DESCRIPTION:  Multimedia Stereo Sample:             Class Definition       *
  5. *                                                                             *
  6. * .CLASSES:      CD                                                           *
  7. *                CDHandler                                                    *
  8. *                CDObserver                                                   *
  9. *                                                                             *
  10. * .COPYRIGHT:                                                                 *
  11. *    Licensed Material - Program-Property of IBM                              *
  12. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  13. *                                                                             *
  14. * .DISCLAIMER:                                                                *
  15. *   The following [enclosed] code is sample code created by IBM               *
  16. *   Corporation.  This sample code is not part of any standard IBM product    *
  17. *   and is provided to you solely for the purpose of assisting you in the     *
  18. *   development of your applications.  The code is provided 'AS IS',          *
  19. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  20. *   arising out of your use of the sample code, even if they have been        *
  21. *   advised of the possibility of such damages.                               *
  22. *                                                                             *
  23. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  24. *                                                                             *
  25. ******************************************************************************/
  26. #ifndef _MLTCD_
  27. #define _MLTCD_
  28. #include <immcdda.hpp>
  29. #include <ifont.hpp>
  30. #include <immttime.hpp>
  31. #include <inotifev.hpp>
  32. #include <icolor.hpp>
  33. #include <ianimbut.hpp>
  34. #include <icmdhdr.hpp>
  35. #include <istattxt.hpp>
  36. #include <iobservr.hpp>
  37. #include <immplypn.hpp>
  38. #include <immplyhd.hpp>
  39. #include "mltcd.h"
  40.  
  41. class CDHandler;
  42. class CDObserver;
  43.  
  44. class CD  : public IMMPlayerPanel {
  45. //**************************************************************************
  46. // Class:   CD                                                             *
  47. //                                                                         *
  48. // Purpose: Provide a CD player.                                           *
  49. //          It is a subclass of IMMPlayerPanel                             *
  50. //                                                                         *
  51. //**************************************************************************
  52.   public:
  53.  
  54.     CD( IMMAudioCD*       cd,
  55.         unsigned long     windowid,
  56.         IWindow*          parent,
  57.         IWindow*          owner);
  58.  
  59.     ~CD();
  60.  
  61.     IAnimatedButton
  62.      *ejectButton              () const,
  63.      *scanForwardButton        () const,
  64.      *scanBackwardButton       () const;
  65.     void
  66.       playTimeEvent();
  67.  
  68.  
  69. /*-------------------------------- Device ------------------------------------*/
  70.     IMMAudioCD*
  71.       cdPlayer() const;
  72.  
  73.     IStaticText
  74.       name,
  75.       discReadout,
  76.       readout;
  77.  
  78.   private:
  79.     IMMAudioCD
  80.       *pCDPlayer;
  81.  
  82.     IAnimatedButton
  83.       *trackF,
  84.       *trackB,
  85.       *scanF,
  86.       *scanB,
  87.       *eject;
  88.  
  89.     CDHandler
  90.       *handler;
  91.  
  92.     CDObserver
  93.       *observer;
  94.  
  95. };
  96.  
  97. class CDHandler : public IMMPlayerPanelHandler {
  98. typedef IMMPlayerPanelHandler
  99.   Inherited;
  100. //**************************************************************************
  101. // Class:   CDHandler                                                      *
  102. //                                                                         *
  103. // Purpose: Provide a Handler for processing the track and scan buttons    *
  104. //                                                                         *
  105. //**************************************************************************
  106.   public:
  107.  
  108.     CDHandler ();
  109.  
  110. /*---------------------------- Event Dispatching -----------------------------*/
  111.     virtual Boolean
  112.       command (ICommandEvent& event);
  113.  
  114. /*----------------------------- Event Processing -----------------------------*/
  115.     virtual Boolean
  116.       rewind      (const IMMPlayerPanel& panel),
  117.       fastForward (const IMMPlayerPanel& panel);
  118.  
  119. };
  120.  
  121. class CDObserver : public IObserver {
  122. typedef IObserver
  123.   Inherited;
  124. //**************************************************************************
  125. // Class:   CDObserver                                                     *
  126. //                                                                         *
  127. // Purpose: Provide an Observer for processing the play notifications.     *
  128. //                                                                         *
  129. //**************************************************************************
  130.   public:
  131.  
  132.     CDObserver (CD& cdPanel);
  133.  
  134.     virtual CDObserver
  135.       &dispatchNotificationEvent(const INotificationEvent&);
  136.  
  137.   private:
  138.     CD
  139.       &panel;
  140.  
  141. };
  142. #endif
  143.