这篇教程C++ uuid函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uuid函数的典型用法代码示例。如果您正苦于以下问题:C++ uuid函数的具体用法?C++ uuid怎么用?C++ uuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uuid函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: __declspec#include <shellapi.h>#include <commctrl.h>#include <strsafe.h>HINSTANCE g_hInst = NULL;UINT const WMAPP_NOTIFYCALLBACK = WM_APP + 1;UINT const WMAPP_HIDEFLYOUT = WM_APP + 2;UINT_PTR const HIDEFLYOUT_TIMER_ID = 1;wchar_t const szWindowClass[] = L"NotificationIconTest";wchar_t const szFlyoutWindowClass[] = L"NotificationFlyout";// Use a guid to uniquely identify our iconclass __declspec(uuid("9D0B8B92-4E1C-488e-A1E1-2331AFCE2CB5")) PrinterIcon;// Forward declarations of functions included in this code module:void RegisterWindowClass(PCWSTR pszClassName, PCWSTR pszMenuName, WNDPROC lpfnWndProc);LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);ATOM RegisterFlyoutClass(HINSTANCE hInstance);LRESULT CALLBACK FlyoutWndProc(HWND, UINT, WPARAM, LPARAM);HWND ShowFlyout(HWND hwnd);void HideFlyout(HWND hwndMainWindow, HWND hwndFlyout);void PositionFlyout(HWND hwnd, REFGUID guidIcon);void ShowContextMenu(HWND hwnd, POINT pt);BOOL AddNotificationIcon(HWND hwnd);BOOL DeleteNotificationIcon();BOOL ShowLowInkBalloon();BOOL ShowNoInkBalloon();BOOL ShowPrintJobBalloon();
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:31,
示例2: return bool AnalysisObject_Impl::uuidAndVersionEqual(const AnalysisObject& other) const { return ((uuid() == other.uuid()) && (versionUUID() == other.versionUUID())); }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:3,
示例3: returnbool WebPage::matchesWindowSelector(QString selector) { return (selector == getWindowName() || selector == mainFrame()->title() || selector == mainFrame()->url().toString() || selector == uuid());}
开发者ID:DanGrenier,项目名称:Reap_Dev,代码行数:6,
示例4: ACE_ERROR//.........这里部分代码省略......... } } // IPv6 - check for the interface name extension if (!this->hostname_.empty() && '+' == this->hostname_[0]) { std::string ifname = this->hostname_.substr(1); this->is_ipv6_ = true; if (ifname.empty()) { this->hostname_ = ""; } else { while (true) { char *ip_addr = NULL; if ('?' == this->hostname_[1]) ip_addr = get_first_external_ip(AF_INET6); else ip_addr = get_ip_from_ifname(AF_INET6, ifname.c_str()); this->hostname_ = ip_addr ? (const char*)ip_addr : ""; if (ip_addr) { ACE_DEBUG((LM_INFO, ACE_TEXT("%N:%l - Autodetected address for ") ACE_TEXT("IPv6 endpoint on %s - %s/n"), ACE_TEXT_CHAR_TO_TCHAR(ifname.c_str()), ACE_TEXT_CHAR_TO_TCHAR(this->hostname_.c_str()))); free(ip_addr); break; } ACE_DEBUG((LM_WARNING, ACE_TEXT("%N:%l - Could not determine auto address for ") ACE_TEXT("this IPv6 NIC - %s. Retrying in 10 seconds.../n"), ACE_TEXT_CHAR_TO_TCHAR(ifname.c_str()))); ACE_OS::sleep(10); } } } // check for empty hostname and fix it up so that // we don't throw the MProfile exception if (this->hostname_.empty()) { char host_name[HOST_NAME_MAX] = { '/0' }; ACE_OS::hostname(host_name, sizeof(host_name)); this->hostname_ = (const char*)host_name; ACE_DEBUG((LM_WARNING, ACE_TEXT("%N:%l - DEPRECATED: Using default ") ACE_TEXT("hostname for %s facing endpoint - %s/n"), outside_facing ? ACE_TEXT("outside") : ACE_TEXT("inside"), ACE_TEXT_CHAR_TO_TCHAR(this->hostname_.c_str()))); } if (option_pos != std::string::npos) { // The rest are optional modifiers, ssl port, hostname alias ++option_pos; std::string test("alias="); size_t opt = ep_str.find (test, option_pos); if (opt != std::string::npos) { size_t comma = ep_str.find (',',opt); size_t begin = opt + test.length(); this->alias_ = (comma == std::string::npos) ? ep_str.substr(begin) : ep_str.substr(begin, comma - begin); } test = "random_alias"; opt = ep_str.find (test, option_pos); if (opt != std::string::npos) { test = "alias="; opt = ep_str.find (test, option_pos); if (opt != std::string::npos) { ACE_DEBUG((LM_ERROR, ACE_TEXT("%N:%l - Both random_alias and alias, which are mutually exclusive, are used/n"))); return false; } ACE_Utils::UUID uuid(*ACE_Utils::UUID_GENERATOR::instance ()->generate_UUID()); const ACE_CString *uuid_str(uuid.to_string()); this->alias_ = uuid_str->c_str(); } test = "ssl_port="; opt = ep_str.find (test, option_pos); if (opt != std::string::npos) { size_t comma = ep_str.find (',',opt); size_t begin = opt + test.length(); std::string portstr = (comma == std::string::npos) ? ep_str.substr(begin) : ep_str.substr(begin, comma - begin); this->ssl_port_ = static_cast<int> (ACE_OS::strtol(portstr.c_str(), 0, 10)); if (0 >= this->ssl_port_) { if (outside_facing) this->ssl_port_ = LORICA_DEFAULT_OUTSIDE_FACING_PORT_SEC; else this->ssl_port_ = LORICA_DEFAULT_INSIDE_FACING_PORT_SEC; } } } return true;}
开发者ID:colding,项目名称:lorica,代码行数:101,
示例5: lockvoidMediaEngineWebRTC::EnumerateAudioDevices(nsTArray<nsRefPtr<MediaEngineAudioSource> >* aASources){ ScopedCustomReleasePtr<webrtc::VoEBase> ptrVoEBase; ScopedCustomReleasePtr<webrtc::VoEHardware> ptrVoEHw; // We spawn threads to handle gUM runnables, so we must protect the member vars MutexAutoLock lock(mMutex);#ifdef MOZ_WIDGET_ANDROID jobject context = mozilla::AndroidBridge::Bridge()->GetGlobalContextRef(); // get the JVM JavaVM *jvm = mozilla::AndroidBridge::Bridge()->GetVM(); JNIEnv *env = GetJNIForThread(); if (webrtc::VoiceEngine::SetAndroidObjects(jvm, env, (void*)context) != 0) { LOG(("VoiceEngine:SetAndroidObjects Failed")); return; }#endif if (!mVoiceEngine) { mVoiceEngine = webrtc::VoiceEngine::Create(); if (!mVoiceEngine) { return; } } PRLogModuleInfo *logs = GetWebRTCLogInfo(); if (!gWebrtcTraceLoggingOn && logs && logs->level > 0) { // no need to a critical section or lock here gWebrtcTraceLoggingOn = 1; const char *file = PR_GetEnv("WEBRTC_TRACE_FILE"); if (!file) { file = "WebRTC.log"; } LOG(("Logging webrtc to %s level %d", __FUNCTION__, file, logs->level)); mVoiceEngine->SetTraceFilter(logs->level); mVoiceEngine->SetTraceFile(file); } ptrVoEBase = webrtc::VoEBase::GetInterface(mVoiceEngine); if (!ptrVoEBase) { return; } if (!mAudioEngineInit) { if (ptrVoEBase->Init() < 0) { return; } mAudioEngineInit = true; } ptrVoEHw = webrtc::VoEHardware::GetInterface(mVoiceEngine); if (!ptrVoEHw) { return; } int nDevices = 0; ptrVoEHw->GetNumOfRecordingDevices(nDevices); for (int i = 0; i < nDevices; i++) { // We use constants here because GetRecordingDeviceName takes char[128]. char deviceName[128]; char uniqueId[128]; // paranoia; jingle doesn't bother with this deviceName[0] = '/0'; uniqueId[0] = '/0'; int error = ptrVoEHw->GetRecordingDeviceName(i, deviceName, uniqueId); if (error) { LOG((" VoEHardware:GetRecordingDeviceName: Failed %d", ptrVoEBase->LastError() )); continue; } if (uniqueId[0] == '/0') { // Mac and Linux don't set uniqueId! MOZ_ASSERT(sizeof(deviceName) == sizeof(uniqueId)); // total paranoia strcpy(uniqueId,deviceName); // safe given assert and initialization/error-check } nsRefPtr<MediaEngineWebRTCAudioSource> aSource; NS_ConvertUTF8toUTF16 uuid(uniqueId); if (mAudioSources.Get(uuid, getter_AddRefs(aSource))) { // We've already seen this device, just append. aASources->AppendElement(aSource.get()); } else { aSource = new MediaEngineWebRTCAudioSource( mVoiceEngine, i, deviceName, uniqueId ); mAudioSources.Put(uuid, aSource); // Hashtable takes ownership. aASources->AppendElement(aSource); } }}
开发者ID:JuannyWang,项目名称:gecko-dev,代码行数:98,
示例6: convertNativeToTclObjectstatic va_listconvertNativeToTclObject (va_list pArg, Tcl_Interp *interp, TclObject &tclObject, const Type &type, bool byRef=false){ switch (type.vartype()) { case VT_BOOL: tclObject = Tcl_NewBooleanObj( byRef ? *va_arg(pArg, VARIANT_BOOL *) : va_arg(pArg, VARIANT_BOOL)); break; case VT_DATE: case VT_R4: case VT_R8: tclObject = Tcl_NewDoubleObj( byRef ? *va_arg(pArg, double *) : va_arg(pArg, double)); break; case VT_USERDEFINED: if (type.name() == "GUID") { UUID *pUuid = va_arg(pArg, UUID *); Uuid uuid(*pUuid); tclObject = Tcl_NewStringObj( const_cast<char *>(uuid.toString().c_str()), -1); break; } // Fall through case VT_DISPATCH: case VT_UNKNOWN: { IUnknown *pUnknown = va_arg(pArg, IUnknown *); if (pUnknown == 0) { tclObject = Tcl_NewObj(); } else { const Interface *pInterface = InterfaceManager::instance().find(type.iid()); tclObject = Extension::referenceHandles.newObj( interp, Reference::newReference(pUnknown, pInterface)); } } break; case VT_NULL: tclObject = Tcl_NewObj(); break; case VT_LPWSTR: case VT_BSTR: {#if TCL_MINOR_VERSION >= 2 // Uses Unicode function introduced in Tcl 8.2. Tcl_UniChar *pUnicode = byRef ? *va_arg(pArg, Tcl_UniChar **) : va_arg(pArg, Tcl_UniChar *); if (pUnicode != 0) { tclObject = Tcl_NewUnicodeObj(pUnicode, -1); } else { tclObject = Tcl_NewObj(); }#else wchar_t *pUnicode = byRef ? *va_arg(pArg, wchar_t **) : va_arg(pArg, wchar_t *); _bstr_t str(pUnicode); tclObject = Tcl_NewStringObj(str, -1);#endif } break; case VT_VARIANT: tclObject = TclObject( byRef ? va_arg(pArg, VARIANT *) : &va_arg(pArg, VARIANT), type, interp); break; case VT_SAFEARRAY: tclObject = TclObject( byRef ? *va_arg(pArg, SAFEARRAY **) : va_arg(pArg, SAFEARRAY *), type, interp); break; default: tclObject = Tcl_NewLongObj( byRef ? *va_arg(pArg, int *) : va_arg(pArg, int)); }
开发者ID:pukkaone,项目名称:tcom,代码行数:88,
示例7: uuidintTester::test (void){ int retval = 0; // Generate UUID auto_ptr <ACE_Utils::UUID> uuid (ACE_Utils::UUID_GENERATOR::instance ()->generate_UUID ()); ACE_CString uuid_str (uuid->to_string ()->c_str ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Generated UUID/n %C/n"), uuid_str.c_str ())); // Construct UUID from string ACE_Utils::UUID new_uuid (uuid_str); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID Constructed from above Generated UUID/n %C/n"), new_uuid.to_string ()->c_str ())); // Construct UUID from string by assigning it ACE_Utils::UUID new_uuid_assign; new_uuid_assign.from_string (new_uuid.to_string ()->c_str ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID Constructed from above Generated UUID ") ACE_TEXT ("with assign/n %C/n"), new_uuid_assign.to_string ()->c_str ())); if (new_uuid != new_uuid_assign) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: UUIDs are not the same/n")), -1); // Check the hash value of the 2 UUIDs if (new_uuid.hash () != new_uuid_assign.hash ()) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: hash value of UUIDs are ") ACE_TEXT ("not the same")), -1); // Construct UUID using the copy constructor ACE_Utils::UUID new_uuid_copy (new_uuid); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID constructed from above Generated UUID") ACE_TEXT (" with copy/n %C/n"), new_uuid_copy.to_string ()->c_str ())); if (new_uuid != new_uuid_copy) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: UUIDs are not the same ") ACE_TEXT ("with copy/n")), -1); ACE_Utils::UUID nil_uuid (*ACE_Utils::UUID::NIL_UUID.to_string ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID Constructed from NIL_UUID with ") ACE_TEXT ("string copy/n %C/n"), nil_uuid.to_string ()->c_str ())); if (nil_uuid != ACE_Utils::UUID::NIL_UUID) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: UUIDs are not the same with ") ACE_TEXT ("NIL_UUID string copy/n")), -1); // Construct UUID using the assignment constructor ACE_Utils::UUID new_uuid_assigment; new_uuid_assigment = new_uuid; ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID Constructed from above Generated UUID ") ACE_TEXT ("with assignment/n %C/n"), new_uuid_assigment.to_string ()->c_str ())); if (new_uuid != new_uuid_assigment) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: UUIDs are not the same " ACE_TEXT ("with assignment/n"))), -1); // Generate UUID with process and thread ids. auto_ptr <ACE_Utils::UUID> uuid_with_tp_id (ACE_Utils::UUID_GENERATOR::instance ()->generate_UUID (0x0001, 0xc0)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID with Thread and Process ID/n %C/n"), uuid_with_tp_id->to_string ()->c_str ())); if (new_uuid == *uuid_with_tp_id) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Error: UUIDs are the same/n")), -1); // Construct UUID from string ACE_Utils::UUID new_uuid_with_tp_id (uuid_with_tp_id->to_string ()->c_str ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UUID with Thread and Process ID reconstructed ") ACE_TEXT ("from above UUID /n %C/n"), new_uuid_with_tp_id.to_string ()->c_str ())); return retval;//.........这里部分代码省略.........
开发者ID:PGSeungminLee,项目名称:CGSF,代码行数:101,
示例8: __declspec// Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the// License for the specific language governing permissions and limitations// under the License.#include "pch.h"#include <Vector.h>namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template<> struct __declspec(uuid("b939af5b-b45d-5489-9149-61442c1905fe")) IVector<int> : IVector_impl <int> { }; template<> struct __declspec(uuid("8d720cdf-3934-5d3f-9a55-40e8063b086a")) IVectorView<int> : IVectorView_impl<int> { }; template<> struct __declspec(uuid("81a643fb-f51c-5565-83c4-f96425777b66")) IIterable<int> : IIterable_impl <int> { }; template<> struct __declspec(uuid("bfea7f78-50c2-5f1d-a6ea-9e978d2699ff")) IIterator<int> : IIterator_impl <int> { }; } } }}namespace NativeComponent{ using namespace Windows::Foundation::Collections; using namespace Microsoft::WRL; using namespace collections; public ref class VectorCreator sealed {
开发者ID:Azzhag,项目名称:Win2D,代码行数:31,
示例9: CBaseInputPin//CStreamSwitcherInputPin::CStreamSwitcherInputPin(CStreamSwitcherFilter* pFilter, HRESULT* phr, LPCWSTR pName) : CBaseInputPin(NAME("CStreamSwitcherInputPin"), pFilter, &pFilter->m_csState, phr, pName) , m_Allocator(this, phr) , m_bSampleSkipped(FALSE) , m_bQualityChanged(FALSE) , m_bUsingOwnAllocator(FALSE) , m_evBlock(TRUE) , m_fCanBlock(false) , m_hNotifyEvent(NULL){ m_bCanReconnectWhenActive = TRUE;}class __declspec(uuid("138130AF-A79B-45D5-B4AA-87697457BA87")) NeroAudioDecoder {};STDMETHODIMP CStreamSwitcherInputPin::NonDelegatingQueryInterface(REFIID riid, void** ppv){ return QI(IStreamSwitcherInputPin) IsConnected() && GetCLSID(GetFilterFromPin(GetConnected())) == __uuidof(NeroAudioDecoder) && QI(IPinConnection) __super::NonDelegatingQueryInterface(riid, ppv);}// IPinConnectionSTDMETHODIMP CStreamSwitcherInputPin::DynamicQueryAccept(const AM_MEDIA_TYPE* pmt){ return QueryAccept(pmt);
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:31,
示例10: __declspec#include "global.h"#include "MovieTexture_DShowHelper.h"#include "RageUtil.h"#include "RageLog.h"#include "archutils/Win32/DirectXHelpers.h"//-----------------------------------------------------------------------------// Define GUID for Texture Renderer// {71771540-2017-11cf-AE26-0020AFD79767}//-----------------------------------------------------------------------------struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureRenderer;static HRESULT CBV_ret;CTextureRenderer::CTextureRenderer(): CBaseVideoRenderer(__uuidof(CLSID_TextureRenderer), NAME("Texture Renderer"), NULL, &CBV_ret), m_OneFrameDecoded( "m_OneFrameDecoded", 0 ){ if( FAILED(CBV_ret) ) RageException::Throw( hr_ssprintf(CBV_ret, "Could not create texture renderer object!") ); m_pTexture = NULL;}CTextureRenderer::~CTextureRenderer(){}HRESULT CTextureRenderer::CheckMediaType(const CMediaType *pmt){
开发者ID:Highlogic,项目名称:stepmania-event,代码行数:31,
示例11: childGetListInterfacevoid RlvFloaterBehaviour::refreshAll(){ LLVOAvatar* pAvatar = gAgent.getAvatarObject(); LLCtrlListInterface* pList = childGetListInterface("behaviour_list"); const rlv_object_map_t* pRlvObjects = gRlvHandler.getObjectMap(); if ( (!pAvatar) || (!pList) || (!pRlvObjects) ) return; pList->operateOnAll(LLCtrlListInterface::OP_DELETE); for (rlv_object_map_t::const_iterator itObj = pRlvObjects->begin(), endObj = pRlvObjects->end(); itObj != endObj; ++itObj) { std::string strName = itObj->first.asString(); LLViewerInventoryItem* pItem = NULL; LLViewerObject* pObj = gObjectList.findObject(itObj->first); if (pObj) { LLViewerJointAttachment* pAttachPt = get_if_there(pAvatar->mAttachmentPoints, gRlvHandler.getAttachPointIndex(pObj), (LLViewerJointAttachment*)NULL); if (pAttachPt) { pItem = gInventory.getItem(pAttachPt->getItemID()); } } if (pItem) strName = pItem->getName(); const rlv_command_list_t* pCommands = itObj->second.getCommandList(); for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd) { std::string strBhvr = itCmd->asString(); LLUUID uuid(itCmd->getOption()); if (uuid.notNull()) { std::string strLookup; if ( (gCacheName->getFullName(uuid, strLookup)) || (gCacheName->getGroupName(uuid, strLookup)) ) { if (strLookup.find("???") == std::string::npos) strBhvr.assign(itCmd->getBehaviour()).append(":").append(strLookup); } else if (m_PendingLookup.end() == std::find(m_PendingLookup.begin(), m_PendingLookup.end(), uuid)) { gCacheName->get(uuid, FALSE, onAvatarNameLookup, this); m_PendingLookup.push_back(uuid); } } LLSD element; // Restriction column element["columns"][0]["column"] = "behaviour"; element["columns"][0]["value"] = strBhvr; element["columns"][0]["font"] = "SANSSERIF"; element["columns"][0]["font-style"] = "NORMAL"; // Object Name column element["columns"][1]["column"] = "name"; element["columns"][1]["value"] = strName; element["columns"][1]["font"] = "SANSSERIF"; element["columns"][1]["font-style"] = "NORMAL"; pList->addElement(element, ADD_BOTTOM); } }}
开发者ID:kow,项目名称:Meerkat-Viewer,代码行数:66,
示例12: lockvoidMediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource, nsTArray<RefPtr<MediaEngineAudioSource> >* aASources){ ScopedCustomReleasePtr<webrtc::VoEBase> ptrVoEBase; // We spawn threads to handle gUM runnables, so we must protect the member vars MutexAutoLock lock(mMutex); if (aMediaSource == dom::MediaSourceEnum::AudioCapture) { RefPtr<MediaEngineWebRTCAudioCaptureSource> audioCaptureSource = new MediaEngineWebRTCAudioCaptureSource(nullptr); aASources->AppendElement(audioCaptureSource); return; }#ifdef MOZ_WIDGET_ANDROID jobject context = mozilla::AndroidBridge::Bridge()->GetGlobalContextRef(); // get the JVM JavaVM* jvm; JNIEnv* const env = jni::GetEnvForThread(); MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm)); if (webrtc::VoiceEngine::SetAndroidObjects(jvm, (void*)context) != 0) { LOG(("VoiceEngine:SetAndroidObjects Failed")); return; }#endif if (!mVoiceEngine) { mConfig.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(mExtendedFilter)); mConfig.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(mDelayAgnostic)); mVoiceEngine = webrtc::VoiceEngine::Create(mConfig); if (!mVoiceEngine) { return; } } ptrVoEBase = webrtc::VoEBase::GetInterface(mVoiceEngine); if (!ptrVoEBase) { return; } // Always re-init the voice engine, since if we close the last use we // DeInitEngine() and Terminate(), which shuts down Process() - but means // we have to Init() again before using it. Init() when already inited is // just a no-op, so call always. if (ptrVoEBase->Init() < 0) { return; } if (!mAudioInput) { if (SupportsDuplex()) { // The platform_supports_full_duplex. mAudioInput = new mozilla::AudioInputCubeb(mVoiceEngine); } else { mAudioInput = new mozilla::AudioInputWebRTC(mVoiceEngine); } } int nDevices = 0; mAudioInput->GetNumOfRecordingDevices(nDevices); int i;#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) i = 0; // Bug 1037025 - let the OS handle defaulting for now on android/b2g#else // -1 is "default communications device" depending on OS in webrtc.org code i = -1;#endif for (; i < nDevices; i++) { // We use constants here because GetRecordingDeviceName takes char[128]. char deviceName[128]; char uniqueId[128]; // paranoia; jingle doesn't bother with this deviceName[0] = '/0'; uniqueId[0] = '/0'; int error = mAudioInput->GetRecordingDeviceName(i, deviceName, uniqueId); if (error) { LOG((" VoEHardware:GetRecordingDeviceName: Failed %d", error)); continue; } if (uniqueId[0] == '/0') { // Mac and Linux don't set uniqueId! MOZ_ASSERT(sizeof(deviceName) == sizeof(uniqueId)); // total paranoia strcpy(uniqueId, deviceName); // safe given assert and initialization/error-check } RefPtr<MediaEngineAudioSource> aSource; NS_ConvertUTF8toUTF16 uuid(uniqueId); if (mAudioSources.Get(uuid, getter_AddRefs(aSource))) { // We've already seen this device, just append. aASources->AppendElement(aSource.get()); } else { AudioInput* audioinput = mAudioInput; if (SupportsDuplex()) { // The platform_supports_full_duplex.//.........这里部分代码省略.........
开发者ID:frap129,项目名称:hyperfox,代码行数:101,
示例13: cacheDir// Checks cache entries and removes invalid ones from the index filevoid Cache::check(bool force){ std::map<std::string, std::pair<uint32_t, uint32_t> > index; std::string path = cacheDir(); PDEBUG << "Checking cache in dir: " << path << endl; bool created; checkDir(path, &created); if (created) { Logger::info() << "Cache: Created empty cache for '" << uuid() << '/'' << endl; return; } sys::datetime::Watch watch; GZIStream *in = new GZIStream(path+"/index"); if (!in->ok()) { Logger::info() << "Cache: Empty cache for '" << uuid() << '/'' << endl; delete in; return; } BIStream *cache_in = NULL; uint32_t cache_index = -1; uint32_t version; *in >> version; switch (checkVersion(version)) { case OutOfDate: delete in; Logger::warn() << "Cache: Cache is out of date"; if (!force) { Logger::warn() << " - won't clear it until forced to do so" << endl; } else { Logger::warn() << ", clearing" << endl; clear(); } return; case UnknownVersion: delete in; Logger::warn() << "Cache: Unknown cache version number " << version; if (!force) { Logger::warn() << " - won't clear it until forced to do so" << endl; } else { Logger::warn() << ", clearing" << endl; clear(); } return; default: break; } Logger::status() << "Checking all indexed revisions... " << ::flush; std::string id; std::pair<uint32_t, uint32_t> pos; uint32_t crc; std::map<std::string, uint32_t> crcs; std::vector<std::string> corrupted; while (!(*in >> id).eof()) { if (!in->ok()) { goto corrupt; } *in >> pos.first >> pos.second; *in >> crc; if (!in->ok()) { goto corrupt; } index[id] = pos; crcs[id] = crc; if (cache_in == NULL || cache_index != pos.first) { delete cache_in; cache_in = new BIStream(str::printf("%s/cache.%u", path.c_str(), pos.first)); cache_index = pos.first; if (!cache_in->ok()) { delete cache_in; cache_in = NULL; goto corrupt; } } if (cache_in != NULL) { if (!cache_in->seek(pos.second)) { goto corrupt; } else { std::vector<char> data; *cache_in >> data; if (utils::crc32(data) != crc) { goto corrupt; } } } PTRACE << "Revision " << id << " ok" << endl; continue;corrupt: PTRACE << "Revision " << id << " corrupted!" << endl;//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:pepper,代码行数:101,
示例14: SafeReleasetemplate <class T>void SafeRelease(T **ppT){ if (*ppT) { (*ppT)->Release(); *ppT = nullptr; }}template <class T> HRESULT SetInterface(T **ppT, IUnknown *punk){ SafeRelease(ppT); return punk ? punk->QueryInterface(ppT) : E_NOINTERFACE;}class __declspec(uuid("5100FEC1-212B-4BF5-9BF8-3E650FD794A3")) CExecuteCommandVerb : public IExecuteCommand, public IObjectWithSelection, public IInitializeCommand, public IObjectWithSite, public IExecuteCommandApplicationHostEnvironment{public: CExecuteCommandVerb() : mRef(0), mShellItemArray(nullptr), mUnkSite(nullptr), mTargetIsFileSystemLink(false), mTargetIsDefaultBrowser(false), mTargetIsBrowser(false),
开发者ID:mvujovic,项目名称:gecko-dev,代码行数:30,
示例15: set_headint set_head(QStringList command) { qDebug() << "set_head(" << command.join(" ") << ")" << endl; /** * Debug */ for(int i=0;i<command.size();i++) { qDebug() << "command.at(" << i << ")" << command.at(i) << endl; } /** * Check input */ QTextStream errorStream(stderr); if(command.size() != 5) { errorStream << "Error: set_head(" << command.join(" ") << "): No valid number of arguments!" << endl; man("usage set_head"); return 1; } if(command.at(0)!="set_head") { errorStream << "Error: set_head(" << command.join(" ") << "): No valid command!" << endl; man("usage set_head"); return 1; } if(! command.at(2).contains(QRegExp("^(binary|integer|hex|cip)$"))) { errorStream << "Error: set_head(" << command.join(" ") << "): No valid CIP omode!" << endl; man("usage set_head"); return 1; } if(! command.at(3).contains(QRegExp("^(request|profile|version|channel|uuid|ip|port|time|type|size|data)$"))) { errorStream << "Error: set_head(" << command.join(" ") << "): No valid header key!" << endl; man("usage set_head"); return 1; } /** * Check value for integer and single value */ if(command.at(2)=="integer" && command.at(3).contains(QRegExp("^(request|profile|version|channel|type|size)$")) && // not uint8 (0-255) ((! command.at(4).contains(QRegExp("^//d//d?//d?$"))) || command.at(4).toInt() < 0 || command.at(4).toInt() > 255)) { errorStream << "Error: set_head(" << command.join(" ") << "): No valid header value!" << endl; man("usage set_head"); return 1; } /** * Check value for binary and single value */ if(command.at(2)=="binary" && command.at(3).contains(QRegExp("^(request|profile|version|channel|type|size)$")) && // not uint8 (00000000-11111111) ((! command.at(4).contains(QRegExp("^(0|1){8}$"))))) { errorStream << "Error: set_head(" << command.join(" ") << "): No valid header value!" << endl; man("usage set_head"); return 1; } /** * Check value for hex and single value */ if(command.at(2)=="hex" && command.at(3).contains(QRegExp("^(request|profile|version|channel|type|size)$")) && // not uint8 (00-ff) ((! command.at(4).contains(QRegExp("^(//d|a|b|c|d|e|f){2}$"))))) { errorStream << "Error: set_head(" << command.join(" ") << "): No valid header value!" << endl; man("usage set_head"); return 1; } /** * Check value for binary and uuid */ if(command.at(2)=="binary" && command.at(3)=="uuid") { errorStream << "Not yet implemented!" << endl; return 1; } /** * Check value for integer and uuid */ if(command.at(2)=="integer" && command.at(3)=="uuid") { errorStream << "Not yet implemented!" << endl; return 1; } /**//.........这里部分代码省略.........
开发者ID:stefanhans,项目名称:ContextRouting,代码行数:101,
示例16: __declspec**** Magnus Norddahl*/#include "Sound/precomp.h"#include "soundoutput_win32.h"#include "API/Core/System/exception.h"#include "API/Core/Text/logger.h"#include "Core/System/Win32/system_win32.h"#include <mmreg.h>#include "API/Core/Math/cl_math.h"// KSDATAFORMAT_SUBTYPE_IEEE_FLOAT is not available on some old headers#ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT#ifdef _MSC_VERstruct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT;#define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT)#else#include <initguid.h>DEFINE_GUID(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT,0x00000003L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);DEFINE_GUID(GUID_NULL,0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);#endif#endifnamespace clan{ SoundOutput_Win32::SoundOutput_Win32(int init_mixing_frequency, int init_mixing_latency) : SoundOutput_Impl(init_mixing_frequency, init_mixing_latency), audio_buffer_ready_event(INVALID_HANDLE_VALUE), is_playing(false), fragment_size(0), wait_timeout(mixing_latency * 2), write_pos(0) { try {
开发者ID:ArtHome12,项目名称:ClanLib,代码行数:31,
示例17: if CVobSubStream* pVSS = (CVobSubStream*)(ISubStream*)m_pSubStream; pVSS->RemoveAll(); } else if (IsHdmvSub(&m_mt)) { CAutoLock cAutoLock2(m_pSubLock); CRenderedHdmvSubtitle* pHdmvSubtitle = (CRenderedHdmvSubtitle*)(ISubStream*)m_pSubStream; pHdmvSubtitle->NewSegment(tStart, tStop, dRate); } TRACE(_T("NewSegment: InvalidateSubtitle(%I64d, ...)/n"), tStart); // IMPORTANT: m_pSubLock must not be locked when calling this InvalidateSubtitle(tStart, m_pSubStream); return __super::NewSegment(tStart, tStop, dRate);}interface __declspec(uuid("D3D92BC3-713B-451B-9122-320095D51EA5"))IMpeg2DemultiplexerTesting :public IUnknown { STDMETHOD(GetMpeg2StreamType)(ULONG * plType) PURE; STDMETHOD(toto)() PURE;};STDMETHODIMP CSubtitleInputPin::Receive(IMediaSample* pSample){ HRESULT hr; hr = __super::Receive(pSample); if (FAILED(hr)) { return hr; }
开发者ID:KhR0N1K,项目名称:mpc-hc,代码行数:30,
示例18: uuid/*! * /brief JsonDbObject::updateVersionReplicating implements a replicatedWrite * /param other the (remote) object to include into this one. * /return if the passed object was a valid replication */bool JsonDbObject::updateVersionReplicating(const JsonDbObject &other){ // these two will be the final _meta content QJsonArray history; QJsonArray conflicts; // let's go thru all version, i.e. this, this._conflicts, other, and other._conflicts { // thanks to the operator <, documents will sort and remove duplicates // the value is just for show, QSet is based on QHash, which does not sort QMap<JsonDbObject,bool> documents; QUuid id; if (!isEmpty()) { id = uuid(); populateMerge(&documents, id, *this); } else { id = other.uuid(); } if (!populateMerge(&documents, id, other, true)) return false; // now we have all versions sorted and duplicates removed // let's figure out what to keep, what to toss // this is O(n^2) but should be fine in real world situations for (QMap<JsonDbObject,bool>::const_iterator ii = documents.begin(); ii != documents.end(); ii++) { bool alive = !ii.key().isDeleted(); for (QMap<JsonDbObject,bool>::const_iterator jj = ii + 1; alive && jj != documents.end(); jj++) if (ii.key().isAncestorOf(jj.key())) alive = false; if (ii+1 == documents.end()) { // last element, so found the winner, // assigning to *this, which is head *this = ii.key(); populateHistory(&history, *this, false); } else if (alive) { // this is a conflict, strip _meta and keep it JsonDbObject conflict(ii.key()); conflict.remove(JsonDbString::kMetaStr); conflicts.append(conflict); } else { // this version was replaced, just keep history populateHistory(&history, ii.key(), true); } } } // let's write a new _meta into head if (history.size() || conflicts.size()) { QJsonObject meta; if (history.size()) meta.insert(QStringLiteral("history"), history); if (conflicts.size()) meta.insert(JsonDbString::kConflictsStr, conflicts); insert(JsonDbString::kMetaStr, meta); } else { // this is really just for sanity reason, but it feels better to have it // aka: this branch should never be reached in real world situations remove(JsonDbString::kMetaStr); } return true;}
开发者ID:Distrotech,项目名称:qtjsondb,代码行数:69,
示例19: getValue double DiscreteVariable_Impl::getValue(const DataPoint& dataPoint) const { OptionalInt index = dataPoint.problem().getVariableIndexByUUID(uuid()); OS_ASSERT(index); return dataPoint.variableValues()[*index].toDouble(); }
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:5,
示例20: __declspec#define _CRT_SECURE_NO_WARNINGS#include "Com.h"struct __declspec(uuid("4DE37185-5855-4B6F-A0D8-F4B530548510")) IFoo : public IDispatch{ virtual HRESULT __stdcall Bar() = 0;};struct __declspec(uuid("4DE37185-5855-4B6F-A0D8-F4B530548511")) IFoo2 : public IDispatch{ virtual HRESULT __stdcall Bar2() = 0;};template <typename Interface>class IFooPtrT : public Com::Pointer<Interface>{public: IFooPtrT(Interface* value = nullptr) : Com::Pointer<Interface>(value) { } IFooPtrT<Interface>& operator=(Interface* value) { using Base = Com::Pointer<Interface>; Base::operator=(value); return *this; } operator Interface*() const { return p; }
开发者ID:jmfb,项目名称:Com,代码行数:31,
示例21: INTERNET_MAX_URL_LENGTH//// HideDesktop() - hides the desktop// RestoreDesktop() - restore the desktop//#define WIN32_LEAN_AND_MEAN#include <Windows.h>#include <WinInet.h> // Shell object uses INTERNET_MAX_URL_LENGTH (go figure)#if _MSC_VER < 1400#define _WIN32_IE 0x0400#endif#include <atlbase.h> // ATL smart pointers#include <shlguid.h> // shell GUIDs#include <shlobj.h> // IActiveDesktopstruct __declspec(uuid("F490EB00-1240-11D1-9888-006097DEACF9")) IActiveDesktop;#define PACKVERSION(major,minor) MAKELONG(minor,major)DWORD GetDllVersion(LPCTSTR lpszDllName){ HINSTANCE hinstDll; DWORD dwVersion = 0; hinstDll = LoadLibrary(lpszDllName); if(hinstDll) { DLLGETVERSIONPROC pDllGetVersion; pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hinstDll, "DllGetVersion");
开发者ID:HippoRemote,项目名称:WinHippoVNC,代码行数:31,
示例22: dupint CmdDuplicate::execute (std::string&){ int rc = 0; int count = 0; // Apply filter. Filter filter; std::vector <Task> filtered; filter.subset (filtered); if (filtered.size () == 0) { context.footnote (STRING_FEEDBACK_NO_TASKS_SP); return 1; } // Accumulated project change notifications. std::map <std::string, std::string> projectChanges; for (auto& task : filtered) { // Duplicate the specified task. Task dup (task); dup.id = 0; // Reset, and TDB2::add will set. dup.set ("uuid", uuid ()); // Needs a new UUID. dup.remove ("start"); // Does not inherit start date. dup.remove ("end"); // Does not inherit end date. dup.remove ("entry"); // Does not inherit entry date. // When duplicating a child task, downgrade it to a plain task. if (dup.has ("parent")) { dup.remove ("parent"); dup.remove ("recur"); dup.remove ("until"); dup.remove ("imask"); std::cout << format (STRING_CMD_DUPLICATE_NON_REC, task.id) << "/n"; } // When duplicating a parent task, create a new parent task. else if (dup.getStatus () == Task::recurring) { dup.remove ("mask"); std::cout << format (STRING_CMD_DUPLICATE_REC, task.id) << "/n"; } dup.setStatus (Task::pending); // Does not inherit status. // Must occur after Task::recurring check. dup.modify (Task::modAnnotate); if (permission (format (STRING_CMD_DUPLICATE_CONFIRM, task.id, task.get ("description")), filtered.size ())) { context.tdb2.add (dup); ++count; feedback_affected (STRING_CMD_DUPLICATE_TASK, task); if (context.verbose ("new-id")) std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.id) + "/n"; else if (context.verbose ("new-uuid")) std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.get ("uuid")) + "/n"; if (context.verbose ("project")) projectChanges[task.get ("project")] = onProjectChange (task); } else { std::cout << STRING_CMD_DUPLICATE_NO << "/n"; rc = 1; if (_permission_quit) break; } } // Now list the project changes. for (auto& change : projectChanges) if (change.first != "") context.footnote (change.second); feedback_affected (count == 1 ? STRING_CMD_DUPLICATE_1 : STRING_CMD_DUPLICATE_N, count); return rc;}
开发者ID:austinwagner,项目名称:task,代码行数:86,
示例23: CBaseInputPinCStreamSwitcherInputPin::CStreamSwitcherInputPin(CStreamSwitcherFilter* pFilter, HRESULT* phr, LPCWSTR pName) : CBaseInputPin(NAME("CStreamSwitcherInputPin"), pFilter, &pFilter->m_csState, phr, pName) , m_Allocator(this, phr) , m_bSampleSkipped(FALSE) , m_bQualityChanged(FALSE) , m_bUsingOwnAllocator(FALSE) , m_evBlock(TRUE) , m_fCanBlock(false) , m_hNotifyEvent(NULL){ m_bCanReconnectWhenActive = TRUE;}class __declspec(uuid("138130AF-A79B-45D5-B4AA-87697457BA87")) NeroAudioDecoder {};STDMETHODIMP CStreamSwitcherInputPin::NonDelegatingQueryInterface(REFIID riid, void** ppv){ return QI(IStreamSwitcherInputPin) IsConnected() && GetCLSID(GetFilterFromPin(GetConnected())) == __uuidof(NeroAudioDecoder) && QI(IPinConnection) __super::NonDelegatingQueryInterface(riid, ppv);}// IPinConnectionSTDMETHODIMP CStreamSwitcherInputPin::DynamicQueryAccept(const AM_MEDIA_TYPE* pmt){ return QueryAccept(pmt);}
开发者ID:Strongc,项目名称:sheshouyingyin,代码行数:30,
示例24: QStringvoidDatabaseCommand_PlaybackHistory::exec( DatabaseImpl* dbi ){ TomahawkSqlQuery query = dbi->newquery(); QList<Tomahawk::query_ptr> ql; QString whereToken; if ( !source().isNull() ) { whereToken = QString( "WHERE source %1" ).arg( source()->isLocal() ? "IS NULL" : QString( "= %1" ).arg( source()->id() ) ); } QString sql = QString( "SELECT track, playtime, secs_played " "FROM playback_log " "%1 " "ORDER BY playtime DESC " "%2" ).arg( whereToken ) .arg( m_amount > 0 ? QString( "LIMIT 0, %1" ).arg( m_amount ) : QString() ); query.prepare( sql ); query.exec(); while( query.next() ) { TomahawkSqlQuery query_track = dbi->newquery(); QString sql = QString( "SELECT track.name, artist.name " "FROM track, artist " "WHERE artist.id = track.artist " "AND track.id = %1" ).arg( query.value( 0 ).toUInt() ); query_track.prepare( sql ); query_track.exec(); if ( query_track.next() ) { Tomahawk::query_ptr q = Tomahawk::Query::get( query_track.value( 1 ).toString(), query_track.value( 0 ).toString(), QString(), uuid() ); ql << q; } } qDebug() << Q_FUNC_INFO << ql.length(); if ( ql.count() ) emit tracks( ql );}
开发者ID:hatstand,项目名称:tomahawk,代码行数:49,
示例25: commentSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/#include "stdafx.h"#include <numeric>#include <sstream>#include <unordered_map>#include <evntrace.h>#include <evntcons.h>#include <tdh.h>#include "EtwCommon.h"#pragma comment(lib, "tdh.lib")struct __declspec(uuid("{83ed54f0-4d48-4e45-b16e-726ffd1fa4af}")) Microsoft_Windows_Networking_Correlation;struct __declspec(uuid("{2ed6006e-4729-4609-b423-3ee7bcd678ef}")) Microsoft_Windows_NDIS_PacketCapture;/*per->EventDescriptor.Keyword0x80000601'40000001 PacketStart0x80000601'80000001 PacketEnd0x00000001'00000000 SendPath0x00000200'00000000 PiiPresent0x00000400'00000000 Packet*/constexpr ULONGLONG KeywordPacketStart = 0x00000000'40000000;constexpr ULONGLONG KeywordPacketEnd = 0x00000000'80000000;
开发者ID:egtra,项目名称:ndiscap-packet,代码行数:30,
注:本文中的uuid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uuid_bin2str函数代码示例 C++ utsname函数代码示例 |