core/audio/Transport.cpp: fixed Transport::SetTrackPosition() so that it won't crash the program if you change the position if no song is currently selected. 
cube/TracklistModel.cpp: made it so that the duration of a song is now properly shown as mm:ss. 
Variables are available if we want to add more times (hours and days for example). Code for it was taken from TracklistController.cpp.
apedecoder/apedecoder.vcproj and oggdecoder/oggdecoder.vcproj: added /NODEFAULTLIB:LIBCMT to the linker command line so that they compile.
This commit is contained in:
bart.apella 2008-06-05 15:59:38 +00:00
parent 0c8d9725a3
commit 9f63336389
4 changed files with 32 additions and 3 deletions

View File

@ -61,6 +61,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/NODEFAULTLIB:LIBCMT"
AdditionalDependencies="MACLib.lib"
AdditionalLibraryDirectories="ape;../../3rdparty/lib"
IgnoreAllDefaultLibraries="false"

View File

@ -61,6 +61,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/NODEFAULTLIB:LIBCMT&#x0D;&#x0A;"
AdditionalDependencies="ogg_static.lib vorbis_static.lib vorbisfile_static.lib"
AdditionalLibraryDirectories="./lib;../../3rdparty/lib"
GenerateDebugInformation="true"

View File

@ -179,9 +179,15 @@ bool Transport::Resume()
void Transport::SetTrackPosition(unsigned long position)
{
AudioStream* stream = this->openStreams[0];
try
{
AudioStream* stream = this->openStreams.at(0);
stream->SetPositionMs(position);
}
catch(...)
{
}
}
unsigned long Transport::TrackPosition() const

View File

@ -85,8 +85,29 @@ uistring TracklistModel::CellValueToString(int rowIndex, ColumnRef co
}else{
const utfchar *value = track->GetValue(tracklistColumn->metaKey.c_str());
if(value)
{
if (tracklistColumn->metaKey == "duration")
{
UINT64 duration = boost::lexical_cast<int>(value);
UINT64 days(duration/86400);
duration = duration%86400;
UINT64 hours(duration/3600);
duration = duration%3600;
UINT64 minutes(duration/60);
duration = duration%60;
utfstring result;
if (minutes < 10)
result += _T("0");
result += boost::lexical_cast<utfstring>(minutes) + _T(":");
if (duration < 10)
result += _T("0");
result += boost::lexical_cast<utfstring>(duration);
return win32cpp::Escape(result);
}
return win32cpp::Escape(value);
}
return _T("");
}
}