mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-03 22:17:08 +00:00
Show date/time of saves on pause screen. Better WASAPI error checking.
This commit is contained in:
parent
e2825890a0
commit
5354f5163a
@ -140,7 +140,7 @@ public:
|
|||||||
|
|
||||||
screenshotFilename_ = SaveState::GenerateSaveSlotFilename(slot, "jpg");
|
screenshotFilename_ = SaveState::GenerateSaveSlotFilename(slot, "jpg");
|
||||||
PrioritizedWorkQueue *wq = g_gameInfoCache.WorkQueue();
|
PrioritizedWorkQueue *wq = g_gameInfoCache.WorkQueue();
|
||||||
Add(new UI::Spacer(10));
|
Add(new Spacer(5));
|
||||||
|
|
||||||
AsyncImageFileView *fv = Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, wq, new UI::LayoutParams(82 * 2, 47 * 2)));
|
AsyncImageFileView *fv = Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, wq, new UI::LayoutParams(82 * 2, 47 * 2)));
|
||||||
fv->SetOverlayText(StringFromFormat("%i", slot_ + 1));
|
fv->SetOverlayText(StringFromFormat("%i", slot_ + 1));
|
||||||
@ -159,6 +159,17 @@ public:
|
|||||||
loadStateButton_->OnClick.Handle(this, &SaveSlotView::OnLoadState);
|
loadStateButton_->OnClick.Handle(this, &SaveSlotView::OnLoadState);
|
||||||
|
|
||||||
fv->OnClick.Handle(this, &SaveSlotView::OnScreenshotClick);
|
fv->OnClick.Handle(this, &SaveSlotView::OnScreenshotClick);
|
||||||
|
|
||||||
|
std::string dateStr = SaveState::GetSlotDateAsString(slot_);
|
||||||
|
std::vector<std::string> dateStrs;
|
||||||
|
SplitString(dateStr, ' ', dateStrs);
|
||||||
|
if (!dateStrs.empty() && !dateStrs[0].empty()) {
|
||||||
|
LinearLayout *strs = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT));
|
||||||
|
Add(strs);
|
||||||
|
for (size_t i = 0; i < dateStrs.size(); i++) {
|
||||||
|
strs->Add(new TextView(dateStrs[i], new LinearLayoutParams(0.0, G_VCENTER)));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fv->SetFilename("");
|
fv->SetFilename("");
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
#include "Common/CommonWindows.h"
|
||||||
#include <dsound.h>
|
#include <dsound.h>
|
||||||
|
|
||||||
#include "native/thread/threadutil.h"
|
#include "native/thread/threadutil.h"
|
||||||
#include "Common/CommonWindows.h"
|
|
||||||
#include "Core/Reporting.h"
|
#include "Core/Reporting.h"
|
||||||
#include "Core/Util/AudioFormat.h"
|
#include "Core/Util/AudioFormat.h"
|
||||||
#include "Windows/W32Util/Misc.h"
|
#include "Windows/W32Util/Misc.h"
|
||||||
@ -320,13 +320,37 @@ int WASAPIAudioBackend::RunThread() {
|
|||||||
hresult = CoCreateInstance(CLSID_MMDeviceEnumerator,
|
hresult = CoCreateInstance(CLSID_MMDeviceEnumerator,
|
||||||
NULL, /*Object is not created as the part of the aggregate */
|
NULL, /*Object is not created as the part of the aggregate */
|
||||||
CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator);
|
CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator);
|
||||||
|
if (FAILED(hresult)) goto bail;
|
||||||
|
|
||||||
hresult = pDeviceEnumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &pDevice);
|
hresult = pDeviceEnumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &pDevice);
|
||||||
|
if (FAILED(hresult)) {
|
||||||
|
pDeviceEnumerator->Release();
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
hresult = pDevice->Activate(IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pAudioInterface);
|
hresult = pDevice->Activate(IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pAudioInterface);
|
||||||
|
if (FAILED(hresult)) {
|
||||||
|
pDevice->Release();
|
||||||
|
pDeviceEnumerator->Release();
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
hresult = pAudioInterface->GetMixFormat((WAVEFORMATEX**)&pDeviceFormat);
|
hresult = pAudioInterface->GetMixFormat((WAVEFORMATEX**)&pDeviceFormat);
|
||||||
hresult = pAudioInterface->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, hnsBufferDuration, 0, &pDeviceFormat->Format, NULL);
|
hresult = pAudioInterface->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, hnsBufferDuration, 0, &pDeviceFormat->Format, NULL);
|
||||||
hresult = pAudioInterface->GetService(IID_IAudioRenderClient, (void**)&pAudioRenderClient);
|
hresult = pAudioInterface->GetService(IID_IAudioRenderClient, (void**)&pAudioRenderClient);
|
||||||
|
if (FAILED(hresult)) {
|
||||||
|
pDevice->Release();
|
||||||
|
pDeviceEnumerator->Release();
|
||||||
|
pAudioInterface->Release();
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
hresult = pAudioInterface->GetBufferSize(&pNumBufferFrames);
|
hresult = pAudioInterface->GetBufferSize(&pNumBufferFrames);
|
||||||
|
if (FAILED(hresult)) {
|
||||||
|
pDevice->Release();
|
||||||
|
pDeviceEnumerator->Release();
|
||||||
|
pAudioInterface->Release();
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
sampleRate_ = pDeviceFormat->Format.nSamplesPerSec;
|
sampleRate_ = pDeviceFormat->Format.nSamplesPerSec;
|
||||||
|
|
||||||
@ -430,6 +454,7 @@ int WASAPIAudioBackend::RunThread() {
|
|||||||
pAudioInterface->Release();
|
pAudioInterface->Release();
|
||||||
pAudioRenderClient->Release();
|
pAudioRenderClient->Release();
|
||||||
|
|
||||||
|
bail:
|
||||||
threadData_ = 2;
|
threadData_ = 2;
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user