| 920 | } |
| 921 | |
| 922 | static int command_play (int unitnum, int startlsn, int endlsn, int scan, play_status_callback statusfunc, play_subchannel_callback subfunc) |
| 923 | { |
| 924 | struct cdunit *cdu = unitisopen (unitnum); |
| 925 | if (!cdu) |
| 926 | return 0; |
| 927 | if (cdu->cdda_play) { |
| 928 | cdu->cdda_play = -1; |
| 929 | while (cdu->thread_active) |
| 930 | Sleep (10); |
| 931 | cdu->cdda_play = 0; |
| 932 | } |
| 933 | cdu->cd_last_pos = startlsn; |
| 934 | cdu->cdda_start = startlsn; |
| 935 | cdu->cdda_end = endlsn; |
| 936 | cdu->cdda_subfunc = subfunc; |
| 937 | cdu->cdda_statusfunc = statusfunc; |
| 938 | cdu->cdda_scan = scan > 0 ? 10 : (scan < 0 ? 10 : 0); |
| 939 | cdu->cdda_delay = setstate (cdu, -1, -1); |
| 940 | cdu->cdda_delay_frames = setstate (cdu, -2, -1); |
| 941 | setstate (cdu, cdu->cdda_delay > 0 || cdu->cdda_delay_frames ? AUDIO_STATUS_NOT_SUPPORTED : AUDIO_STATUS_IN_PROGRESS, -1); |
| 942 | if (!isaudiotrack (&cdu->di.toc, startlsn)) { |
| 943 | setstate (cdu, AUDIO_STATUS_PLAY_ERROR, -1); |
| 944 | return 0; |
| 945 | } |
| 946 | if (!cdu->thread_active) { |
| 947 | uae_start_thread (_T("cdimage_cdda_play"), cdda_play_func, cdu, NULL); |
| 948 | while (!cdu->thread_active) |
| 949 | Sleep (10); |
| 950 | } |
| 951 | cdu->cdda_play++; |
| 952 | return 1; |
| 953 | } |
| 954 | |
| 955 | static int command_qcode (int unitnum, uae_u8 *buf, int sector, bool all) |
| 956 | { |
nothing calls this directly
no test coverage detected