mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 04:18:36 +00:00
changes:
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:
parent
0c8d9725a3
commit
9f63336389
@ -61,6 +61,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NODEFAULTLIB:LIBCMT"
|
||||
AdditionalDependencies="MACLib.lib"
|
||||
AdditionalLibraryDirectories="ape;../../3rdparty/lib"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
|
@ -61,6 +61,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NODEFAULTLIB:LIBCMT
"
|
||||
AdditionalDependencies="ogg_static.lib vorbis_static.lib vorbisfile_static.lib"
|
||||
AdditionalLibraryDirectories="./lib;../../3rdparty/lib"
|
||||
GenerateDebugInformation="true"
|
||||
|
@ -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
|
||||
|
@ -83,9 +83,30 @@ uistring TracklistModel::CellValueToString(int rowIndex, ColumnRef co
|
||||
if(!track){
|
||||
return _T("");
|
||||
}else{
|
||||
const utfchar *value = track->GetValue(tracklistColumn->metaKey.c_str());
|
||||
const utfchar *value = track->GetValue(tracklistColumn->metaKey.c_str());
|
||||
if(value)
|
||||
return win32cpp::Escape(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("");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user