diff --git a/DXAudioOutput.cpp b/DXAudioOutput.cpp index b5a5d30f7..4f5c9abd5 100644 --- a/DXAudioOutput.cpp +++ b/DXAudioOutput.cpp @@ -341,6 +341,8 @@ DXAudioOutput::DXAudioOutput() { QMessageBox::warning(NULL, tr("Mumble"), tr("Opening chosen DirectSound Output failed. Using defaults."), QMessageBox::Ok, QMessageBox::NoButton); qWarning("DXAudioOutput: Primary buffer of %ld Hz, %d channels, %d bits",wfxSet.nSamplesPerSec,wfxSet.nChannels,wfxSet.wBitsPerSample); + if (p3DListener) + qWarning("DXAudioOutput: 3D mode active"); bRunning = true; } diff --git a/GlobalShortcut_win.cpp b/GlobalShortcut_win.cpp index 07a4072c5..25b3d7295 100644 --- a/GlobalShortcut_win.cpp +++ b/GlobalShortcut_win.cpp @@ -232,7 +232,6 @@ BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE pdidi, LPVOID pContext InputDevice *id = new InputDevice; id->guid = pdidi->guidInstance; - cbgsw->qhInputDevices[id->guid] = id; if (FAILED(hr = cbgsw->pDI->CreateDevice(pdidi->guidInstance, &id->pDID, NULL))) qFatal("GlobalShortcutWin: CreateDevice: %lx", hr); @@ -281,8 +280,11 @@ BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE pdidi, LPVOID pContext if(FAILED(hr = id->pDID->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph))) qFatal("GlobalShortcutWin::SetProperty"); + + cbgsw->qhInputDevices[id->guid] = id; } else { id->pDID->Release(); + free(id); } return DIENUM_CONTINUE; @@ -310,7 +312,6 @@ void GlobalShortcutWin::remap() { foreach(InputDevice *id, qhInputDevices) { if (id->pDID) { - id->pDID->Unacquire(); id->pDID->Release(); } free(id); @@ -358,6 +359,11 @@ void GlobalShortcutWin::remap() { GlobalShortcutWin::~GlobalShortcutWin() { unacquire(); + foreach(InputDevice *id, qhInputDevices) { + if (id->pDID) { + id->pDID->Release(); + } + } pDI->Release(); } @@ -375,6 +381,7 @@ void GlobalShortcutWin::timeTicked() { if (bNeedRemap) remap(); + foreach(InputDevice *id, qhInputDevices) { DIDEVICEOBJECTDATA rgdod[DX_SAMPLE_BUFFER_SIZE]; DWORD dwItems = DX_SAMPLE_BUFFER_SIZE; @@ -402,6 +409,7 @@ void GlobalShortcutWin::timeTicked() { pressed = true; } } + foreach(Shortcut *s, id->qmhOfsToShortcut.values(rgdod[j].dwOfs)) { qpButton button(id->guid, id->qhOfsToType[rgdod[j].dwOfs]); int idx; diff --git a/main.cpp b/main.cpp index dcd30ff50..d7efd3947 100644 --- a/main.cpp +++ b/main.cpp @@ -50,6 +50,30 @@ namespace boost { } #endif +void mumbleMessageOutput(QtMsgType type, const char *msg) +{ + FILE *f=NULL; + f=fopen("Console.txt", "a+"); + if (!f) + f=stderr; + + char c; + switch (type) { + case QtDebugMsg: + c='D'; + break; + case QtWarningMsg: + c='W'; + break; + case QtFatalMsg: + c='F'; + break; + default: + c='X'; + } + fprintf(f, "<%c>%s %s\n", c, qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")), msg); + fclose(f); +} int main(int argc, char **argv) { @@ -68,6 +92,9 @@ int main(int argc, char **argv) int res; QT_REQUIRE_VERSION(argc, argv, "4.1.0"); +#ifdef QT_NO_DEBUG + qInstallMsgHandler(mumbleMessageOutput); +#endif // Initialize application object. QApplication a(argc, argv);