void MP3Player::Previous()
{
	if(isPlayAll&&(counter-1)>0)
	{
		Stop();
		PlayTrack(currentDir.c_str(),(counter-1));//temp,currentDir.c_str()
		isPlayAll = true;
	}
}
示例#2
0
bool NativePlayer::PrevTrack()
{
    BYTE track = GetTrack() - 1;
    if ( track < 1 ) track = GetNumberOfTracks();
    if ( GetMode() == MCI_MODE_PLAY )
        return PlayTrack( track );
    else
        return SeekTrack( track );
}
示例#3
0
static BOOLEAN
TalkSegue (COUNT wait_track)
{
	TALKING_STATE talkingState;

	// Transition animation to talking state, if necessary
	if (wantTalkingAnim () && haveTalkingAnim ())
	{	
		if (haveTransitionAnim ())
			setRunIntroAnim ();
					
		setRunTalkingAnim ();

		// wait until the transition finishes
		while (runningIntroAnim ())
			runCommAnimFrame ();
	}

	memset (&talkingState, 0, sizeof talkingState);

	if (wait_track == 0)
	{	// Restarting with a rewind
		wait_track = WAIT_TRACK_ALL;
		talkingState.rewind = true;
	}
	else if (!PlayingTrack ())
	{	// initial start of player
		PlayTrack ();
		assert (PlayingTrack ());
	}

	// Run the talking controls
	SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
	talkingState.InputFunc = DoTalkSegue;
	talkingState.waitTrack = wait_track;
	DoInput (&talkingState, FALSE);

	ClearSubtitles ();

	if (talkingState.ended)
	{	// reached the end; set STOP icon
		SetSliderImage (SetAbsFrameIndex (ActivityFrame, 8));
	}

	// transition back to silent, if necessary
	if (runningTalkingAnim ())
		setStopTalkingAnim ();

	// Wait until the animation task stops "talking"
	while (runningTalkingAnim ())
		runCommAnimFrame ();

	return talkingState.ended;
}
示例#4
0
bool NativePlayer::NextTrack()
{
    BYTE track = GetTrack() + 1;
    BYTE total = GetNumberOfTracks();
    if ( track > total )
        track = 1;
    if ( GetMode() == MCI_MODE_PLAY )
        return PlayTrack( track );
    else
        return SeekTrack( track );
}
示例#5
0
void SoundEngine::PrevTrack()
{
    if (nosound)
    {
        return;
    }

    if (currentTrack == playlist.begin())
    {
        currentTrack = playlist.end();
    }
    --currentTrack;
    PlayTrack(*currentTrack);
}
示例#6
0
void SoundEngine::NextTrack()
{
    if (nosound)
    {
        return;
    }

    if (++currentTrack == playlist.end())
    {
        currentTrack = playlist.begin();
    }

    PlayTrack(*currentTrack);
}
示例#7
0
void SoundEngine::PlayMusic()
{
    if (nosound)
    {
        return;
    }
    if (!Mix_PlayingMusic()) {
        if (Mix_PausedMusic()) {
            Mix_ResumeMusic();
        } else {
            PlayTrack(*currentTrack);
        }
    }
}
// Manages Currently playing 2D cinematic
void cinematicRender() {
	
	arxtime.update(false);
	float now = arxtime.now_f();

	if(PLAY_LOADED_CINEMATIC == Cinematic_StartRequested) {
		LogDebug("really starting cinematic now");
		LastFrameTicks = now;
		PLAY_LOADED_CINEMATIC = Cinematic_Started;
	}

	PlayTrack(ControlCinematique);
	ControlCinematique->InitDeviceObjects();
	GRenderer->SetRenderState(Renderer::AlphaBlending, true);

	ControlCinematique->Render(now - LastFrameTicks);

	// end the animation
	if(   !ControlCinematique->key
	   || GInput->isKeyPressedNowUnPressed(Keyboard::Key_Escape)
	) {
		ControlCinematique->projectload=false;
		StopSoundKeyFramer();
		ControlCinematique->OneTimeSceneReInit();
		ControlCinematique->DeleteDeviceObjects();
		arxtime.resume();
		PLAY_LOADED_CINEMATIC = Cinematic_Stopped;

		bool bWasBlocked = false;
		if(BLOCK_PLAYER_CONTROLS) {
			bWasBlocked = true;
		}

		// !! avant le cine end
		if(ACTIVECAM) {
			ACTIVECAM->orgTrans.pos = ePos;
		}

		if(bWasBlocked) {
			BLOCK_PLAYER_CONTROLS = true;
		}

		ARX_SPEECH_Reset();
		SendMsgToAllIO(SM_CINE_END, LAST_LAUNCHED_CINE);
	}

	LastFrameTicks = now;
}
void MP3Player::Halt()
{
	Timer1.detachInterrupt();
	PLAY=false; 
	while(!myFile.close())
	{
	   #if DEBUG
	   Serial.println("close audio file");
	   #endif 
	}
	//AMPSHUTDOWN();
	#if DEBUG
    Serial.println("finish");
	#endif 
	delayMicroseconds(100000);
	name = "";
	  if(isPlayAll)
		PlayTrack("",0,"");
}
void MP3Player::PlayFolderStartFrom(const char* dirName,const char* start_track)
{
	PlayTrack(dirName,start_track);
	if(!finishSearch)
		isPlayAll = true;
}
void MP3Player::PlayFolder(const char* dirName)
{
	PlayTrack(dirName,0,"");
}
void MP3Player::PlayFolderStartFrom(int start_index)
{
	PlayTrack(start_index);
	if(!finishSearch)
		isPlayAll = true;
}
void MP3Player::PlayFolder()
{
	PlayTrack("/",0,"");
}
void MP3Player::PlayTrack(const char* dirName,int track_no)
{
	if(track_no>0)
		PlayTrack(dirName,track_no,"");
}
void MP3Player::PlayTrack(const char* dirName,const char* track_name)
{	
	if(!String(track_name).equals(""))
		PlayTrack(dirName,-1,track_name);
}
void MP3Player::PlayTrack(int track_no)
{	
	if(track_no>0)
		PlayTrack("/",track_no,"");
}