mciapi.pas 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. Copyright (c) 1992, 1993 by International Business Machines Corporation
  3. Copyright (c) 2002 by Andry Svirgunov ([email protected])
  4. Copyright (c) 2002-2003 by Yuri Prokushev ([email protected])
  5. High-Level MCI Interfaces of OS/2 Multimedia subsystem
  6. This program is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU Library General Public License (LGPL) as
  8. published by the Free Software Foundation; either version 2 of the
  9. License, or (at your option) any later version. This program is
  10. distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE.
  13. See the GNU Library General Public License for more details. You should
  14. have received a copy of the GNU Library General Public License along
  15. with this program; if not, write to the Free Software Foundation, Inc.,
  16. 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
  17. **********************************************************************}
  18. {
  19. @abstract(High-Level MCI Interfaces of OS/2 Multimedia subsystem)
  20. @author(Andry Svirgunov ([email protected]))
  21. @author(Yuri Prokushev ([email protected]))
  22. @created(01 Oct 2002)
  23. @lastmod(19 Jan 2003)
  24. This is the High-Level Macro Service API Routines of OS/2 Multimedia subsystem.
  25. All functions are from MCIAPI dll (which also contains REXX functions.
  26. See "Multimedia with REXX" for more information.).
  27. Warning: This code is alfa. Future versions of this unit will propably
  28. not be compatible.
  29. }
  30. {$IFNDEF FPC_DOTTEDUNITS}
  31. Unit mciapi;
  32. {$ENDIF FPC_DOTTEDUNITS}
  33. {$MODE ObjFPC}
  34. Interface
  35. // Flags for mciPlayFile
  36. Const
  37. // digital and overlay
  38. MCI_OWNERISPARENT = $0001;
  39. // stop playing whatever is playing
  40. MCI_STOPACTIVE = $0002;
  41. // play and return immediately
  42. MCI_ASYNCRENDEZVOUS = $0004;
  43. // wait til prev is finished then play
  44. MCI_RENDEZVOUS = $0008;
  45. // no syncup will be done
  46. MCI_ASYNC = $0010;
  47. {
  48. This function plays a multimedia data file (video, audio) using MCI commands.
  49. hwndOwner is handle of owner window. If hwndOwner equial to zero used active
  50. window.
  51. pszFile is pointer to asciiz name of data file. For compound files can be
  52. used 'filename+element'.
  53. ulFlags is MCI_* flags.
  54. pszTitle is title of generated window (e.g. for video). Ignored if not generated.
  55. hwndViewport is handle of window for displaying video. If none, then default
  56. window displayed.
  57. }
  58. Function mciPlayFile(hwndOwner: Cardinal; // Ownerwindow
  59. pszFile: PAnsiChar; // File
  60. ulFlags: Cardinal; // Flags
  61. pszTitle: PAnsiChar; // Title
  62. hwndViewport: Cardinal): // Viewport Window
  63. Cardinal; cdecl;
  64. Function mciPlayResource(hwndOwner: Cardinal; // Owner Window
  65. hmod: LongInt; // Module
  66. resType: LongInt; // Resource Type
  67. resID: LongInt; // Resource ID
  68. ulFlags: Cardinal; // Flags
  69. pszTitle: PAnsiChar; // Title
  70. hwndViewport: Cardinal): // Viewport Window
  71. Cardinal; cdecl;
  72. Function mciRecordAudioFile(hwndOwner: Cardinal;
  73. pszFile,
  74. pszTitle: PAnsiChar;
  75. ulFlags: Cardinal):
  76. Cardinal; cdecl;
  77. // Audio Macro Service Constants and Routines
  78. Const
  79. MMIO_FE_FINDFIRST = 1;
  80. MMIO_FE_FINDNEXT = 2;
  81. MMIO_FE_FINDEND = 3;
  82. MMIO_FE_FINDELEMENT = 4;
  83. MMIO_RE_COMPACT = 1;
  84. Function mmioRemoveElement(pszFileElement: PAnsiChar;
  85. ulFlag: LongInt):
  86. Cardinal; cdecl;
  87. Function mmioFindElement(ulCode: LongInt; // Find Code
  88. pszElement: PAnsiChar; // Element
  89. ulElementLen: LongInt; // Element Buffer Length
  90. pszFile: PAnsiChar;
  91. ulReserved: LongInt): // Compound File
  92. Cardinal; cdecl;
  93. Implementation
  94. Function mciPlayFile(hwndOwner: Cardinal; pszFile: PAnsiChar; ulFlags: Cardinal; pszTitle: PAnsiChar; hwndViewport: Cardinal): Cardinal; cdecl;
  95. external 'MCIAPI' index 10;
  96. Function mciPlayResource(hwndOwner: Cardinal; hmod: LongInt; resType: LongInt; resID: LongInt; ulFlags: Cardinal; pszTitle: PAnsiChar; hwndViewport: Cardinal): Cardinal; cdecl;
  97. external 'MCIAPI' index 11;
  98. Function mciRecordAudioFile(hwndOwner: Cardinal; pszFile, pszTitle: PAnsiChar; ulFlags: Cardinal): Cardinal; cdecl;
  99. external 'MCIAPI' index 12;
  100. Function mmioRemoveElement(pszFileElement: PAnsiChar; ulFlag: LongInt): Cardinal; cdecl;
  101. external 'MCIAPI' index 16;
  102. Function mmioFindElement(ulCode: LongInt; pszElement: PAnsiChar; ulElementLen: LongInt; pszFile: PAnsiChar; ulReserved: LongInt): Cardinal; cdecl;
  103. external 'MCIAPI' index 18;
  104. end.