当前位置: 首页>>代码示例>>C++>>正文


C++ CDAudio_Resume函数代码示例

本文整理汇总了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 ();
}
开发者ID:Jaegermeiste,项目名称:quake2_322,代码行数:16,代码来源:cd_win.c

示例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;
    }
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:25,代码来源:cd_bsd.c

示例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);
	}
}
开发者ID:AJenbo,项目名称:Quake-2,代码行数:32,代码来源:cd_sdl.c

示例4: SCR_EndLoadingPlaque

/*
===============
SCR_EndLoadingPlaque

================
*/
void SCR_EndLoadingPlaque (void)
{
	scr_disabled_for_loading = qfalse;
	scr_fullupdate = 0;
	Con_ClearNotify ();
	CDAudio_Resume();
}
开发者ID:drmabuse1981,项目名称:DQuakePlus,代码行数:13,代码来源:video_hardware_screen.cpp

示例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;
	}
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:25,代码来源:cd_sdl.c

示例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;
}
开发者ID:Blub,项目名称:darkplaces,代码行数:25,代码来源:cd_shared.c

示例7: CDAudio_Activate

void CDAudio_Activate (qboolean active)
{
	if (active)
		CDAudio_Resume ();
	else
		CDAudio_Pause ();
}
开发者ID:AkBKukU,项目名称:Quake-2,代码行数:7,代码来源:cd_linux.c

示例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;
		};
	};
}
开发者ID:Izhido,项目名称:qrevpak,代码行数:29,代码来源:cd_revol.c

示例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;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:35,代码来源:vid_sdl.c

示例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");
			
		}
开发者ID:darkduke606,项目名称:DQuakePlus,代码行数:30,代码来源:system.cpp

示例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;
}
开发者ID:antoche,项目名称:Quakespasm-Rift,代码行数:64,代码来源:gl_vidsdl.c

示例12: CLQW_ParseSetPause

static void CLQW_ParseSetPause( QMsg& message ) {
	cl.qh_paused = message.ReadByte();
	if ( cl.qh_paused ) {
		CDAudio_Pause();
	} else {
		CDAudio_Resume();
	}
}
开发者ID:janisl,项目名称:jlquake,代码行数:8,代码来源:parse.cpp

示例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;
    }
}
开发者ID:dommul,项目名称:super8,代码行数:15,代码来源:cd_win.c

示例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 ();
		}
	}
}
开发者ID:Izhido,项目名称:qrevpak,代码行数:16,代码来源:cd_win.c

示例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();
}
开发者ID:bazilio-ua,项目名称:fxquake,代码行数:16,代码来源:cd_win.c


注:本文中的CDAudio_Resume函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。