mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Console.txt error logging and fixed some shortcut bugs
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@393 05730e5d-ab1b-0410-a4ac-84af385074fa
This commit is contained in:
parent
d7cdbc3580
commit
349f01360b
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
27
main.cpp
27
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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user