void _odsf(PCWSTR wszFunction, PCWSTR wszString) { CCString sMsg; sMsg.FormatW(L"[ %-20.20s ] ", wszFunction); sMsg.cat(wszString); if(__g_bLogOpened == TRUE) { __g_Log._AddEntry(sMsg); } OutputDebugStringW(sMsg); OutputDebugStringW(L"\n"); }
HRESULT CMixerControl::SaveControl(XMLDoc* pDoc, XMLEl* pParent) { XMLEl* pThis = 0; HRESULT hr; CCString sValues; CCString sTemp; BOOL bFirst; if(FAILED(hr = XMLFindControl(pDoc, pParent, m_mc.dwControlID, CCString(m_mc.szName), m_Type, &pThis, TRUE))) { return hr; } // Save the values of this control. // We just go in order, separating values with a comma. bFirst = TRUE;// This will determine if we need to add a comma or not. int i = 0; switch(m_DataType) { case MIXDT_CUSTOM: { sValues.FromBinary(m_pRaw, m_mc.Metrics.cbCustomData); pThis->setAttribute(CCString(L"Values"), sValues.variant()); break; } case MIXDT_SIGNED: { MIXERCONTROLDETAILS_SIGNED* p = (MIXERCONTROLDETAILS_SIGNED*)m_pRaw; sValues.froml(p[0].lValue, 10); for(i=1;i<m_nRawItems;i++) { sValues.cat(L", "); sTemp.froml(p[i].lValue, 10); sValues.cat(sTemp); } pThis->setAttribute(CCString(L"Values"), sValues.variant()); break; } case MIXDT_UNSIGNED: { MIXERCONTROLDETAILS_UNSIGNED* p = (MIXERCONTROLDETAILS_UNSIGNED*)m_pRaw; sValues.fromul(p[0].dwValue, 10); for(i=1;i<m_nRawItems;i++) { sValues.cat(L", "); sTemp.fromul(p[i].dwValue, 10); sValues.cat(sTemp); } pThis->setAttribute(CCString(L"Values"), sValues.variant()); break; } case MIXDT_BOOLEAN: { MIXERCONTROLDETAILS_BOOLEAN* p = (MIXERCONTROLDETAILS_BOOLEAN*)m_pRaw; sValues = (p[0].fValue == TRUE) ? L"TRUE" : L"FALSE"; for(i=1;i<m_nRawItems;i++) { sTemp.FormatW(L", %s", (p[i].fValue == TRUE) ? L"TRUE" : L"FALSE"); sValues.cat(sTemp); } pThis->setAttribute(CCString(L"Values"), sValues.variant()); break; } default: { // } } SAFE_RELEASE(pThis); return hr; }