本文整理汇总了C++中CDAudio_Resume函数的典型用法代码示例。如果您正苦于以下问题:C++ CDAudio_Resume函数的具体用法?C++ CDAudio_Resume怎么用?C++ CDAudio_Resume使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CDAudio_Resume函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CDAudio_Activate
/*
===========
CDAudio_Activate
Called when the main window gains or loses focus.
The window have been destroyed and recreated
between a deactivate and an activate.
===========
*/
void CDAudio_Activate (int active)
{
if (active)
CDAudio_Resume ();
else
CDAudio_Pause ();
}
示例2: CDAudio_SetVolume
static qboolean CDAudio_SetVolume (cvar_t *var)
{
if (cdfile == -1 || !enabled)
return false;
if (var->value < 0.0)
Cvar_SetValue (var->name, 0.0);
else if (var->value > 1.0)
Cvar_SetValue (var->name, 1.0);
old_cdvolume = var->value;
if (hw_vol_works)
{
drv_vol.vol[0] = drv_vol.vol[2] =
drv_vol.vol[1] = drv_vol.vol[3] = var->value * 255.0;
return CD_SetVolume (&drv_vol);
}
else
{
if (old_cdvolume == 0.0)
CDAudio_Pause ();
else
CDAudio_Resume();
return false;
}
}
示例3: CDAudio_Update
void CDAudio_Update()
{
if(!cd_id || !enabled) return;
if(cd_volume && cd_volume->value != cdvolume)
{
if(cdvolume)
{
Cvar_SetValue("cd_volume",0.0);
CDAudio_Pause();
}
else
{
Cvar_SetValue("cd_volume",1.0);
CDAudio_Resume();
}
cdvolume = cd_volume->value;
return;
}
if(cd_nocd->value)
{
CDAudio_Stop();
return;
}
if(playLooping &&
(SDL_CDStatus(cd_id) != CD_PLAYING) &&
(SDL_CDStatus(cd_id) != CD_PAUSED))
{
CDAudio_Play(lastTrack,true);
}
}
示例4: SCR_EndLoadingPlaque
/*
===============
SCR_EndLoadingPlaque
================
*/
void SCR_EndLoadingPlaque (void)
{
scr_disabled_for_loading = qfalse;
scr_fullupdate = 0;
Con_ClearNotify ();
CDAudio_Resume();
}
示例5: CDAudio_SetVolume
static qboolean CDAudio_SetVolume (cvar_t *var)
{
if (!cd_handle || !enabled)
return false;
if (var->value < 0.0)
Cvar_SetValue (var->name, 0.0);
else if (var->value > 1.0)
Cvar_SetValue (var->name, 1.0);
old_cdvolume = var->value;
if (hw_vol_works)
{
/* FIXME: write proper code in here when SDL
supports cdrom volume control some day. */
return CD_SetVolume (NULL);
}
else
{
if (old_cdvolume == 0.0)
CDAudio_Pause ();
else
CDAudio_Resume();
return false;
}
}
示例6: CDAudio_Stop
void CDAudio_Stop (void)
{
if (!enabled)
return;
// save the playlist position
CDAudio_StopPlaylistTrack();
if (faketrack != -1)
{
S_StopChannel (faketrack, true);
faketrack = -1;
}
else if (cdPlaying && (CDAudio_SysStop() == -1))
return;
else if(wasPlaying)
{
CDAudio_Resume(); // needed by SDL - can't stop while paused there (causing pause/stop to fail after play, pause, stop, play otherwise)
if (cdPlaying && (CDAudio_SysStop() == -1))
return;
}
wasPlaying = false;
cdPlaying = false;
}
示例7: CDAudio_Activate
void CDAudio_Activate (qboolean active)
{
if (active)
CDAudio_Resume ();
else
CDAudio_Pause ();
}
示例8: CDAudio_Update
void CDAudio_Update(void)
{
if (!enabled)
return;
if (bgmvolume.value != cdvolume)
{
cdvolume = bgmvolume.value;
CDAudio_SetVolume (cdvolume);
if (cdvolume)
{
if(!playing)
CDAudio_Resume ();
}
else
{
if(playing)
CDAudio_Pause ();
}
};
if(StatusOgg() == OGG_STATUS_EOF)
{
if(playing)
{
playing = false;
};
};
}
示例9: VID_ChangeVideoMode
//
// VID_ChangeVideoMode
// intended only as a callback for VID_Restart_f
//
static void VID_ChangeVideoMode (int newmode)
{
int stat, temp;
if (!screen)
return;
temp = scr_disabled_for_loading;
scr_disabled_for_loading = true;
CDAudio_Pause ();
MIDI_Pause (MIDI_ALWAYS_PAUSE);
S_ClearBuffer ();
stat = VID_SetMode (newmode, vid_curpal);
if (!stat)
{
if (vid_modenum == newmode)
Sys_Error ("Couldn't set video mode: %s", SDL_GetError());
// failed setting mode, probably due to insufficient
// memory. go back to previous mode.
Cvar_SetValue ("vid_mode", vid_modenum);
stat = VID_SetMode (vid_modenum, vid_curpal);
if (!stat)
Sys_Error ("Couldn't set video mode: %s", SDL_GetError());
}
CDAudio_Resume ();
MIDI_Pause (MIDI_ALWAYS_RESUME);
scr_disabled_for_loading = temp;
}
示例10: resume
void resume()
{
Con_Printf("Resume requested\n");
// Check each file.
for (std::size_t file_index = 0; file_index < file_count; ++file_index)
{
// Is the file in use?
file& file = files[file_index];
if (file.name[0])
{
// Reopen the file. This can repeatedly fail, so we keep trying.
const char* mode = file.write ? "ab" : "rb";
do
{
file.handle = fopen(file.name, mode);
}
while (!file.handle);
// Restore the offset;
if (fseek(file.handle, file.offset, SEEK_SET) != 0)
{
throw std::runtime_error("Couldn't seek in file");
}
}
}
CDAudio_Resume();
Con_Printf("Filesystem resumed\n");
}
示例11: VID_SetMode
/*
================
VID_SetMode
================
*/
static int VID_SetMode (int width, int height, int bpp, qboolean fullscreen)
{
int temp;
Uint32 flags = DEFAULT_SDL_FLAGS;
char caption[50];
if (fullscreen)
flags |= SDL_FULLSCREEN;
// so Con_Printfs don't mess us up by forcing vid and snd updates
temp = scr_disabled_for_loading;
scr_disabled_for_loading = true;
CDAudio_Pause ();
BGM_Pause ();
//
// swap control (the "before SDL_SetVideoMode" part)
//
gl_swap_control = true;
if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == -1)
gl_swap_control = false;
bpp = SDL_VideoModeOK(width, height, bpp, flags);
draw_context = SDL_SetVideoMode(width, height, bpp, flags);
if (!draw_context)
Sys_Error ("Couldn't set video mode");
q_snprintf(caption, sizeof(caption), "QuakeSpasm %1.2f.%d", (float)FITZQUAKE_VERSION, QUAKESPASM_VER_PATCH);
SDL_WM_SetCaption(caption, caption);
vid.width = draw_context->w;
vid.height = draw_context->h;
vid.conwidth = vid.width & 0xFFFFFFF8;
vid.conheight = vid.conwidth * vid.height / vid.width;
vid.numpages = 2;
modestate = draw_context->flags & SDL_FULLSCREEN ? MS_FULLSCREEN : MS_WINDOWED;
CDAudio_Resume ();
BGM_Resume ();
scr_disabled_for_loading = temp;
// fix the leftover Alt from any Alt-Tab or the like that switched us away
ClearAllStates ();
Con_SafePrintf ("Video mode %dx%dx%d initialized\n",
draw_context->w,
draw_context->h,
draw_context->format->BitsPerPixel);
vid.recalc_refdef = 1;
// no pending changes
vid_changed = false;
return true;
}
示例12: CLQW_ParseSetPause
static void CLQW_ParseSetPause( QMsg& message ) {
cl.qh_paused = message.ReadByte();
if ( cl.qh_paused ) {
CDAudio_Pause();
} else {
CDAudio_Resume();
}
}
示例13: CDAudio_Update
void CDAudio_Update(void)
{
if (!cd_enabled.value || !initialized) // Manoel Kasimier - CD player in menu
return;
if (bgmvolume.value != cdvolume)
{
CD_SetVolume(bgmvolume.value ); // Hexen 2
if (cdvolume && !bgmvolume.value) // Manoel Kasimier - just muted
CDAudio_Pause ();
else if (!cdvolume && bgmvolume.value) // Manoel Kasimier
CDAudio_Resume ();
cdvolume = bgmvolume.value;
}
}
示例14: CDAudio_Update
void CDAudio_Update(void)
{
if ( cd_nocd->value != !enabled )
{
if ( cd_nocd->value )
{
CDAudio_Stop();
enabled = false;
}
else
{
enabled = true;
CDAudio_Resume ();
}
}
}
示例15: CDAudio_SetVolume
static void CDAudio_SetVolume (cvar_t *var)
{
if (var->value < 0.0)
Cvar_SetValue (var->name, 0.0);
else if (var->value > 1.0)
Cvar_SetValue (var->name, 1.0);
old_cdvolume = var->value;
#ifdef USE_AUX_API
CD_SetVolume (var->value * 0xffff);
#endif /* USE_AUX_API */
if (old_cdvolume == 0.0)
CDAudio_Pause ();
else
CDAudio_Resume();
}