minor fixes

This commit is contained in:
Nomango 2019-08-23 13:22:21 +08:00
parent a5fe64fa2c
commit 84ede8af45
2 changed files with 14 additions and 7 deletions

View File

@ -65,8 +65,7 @@ namespace kiwano
Close();
}
Transcoder transcoder;
HRESULT hr = transcoder.LoadMediaFile(file_path);
HRESULT hr = transcoder_.LoadMediaFile(file_path);
if (FAILED(hr))
{
@ -74,7 +73,7 @@ namespace kiwano
return false;
}
hr = Audio::GetInstance()->CreateVoice(&voice_, transcoder.GetBuffer().format);
hr = Audio::GetInstance()->CreateVoice(&voice_, transcoder_.GetBuffer().format);
if (FAILED(hr))
{
Close();
@ -94,8 +93,7 @@ namespace kiwano
Close();
}
Transcoder transcoder;
HRESULT hr = transcoder.LoadMediaResource(res);
HRESULT hr = transcoder_.LoadMediaResource(res);
if (FAILED(hr))
{
@ -103,7 +101,7 @@ namespace kiwano
return false;
}
hr = Audio::GetInstance()->CreateVoice(&voice_, transcoder.GetBuffer().format);
hr = Audio::GetInstance()->CreateVoice(&voice_, transcoder_.GetBuffer().format);
if (FAILED(hr))
{
Close();

View File

@ -127,7 +127,16 @@ namespace kiwano
}
debug_text_->SetText(ss.str());
SetSize(Size{ 20 + debug_text_->GetSize().x, 20 + debug_text_->GetSize().y });
if (debug_text_->GetWidth() > GetWidth() - 20)
{
SetWidth(20 + debug_text_->GetWidth());
}
if (debug_text_->GetHeight() > GetHeight() - 20)
{
SetHeight(20 + debug_text_->GetHeight());
}
}
}