MCI.H 2.9 KB

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