MCI.H 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _MCI_H_
  19. #define _MCI_H_
  20. /****************************************************************************
  21. *
  22. * FILE
  23. * MCI.H
  24. *
  25. * DESCRIPTION
  26. *
  27. * PROGRAMMER
  28. * Denzil E. Long, Jr.
  29. *
  30. * DATE
  31. * 6/22/98
  32. *
  33. ****************************************************************************/
  34. #include "function.h"
  35. #ifdef MCIMPEG
  36. #include <windows.h>
  37. #include <mmsystem.h>
  38. #include <digitalv.h>
  39. #include "watcom.h"
  40. /* MCIDevice - MCI device capabilities and description
  41. *
  42. * name - Name used to open device.
  43. * description - Product description
  44. * type - Device type
  45. * canEject - Can eject media flag
  46. * canPlay - Can playback media
  47. * canRecord - Can record media
  48. * canSave - Can save media
  49. * usesDevElem - Uses device element
  50. * hasAudio - Media supports audio
  51. * hasVideo - Media supports video
  52. * reqElemFile - Requires element file
  53. */
  54. typedef struct _MCIDevice
  55. {
  56. char name[64];
  57. char description[64];
  58. unsigned long type;
  59. bool canEject;
  60. bool canPlay;
  61. bool canRecord;
  62. bool canSave;
  63. bool usesDevElem;
  64. bool hasAudio;
  65. bool hasVideo;
  66. bool reqElemFile;
  67. } MCIDevice;
  68. /* MCI enumeration callback definition */
  69. typedef bool (MCIEnumCB)(MCIDevice* desc, void*);
  70. class MCI
  71. {
  72. public:
  73. // Open MCI device
  74. MCIDEVICEID OpenDevice(const char* name);
  75. void CloseDevice(MCIDEVICEID id);
  76. // Enumerate devices
  77. bool EnumerateDevices(MCIEnumCB* callback, void* context);
  78. // Get number of MCI devices name in registry or [MCI] section
  79. // of system.ini
  80. unsigned int GetDeviceCount(void);
  81. // Get device name from registry or [MCI] section of system.ini
  82. bool GetDeviceName(unsigned int item, char* buffer);
  83. // Get general device description
  84. bool GetDeviceDescription(const char* name, MCIDevice* caps);
  85. // Get type name (IE: Digital Video) from type ID (IE: MCI_DEVTYPE_DIGITAL_VIDEO)
  86. const char* GetDeviceTypeName(unsigned long type);
  87. // Get device product name
  88. bool GetProductName(MCIDEVICEID id, char* buffer);
  89. // Get device capability
  90. bool GetCapability(MCIDEVICEID id, unsigned long capItem,
  91. unsigned long* result);
  92. };
  93. #endif // MCIMPEG
  94. #endif // _MCI_H_