Ejemplo n.º 1
0
wxString CMusikPlayer::GetTimeStr()
{
	if(_CurrentSongIsNetStream())
	{
		wxString sProgress;
		switch(m_NETSTREAM_status)
		{
		case FSOUND_STREAM_NET_NOTCONNECTED:
			sProgress = _("not connected");
			break;
		case FSOUND_STREAM_NET_CONNECTING:
			sProgress = _("connecting ...");
			break;
		case FSOUND_STREAM_NET_BUFFERING:
			sProgress = _("buffering ...");
			break;
		case FSOUND_STREAM_NET_READY:
			sProgress = _("streaming");
			break;
		case FSOUND_STREAM_NET_ERROR:
			sProgress = _("net error");
			break;
		}

		return wxString::Format( wxT( "%s (%d%%)"), (const wxChar *)sProgress, GetTime( FMOD_SEC ));
		
	}
	else
		return SecToStr( GetTime( FMOD_SEC ) ) + wxT("/") + SecToStr(GetDuration( FMOD_SEC ));
}
Ejemplo n.º 2
0
wxString CMusikPlayer::GetTimeLeftStr()
{
	if(_CurrentSongIsNetStream())
	{
		return GetTimeStr();
	}
	else
		return SecToStr( GetTimeLeft( FMOD_SEC ) );
}
Ejemplo n.º 3
0
void PrintFinish (void)
{
	char Str[20];

	if (start != 0)
	{
		end = I_FloatTime ();

		SecToStr ((end - start + 0.5), Str, true);

		logprintf ("\nElapsed time : %s\n", Str);
	}

	fclose (logfile);
}
Ejemplo n.º 4
0
// replaces special tags such as %TITLE% with info from the song
void CTunage::ParseTags( wxString& str )
{
	CNiceFilesize filesize;
	filesize.AddB( m_Song.MetaData.nFilesize );
	wxString sFilesize = filesize.GetFormatted();

	str.Replace( wxT("$ARTIST"), ConvFromUTF8( m_Song.MetaData.Artist ));
	str.Replace( wxT("$ALBUM"), ConvFromUTF8( m_Song.MetaData.Album ));
	str.Replace( wxT("$TITLE"), ConvFromUTF8(m_Song.MetaData.Title ));
	str.Replace( wxT("$YEAR"), ConvFromUTF8(m_Song.MetaData.Year ));

	if ( m_Song.MetaData.nFilesize == -1 )
		str.Replace( wxT("$NAME"), wxGetApp().Prefs.sTunageStoppedText );
	else
		str.Replace( wxT("$NAME"), wxString::Format( wxT("%s - %s"),(const wxChar*)ConvFromUTF8(m_Song.MetaData.Artist), (const wxChar *)ConvFromUTF8(m_Song.MetaData.Title) ) );

	str.Replace( wxT("$FILENAME"), m_Song.MetaData.Filename.GetFullPath() );
	str.Replace( wxT("$FILESIZE"), sFilesize );
	str.Replace( wxT("$BITRATE"), wxString::Format( wxT("%d"), m_Song.MetaData.nBitrate ) );
	str.Replace( wxT("$TRACKLENGTH"), SecToStr( m_Song.MetaData.nDuration_ms /1000 ) );

	str.Replace( wxT("$TIMESPLAYED"), wxString::Format( wxT("%d"), m_Song.TimesPlayed ) );
	str.Replace( wxT("$TRACKNUM"), wxString::Format( wxT("%.2d"), m_Song.MetaData.nTracknum ) );
}