WindacPlay.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef NULLSOFT_WINDACPLAYH
  2. #define NULLSOFT_WINDACPLAYH
  3. #include "Main.h"
  4. #include "CDPlay.h"
  5. #include "windac/Dac32.h"
  6. #include "../nu/AutoLock.h"
  7. using namespace Nullsoft::Utility;
  8. class WindacPlay : public C_CDPlay
  9. {
  10. public:
  11. WindacPlay();
  12. ~WindacPlay();
  13. int open(wchar_t drive, int track);
  14. int play(wchar_t drive, int track);
  15. static DWORD WINAPI threadProc(LPVOID lpParameter)
  16. {
  17. WindacPlay *wp = (WindacPlay *)lpParameter;
  18. return wp->threadProc2();
  19. }
  20. int read(char *dest, int len, int *killswitch);
  21. int threadProc2();
  22. void stop();
  23. void pause()
  24. {
  25. line.outMod->Pause(1);
  26. }
  27. void unpause()
  28. {
  29. line.outMod->Pause(0);
  30. }
  31. int getlength()
  32. {
  33. return g_playlength;
  34. }
  35. int getoutputtime()
  36. {
  37. return line.outMod->GetOutputTime();
  38. }
  39. void setoutputtime(int time_in_ms)
  40. {
  41. need_seek = time_in_ms;
  42. }
  43. void setvolume(int _a_v, int _a_p)
  44. {
  45. line.outMod->SetVolume(_a_v);
  46. line.outMod->SetPan(_a_p);
  47. }
  48. private:
  49. void getTrackInfos(int *drivenum, char driveletter);
  50. unsigned char *sbuf;
  51. long bytes_in_sbuf;
  52. int buf_size;
  53. int start, end;
  54. int g_nch, g_srate, g_bps;
  55. int killswitch;
  56. HANDLE hThread;
  57. int decode_pos_ms;
  58. int need_seek;
  59. BOOL inited;
  60. CMapDrive *m_pMapDrive;
  61. CSCSICD *scsi;
  62. TDriveInfo drive_info;
  63. CCDAdress start_sector, current_sector, end_sector;
  64. int slength;
  65. DWORD last_eject_scan;
  66. bool needsToClose;
  67. };
  68. #endif