CDAudio_Play_byName(buf, looping);
}
+float CDAudio_GetPosition ()
+{
+ if(faketrack != -1)
+ return S_GetChannelPosition(faketrack);
+ return -1;
+}
+
void CDAudio_Stop (void)
{
if (!enabled)
int CDAudio_Startup(void);
void CDAudio_Shutdown(void);
void CDAudio_Update(void);
-
+float CDAudio_GetPosition(void);
start = bound(0, start, slength);
if (length < 0) // FTE_STRINGS feature
- length += slength - start;
+ length += slength - start + 1;
maxlen = min((int)sizeof(string) - 1, slength - start);
length = bound(0, length, maxlen);
=========
*/
extern double host_starttime;
+float CDAudio_GetPosition(void);
void VM_gettime(void)
{
int timer_index;
PRVM_G_FLOAT(OFS_RETURN) = (float) (Sys_DoubleTime() - realtime);
break;
case 3: // GETTIME_UPTIME
- PRVM_G_FLOAT(OFS_RETURN) = (float) Sys_DoubleTime() - host_starttime;
+ PRVM_G_FLOAT(OFS_RETURN) = (float) (Sys_DoubleTime() - host_starttime);
+ break;
+ case 4: // GETTIME_CDTRACK
+ PRVM_G_FLOAT(OFS_RETURN) = (float) CDAudio_GetPosition();
break;
default:
VM_Warning("VM_gettime: %s: unsupported timer specified, returning realtime\n", PRVM_NAME);
}
}
+float S_GetChannelPosition (unsigned int ch_ind)
+{
+ // FIXME unsupported
+ return -1;
+}
+
void S_BlockSound (void){
soundblocked++;
}
channels[ch_ind].master_vol = (int)(fvol * 255.0f);
}
+float S_GetChannelPosition (unsigned int ch_ind)
+{
+ // note: this is NOT accurate yet
+ int s;
+ channel_t *ch = &channels[ch_ind];
+ sfx_t *sfx = ch->sfx;
+
+ s = ch->pos;
+ /*
+ if(!snd_usethreadedmixing)
+ s += _snd_mixahead.value * S_GetSoundRate();
+ */
+ return (s % sfx->total_length) / (float) S_GetSoundRate();
+}
+
+
/*
=================
{
return 0;
}
+
+float S_GetChannelPosition (unsigned int ch_ind)
+{
+ return -1;
+}
+
void S_StopChannel (unsigned int channel_ind, qboolean lockmutex);
qboolean S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qboolean value);
void S_SetChannelVolume (unsigned int ch_ind, float fvol);
+float S_GetChannelPosition (unsigned int ch_ind);
void S_BlockSound (void);
void S_UnblockSound (void);
"DP_QC_GETTAGINFO "
"DP_QC_GETTAGINFO_BONEPROPERTIES "
"DP_QC_GETTIME "
+"DP_QC_GETTIME_CDTRACK "
"DP_QC_MINMAXBOUND "
"DP_QC_MULTIPLETEMPSTRINGS "
"DP_QC_NUM_FOR_EDICT "