home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / MPLAYER.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  12.1 KB  |  303 lines

  1. //----------------------------------------------------------------------------
  2. // MPlayer.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: MPlayer.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef MPlayerHPP
  6. #define MPlayerHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef MenusHPP
  9. #include <Menus.hpp>
  10. #endif
  11.  
  12. #ifndef SysUtilsHPP
  13. #include <SysUtils.hpp>
  14. #endif
  15.  
  16. #ifndef DialogsHPP
  17. #include <Dialogs.hpp>
  18. #endif
  19.  
  20. #ifndef MMSystemHPP
  21. #include <MMSystem.hpp>
  22. #endif
  23.  
  24. #ifndef MessagesHPP
  25. #include <Messages.hpp>
  26. #endif
  27.  
  28. #ifndef GraphicsHPP
  29. #include <Graphics.hpp>
  30. #endif
  31.  
  32. #ifndef FormsHPP
  33. #include <Forms.hpp>
  34. #endif
  35.  
  36. #ifndef ControlsHPP
  37. #include <Controls.hpp>
  38. #endif
  39.  
  40. #ifndef ClassesHPP
  41. #include <Classes.hpp>
  42. #endif
  43.  
  44. #ifndef WindowsHPP
  45. #include <Windows.hpp>
  46. #endif
  47.  
  48. #ifndef SystemHPP
  49. #include <System.hpp>
  50. #endif
  51.  
  52. namespace Mplayer
  53. {
  54. //-- type declarations -------------------------------------------------------
  55. enum TMPBtnType { btPlay, btPause, btStop, btNext, btPrev, btStep, btBack, btRecord, btEject };
  56.  
  57. typedef Set<TMPBtnType, btPlay, btEject>  TButtonSet;
  58.  
  59. enum TMPGlyph { mgEnabled, mgDisabled, mgColored };
  60.  
  61. struct TMPButton
  62. {
  63.     System::Boolean Visible;
  64.     System::Boolean Enabled;
  65.     System::Boolean Colored;
  66.     System::Boolean Auto;
  67.     Graphics::TBitmap *Bitmaps[3];
  68. } ;
  69.  
  70. enum TMPDeviceTypes { dtAutoSelect, dtAVIVideo, dtCDAudio, dtDAT, dtDigitalVideo, dtMMMovie, dtOther, 
  71.     dtOverlay, dtScanner, dtSequencer, dtVCR, dtVideodisc, dtWaveAudio };
  72.  
  73. enum TMPTimeFormats { tfMilliseconds, tfHMS, tfMSF, tfFrames, tfSMPTE24, tfSMPTE25, tfSMPTE30, tfSMPTE30Drop, 
  74.     tfBytes, tfSamples, tfTMSF };
  75.  
  76. enum TMPModes { mpNotReady, mpStopped, mpPlaying, mpRecording, mpSeeking, mpPaused, mpOpen };
  77.  
  78. enum TMPNotifyValues { nvSuccessful, nvSuperseded, nvAborted, nvFailure };
  79.  
  80. enum TMPDevCaps { mpCanStep, mpCanEject, mpCanPlay, mpCanRecord, mpUsesWindow };
  81.  
  82. typedef Set<TMPDevCaps, mpCanStep, mpUsesWindow>  TMPDevCapsSet;
  83.  
  84. typedef void __fastcall (__closure *EMPNotify)(System::TObject *Sender, TMPBtnType Button, System::Boolean 
  85.     &DoDefault);
  86.  
  87. typedef void __fastcall (__closure *EMPPostNotify)(System::TObject *Sender, TMPBtnType Button);
  88.  
  89. class __declspec(delphiclass) EMCIDeviceError;
  90. class __declspec(pascalimplementation) EMCIDeviceError : public Sysutils::Exception
  91. {
  92.     typedef EMCIDeviceError ThisClass;
  93.     typedef Sysutils::Exception inherited;
  94.     
  95. public:
  96.     /* !! Exception.Create */ __fastcall EMCIDeviceError(const System::AnsiString Msg) : Sysutils::Exception(
  97.         Msg) { }
  98.     /* !! Exception.CreateFmt */ __fastcall EMCIDeviceError(const System::AnsiString Msg, const TVarRec 
  99.         *Args, const System::Integer Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  100.     /* !! Exception.CreateRes */ __fastcall EMCIDeviceError(System::Integer Ident) : Sysutils::Exception(
  101.         Ident) { }
  102.     /* !! Exception.CreateResFmt */ __fastcall EMCIDeviceError(System::Integer Ident, const TVarRec *Args
  103.         , const System::Integer Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  104.     /* !! Exception.CreateHelp */ __fastcall EMCIDeviceError(const System::AnsiString Msg, System::Integer 
  105.         AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
  106.     /* !! Exception.CreateFmtHelp */ __fastcall EMCIDeviceError(const System::AnsiString Msg, const TVarRec 
  107.         *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Msg, Args
  108.         , Args_Size, AHelpContext) { }
  109.     /* !! Exception.CreateResHelp */ __fastcall EMCIDeviceError(System::Integer Ident, System::Integer 
  110.         AHelpContext) : Sysutils::Exception(Ident, AHelpContext) { }
  111.     /* !! Exception.CreateResFmtHelp */ __fastcall EMCIDeviceError(System::Integer Ident, const TVarRec 
  112.         *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Ident, 
  113.         Args, Args_Size, AHelpContext) { }
  114.     
  115. public:
  116.     /* !! TObject.Destroy */ __fastcall virtual ~EMCIDeviceError(void) { }
  117.     
  118. };
  119.  
  120. class __declspec(delphiclass) TMediaPlayer;
  121. class __declspec(pascalimplementation) TMediaPlayer : public Controls::TCustomControl
  122. {
  123.     typedef TMediaPlayer ThisClass;
  124.     typedef Controls::TCustomControl inherited;
  125.     
  126. private:
  127.     TMPButton Buttons[9];
  128.     TButtonSet FVisibleButtons;
  129.     TButtonSet FEnabledButtons;
  130.     TButtonSet FColoredButtons;
  131.     TButtonSet FAutoButtons;
  132.     System::Boolean Pressed;
  133.     System::Boolean Down;
  134.     TMPBtnType CurrentButton;
  135.     Windows::TRect CurrentRect;
  136.     System::Integer ButtonWidth;
  137.     Windows::TPoint MinBtnSize;
  138.     EMPNotify FOnClick;
  139.     EMPPostNotify FOnPostClick;
  140.     Classes::TNotifyEvent FOnNotify;
  141.     TMPBtnType FocusedButton;
  142.     System::Boolean MCIOpened;
  143.     TMPDevCapsSet FCapabilities;
  144.     System::Boolean FCanPlay;
  145.     System::Boolean FCanStep;
  146.     System::Boolean FCanEject;
  147.     System::Boolean FCanRecord;
  148.     System::Boolean FHasVideo;
  149.     System::Longint FFlags;
  150.     System::Boolean FWait;
  151.     System::Boolean FNotify;
  152.     System::Boolean FUseWait;
  153.     System::Boolean FUseNotify;
  154.     System::Boolean FUseFrom;
  155.     System::Boolean FUseTo;
  156.     System::Word FDeviceID;
  157.     TMPDeviceTypes FDeviceType;
  158.     System::Longint FTo;
  159.     System::Longint FFrom;
  160.     System::Longint FFrames;
  161.     System::Longint FError;
  162.     TMPNotifyValues FNotifyValue;
  163.     Controls::TWinControl *FDisplay;
  164.     System::Integer FDWidth;
  165.     System::Integer FDHeight;
  166.     System::AnsiString FElementName;
  167.     System::Boolean FAutoEnable;
  168.     System::Boolean FAutoOpen;
  169.     System::Boolean FAutoRewind;
  170.     System::Boolean FShareable;
  171.     void __fastcall LoadBitmaps(void);
  172.     void __fastcall DestroyBitmaps(void);
  173.     void __fastcall SetEnabledButtons( TButtonSet Value);
  174.     void __fastcall SetColored( TButtonSet Value);
  175.     void __fastcall SetVisible( TButtonSet Value);
  176.     void __fastcall SetAutoEnable(System::Boolean Value);
  177.     void __fastcall DrawAutoButtons(void);
  178.     void __fastcall DoMouseDown(System::Integer XPos, System::Integer YPos);
  179.     MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  180.     MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  181.     MESSAGE void __fastcall WMMouseMove(Messages::TWMMouse &Message);
  182.     MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
  183.     MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  184.     MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  185.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  186.     MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  187.     virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);
  188.     System::Integer __fastcall VisibleButtonCount(void);
  189.     void __fastcall Adjust(void);
  190.     void __fastcall DoClick(TMPBtnType Button);
  191.     void __fastcall DoPostClick(TMPBtnType Button);
  192.     void __fastcall DrawButton(TMPBtnType Btn, System::Integer X);
  193.     void __fastcall CheckIfOpen(void);
  194.     void __fastcall SetPosition(System::Longint Value);
  195.     void __fastcall SetDeviceType(TMPDeviceTypes Value);
  196.     void __fastcall SetWait(System::Boolean Flag);
  197.     void __fastcall SetNotify(System::Boolean Flag);
  198.     void __fastcall SetFrom(System::Longint Value);
  199.     void __fastcall SetTo(System::Longint Value);
  200.     void __fastcall SetTimeFormat(TMPTimeFormats Value);
  201.     void __fastcall SetDisplay(Controls::TWinControl *Value);
  202.     void __fastcall SetOrigDisplay(void);
  203.     void __fastcall SetDisplayRect(const Windows::TRect &Value);
  204.     Windows::TRect __fastcall GetDisplayRect(void);
  205.     void __fastcall GetDeviceCaps(void);
  206.     System::Longint __fastcall GetStart(void);
  207.     System::Longint __fastcall GetLength(void);
  208.     TMPModes __fastcall GetMode(void);
  209.     System::Longint __fastcall GetTracks(void);
  210.     System::Longint __fastcall GetPosition(void);
  211.     System::AnsiString __fastcall GetErrorMessage(void);
  212.     TMPTimeFormats __fastcall GetTimeFormat(void);
  213.     System::Longint __fastcall GetTrackLength(System::Integer TrackNum);
  214.     System::Longint __fastcall GetTrackPosition(System::Integer TrackNum);
  215.     
  216. protected:
  217.     virtual void __fastcall Loaded(void);
  218.     virtual void __fastcall AutoButtonSet(TMPBtnType Btn);
  219.     virtual void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation
  220.         );
  221.     virtual void __fastcall Paint(void);
  222.     MESSAGE void __fastcall MMNotify(Messages::TMessage &Message);
  223.     virtual void __fastcall Click(TMPBtnType Button, System::Boolean &DoDefault);
  224.     virtual void __fastcall PostClick(TMPBtnType Button);
  225.     virtual void __fastcall DoNotify(void);
  226.     virtual void __fastcall Updated(void);
  227.     
  228. public:
  229.     __fastcall virtual TMediaPlayer(Classes::TComponent *AOwner);
  230.     __fastcall virtual ~TMediaPlayer(void);
  231.     void __fastcall Open(void);
  232.     void __fastcall Close(void);
  233.     void __fastcall Play(void);
  234.     void __fastcall Stop(void);
  235.     void __fastcall Pause(void);
  236.     void __fastcall Step(void);
  237.     void __fastcall Back(void);
  238.     void __fastcall Previous(void);
  239.     void __fastcall Next(void);
  240.     void __fastcall StartRecording(void);
  241.     void __fastcall Eject(void);
  242.     void __fastcall Save(void);
  243.     void __fastcall PauseOnly(void);
  244.     void __fastcall Resume(void);
  245.     void __fastcall Rewind(void);
  246.     __property System::Longint TrackLength[System::Integer TrackNum] = {read=GetTrackLength};
  247.     __property System::Longint TrackPosition[System::Integer TrackNum] = {read=GetTrackPosition};
  248.     __property TMPDevCapsSet Capabilities = {read=FCapabilities, nodefault};
  249.     __property System::Longint Error = {read=FError, nodefault};
  250.     __property System::AnsiString ErrorMessage = {read=GetErrorMessage, nodefault};
  251.     __property System::Longint Start = {read=GetStart, nodefault};
  252.     __property System::Longint Length = {read=GetLength, nodefault};
  253.     __property System::Longint Tracks = {read=GetTracks, nodefault};
  254.     __property System::Longint Frames = {read=FFrames, write=FFrames, nodefault};
  255.     __property TMPModes Mode = {read=GetMode, nodefault};
  256.     __property System::Longint Position = {read=GetPosition, write=SetPosition, nodefault};
  257.     __property System::Boolean Wait = {read=FWait, write=SetWait, nodefault};
  258.     __property System::Boolean Notify = {read=FNotify, write=SetNotify, nodefault};
  259.     __property TMPNotifyValues NotifyValue = {read=FNotifyValue, nodefault};
  260.     __property System::Longint StartPos = {read=FFrom, write=SetFrom, nodefault};
  261.     __property System::Longint EndPos = {read=FTo, write=SetTo, nodefault};
  262.     __property System::Word DeviceID = {read=FDeviceID, nodefault};
  263.     __property TMPTimeFormats TimeFormat = {read=GetTimeFormat, write=SetTimeFormat, nodefault};
  264.     __property Windows::TRect DisplayRect = {read=GetDisplayRect, write=SetDisplayRect};
  265.     
  266. __published:
  267.     __property TButtonSet ColoredButtons = {read=FColoredButtons, write=SetColored, default=511};
  268.     __property Enabled ;
  269.     __property TButtonSet EnabledButtons = {read=FEnabledButtons, write=SetEnabledButtons, default=511}
  270.         ;
  271.     __property TButtonSet VisibleButtons = {read=FVisibleButtons, write=SetVisible, default=511};
  272.     __property System::Boolean AutoEnable = {read=FAutoEnable, write=SetAutoEnable, default=1};
  273.     __property System::Boolean AutoOpen = {read=FAutoOpen, write=FAutoOpen, default=0};
  274.     __property System::Boolean AutoRewind = {read=FAutoRewind, write=FAutoRewind, default=1};
  275.     __property TMPDeviceTypes DeviceType = {read=FDeviceType, write=SetDeviceType, default=0};
  276.     __property Controls::TWinControl * Display = {read=FDisplay, write=SetDisplay, nodefault};
  277.     __property System::AnsiString FileName = {read=FElementName, write=FElementName, nodefault};
  278.     __property System::Boolean Shareable = {read=FShareable, write=FShareable, default=0};
  279.     __property Visible ;
  280.     __property ParentShowHint ;
  281.     __property ShowHint ;
  282.     __property PopupMenu ;
  283.     __property TabOrder ;
  284.     __property TabStop ;
  285.     __property EMPNotify OnClick = {read=FOnClick, write=FOnClick};
  286.     __property OnEnter ;
  287.     __property OnExit ;
  288.     __property EMPPostNotify OnPostClick = {read=FOnPostClick, write=FOnPostClick};
  289.     __property Classes::TNotifyEvent OnNotify = {read=FOnNotify, write=FOnNotify};
  290. };
  291.  
  292. //-- var, const, procedure ---------------------------------------------------
  293. //-- template instantiations -------------------------------------------------
  294. template class TMPDevCapsSet ;
  295. template class TButtonSet ;
  296.  
  297. }    /* namespace Mplayer */
  298. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  299. using namespace Mplayer;
  300. #endif
  301. //-- end unit ----------------------------------------------------------------
  302. #endif    // MPlayer
  303.