您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IsPlaying函数代码示例

51自学网 2021-06-01 21:42:23
  C++
这篇教程C++ IsPlaying函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中IsPlaying函数的典型用法代码示例。如果您正苦于以下问题:C++ IsPlaying函数的具体用法?C++ IsPlaying怎么用?C++ IsPlaying使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了IsPlaying函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: lock

bool Base::Start()//----------------{	if(!IsOpen()) return false; 	if(!IsPlaying())	{		{			Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex);			m_CurrentUpdateInterval = 0.0;			m_StreamPositionRenderFrames = 0;			m_StreamPositionOutputFrames = 0;		}		m_Clock.SetResolution(1);		m_RequestFlags.fetch_and(~RequestFlagRestart);		if(!InternalStart())		{			m_Clock.SetResolution(0);			return false;		}		m_IsPlaying = true;	}	return true;}
开发者ID:luaman,项目名称:modplug,代码行数:23,


示例2: UpdateTimer

void COggStream::Update() {    if (!stopped) {        UpdateTimer();        if (!paused) {            if (UpdateBuffers()) {                if (!IsPlaying()) {                    // source state changed                    if (!StartPlaying()) {                        // stream stopped                        ReleaseBuffers();                    } else {                        // stream interrupted                        ReleaseBuffers();                    }                }            } else {                // EOS, nothing left to do                ReleaseBuffers();            }        }    }}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:23,


示例3: SetAnimation

void wxAnimationCtrl::SetAnimation(const wxAnimation &anim){    if (IsPlaying())        Stop();    ResetAnim();    ResetIter();    // copy underlying GdkPixbuf object    m_anim = anim.GetPixbuf();    // m_anim may be null in case wxNullAnimation has been passed    if (m_anim)    {        // add a reference to the GdkPixbufAnimation        g_object_ref(m_anim);        if (!this->HasFlag(wxAC_NO_AUTORESIZE))            FitToAnimation();    }    DisplayStaticImage();}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:23,


示例4: MixNull

void SoundSource::Update(float timeStep){    if (!audio_ || !IsEnabledEffective())        return;    // If there is no actual audio output, perform fake mixing into a nonexistent buffer to check stopping/looping    if (!audio_->IsInitialized())        MixNull(timeStep);    // check for autoPlay    if (autoPlay_ && sound_.NotNull() && !hasAutoPlayed_ && !context_->GetEditorContext())    {        hasAutoPlayed_ = true;        Play(sound_);    }    // Free the stream if playback has stopped    if (soundStream_ && !position_)        StopLockless();    // Check for autoremove    if (autoRemove_)    {        if (!IsPlaying())        {            autoRemoveTimer_ += timeStep;            if (autoRemoveTimer_ > AUTOREMOVE_DELAY)            {                Remove();                // Note: this object is now deleted, so only returning immediately is safe                return;            }        }        else            autoRemoveTimer_ = 0.0f;    }}
开发者ID:AliAkbarMontazeri,项目名称:AtomicGameEngine,代码行数:37,


示例5: InternalStopForce

void Base::Stop(bool force)//-------------------------{	if(!IsOpen()) return;	if(IsPlaying())	{		if(force)		{			InternalStopForce();		} else		{			InternalStop();		}		m_RequestFlags.fetch_and(~RequestFlagRestart);		m_Clock.SetResolution(0);		m_IsPlaying = false;		{			Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex);			m_CurrentUpdateInterval = 0.0;			m_StreamPositionRenderFrames = 0;			m_StreamPositionOutputFrames = 0;		}	}}
开发者ID:luaman,项目名称:modplug,代码行数:24,


示例6: Play

bool psEntity::Play(SoundControl* &ctrl, csVector3 entityPosition){    EntityState* entityState;    // checking if a sound is still playing    if(IsPlaying())    {        return false;    }    // checking if the state is defined    entityState = states.Get(state, 0);    if(entityState == 0)    {        return false;    }    // picking up randomly among resources    if(!entityState->resources.IsEmpty())    {        int resourceNumber = SoundManager::randomGen.Get() * entityState->resources.GetSize();        Debug4(LOG_SOUND, 0, "psEntity::Play() %s PLAYS %s meshid: %u",entityName.GetData(),entityState->resources[resourceNumber],GetMeshID());        if(SoundSystemManager::GetSingleton().Play3DSound(entityState->resources[resourceNumber], DONT_LOOP, 0, 0,                entityState->volume, ctrl, entityPosition, 0, minRange, maxRange,                VOLUME_ZERO, CS_SND3D_ABSOLUTE, handle))        {            when = entityState->delay;            handle->SetCallback(this, &StopCallback);            return true;        }    }    return false;}
开发者ID:Chettie,项目名称:Eulora-client,代码行数:36,


示例7: OnAnimStopped

void nuiAnimationSequence::OnAnimStopped(const nuiEvent& rEvent){  if (IsPlaying())  {    //NGL_LOG(_T("nuiAnimationSequence), NGL_LOG_DEBUG, _T("::OnAnimStopped/n"));    nuiAnimation* pAnim = (nuiAnimation*)rEvent.mpUser;    // Find the next anim in the sequence:    std::list<nuiAnimation*>::iterator it = mpAnimations.begin();    std::list<nuiAnimation*>::iterator end = mpAnimations.end();    while (it != end)    {      if (pAnim == *it)      {        ++it;        break;      }      ++it;    }    if (it != end)    {      // Launch the next anim in the sequence:      pAnim = *it;      pAnim->Play();      //NGL_LOG(_T("nuiAnimationSequence), NGL_LOG_DEBUG, _T("OnAnimStopped Launch next anim/n"));    }    else    {      // stop the sequence if this was the last in the chain:      //NGL_LOG(_T("nuiAnimationSequence), NGL_LOG_DEBUG, _T("OnAnimStopped STOP/n"));      mpAnimations.front()->Play();    }  }}
开发者ID:jpastuszek,项目名称:nui3,代码行数:36,


示例8: Fadeout

void CAudioManager::Fadeout(int id, int targetVolume, float time){  if(m_bValidAudio == false)    return;  int currentVolume = 0;  double timeStep = 0;  double volumeStep = 0;  for(int i = 0; i < m_AudioClip.size(); i++){    if(m_AudioClip[i].AudioID == id && IsPlaying(id) == true){      m_AudioClip[i].bFadeout = true;            m_AudioClip[i].targetVolume = targetVolume;      currentVolume = GetVolume(i);      if(targetVolume < currentVolume && time > 0){        timeStep = time/ 0.1;        volumeStep = (double)(currentVolume - targetVolume) / timeStep;        m_AudioClip[i].fadeStep = volumeStep;        m_AudioClip[i].bFadein = true;      }    }  }//for}
开发者ID:ChuckBolin,项目名称:CookieStealingOgre,代码行数:24,


示例9: wxDynamicCast

void MapSidebar::UpdateSimButtons(){	wxButton* button;	button = wxDynamicCast(FindWindow(ID_SimPlay), wxButton);	wxCHECK(button, );	button->Enable(m_SimState != SimPlaying);	button = wxDynamicCast(FindWindow(ID_SimFast), wxButton);	wxCHECK(button, );	button->Enable(m_SimState != SimPlayingFast);	button = wxDynamicCast(FindWindow(ID_SimSlow), wxButton);	wxCHECK(button, );	button->Enable(m_SimState != SimPlayingSlow);	button = wxDynamicCast(FindWindow(ID_SimPause), wxButton);	wxCHECK(button, );	button->Enable(IsPlaying(m_SimState));	button = wxDynamicCast(FindWindow(ID_SimReset), wxButton);	wxCHECK(button, );	button->Enable(m_SimState != SimInactive);}
开发者ID:krichter722,项目名称:0ad,代码行数:24,


示例10: Play

	/// starts or continue playing, true if successfull	virtual const bool Play(){		if(IsPlaying())return true;		if(IsPaused()){			// unpause sound			if(mpChannel){				result = FMOD_Channel_SetPaused(mpChannel,false);				ERRCHECK(result);			}		} else {			// start playing			mpChannel = 0;			// alloc channel			if(mpSound && mSoundSystem && mSoundSystem->mpSystem){				result = FMOD_System_PlaySound(mSoundSystem->mpSystem, FMOD_CHANNEL_FREE, mpSound, true, &mpChannel);				ERRCHECK(result);			}						// channel free and working?			if(mpChannel){								if(mb3D){					// set 3d position and velocity data					result = FMOD_Channel_Set3DAttributes(mpChannel, &mlPos, &mlVel);					ERRCHECK(result);					// set currently set minmax distances					SetMinMaxDistance(mfMinDistance,mfMaxDistance);				} 								result = FMOD_Channel_SetPaused(mpChannel,false);				ERRCHECK(result);								return true;			} else return false;		}		return false;	}
开发者ID:ghoulsblade,项目名称:lugreexample,代码行数:37,


示例11: return

int SoundEvent::play(SoundLib soundlib,					 VESSEL   *Vessel,					  char    *names ,					  double  *offset,					  int     *newbuffer,					  double  simcomputert,					  double  MissionTime,					  int     mode,					  double  timeremaining,					  double  timeafterpdi,					  double  timetoapproach,					  int     flags,					  int     volume){	int kk;	char buffers[255];	double altitude;	double vlon,vlat,vrad;    double timetopdi;	double timesincepdi;	double deltaoffset =0.;    if (!isValid())		return(false);	// is Sound still playing ?	// if yes let it play//   TRACESETUP("SOUNDEVENT PLAY");	if(lastplayed >= 0)	{        if(soundevents[lastplayed].offset == -1)		{	        if (IsPlaying())			{             //		TRACE("EN TRAIN DE JOUER");                return(false);			}		}		else if (IsPlaying())		{			if (soundevents[lastplayed+1].offset > soundevents[lastplayed].offset)			{			    if(Finish((double) soundevents[lastplayed+1].offset - 0.1))				{				}				else				    return(false);			}		}	}//  no more sounds to be played just return	if(soundevents[lastplayed+1].met == 0)		return(false);//	sprintf(buffers,"ENTREE PLAY MODE %d timeremaining %f timeafterpdi %f altitude %f",//		mode,timeremaining,timeafterpdi,altitude);//	TRACE(buffers);	timetopdi = timeremaining  -(MissionTime - simcomputert);	timesincepdi = timeafterpdi +(MissionTime - simcomputert);	timetoapproach = timetoapproach -(MissionTime -simcomputert);    if (mode == 0)	{ /*		sprintf(buffers,"AVANT PDI IGNIT %f %f %f ",					   timetopdi, MissionTime, simcomputert);		sprintf(oapiDebugString(),"%s",buffers);*/	}		if (mode >= 1 && mode < 3)	{ 		OBJHANDLE hbody=Vessel->GetGravityRef();		double bradius=oapiGetSize(hbody);		Vessel->GetEquPos(vlon, vlat, vrad);		double cgelev=Vessel->GetCOG_elev();		altitude=vrad-bradius-cgelev;							/*		sprintf(buffers,"AFTER PDI : TIMEAFTER %f ALTITUDE %f",			        timesincepdi,altitude);		sprintf(oapiDebugString(),"%s",buffers);*/	}	    kk = lastplayed+1;	sprintf(buffers,"%f",soundevents[kk].altitude);//	TRACE (buffers);//	sprintf(buffers,"%f",altitude);//	TRACE (buffers);//.........这里部分代码省略.........
开发者ID:dseagrav,项目名称:NASSP,代码行数:101,


示例12: GetPosition

// -------------------------------------------------------------------------- //// Sound property functions                                               // -------------------------------------------------------------------------- //void VFmodSoundObject::Play(float fStartTime, bool bAlsoInEditor){  if (m_spResource == NULL || IsPlaying())    return;  if (!bAlsoInEditor && !Vision::Editor.IsAnimatingOrPlaying())    return;     m_fStartTime = fStartTime;      VFmodManager &manager = VFmodManager::GlobalManager();  if (manager.IsInitialized())  {    const hkvVec3 &vPos = GetPosition();    // stop old playing    if (m_pChannel)      m_pChannel->stop();    VFmodSoundResource* pResource = (VFmodSoundResource*)GetResource();    if (pResource->m_pSound == NULL) // sound resource not loaded successfully      return;    FMOD_WARNINGCHECK(manager.m_pSystem->playSound(FMOD_CHANNEL_FREE, pResource->m_pSound, true, &m_pChannel));    if (!m_pChannel)      return;    FMOD_WARNINGCHECK(m_pChannel->getFrequency(&m_fInitialFreq));    // if this a music sound object assign it to the music channel group    if (IsMusic())      m_pChannel->setChannelGroup(manager.m_pMusicGroup);    // set everything      m_pChannel->setUserData(this); // ...so that we can get from channel to VSoundObject    m_pChannel->setCallback(ChannelCallback);    m_pChannel->setMode(IsLooped() ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);    m_pChannel->setPriority(GetPriority());    m_pChannel->set3DMinMaxDistance(Get3DFadeMinDistance(), Get3DFadeMaxDistance());    m_pChannel->set3DAttributes((FMOD_VECTOR *)&vPos, NULL); // no speed (yet)    m_pChannel->setVolume(GetVolume());    m_pChannel->setPan(GetPan());    SetPitch(GetPitch());    SetConeAngles(GetConeAngleInside(), GetConeAngleOutside());    // Initially the sound is left paused, then within the first RunTick it is unpaused. This is required since     // the 3D listener attributes has to be set prior to playing a sound. Otherwise Fmod would perform     // occlusion-raycasts without having initialized listener-attributes, which potentially results in a    // wrong occlusion-behavior.    m_bUnpause = true;    m_bIsPlaying = true;    m_bPlayedOnce = true;    unsigned int ims = (int)(fStartTime*1000.f); // milliseconds    m_pChannel->setPosition(ims,FMOD_TIMEUNIT_MS);    m_pChannel->setMute(IsMuted());  }  Helper_SetFlag(VFMOD_FLAG_PAUSED, !IsPlaying());}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:65,


示例13: QueueNextFile

bool PAPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options){  if (m_currentlyCrossFading) CloseFileInternal(false); //user seems to be in a hurry  m_crossFading = g_guiSettings.GetInt("musicplayer.crossfade");  //WASAPI doesn't support multiple streams, no crossfading for cdda, cd-reading goes mad and no crossfading for last.fm doesn't like two connections  if (file.IsCDDA() || file.IsLastFM() || g_guiSettings.GetString("audiooutput.audiodevice").find("wasapi:") != CStdString::npos) m_crossFading = 0;  if (m_crossFading && IsPlaying())  {    //do a short crossfade on trackskip    //set to max 2 seconds for these prev/next transitions    if (m_crossFading > 2) m_crossFading = 2;    //queue for crossfading    bool result = QueueNextFile(file, false);    if (result)    {      //crossfading value may be update by QueueNextFile when nr of channels changed      if (!m_crossFading) // swap to next track        m_decoder[m_currentDecoder].SetStatus(STATUS_ENDED);      else //force to fade to next track immediately        m_forceFadeToNext = true;    }    return result;  }  // normal opening of file, nothing playing or crossfading not enabled  // however no need to return to gui audio device  CloseFileInternal(false);  // always open the file using the current decoder  m_currentDecoder = 0;  if (!m_decoder[m_currentDecoder].Create(file, (__int64)(options.starttime * 1000), m_crossFading))    return false;  m_iSpeed = 1;  m_bPaused = false;  m_bStopPlaying = false;  m_bytesSentOut = 0;  CLog::Log(LOGINFO, "PAPlayer: Playing %s", file.m_strPath.c_str());  m_timeOffset = (__int64)(options.starttime * 1000);  unsigned int channel, sampleRate, bitsPerSample;  m_decoder[m_currentDecoder].GetDataFormat(&channel, &sampleRate, &bitsPerSample);  if (!CreateStream(m_currentStream, channel, sampleRate, bitsPerSample))  {    m_decoder[m_currentDecoder].Destroy();    CLog::Log(LOGERROR, "PAPlayer::Unable to create audio stream");  }  *m_currentFile = file;  if (ThreadHandle() == NULL)    Create();  m_startEvent.Set();  m_bIsPlaying = true;  m_cachingNextFile = false;  m_currentlyCrossFading = false;  m_forceFadeToNext = false;  m_bQueueFailed = false;  m_decoder[m_currentDecoder].Start();  // start playback  return true;}
开发者ID:mbolhuis,项目名称:xbmc,代码行数:70,


示例14: return

bool CApplicationPlayer::IsPausedPlayback() const{  return (IsPlaying() && IsPaused());}
开发者ID:B0k0,项目名称:xbmc,代码行数:4,


示例15: ProcessCommandLine

//========================================================================================//	/exit		exit T-Clock 2010//	/prop		show T-Clock 2010 properties//	/SyncOpt	SNTP options//	/Sync		synchronize the system clock with an NTP server//	/start		start the Stopwatch (open as needed)//	/stop		stop (pause really) the Stopwatch//	/reset		reset Stopwatch to 0 (stop as needed)//	/lap		record a (the current) lap time//================================================================================================//---------------------------------------------//---------------+++--> T-Clock Command Line Option:void ProcessCommandLine(HWND hwndMain,const char* cmdline)   //-----------------------------+++-->{	int justElevated = 0;	const char* p = cmdline;	if(g_hwndTClockMain != hwndMain){		g_hwndTClockMain = CreateWindow("STATIC",NULL,0,0,0,0,0,HWND_MESSAGE_nowarn,0,0,0);		SubclassWindow(g_hwndTClockMain, MsgOnlyProc);	}		while(*p != '/0') {		if(*p == '/') {			++p;			if(strncasecmp(p, "prop", 4) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_SHOWPROP, 0);				p += 4;			} else if(strncasecmp(p, "exit", 4) == 0) {				SendMessage(hwndMain, MAINM_EXIT, 0, 0);				p += 4;			} else if(strncasecmp(p, "start", 5) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_START, 0);				p += 5;			} else if(strncasecmp(p, "stop", 4) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_STOP, 0);				p += 4;			} else if(strncasecmp(p, "reset", 5) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_RESET, 0);				p += 5;			} else if(strncasecmp(p, "pause", 5) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_PAUSE, 0);				p += 5;			} else if(strncasecmp(p, "resume", 6) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_RESUME, 0);				p += 6;			} else if(strncasecmp(p, "lap", 3) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_LAP, 0);				p += 3;			} else if(strncasecmp(p, "SyncOpt", 7) == 0) {				if(HaveSetTimePermissions()){					if(!SendMessage(hwndMain, WM_COMMAND, MAKEWPARAM(IDM_SNTP,1), 0)){						NetTimeConfigDialog(justElevated);					}				}else{					SendMessage(hwndMain, WM_COMMAND, IDM_SNTP, 0);				}				p += 7;			} else if(strncasecmp(p, "Sync", 4) == 0) {				p += 4;				SendMessage(hwndMain, WM_COMMAND, MAKEWPARAM(IDM_SNTP_SYNC,justElevated), 0);				if(g_hwndTClockMain == hwndMain)					SendMessage(hwndMain, MAINM_EXIT, 0, 0);			} else if(strncmp(p, "Wc", 2) == 0) { // Win10 calendar "restore"				if(p[2] == '1') // restore to previous					api.SetSystemInt(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray, 1);				else // use the slow (new) one					api.DelSystemValue(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray);				p += 2;			} else if(strncmp(p, "UAC", 3) == 0) {				justElevated = 1;				p += 3;			}			continue;		}		++p;	}		if(g_hwndTClockMain != hwndMain){		const DWORD kTimeout = 10000;		const DWORD kStartTicks = GetTickCount();		DWORD timeout;		MSG msg;		msg.message = 0;		for(;;){			int have_ui = IsWindow(g_hwndSheet) || IsWindow(g_hDlgTimer) || IsWindow(g_hDlgTimerWatch) || IsWindow(g_hDlgSNTP) || IsWindow(g_hDlgStopWatch);			if(have_ui)				timeout = INFINITE;			else if(IsPlaying())				timeout = 200;			else				break;			MsgWaitForMultipleObjectsEx(0, NULL, timeout, QS_ALLEVENTS, MWMO_INPUTAVAILABLE);			while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){				if(msg.message == WM_QUIT)					break;				if(!(g_hwndSheet && IsWindow(g_hwndSheet) && PropSheet_IsDialogMessage(g_hwndSheet,&msg))				&& !(g_hDlgTimer && IsWindow(g_hDlgTimer) && IsDialogMessage(g_hDlgTimer,&msg))				&& !(g_hDlgTimerWatch && IsWindow(g_hDlgTimerWatch) && IsDialogMessage(g_hDlgTimerWatch,&msg))				&& !(g_hDlgSNTP && IsWindow(g_hDlgSNTP) && IsDialogMessage(g_hDlgSNTP,&msg))				&& !(g_hDlgStopWatch && IsWindow(g_hDlgStopWatch) && IsDialogStopWatchMessage(g_hDlgStopWatch,&msg))){					TranslateMessage(&msg);//.........这里部分代码省略.........
开发者ID:dubepaul,项目名称:T-Clock,代码行数:101,


示例16: GetPlaybackPosition

int AudioController::GetPlaybackPosition(){	if (!IsPlaying()) return 0;	return MillisecondsFromSamples(player->GetCurrentPosition());}
开发者ID:sthenc,项目名称:Aegisub,代码行数:6,


示例17: return

bool CApplicationPlayer::IsPausedPlayback(){  return (IsPlaying() && (GetPlaySpeed() == 0));}
开发者ID:angp,项目名称:xbmc,代码行数:4,


示例18: SetTimer

HRESULT FMediaContainer::PlayMT(ulong videoID, BOOL bPaused /* = FALSE */){	if (m_pStatusBar)		m_pStatusBar->SetStatusText(0, "Loading video plug-in...", VIEW_PLAYER);	m_bFullScreenAd = FALSE; 	m_MSLast = 0; 	m_MSPlayed = 0; 	HRESULT hr = m_pMediaPlayer.PlayMT(videoID, bPaused); 	BOOL bFullscreenAd = FALSE; 		for (size_t k =0 ; k < MAX_AD_WINDOWS; k++)	{		if (m_pAdWindows[k])		{			m_pAdWindows[k]->ShowWindow(SW_HIDE); 			m_pAdWindows[k]->Clear(); 		}	}	m_CurVideoID = videoID; //No sync, let it burn!	m_AdManager->Clear();	if (SUCCEEDED(hr) || hr == E_PENDING)	{		m_AdRequests.Push(videoID); 		m_bPlaying = !bPaused; 		FDownload &pDown = m_pMediaPlayer.m_pVideo; 		FIniConfig aConf = g_Objects._DownloadManager.GetDownloadConf(videoID); 				if (m_AdManager->LoadAds(aConf, TRUE))		{			IAdWindowInit InitData; 			InitData.m_hWndParent = m_hWnd; 			InitData.m_pAdManager = m_AdManager.m_p; 			InitData.m_pNotify = this;			IAdPosition pPos; 			pPos.m_PlaybackPosMS = pDown.m_Detail.m_PlaybackPosMS / DURATION_MULT;			pPos.m_TotalDurationMS = pDown.m_Detail.m_TotalDurationMS; 			pPos.m_dwFlags = FLAG_PLAYBACK_START; 			for (size_t k = 0; k < MAX_AD_WINDOWS; k++)			{				InitData.m_AdType = (AdTypes)(k + 1);				InitData.m_dwWinID = (DWORD)k; 				if (m_pAdWindows[k] == NULL)					m_pAdWindows[k].Attach(new FAdWindow);				if (m_pAdWindows[k]->Init(InitData))				{					BOOL bHasAd = m_pAdWindows[k]->UpdatePosition(pPos); 					if (k == 0 && bHasAd)						bFullscreenAd = TRUE; 				}			}				SetTimer(1, 500); 		}	}		m_pMediaPlayer.ShowWindow(SW_SHOW); 	if (bFullscreenAd)	{		Pause(); 	}	if (g_MainFrame->IsFullScreen())		m_ControlBar.ShowWindow(SW_HIDE);	UpdateLayout(); 	if (FAILED(hr))	{		if (hr != E_PENDING)		{			if (m_pStatusBar)				m_pStatusBar->SetStatusText(0, "Cannot play video.", VIEW_PLAYER);		}	}	else	{		if (m_pStatusBar)		{			if (IsPlaying())				m_pStatusBar->SetStatusText(0, "Playing", VIEW_PLAYER); 			else				m_pStatusBar->SetStatusText(0, "Paused", VIEW_PLAYER); 		}	}	return hr; }
开发者ID:codeboost,项目名称:libertv,代码行数:94,


示例19: PlayL

void MsgAudioPreview::PlayL()    {    if( IsPlaying() )        {        Stop();        return;        }    //sequence for playing a beep once sound    _LIT8( KFileListBeepSequence, "/x00/x11/x06/x0A/x08/x73/x0A/x40/x28/x0A/xF7/    /x05/xFC/x40/x64/x0A/x08/x40/x32/x0A/xF7/x06/x0B" );     // rng mime type    _LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" );        Cancel(); // stop previous play        if ( !iFullName || iFullName->Des().Length() == 0 )        {        User::Leave( KErrNotFound );        }    TRAP_IGNORE( ReadActiveProfileL() );    TPtrC fileName( iFullName->Des() );    TDataType dataType;    TInt err = GetDataType( fileName, dataType );    if ( err == KErrNotFound )        {        fileName.Set( iDefaultTone );        if ( fileName.Length() == 0 )             {             User::Leave( KErrNotFound );             }        }    else if ( err != KErrNone )        {        User::Leave( err );        }            TBool mimeTypeRng = EFalse;        if ( err == KErrNone )        {        if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 )            {            mimeTypeRng = ETrue;            }        }    TInt ringingType = RingingType();    if ( ringingType == ERingingTypeBeepOnce )        {        // Active profile ringing tone is set to Beep Once        // Don't initialize a FileSequence but use DesSequence instead        iTonePlayer = CMdaAudioToneUtility::NewL( *this );        iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() );        iTonePlayerStatus = EPlayerInitializing;        }    else        {        if( mimeTypeRng )            {            //Ringingtone is a RNG-file            iTonePlayer = CMdaAudioToneUtility::NewL( *this );            iTonePlayer->PrepareToPlayFileSequence( fileName );            iTonePlayerStatus = EPlayerInitializing;            }        else            {            delete iAudioPlayer;            iAudioPlayer = 0;            iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL(                fileName, *this, KAudioPriorityRingingTonePreview,                ( TMdaPriorityPreference )KAudioPrefRingFilePreview );                iAudioPlayerStatus = EPlayerInitializing;            }        }    DisableBackLight();    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:81,


示例20: init_mud

//.........这里部分代码省略.........	// connect_attempts array, to keep people from spam connecting to slow down the mud        connect_attempts        = malloc(sizeof(char*));        connect_attempts[0]     = 0;	mysql = mysql_init(NULL);              if (!mysql)       {               mudlog("Error initializing MySQL: %s", mysql_error(mysql));               abort();       }        // connect to MySQL database       if (!mysql_real_connect(mysql, DB_HOST, DB_LOGIN, DB_PASSWORD, DB_NAME, 0, NULL, 0))        {               mudlog("Error opening mysql database: %s", mysql_error(mysql));                abort();        }        if (mysql_select_db(mysql, DB_NAME))        {               mudlog("Error opening main database: %s",mysql_error(mysql));               if (mysql)                       mysql_close(mysql);                abort();        }	// time of da mud !	fread_time();	// load areas/rooms/objects/creatures	load_db();	// check if hotreboot and reconnect everything	if(hotreboot)	{		MSOCKET *socket=0;		char buf[MAX_BUFFER];		MYSQL_RES *result;		MYSQL_ROW row;		mysql_query(mysql, "SELECT * FROM player WHERE online='1'");		result = mysql_store_result(mysql);		if (mysql_num_rows(result) < 0)		{			mudlog("hotreboot: mysql error is: %s",mysql_error(mysql));			exit(1);		}		while((row = mysql_fetch_row(result)))		{			strcpy(buf, row[P_NAME]);			// check for "host" player.. holds control descriptor			if(!strcasecmp("host", row[C_NAME]))			{				host = atoi(row[P_DESCRIPTOR]);			}			else			{				socket = init_socket();				fread_player(socket, buf);				str_dup(&socket->host,		row[P_HOST]);				str_dup(&socket->ip,		row[P_IP]);				socket->desc = atoi(row[P_DESCRIPTOR]);				socket->connected = CON_PLAYING;				trans(socket->pc, socket->pc->in_room);				sendcrit(socket->pc, "Hotreboot completed.");			}		}		mysql_free_result(result);	}	// make sure nobody has non-existant connections, in the event of a crash + hotreboot	// then go through and update people who are online	// this is also a good time to get host address, as players will be expecting lag	mysql_query(mysql, "UPDATE player SET online='0', descriptor='0'");	for(socket = socket_list; socket; socket = socket->next)	{		get_hostname(socket);		sprintf(buf,"UPDATE player SET online='1', host=/"%s/" WHERE id='%li'",			smash_quotes(socket->host), socket->id);		mysql_query(mysql, buf);	}	// see how many players are in each area, to see if area should be 'alive'	for(socket = socket_list; socket; socket = socket->next)	{		if(IsPlaying(socket->pc))			socket->pc->in_room->area->players++;	}	// check if we need to backup	backup_update();}
开发者ID:borlak,项目名称:acmud,代码行数:101,


示例21: BuffersProcessed

//============================================================================ bool plDSoundBuffer::StreamingFillBuffer(plAudioFileReader *stream){    if(!source)        return false;    ALenum error;    ALuint bufferId;    unsigned char data[STREAM_BUFFER_SIZE];    int buffersProcessed = BuffersProcessed();    hsBool finished = false;    for(int i = 0; i < buffersProcessed; i++)    {        alSourceUnqueueBuffers( source, 1, &bufferId );        if( (error = alGetError()) != AL_NO_ERROR )        {            plStatusLog::AddLineS("audio.log", "Failed to unqueue buffer %d", error);            return false;        }        if(!finished)        {            if(stream->NumBytesLeft() == 0)            {                // if at anytime we run out of data, and we are looping, reset the data stream and continue to fill buffers                if(IsLooping())                {                    stream->SetPosition(0); // we are looping, so reset data stream, and keep filling buffers                }                else                {                    finished = true;    // no more data, but we could still be playing, so we don't want to stop the sound yet                }            }            if(!finished)            {   unsigned int size = stream->NumBytesLeft() < STREAM_BUFFER_SIZE ? stream->NumBytesLeft() : STREAM_BUFFER_SIZE;                stream->Read(size, data);                ALenum format = IGetALFormat(fBufferDesc->fBitsPerSample, fBufferDesc->fNumChannels);                alBufferData( bufferId, format, data, size, fBufferDesc->fNumSamplesPerSec );                if( (error = alGetError()) != AL_NO_ERROR )                {                    plStatusLog::AddLineS("audio.log", "Failed to copy data to sound buffer %d", error);                    return false;                }                alSourceQueueBuffers( source, 1, &bufferId );                if( (error = alGetError()) != AL_NO_ERROR )                {                    plStatusLog::AddLineS("audio.log", "Failed to queue buffer %d", error);                    return false;                }            }        }    }    if(!IsPlaying() && !finished)    {        alSourcePlay(source);    }    alGetError();    return true;}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:64,


示例22: nuiRenderArray

bool nuiSWF::Draw(nuiDrawContext* pContext){  gameswf::set_render_handler(mpRenderHandler);  nglTime now;  if (mLastTime <= 0)    mLastTime = now;  double lap = now - mLastTime;  mLastTime = now;  /* double advance = lap * mFPS; unused */  nuiRenderArray* pDummy = new nuiRenderArray(GL_POINTS);  pContext->DrawArray(pDummy);  glPushAttrib(GL_ALL_ATTRIB_BITS);    float width, height;  width = mpMovie->get_width_pixels();  height = mpMovie->get_height_pixels();  //glScalef(10/width, 10/height, 0);  nuiSize x=0,y=0;  LocalToGlobal(x,y);  glDisableClientState(GL_COLOR_ARRAY);  glDisableClientState(GL_EDGE_FLAG_ARRAY);  glDisableClientState(GL_INDEX_ARRAY);  glDisableClientState(GL_NORMAL_ARRAY);  glDisableClientState(GL_TEXTURE_COORD_ARRAY);  glDisableClientState(GL_VERTEX_ARRAY);  mpMovieInterface->set_display_viewport(ToBelow(x), ToBelow(y), ToBelow(mRect.GetWidth()), ToBelow(mRect.GetHeight()));  //mpMovieInterface->set_display_viewport(50, 50, 1, 1);  mpMovieInterface->set_background_alpha(GetAlpha());  if (IsPlaying())    mpMovieInterface->advance((float)lap);                 mpMovieInterface->display();         glDisableClientState(GL_COLOR_ARRAY);  glDisableClientState(GL_EDGE_FLAG_ARRAY);  glDisableClientState(GL_INDEX_ARRAY);  glDisableClientState(GL_NORMAL_ARRAY);  glDisableClientState(GL_TEXTURE_COORD_ARRAY);  glDisableClientState(GL_VERTEX_ARRAY);  // Restore state that gameswf kills  glDisable(GL_TEXTURE_GEN_S);  glDisable(GL_TEXTURE_GEN_T);  // See if we should exit.  if (mLoop == false     && (mpMovieInterface->get_current_frame() + 1 == mpMovie->get_frame_count()     || mpMovieInterface->get_play_state() == gameswf::character::STOP)    )  {  // We're reached the end of the movie; exit.    Stop();  }  glPopAttrib();  pContext->SetTexture(NULL);  return true;}
开发者ID:JamesLinus,项目名称:nui3,代码行数:63,


示例23: ResyncPlaybackPosition

void AudioController::ResyncPlaybackPosition(int new_position){	if (!IsPlaying()) return;	player->SetCurrentPosition(SamplesFromMilliseconds(new_position));}
开发者ID:sthenc,项目名称:Aegisub,代码行数:6,


示例24: ProcessCommandLine

//========================================================================================//	/exit		exit T-Clock 2010//	/prop		show T-Clock 2010 properties//	/SyncOpt	SNTP options//	/Sync		synchronize the system clock with an NTP server//	/start		start the Stopwatch (open as needed)//	/stop		stop (pause really) the Stopwatch//	/reset		reset Stopwatch to 0 (stop as needed)//	/lap		record a (the current) lap time//================================================================================================//---------------------------------------------//---------------+++--> T-Clock Command Line Option:void ProcessCommandLine(HWND hwndMain,const char* cmdline)   //-----------------------------+++-->{	int justElevated = 0;	const char* p = cmdline;	if(g_hwndTClockMain != hwndMain){		g_hwndTClockMain = CreateWindow("STATIC",NULL,0,0,0,0,0,HWND_MESSAGE_nowarn,0,0,0);		SubclassWindow(g_hwndTClockMain, MsgOnlyProc);	}		while(*p != '/0') {		if(*p == '/') {			++p;			if(strncasecmp(p, "prop", 4) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_SHOWPROP, 0);				p += 4;			} else if(strncasecmp(p, "exit", 4) == 0) {				SendMessage(hwndMain, MAINM_EXIT, 0, 0);				p += 4;			} else if(strncasecmp(p, "start", 5) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_START, 0);				p += 5;			} else if(strncasecmp(p, "stop", 4) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_STOP, 0);				p += 4;			} else if(strncasecmp(p, "reset", 5) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_RESET, 0);				p += 5;			} else if(strncasecmp(p, "pause", 5) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_PAUSE, 0);				p += 5;			} else if(strncasecmp(p, "resume", 6) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_RESUME, 0);				p += 6;			} else if(strncasecmp(p, "lap", 3) == 0) {				SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_LAP, 0);				p += 3;			} else if(strncasecmp(p, "SyncOpt", 7) == 0) {				NetTimeConfigDialog(justElevated);				p += 7;			} else if(strncasecmp(p, "Sync", 4) == 0) {				p += 4;				if(HaveSetTimePermissions()){					SyncTimeNow();				} else if(!justElevated){					if(api.ExecElevated(GetClockExe(),"/UAC /Sync",NULL) != 0){						MessageBox(0,"T-Clock must be elevated to set your system time,/nbut elevation was cancled", "Time Sync Failed", MB_OK|MB_ICONERROR);					}				}				if(g_hwndTClockMain == hwndMain)					SendMessage(hwndMain, MAINM_EXIT, 0, 0);			} else if(strncmp(p, "Wc", 2) == 0) { // Win10 calendar "restore"				if(p[2] == '1') // restore to previous					api.SetSystemInt(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray, 1);				else // use the slow (new) one					api.DelSystemValue(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray);				p += 2;			} else if(strncmp(p, "UAC", 3) == 0) {				justElevated = 1;				p += 3;			}			continue;		}		++p;	}		if(g_hwndTClockMain != hwndMain){		int timeout = 100; /**< timeout in 1/10th seconds to allow sounds up to 10 seconds before terminating */		MSG msg;		msg.message = 0;		while(IsPlaying() && --timeout){			while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){				if(msg.message==WM_QUIT)					break;				TranslateMessage(&msg);				DispatchMessage(&msg);			}			if(msg.message==WM_QUIT)				break;			Sleep(100);		}		DestroyWindow(g_hwndTClockMain);		g_hwndTClockMain = NULL;	}}
开发者ID:andrejtm,项目名称:T-Clock,代码行数:95,


示例25: Create

/*========================idSoundVoice_OpenAL::Create========================*/void idSoundVoice_OpenAL::Create( const idSoundSample* leadinSample_, const idSoundSample* loopingSample_ ){	if( IsPlaying() )	{		// This should never hit		Stop();		return;	}		triggered = true;		leadinSample = ( idSoundSample_OpenAL* )leadinSample_;	loopingSample = ( idSoundSample_OpenAL* )loopingSample_;		if( alIsSource( openalSource ) && CompatibleFormat( leadinSample ) )	{		sampleRate = leadinSample->format.basic.samplesPerSec;	}	else	{		DestroyInternal();		formatTag = leadinSample->format.basic.formatTag;		numChannels = leadinSample->format.basic.numChannels;		sampleRate = leadinSample->format.basic.samplesPerSec;				//soundSystemLocal.hardware.pXAudio2->CreateSourceVoice( &pSourceVoice, ( const WAVEFORMATEX* )&leadinSample->format, XAUDIO2_VOICE_USEFILTER, 4.0f, &streamContext );				CheckALErrors();				alGenSources( 1, &openalSource );		if( CheckALErrors() != AL_NO_ERROR )			//if( pSourceVoice == NULL )		{			// If this hits, then we are most likely passing an invalid sample format, which should have been caught by the loader (and the sample defaulted)			return;		}				alSourcef( openalSource, AL_ROLLOFF_FACTOR, 0.0f );				//if( ( loopingSample == NULL && leadinSample->openalBuffer != 0 ) || ( loopingSample != NULL && soundShader->entries[0]->hardwareBuffer ) )		if( leadinSample->openalBuffer != 0 )		{			alSourcei( openalSource, AL_BUFFER, 0 );						// handle uncompressed (non streaming) single shot and looping sounds			/*			if( triggered )			{				alSourcei( openalSource, AL_BUFFER, looping ? chan->soundShader->entries[0]->openalBuffer : leadinSample->openalBuffer );			}			*/		}		else		{			//if( triggered )						// handle streaming sounds (decode on the fly) both single shot AND looping						alSourcei( openalSource, AL_BUFFER, 0 );			alDeleteBuffers( 3, &lastopenalStreamingBuffer[0] );			lastopenalStreamingBuffer[0] = openalStreamingBuffer[0];			lastopenalStreamingBuffer[1] = openalStreamingBuffer[1];			lastopenalStreamingBuffer[2] = openalStreamingBuffer[2];						alGenBuffers( 3, &openalStreamingBuffer[0] );			/*			if( soundSystemLocal.alEAXSetBufferMode )			{				soundSystemLocal.alEAXSetBufferMode( 3, &chan->openalStreamingBuffer[0], alGetEnumValue( ID_ALCHAR "AL_STORAGE_ACCESSIBLE" ) );			}			*/			openalStreamingBuffer[0];			openalStreamingBuffer[1];			openalStreamingBuffer[2];		}				if( s_debugHardware.GetBool() )		{			if( loopingSample == NULL || loopingSample == leadinSample )			{				idLib::Printf( "%dms: %i created for %s/n", Sys_Milliseconds(), openalSource, leadinSample ? leadinSample->GetName() : "<null>" );			}			else			{				idLib::Printf( "%dms: %i created for %s and %s/n", Sys_Milliseconds(), openalSource, leadinSample ? leadinSample->GetName() : "<null>", loopingSample ? loopingSample->GetName() : "<null>" );			}		}	}		sourceVoiceRate = sampleRate;	//pSourceVoice->SetSourceSampleRate( sampleRate );	//pSourceVoice->SetVolume( 0.0f );		alSourcei( openalSource, AL_SOURCE_RELATIVE, AL_TRUE );	alSource3f( openalSource, AL_POSITION, 0.0f, 0.0f, 0.0f );//.........这里部分代码省略.........
开发者ID:BielBdeLuna,项目名称:StormEngine2,代码行数:101,



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


C++ IsPortActive函数代码示例
C++ IsPet函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。