blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
5
146
content_id
stringlengths
40
40
detected_licenses
listlengths
0
7
license_type
stringclasses
2 values
repo_name
stringlengths
6
79
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
4 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.07k
426M
star_events_count
int64
0
27
fork_events_count
int64
0
12
gha_license_id
stringclasses
3 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
6 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
20
6.28M
extension
stringclasses
20 values
content
stringlengths
20
6.28M
authors
listlengths
1
16
author_lines
listlengths
1
16
a999dd981d7fb3eb21aebe97cf12b8f6ebea32db
a6364718e205f8a83f180f5f06703e8964d6eafe
/foo_lyricsgrabber2/foo_lyricsgrabber2/downloader.h
581405e59934e44b1fb5873d215fb5650348da4f
[ "MIT" ]
permissive
LWain83/lyricsgrabber2
b40f56303b7de120a8f12292e194faac661a79e3
b71765433d6ac0c1d1b85b6b1d82de705c6d5718
refs/heads/master
2016-08-12T18:53:51.990628
2010-08-28T07:13:29
2010-08-28T07:13:29
52,316,826
0
0
null
null
null
null
UTF-8
C++
false
false
1,105
h
#pragma once #define CURL_STATICLIB #include <curl/curl.h> #include <curl/easy.h> #include <string> class web_downloader { public: PFC_DECLARE_EXCEPTION(exception_curl , pfc::exception, "Curl Error") PFC_DECLARE_EXCEPTION(exception_curl_init , exception_curl, "Global libcurl initialisation failed") PFC_DECLARE_EXCEPTION(exception_curl_session, exception_curl, "Start easy Session failed") PFC_DECLARE_EXCEPTION(exception_curl_perform, exception_curl, "File transfer failed") // Constructor web_downloader(); web_downloader(long flags); // Destructor ~web_downloader(); // Raw handle for curl CURL * get_curl_handle() { return m_curl; } template <typename T> void set_option(CURLoption option, T param) { curl_easy_setopt(m_curl, option, param); } std::string do_transfer(const char * url); public: std::string escape(const char * str, size_t len = 0); private: void _init(); static size_t _write_memory_callback(void * ptr, size_t size, size_t nmemb, void * data); private: CURL * m_curl; char m_error[CURL_ERROR_SIZE]; };
[ "qudeid@d0561270-fede-e5e2-f771-9cccb1c17e5b" ]
[ [ [ 1, 45 ] ] ]
ecb02db46a8de59e1b794c6222a663d159bcce86
b5ad65ebe6a1148716115e1faab31b5f0de1b493
/src/NodeViewer/ClassView.cpp
7a711d0b071b80f8854e4c5d35004feb4781ff31
[]
no_license
gasbank/aran
4360e3536185dcc0b364d8de84b34ae3a5f0855c
01908cd36612379ade220cc09783bc7366c80961
refs/heads/master
2021-05-01T01:16:19.815088
2011-03-01T05:21:38
2011-03-01T05:21:38
1,051,010
1
0
null
null
null
null
UTF-8
C++
false
false
11,324
cpp
#include "NodeViewerPCH.h" #include "MainFrm.h" #include "ClassView.h" #include "Resource.h" #include "NodeViewer.h" #include "OutputWnd.h" #include "ArnSceneGraph.h" #include "ArnNode.h" #include "PropertiesWnd.h" class CClassViewMenuButton : public CMFCToolBarMenuButton { friend class CClassView; DECLARE_SERIAL(CClassViewMenuButton) public: CClassViewMenuButton(HMENU hMenu = NULL) : CMFCToolBarMenuButton((UINT)-1, hMenu, -1) { } virtual void OnDraw(CDC* pDC, const CRect& rect, CMFCToolBarImages* pImages, BOOL bHorz = TRUE, BOOL bCustomizeMode = FALSE, BOOL bHighlight = FALSE, BOOL bDrawBorder = TRUE, BOOL bGrayDisabledButtons = TRUE) { pImages = CMFCToolBar::GetImages(); CAfxDrawState ds; pImages->PrepareDrawImage(ds); CMFCToolBarMenuButton::OnDraw(pDC, rect, pImages, bHorz, bCustomizeMode, bHighlight, bDrawBorder, bGrayDisabledButtons); pImages->EndDrawImage(ds); } }; IMPLEMENT_SERIAL(CClassViewMenuButton, CMFCToolBarMenuButton, 1) ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CClassView::CClassView() { m_nCurrSort = ID_SORTING_GROUPBYTYPE; } CClassView::~CClassView() { } BEGIN_MESSAGE_MAP(CClassView, CDockablePane) ON_WM_CREATE() ON_WM_SIZE() ON_WM_CONTEXTMENU() ON_COMMAND(ID_CLASS_ADD_MEMBER_FUNCTION, OnClassAddMemberFunction) ON_COMMAND(ID_CLASS_ADD_MEMBER_VARIABLE, OnClassAddMemberVariable) ON_COMMAND(ID_CLASS_DEFINITION, OnClassDefinition) ON_COMMAND(ID_CLASS_PROPERTIES, OnClassProperties) ON_COMMAND(ID_NEW_FOLDER, OnNewFolder) ON_WM_PAINT() ON_WM_SETFOCUS() ON_COMMAND_RANGE(ID_SORTING_GROUPBYTYPE, ID_SORTING_SORTBYACCESS, OnSort) ON_UPDATE_COMMAND_UI_RANGE(ID_SORTING_GROUPBYTYPE, ID_SORTING_SORTBYACCESS, OnUpdateSort) ON_COMMAND(ID_NODE_PROPERTIES, OnNodeProperties) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CClassView message handlers int CClassView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; CRect rectDummy; rectDummy.SetRectEmpty(); // Create views: const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; if (!m_wndClassView.Create(dwViewStyle, rectDummy, this, 2)) { TRACE0("Failed to create Class View\n"); return -1; // fail to create } // Load images: m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_SORT); m_wndToolBar.LoadToolBar(IDR_SORT, 0, 0, TRUE /* Is locked */); OnChangeVisualStyle(); m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY); m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT)); m_wndToolBar.SetOwner(this); // All commands will be routed via this control , not via the parent frame: m_wndToolBar.SetRouteCommandsViaFrame(FALSE); CMenu menuSort; menuSort.LoadMenu(IDR_POPUP_SORT); m_wndToolBar.ReplaceButton(ID_SORT_MENU, CClassViewMenuButton(menuSort.GetSubMenu(0)->GetSafeHmenu())); CClassViewMenuButton* pButton = DYNAMIC_DOWNCAST(CClassViewMenuButton, m_wndToolBar.GetButton(0)); if (pButton != NULL) { pButton->m_bText = FALSE; pButton->m_bImage = TRUE; pButton->SetImage(GetCmdMgr()->GetCmdImage(m_nCurrSort)); pButton->SetMessageWnd(this); } // Fill in some static tree view data (dummy code, nothing magic here) //FillClassView(); return 0; } void CClassView::OnSize(UINT nType, int cx, int cy) { CDockablePane::OnSize(nType, cx, cy); AdjustLayout(); } void CClassView::FillClassView() { HTREEITEM hRoot = m_wndClassView.InsertItem(_T("ARN Scene Graph Root"), 0, 0); m_wndClassView.SetItemState(hRoot, TVIS_BOLD, TVIS_BOLD); HTREEITEM hClass = m_wndClassView.InsertItem(_T("RootChild1"), 1, 1, hRoot); m_wndClassView.InsertItem(_T("CFakeAboutDlg()"), 3, 3, hClass); m_wndClassView.Expand(hRoot, TVE_EXPAND); hClass = m_wndClassView.InsertItem(_T("RootChild2"), 1, 1, hRoot); m_wndClassView.InsertItem(_T("CFakeApp()"), 3, 3, hClass); m_wndClassView.InsertItem(_T("InitInstance()"), 3, 3, hClass); m_wndClassView.InsertItem(_T("OnAppAbout()"), 3, 3, hClass); hClass = m_wndClassView.InsertItem(_T("RootChild3"), 1, 1, hRoot); m_wndClassView.InsertItem(_T("CFakeAppDoc()"), 4, 4, hClass); m_wndClassView.InsertItem(_T("~CFakeAppDoc()"), 3, 3, hClass); m_wndClassView.InsertItem(_T("OnNewDocument()"), 3, 3, hClass); hClass = m_wndClassView.InsertItem(_T("RootChild4"), 1, 1, hRoot); m_wndClassView.InsertItem(_T("CFakeAppView()"), 4, 4, hClass); m_wndClassView.InsertItem(_T("~CFakeAppView()"), 3, 3, hClass); m_wndClassView.InsertItem(_T("GetDocument()"), 3, 3, hClass); m_wndClassView.Expand(hClass, TVE_EXPAND); hClass = m_wndClassView.InsertItem(_T("CFakeAppFrame"), 1, 1, hRoot); m_wndClassView.InsertItem(_T("CFakeAppFrame()"), 3, 3, hClass); m_wndClassView.InsertItem(_T("~CFakeAppFrame()"), 3, 3, hClass); m_wndClassView.InsertItem(_T("m_wndMenuBar"), 6, 6, hClass); m_wndClassView.InsertItem(_T("m_wndToolBar"), 6, 6, hClass); m_wndClassView.InsertItem(_T("m_wndStatusBar"), 6, 6, hClass); hClass = m_wndClassView.InsertItem(_T("Globals"), 2, 2, hRoot); m_wndClassView.InsertItem(_T("theFakeApp"), 5, 5, hClass); m_wndClassView.Expand(hClass, TVE_EXPAND); } void CClassView::OnContextMenu(CWnd* pWnd, CPoint point) { CTreeCtrl* pWndTree = (CTreeCtrl*)&m_wndClassView; ASSERT_VALID(pWndTree); if (pWnd != pWndTree) { CDockablePane::OnContextMenu(pWnd, point); return; } if (point != CPoint(-1, -1)) { // Select clicked item: CPoint ptTree = point; pWndTree->ScreenToClient(&ptTree); UINT flags = 0; HTREEITEM hTreeItem = pWndTree->HitTest(ptTree, &flags); if (hTreeItem != NULL) { pWndTree->SelectItem(hTreeItem); } } pWndTree->SetFocus(); CMenu menu; menu.LoadMenu(IDR_POPUP_SORT); CMenu* pSumMenu = menu.GetSubMenu(0); if (AfxGetMainWnd()->IsKindOf(RUNTIME_CLASS(CMDIFrameWndEx))) { CMFCPopupMenu* pPopupMenu = new CMFCPopupMenu; if (!pPopupMenu->Create(this, point.x, point.y, (HMENU)pSumMenu->m_hMenu, FALSE, TRUE)) return; ((CMDIFrameWndEx*)AfxGetMainWnd())->OnShowPopupMenu(pPopupMenu); UpdateDialogControls(this, FALSE); } } void CClassView::AdjustLayout() { if (GetSafeHwnd() == NULL) { return; } CRect rectClient; GetClientRect(rectClient); int cyTlb = m_wndToolBar.CalcFixedLayout(FALSE, TRUE).cy; m_wndToolBar.SetWindowPos(NULL, rectClient.left, rectClient.top, rectClient.Width(), cyTlb, SWP_NOACTIVATE | SWP_NOZORDER); m_wndClassView.SetWindowPos(NULL, rectClient.left + 1, rectClient.top + cyTlb + 1, rectClient.Width() - 2, rectClient.Height() - cyTlb - 2, SWP_NOACTIVATE | SWP_NOZORDER); } BOOL CClassView::PreTranslateMessage(MSG* pMsg) { return CDockablePane::PreTranslateMessage(pMsg); } void CClassView::OnSort(UINT id) { if (m_nCurrSort == id) { return; } m_nCurrSort = id; CClassViewMenuButton* pButton = DYNAMIC_DOWNCAST(CClassViewMenuButton, m_wndToolBar.GetButton(0)); if (pButton != NULL) { pButton->SetImage(GetCmdMgr()->GetCmdImage(id)); m_wndToolBar.Invalidate(); m_wndToolBar.UpdateWindow(); } } void CClassView::OnUpdateSort(CCmdUI* pCmdUI) { pCmdUI->SetCheck(pCmdUI->m_nID == m_nCurrSort); } void CClassView::OnClassAddMemberFunction() { AfxMessageBox(_T("Add member function...")); } void CClassView::OnClassAddMemberVariable() { // TODO: Add your command handler code here } void CClassView::OnClassDefinition() { // TODO: Add your command handler code here } void CClassView::OnClassProperties() { // TODO: Add your command handler code here } void CClassView::OnNewFolder() { AfxMessageBox(_T("New Folder...")); } void CClassView::OnPaint() { CPaintDC dc(this); // device context for painting CRect rectTree; m_wndClassView.GetWindowRect(rectTree); ScreenToClient(rectTree); rectTree.InflateRect(1, 1); dc.Draw3dRect(rectTree, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DSHADOW)); } void CClassView::OnSetFocus(CWnd* pOldWnd) { CDockablePane::OnSetFocus(pOldWnd); m_wndClassView.SetFocus(); } void CClassView::OnChangeVisualStyle() { m_ClassViewImages.DeleteImageList(); UINT uiBmpId = theApp.m_bHiColorIcons ? IDB_CLASS_VIEW_24 : IDB_CLASS_VIEW; CBitmap bmp; if (!bmp.LoadBitmap(uiBmpId)) { TRACE(_T("Can't load bitmap: %x\n"), uiBmpId); ASSERT(FALSE); return; } BITMAP bmpObj; bmp.GetBitmap(&bmpObj); UINT nFlags = ILC_MASK; nFlags |= (theApp.m_bHiColorIcons) ? ILC_COLOR24 : ILC_COLOR4; m_ClassViewImages.Create(16, bmpObj.bmHeight, nFlags, 0, 0); m_ClassViewImages.Add(&bmp, RGB(255, 0, 0)); m_wndClassView.SetImageList(&m_ClassViewImages, TVSIL_NORMAL); m_wndToolBar.CleanUpLockedImages(); m_wndToolBar.LoadBitmap(theApp.m_bHiColorIcons ? IDB_SORT_24 : IDR_SORT, 0, 0, TRUE /* Locked */); } void CClassView::updateSceneGraph(ArnSceneGraph* sg, COutputWnd* outputWnd) { m_outputWnd = outputWnd; m_outputWnd->setWndClassView(this); ArnNode* rootNode = sg->getSceneRoot(); CString nodeName(rootNode->getName()); HTREEITEM hRoot = m_wndClassView.InsertItem(nodeName, 0, 0); //m_wndClassView.SetItemState(hRoot, TVIS_BOLD, TVIS_BOLD); m_outputWnd->insertNodeName(nodeName, hRoot); buildSceneGraph(rootNode, hRoot); m_wndClassView.Expand(hRoot, TVE_EXPAND); m_sg = sg; } void CClassView::buildSceneGraph( ArnNode* node, HTREEITEM treeParent ) { unsigned int childrenCount = node->getNodeCount(); unsigned int i; for (i = 0; i < childrenCount; ++i) { ArnNode* childNode = node->getNodeAt(i); CString childNodeName(childNode->getName()); int imgIdx; switch (childNode->getType()) { case NDT_RT_MESH: imgIdx = 1; break; case NDT_RT_ANIM: imgIdx = 2; break; case NDT_RT_SKELETON: imgIdx = 3; break; case NDT_RT_BONE: imgIdx = 4; break; case NDT_RT_CAMERA: imgIdx = 5; break; case NDT_RT_HIERARCHY: imgIdx = 6; break; case NDT_RT_LIGHT: imgIdx = 7; break; case NDT_RT_MATERIAL: imgIdx = 8; break; case NDT_RT_IPO: imgIdx = 9; break; default: imgIdx = 1; break; } HTREEITEM hChild = m_wndClassView.InsertItem(childNodeName, imgIdx, imgIdx, treeParent); m_wndClassView.SetItemData(hChild, reinterpret_cast<DWORD_PTR>(childNode)); m_outputWnd->insertNodeName(childNodeName, hChild); buildSceneGraph(childNode, hChild); } } void CClassView::OnNodeProperties() { HTREEITEM item = m_wndClassView.GetSelectedItem(); const CString itemName = m_wndClassView.GetItemText(item); const DWORD_PTR itemData = m_wndClassView.GetItemData(item); //CT2CA pszConvertedAnsiString(itemName); //ArnNode* node = m_sg->getSceneRoot()->getNodeByName(STRING(pszConvertedAnsiString)); ArnNode* node = reinterpret_cast<ArnNode*>(itemData); m_propWnd->updateNodeProp(node); }
[ [ [ 1, 387 ] ] ]
02c79492e27e1584a18cac9e978c2be96e67cdfe
9c62af23e0a1faea5aaa8dd328ba1d82688823a5
/rl/tags/v0-1/engine/core/include/ActorControlledObject.h
3bd3a750a36756aab02b9b68de6281c9bc79dee4
[ "ClArtistic", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
jacmoe/dsa-hl-svn
55b05b6f28b0b8b216eac7b0f9eedf650d116f85
97798e1f54df9d5785fb206c7165cd011c611560
refs/heads/master
2021-04-22T12:07:43.389214
2009-11-27T22:01:03
2009-11-27T22:01:03
null
0
0
null
null
null
null
ISO-8859-1
C++
false
false
2,961
h
/* This source file is part of Rastullahs Lockenpracht. * Copyright (C) 2003-2005 Team Pantheon. http://www.team-pantheon.de * * This program is free software; you can redistribute it and/or modify * it under the terms of the Clarified Artistic License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Clarified Artistic License for more details. * * You should have received a copy of the Clarified Artistic License * along with this program; if not you can get it here * http://www.jpaulmorrison.com/fbp/artistic2.htm. */ #ifndef __ActorControlledObject_H__ #define __ActorControlledObject_H__ #include "CorePrerequisites.h" #include <OgreMovableObject.h> namespace rl { class Actor; /** Abstrakte Basisklasse für alle Objekte, die man zur * Visualisierung, Höhrbarmachung an einen Aktor heften * kann. Zwischen Actor und ActorControlledObject eine * 1:1-Beziehung. * * Derzeit werden hier im Wesentlichen die OgreMovables * gekapselt, aber auch für Soundquellen ist diese Klasse * geeignet. Eigene Klasse, die gekapselt werden sollen * müssen von Ogre::MovableObject erben. */ class _RlCoreExport ActorControlledObject { public: ActorControlledObject(); virtual ~ActorControlledObject(); /** Diese Methode wird intern benutzt, damit * der Aktor sich dieses Objekt zu eigen machen * kann. * @warning Wenn diese Methode überschrieben wird immer * auch ActorControlledObject::_setActor() aufrufen. */ virtual void _setActor(Actor* actor); virtual Actor* getActor(); virtual void _attachSceneNode(Ogre::SceneNode* node); virtual void _detachSceneNode(Ogre::SceneNode* node); virtual bool isAttachedToNode(Ogre::SceneNode* node) const; virtual bool isAttached() const; /** * Interne Methode. Wird vom Aktor aufgerufen, wenn sich dessen * Status geändert hat. (Position, Orientierung, etc) * Die Standardimplementierung macht nichts, kann aber * von abgeleiteten Klassen überschrieben werden. */ virtual void _update(); /** Liefert das gekapselte Ogre::MovableObject. */ Ogre::MovableObject* getMovableObject(); /** Liefert die Typenbezeichnung der konkreten Klasse. * Sollte dem Typnamen entsprechen. */ virtual Ogre::String getObjectType() = 0; /** Ermöglicht ein Highlighten des ActorControlled */ virtual void setHighlighted( bool highlight ) {}; virtual bool isMeshObject(); protected: Ogre::MovableObject* mMovableObject; }; } #endif
[ "blakharaz@4c79e8ff-cfd4-0310-af45-a38c79f83013" ]
[ [ [ 1, 82 ] ] ]
b99a3fa7e74271e8aa74c22bff1e02457855b397
1cc5720e245ca0d8083b0f12806a5c8b13b5cf98
/archive/ok/3125/c.cpp
f383b95d881f633da4f524d1ac817049e63b5688
[]
no_license
Emerson21/uva-problems
399d82d93b563e3018921eaff12ca545415fd782
3079bdd1cd17087cf54b08c60e2d52dbd0118556
refs/heads/master
2021-01-18T09:12:23.069387
2010-12-15T00:38:34
2010-12-15T00:38:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
887
cpp
#include <iostream> #include <algorithm> #include <utility> #include <cmath> using namespace std; #define FOR(a,b) for(a=0;a<b;a++) #define PI pair<int,int> int len,h; int hat[100][2]; double calc(int i,int x,int y) { return sqrt((hat[i][0]-x+0.0)*(hat[i][0]-x)+(hat[i][1]-y+0.0)*(hat[i][1]-y)); } void st() { cin >> len >> h; int i,j,k,x,y; FOR(i,h) cin >> hat[i][0]>>hat[i][1]; int melhor[2]; double dist = 0,c; bool p = false; FOR(x,len) if(x) FOR(y,len) if(y) { c=0; FOR(i,h) { if(hat[i][0]==x && hat[i][1]==y) goto nex; c = max(c,calc(i,x,y)); } if(c>x || c>y || c>(len-x) || c>(len-y)) goto nex; dist=c; p=true; melhor[0]=x;melhor[1]=y; goto en; nex:; } en: if(!p) cout << "poodle" << endl; else cout << melhor[0] << " " << melhor[1] << endl; } int main() { int t; cin>>t;while(t--)st();return 0; }
[ [ [ 1, 43 ] ] ]
5de71c1a872cddd75ad0a5725c0a177986304807
6fa6532d530904ba3704da72327072c24adfc587
/SCoder/SCoder/coders/echocoder.h
50938db3662dd8472b81e5216db6cf2747ccf6e5
[]
no_license
photoguns/code-hnure
277b1c0a249dae75c66e615986fb1477e6e0f938
92d6ab861a9de3f409c5af0a46ed78c2aaf13c17
refs/heads/master
2020-05-20T08:56:07.927168
2009-05-29T16:49:34
2009-05-29T16:49:34
35,911,792
0
0
null
null
null
null
UTF-8
C++
false
false
1,961
h
#ifndef _ECHOCODER_H_ #define _ECHOCODER_H_ //////////////////////////////////////////////////////////////////////////////// #include "lsbsoundcoder.h" //////////////////////////////////////////////////////////////////////////////// /** C++ class for stegano -coding -encoding based on echo algorithm * Use it with some sound container * * @author Roman Pasechnik * @since May 23rd, 2009 * @updated May 23rd, 2009 * */ class EchoCoder: public LSBSoundCoder { //////////////////////////////////////////////////////////////////////////////// public: //////////////////////////////////////////////////////////////////////////////// /** Constructor */ EchoCoder(); /** Destructor */ virtual ~EchoCoder(); /** Puts the message into container */ virtual void SetMessage ( Container* _container, const std::string& message, const Key* _key ); /** Gets the message from container */ virtual std::string GetMessage ( const Container* _container, const Key* _key ); //////////////////////////////////////////////////////////////////////////////// private: //////////////////////////////////////////////////////////////////////////////// /** Special handling */ virtual void SetupContainer( const WAVContainer* _container ); /** Reads bit from container */ virtual bool GetBit( bool* _bit ); /** Writes bit in container */ virtual bool SetBit( bool _bit ); /** Writes echo of sample in container */ void WriteEcho( short _sample, bool _greater ); /** First echo offset [samples] */ int m_EchoFirstOffset; /** Second echo offset [samples] */ int m_EchoSecondOffset; //////////////////////////////////////////////////////////////////////////////// }; #endif //_ECHOCODER_H_
[ "[email protected]@8592428e-0b6d-11de-9036-69e38a880166" ]
[ [ [ 1, 81 ] ] ]
ca508ebd9b81ec255ce08f4ef1ffadb2ac112b7e
e7c45d18fa1e4285e5227e5984e07c47f8867d1d
/Common/Scd/KWDB/crack.cpp
542ea64c7ecac7dffe2429f8b0ef31d1fd090d9b
[]
no_license
abcweizhuo/Test3
0f3379e528a543c0d43aad09489b2444a2e0f86d
128a4edcf9a93d36a45e5585b70dee75e4502db4
refs/heads/master
2021-01-17T01:59:39.357645
2008-08-20T00:00:29
2008-08-20T00:00:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,553
cpp
// crack.cpp // This is a part of the Microsoft Foundation Classes C++ library. // Copyright (C) 1992-1995 Microsoft Corporation // All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. #include "stdafx.h" #define __CRACK_CPP #include "crack.h" ADOX::DataTypeEnum/*short*/ ConvertStringTypeToDBType( const CString& strVar ) { if ( strVar == _T("Bool") || strVar == _T("ADODB::adBoolean") || strVar == _T("Boolean") ) return ADOX::adBoolean; else if ( strVar == _T("ADODB::adUnsignedTinyInt") || strVar == _T("Byte") ) return ADOX::adUnsignedTinyInt; else if ( strVar == _T("ADODB::adSmallInt") || strVar == _T("Integer")) return ADOX::adSmallInt; else if ( strVar == _T("ADODB::adInteger") || strVar == _T("Long") ) return ADOX::adInteger; else if ( strVar == _T("ADODB::adCurrency") || strVar == _T("Currency") ) return ADOX::adCurrency; else if ( strVar == _T("ADODB::adSingle") || strVar == _T("Single") ) return ADOX::adSingle; else if ( strVar == _T("ADODB::adDouble") || strVar == _T("Double") ) return ADOX::adDouble; else if ( strVar == _T("ADODB::adVarWChar") || strVar == _T("Text") ) return ADOX::adVarWChar; else if ( strVar == _T("ADODB::adLongVarWChar") || strVar == _T("Memo") ) return ADOX::adLongVarWChar; else if ( strVar == _T("ADODB::adLongVarBinary") || strVar == _T("Long Binary") ) return ADOX::adLongVarBinary; else if ( strVar == _T("ADODB::adDate") || strVar == _T("Date") ) return ADOX::adDate; // Default, don't know what it really is... return ADOX::adLongVarWChar; } LPCTSTR CCrack::strFieldType(ADOX::DataTypeEnum/*short*/ sType) { switch(sType){ case (ADOX::adBoolean/*ADODB::adBoolean*/): return _T("Bool"); case (ADOX::adUnsignedTinyInt/*ADODB::adUnsignedTinyInt*/): return _T("Byte"); case (ADOX::adSmallInt/*ADODB::adSmallInt*/): return _T("Integer"); case (ADOX::adInteger/*ADODB::adInteger*/): return _T("Long"); case (ADOX::adCurrency/*ADODB::adCurrency*/): return _T("Currency"); case (ADOX::adSingle/*ADODB::adSingle*/): return _T("Single"); case (ADOX::adDouble/*ADODB::adDouble*/): return _T("Double"); case (ADOX::adDate/*ADODB::adDate*/): return _T("Date"); case (ADOX::adVarWChar/*ADODB::adVarWChar*/): return _T("Text"); case (ADOX::adLongVarBinary/*ADODB::adLongVarBinary*/): return _T("Long Binary"); case (ADOX::adLongVarWChar/*ADODB::adLongVarWChar*/): return _T("Memo"); case (ADOX::adGUID/*ADODB::adGUID*/): return _T("GUID"); } return _T("Unknown"); } #pragma warning(disable:4100) LPCTSTR CCrack::strQueryDefType(ADOX::DataTypeEnum/*short*/ sType) { //switch(sType){ // case (dbQSelect): // return _T("Select"); // case (dbQAction): // return _T("Action"); // case (dbQCrosstab): // return _T("Crosstab"); // case (dbQDelete): // return _T("Delete"); // case (dbQUpdate): // return _T("Update"); // case (dbQAppend): // return _T("Append"); // case (dbQMakeTable): // return _T("MakeTable"); // case (dbQDDL): // return _T("DDL"); // case (dbQSQLPassThrough): // return _T("SQLPassThrough"); // case (dbQSetOperation): // return _T("Set Operation"); // case (dbQSPTBulk): // return _T("SPTBulk"); //} return _T("Unknown"); } LPCTSTR CCrack::strBOOL(BOOL bFlag) { return bFlag ? _T("TRUE") : _T("FALSE"); } CString CCrack::strVARIANT(const COleVariant& var) { CString strRet; strRet = _T("Fish"); switch(var.vt) { case VT_EMPTY: case VT_NULL: strRet = _T("NULL"); break; case VT_I2: strRet.Format(_T("%hd"),V_I2(&var)); break; case VT_I4: strRet.Format(_T("%d"),V_I4(&var)); break; case VT_R4: strRet.Format(_T("%e"),(double)V_R4(&var)); break; case VT_R8: strRet.Format(_T("%e"),V_R8(&var)); break; case VT_CY: strRet = COleCurrency(var).Format(); break; case VT_DATE: strRet = COleDateTime(var).Format(_T("%m %d %y")); break; case VT_BSTR: strRet = V_BSTRT(&var); break; case VT_DISPATCH: strRet = _T("VT_DISPATCH"); break; case VT_ERROR: strRet = _T("VT_ERROR"); break; case VT_BOOL: return strBOOL(V_BOOL(&var)); case VT_VARIANT: strRet = _T("VT_VARIANT"); break; case VT_UNKNOWN: strRet = _T("VT_UNKNOWN"); break; case VT_I1: strRet = _T("VT_I1"); break; case VT_UI1: strRet.Format(_T("0x%02hX"),(unsigned short)V_UI1(&var)); break; case VT_UI2: strRet = _T("VT_UI2"); break; case VT_UI4: strRet = _T("VT_UI4"); break; case VT_I8: strRet = _T("VT_I8"); break; case VT_UI8: strRet = _T("VT_UI8"); break; case VT_INT: strRet = _T("VT_INT"); break; case VT_UINT: strRet = _T("VT_UINT"); break; case VT_VOID: strRet = _T("VT_VOID"); break; case VT_HRESULT: strRet = _T("VT_HRESULT"); break; case VT_PTR: strRet = _T("VT_PTR"); break; case VT_SAFEARRAY: strRet = _T("VT_SAFEARRAY"); break; case VT_CARRAY: strRet = _T("VT_CARRAY"); break; case VT_USERDEFINED: strRet = _T("VT_USERDEFINED"); break; case VT_LPSTR: strRet = _T("VT_LPSTR"); break; case VT_LPWSTR: strRet = _T("VT_LPWSTR"); break; case VT_FILETIME: strRet = _T("VT_FILETIME"); break; case VT_BLOB: strRet = _T("VT_BLOB"); break; case VT_STREAM: strRet = _T("VT_STREAM"); break; case VT_STORAGE: strRet = _T("VT_STORAGE"); break; case VT_STREAMED_OBJECT: strRet = _T("VT_STREAMED_OBJECT"); break; case VT_STORED_OBJECT: strRet = _T("VT_STORED_OBJECT"); break; case VT_BLOB_OBJECT: strRet = _T("VT_BLOB_OBJECT"); break; case VT_CF: strRet = _T("VT_CF"); break; case VT_CLSID: strRet = _T("VT_CLSID"); break; } VARTYPE vt = var.vt; if(vt & VT_ARRAY) { vt = (VARTYPE) (vt & ~VT_ARRAY); strRet = _T("Array of "); } if(vt & VT_BYREF) { vt = (VARTYPE) (vt & ~VT_BYREF); strRet += _T("Pointer to "); } if(vt != var.vt) { switch(vt){ case VT_EMPTY: strRet += _T("VT_EMPTY"); break; case VT_NULL: strRet += _T("VT_NULL"); break; case VT_I2: strRet += _T("VT_I2"); break; case VT_I4: strRet += _T("VT_I4"); break; case VT_R4: strRet += _T("VT_R4"); break; case VT_R8: strRet += _T("VT_R8"); break; case VT_CY: strRet += _T("VT_CY"); break; case VT_DATE: strRet += _T("VT_DATE"); break; case VT_BSTR: strRet += _T("VT_BSTR"); break; case VT_DISPATCH: strRet += _T("VT_DISPATCH"); break; case VT_ERROR: strRet += _T("VT_ERROR"); break; case VT_BOOL: strRet += _T("VT_BOOL"); break; case VT_VARIANT: strRet += _T("VT_VARIANT"); break; case VT_UNKNOWN: strRet += _T("VT_UNKNOWN"); break; case VT_I1: strRet += _T("VT_I1"); break; case VT_UI1: strRet += _T("VT_UI1"); break; case VT_UI2: strRet += _T("VT_UI2"); break; case VT_UI4: strRet += _T("VT_UI4"); break; case VT_I8: strRet += _T("VT_I8"); break; case VT_UI8: strRet += _T("VT_UI8"); break; case VT_INT: strRet += _T("VT_INT"); break; case VT_UINT: strRet += _T("VT_UINT"); break; case VT_VOID: strRet += _T("VT_VOID"); break; case VT_HRESULT: strRet += _T("VT_HRESULT"); break; case VT_PTR: strRet += _T("VT_PTR"); break; case VT_SAFEARRAY: strRet += _T("VT_SAFEARRAY"); break; case VT_CARRAY: strRet += _T("VT_CARRAY"); break; case VT_USERDEFINED: strRet += _T("VT_USERDEFINED"); break; case VT_LPSTR: strRet += _T("VT_LPSTR"); break; case VT_LPWSTR: strRet += _T("VT_LPWSTR"); break; case VT_FILETIME: strRet += _T("VT_FILETIME"); break; case VT_BLOB: strRet += _T("VT_BLOB"); break; case VT_STREAM: strRet += _T("VT_STREAM"); break; case VT_STORAGE: strRet += _T("VT_STORAGE"); break; case VT_STREAMED_OBJECT: strRet += _T("VT_STREAMED_OBJECT"); break; case VT_STORED_OBJECT: strRet += _T("VT_STORED_OBJECT"); break; case VT_BLOB_OBJECT: strRet += _T("VT_BLOB_OBJECT"); break; case VT_CF: strRet += _T("VT_CF"); break; case VT_CLSID: strRet += _T("VT_CLSID"); break; } } return strRet; }
[ [ [ 1, 369 ] ] ]
9b09d72c167654ba52249fce25475e546f9e7c05
3aafc3c40c1464fc2a32d1b6bba23818903a4ec9
/TagControlTest/TagControlTest/Form1.h
f246b3b245435faf3edc4a67079ac30e0a4e2775
[]
no_license
robintw/rlibrary
13930416649ec38196bfd38e0980616e9f5454c8
3e55d49acba665940828e26c8bff60863a86246f
refs/heads/master
2020-09-22T10:31:55.561804
2009-01-24T19:05:19
2009-01-24T19:05:19
34,583,564
0
1
null
null
null
null
UTF-8
C++
false
false
2,854
h
#pragma once namespace TagControlTest { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { if (components) { delete components; } } private: TagCloud::TagCloudControl^ tagCloudControl1; protected: private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->tagCloudControl1 = (gcnew TagCloud::TagCloudControl()); this->SuspendLayout(); // // tagCloudControl1 // this->tagCloudControl1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; this->tagCloudControl1->Location = System::Drawing::Point(12, 12); this->tagCloudControl1->Name = L"tagCloudControl1"; this->tagCloudControl1->Size = System::Drawing::Size(529, 230); this->tagCloudControl1->TabIndex = 0; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(845, 329); this->Controls->Add(this->tagCloudControl1); this->Name = L"Form1"; this->Text = L"Form1"; this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load); this->ResumeLayout(false); } #pragma endregion private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { tagCloudControl1->Keywords = gcnew array<String^> { "hello", "robin timothy wilson long long long blah", "olivia", "test", "chaplaincy", "christian", "good", "craftyness", "great book"}; tagCloudControl1->Values = gcnew array<int> { 3, 10, 30, 15, 20, 5, 23, 35, 1 }; tagCloudControl1->UpdateFromArrays(); } }; }
[ "[email protected]@02cab514-f24f-0410-a9ea-a7698ff47c65" ]
[ [ [ 1, 91 ] ] ]
9ecf16da9b2cf04ffa264eb0fadc686cdd31caf9
22438bd0a316b62e88380796f0a8620c4d129f50
/libs/napl/smputils.h
3fd8a5c2e2e57d72ef4e18df9bd59b2a365d15b6
[ "BSL-1.0" ]
permissive
DannyHavenith/NAPL
1578f5e09f1b825f776bea9575f76518a84588f4
5db7bf823bdc10587746d691cb8d94031115b037
refs/heads/master
2021-01-20T02:17:01.186461
2010-11-26T22:26:25
2010-11-26T22:26:25
1,856,141
0
1
null
null
null
null
UTF-8
C++
false
false
2,038
h
//////////////////////////////////////////////////////////////////////////////// // // smputils.h - sample utility functions // #ifndef _SAMPLE_UTILS_H #define _SAMPLE_UTILS_H // balance delivers a sample that is a balanced average of s1 and s2, // where s1:s2 == q1:q2 template< typename sampletype> static inline const sampletype balance( const unsigned short q1, const unsigned short q2, const sampletype &s1, const sampletype &s2) { typedef typename sampletraits<sampletype>::template accumulator_gen<void>::type accumulatortype; return sampletype( (accumulatortype( s1) * ( (long)q1) + accumulatortype( s2) * ( (long)q2)) / (long)(q1 + q2) ); /* return sample_cast< sampletype, sampletraits< sampletype>::accumulatortype>( (sample_cast<sampletraits< sampletype>::accumulatortype, sampletype>(s1) * q1 + (sample_cast<sampletraits< sampletype>::accumulatortype, sampletype>(s2) * q2))/ (q1 + q2)); */ } // // fixed_balance uses a scale of 0 - 32768, where 0 means s1 and no s2, // 32768 means s2 and no s1, and every value in between means a mix of // s1 and s2. // template< typename sampletype> static inline const sampletype fixed_balance( const unsigned short q1, const sampletype &s1, const sampletype &s2) { typedef typename sampletraits<sampletype>::template accumulator_gen<void>::type accumulatortype; return sampletype( (accumulatortype( s1) * ( (long)q1) + accumulatortype( s2) * ( (long)(0x8000 - q1))) / (long)(0x8000) ); } // // fixed_damp is a fixed-point 'damper'. it takes a factor between 0 and 65535 // and a sample and multiplies the sample with (factor/32768) // template< typename sampletype> static inline sampletype fixed_damp( unsigned short factor, const sampletype &sample) { typedef typename sampletraits<sampletype>::template accumulator_gen<void>::type accumulatortype; return sampletype( (accumulatortype( sample) * factor) / (long)(0x8000) ); } #endif
[ [ [ 1, 62 ] ] ]
7aa61d72fabde65a6e4e28ce1558a30d5189f8c0
27d5670a7739a866c3ad97a71c0fc9334f6875f2
/CPP/Shared/Nav2ErrorSv.cpp
21d93e88506daa807330d3e9de5188151ae7bda3
[ "BSD-3-Clause" ]
permissive
ravustaja/Wayfinder-S60-Navigator
ef506c418b8c2e6498ece6dcae67e583fb8a4a95
14d1b729b2cea52f726874687e78f17492949585
refs/heads/master
2021-01-16T20:53:37.630909
2010-06-28T09:51:10
2010-06-28T09:51:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,282
cpp
/* Copyright (c) 1999 - 2010, Vodafone Group Services Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Vodafone Group Services Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define LANGUAGE_SW #include "master.loc" #include "Nav2Error.h" #include "Nav2ErrorXX.h" namespace isab { namespace Nav2Error { static const Nav2ErrorElement nav2ErrorVector[] = { #define NAV2ERROR_LINE(symbol, id, txt) {ErrorNbr(id), txt}, #define NAV2ERROR_LINE_LAST(symbol, id, txt) {ErrorNbr(id), txt} #include "Nav2Error.master" #undef NAV2ERROR_LINE #undef NAV2ERROR_LINE_LAST }; Nav2ErrorTableSv::Nav2ErrorTableSv() : Nav2ErrorTable() { int32 elementSize = (uint8*)&nav2ErrorVector[1] - (uint8*)&nav2ErrorVector[0]; m_table = nav2ErrorVector; m_tableSize = sizeof(nav2ErrorVector) / elementSize; } } /* namespace Nav2Error */ } /* namespace isab */
[ [ [ 1, 42 ] ] ]
27cfc526c1578ec8e737ddc4400b1be78349abd9
ea02e41514b3b979c78af4ea7b5c55e99834036b
/MonoLaunch/MonoCtrl2/RegHelper.cpp
91d346b18976376290cef30dbc05e9c8d49ce8c3
[ "MIT" ]
permissive
isabella232/wintools
446228b88eb4296633b0c2be05c18fe291d6b5d2
203f7b550c0a1660306d4cc0606b1dc6289e8d9a
refs/heads/master
2022-02-23T13:02:25.859592
2010-04-07T16:45:52
2010-04-07T16:45:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,771
cpp
#include "StdAfx.h" #include ".\reghelper.h" CRegHelper::CRegHelper(void) { } CRegHelper::~CRegHelper(void) { } // Retrieves from the registry the default CLR LRESULT CRegHelper::GetDefaultCLR(LPTSTR szBuffer, DWORD dwBuffLen) { LRESULT lRc = 0; HKEY hkMonoKey = NULL; DWORD dwType = REG_SZ; DWORD dwcbValLen = REGBUFFLEN; BYTE cbVal[REGBUFFLEN]; DWORD dwIdx = 0; ZeroMemory(cbVal, sizeof(cbVal)); lRc = ::RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Novell\\Mono"), 0, KEY_READ, &hkMonoKey ); // Check for Errors opening the key if(lRc != ERROR_SUCCESS) { AfxMessageBox(_T("Could not open the Novell\\Mono registry key.")); return -1; } lRc = ::RegQueryValueEx( hkMonoKey, _T("DefaultCLR"), 0, &dwType, cbVal, &dwcbValLen ); if(lRc == ERROR_SUCCESS) { if(dwcbValLen > dwBuffLen) { szBuffer = NULL; return dwcbValLen; } else { lstrcpy(szBuffer, (LPCTSTR)cbVal); } } ::RegCloseKey(hkMonoKey); return 0; } // Retrieves from the registry the default CLR LRESULT CRegHelper::SetDefaultCLR(LPCTSTR szBuffer) { LRESULT lRc = 0; HKEY hkMonoKey = NULL; DWORD dwType = REG_SZ; DWORD dwcbValLen = 0; DWORD dwIdx = 0; lRc = ::RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Novell\\Mono"), 0, KEY_WRITE, &hkMonoKey ); // Check for Errors opening the key if(lRc != ERROR_SUCCESS) { AfxMessageBox(_T("Could not open the Novell\\Mono registry key.")); return -1; } dwcbValLen = ::lstrlen((LPCTSTR)szBuffer); lRc = ::RegSetValueEx( hkMonoKey, _T("DefaultCLR"), 0, dwType, (const BYTE*)szBuffer, dwcbValLen ); ::RegCloseKey(hkMonoKey); return 0; }
[ [ [ 1, 104 ] ] ]
5f62fbffe64a9d88a0b253f5260fa2d72699ad5e
e2e49023f5a82922cb9b134e93ae926ed69675a1
/tools/aosdesigner/view/LogView.hpp
9834017627906e86df858f1eb9f5225a96207dd2
[]
no_license
invy/mjklaim-freewindows
c93c867e93f0e2fe1d33f207306c0b9538ac61d6
30de8e3dfcde4e81a57e9059dfaf54c98cc1135b
refs/heads/master
2021-01-10T10:21:51.579762
2011-12-12T18:56:43
2011-12-12T18:56:43
54,794,395
1
0
null
null
null
null
UTF-8
C++
false
false
576
hpp
#ifndef HGUARD_AOSD_VIEW_LOGVIEW_HPP__ #define HGUARD_AOSD_VIEW_LOGVIEW_HPP__ #pragma once #include <memory> #include <QDockWidget> #include <QListView> #include "utilcpp/Log.hpp" class QTextEdit; namespace aosd { namespace view { /** Display the logs of activity of the application. **/ class LogView : public QDockWidget { Q_OBJECT public: LogView(); ~LogView(); private: std::unique_ptr<QTextEdit> m_text_area; void print_log( util::Log::Level level, const std::string& message ); }; } } #endif
[ "klaim@localhost" ]
[ [ [ 1, 43 ] ] ]
912d4798c053dc205be6bf93a2c1d07a760d3d16
14ad15a09c39347ecc9733c1547bdccefc75893f
/cport/include/CPortReg.hpp
6e9e1ea775a988065802a649786961cbb3e04e73
[]
no_license
begoon/serialcom
649ea1e3d2bea084349558c63e2f1a09c55a38a9
ea2ac76672a3ab43e19724c15c2d9c4ccf0b6970
refs/heads/master
2021-01-10T19:53:20.109320
2009-06-06T13:56:49
2009-06-06T13:56:49
32,339,549
1
0
null
null
null
null
UTF-8
C++
false
false
4,878
hpp
// Borland C++ Builder // Copyright (c) 1995, 2002 by Borland Software Corporation // All rights reserved // (DO NOT EDIT: machine generated header) 'CPortReg.pas' rev: 6.00 #ifndef CPortRegHPP #define CPortRegHPP #pragma delphiheader begin #pragma option push -w- #pragma option push -Vx #include <Menus.hpp> // Pascal unit #include <Classes.hpp> // Pascal unit #include <PropertyCategories.hpp> // Pascal unit #include <DesignMenus.hpp> // Pascal unit #include <DesignEditors.hpp> // Pascal unit #include <DesignIntf.hpp> // Pascal unit #include <SysInit.hpp> // Pascal unit #include <System.hpp> // Pascal unit //-- user supplied ----------------------------------------------------------- namespace Cportreg { //-- type declarations ------------------------------------------------------- class DELPHICLASS TComLibraryEditor; class PASCALIMPLEMENTATION TComLibraryEditor : public Designeditors::TComponentEditor { typedef Designeditors::TComponentEditor inherited; public: virtual AnsiString __fastcall GetVerb(int Index); virtual int __fastcall GetVerbCount(void); virtual void __fastcall ExecuteVerb(int Index); public: #pragma option push -w-inl /* TComponentEditor.Create */ inline __fastcall virtual TComLibraryEditor(Classes::TComponent* AComponent, Designintf::_di_IDesigner ADesigner) : Designeditors::TComponentEditor(AComponent, ADesigner) { } #pragma option pop public: #pragma option push -w-inl /* TObject.Destroy */ inline __fastcall virtual ~TComLibraryEditor(void) { } #pragma option pop }; class DELPHICLASS TComPortEditor; class PASCALIMPLEMENTATION TComPortEditor : public TComLibraryEditor { typedef TComLibraryEditor inherited; public: virtual void __fastcall ExecuteVerb(int Index); virtual AnsiString __fastcall GetVerb(int Index); virtual int __fastcall GetVerbCount(void); virtual void __fastcall Edit(void); public: #pragma option push -w-inl /* TComponentEditor.Create */ inline __fastcall virtual TComPortEditor(Classes::TComponent* AComponent, Designintf::_di_IDesigner ADesigner) : TComLibraryEditor(AComponent, ADesigner) { } #pragma option pop public: #pragma option push -w-inl /* TObject.Destroy */ inline __fastcall virtual ~TComPortEditor(void) { } #pragma option pop }; class DELPHICLASS TComTerminalEditor; class PASCALIMPLEMENTATION TComTerminalEditor : public TComLibraryEditor { typedef TComLibraryEditor inherited; public: virtual void __fastcall ExecuteVerb(int Index); virtual AnsiString __fastcall GetVerb(int Index); virtual int __fastcall GetVerbCount(void); virtual void __fastcall Edit(void); public: #pragma option push -w-inl /* TComponentEditor.Create */ inline __fastcall virtual TComTerminalEditor(Classes::TComponent* AComponent, Designintf::_di_IDesigner ADesigner) : TComLibraryEditor(AComponent, ADesigner) { } #pragma option pop public: #pragma option push -w-inl /* TObject.Destroy */ inline __fastcall virtual ~TComTerminalEditor(void) { } #pragma option pop }; class DELPHICLASS TComPortProperty; class PASCALIMPLEMENTATION TComPortProperty : public Designeditors::TStringProperty { typedef Designeditors::TStringProperty inherited; public: virtual Designintf::TPropertyAttributes __fastcall GetAttributes(void); virtual void __fastcall GetValues(Classes::TGetStrProc Proc); public: #pragma option push -w-inl /* TPropertyEditor.Create */ inline __fastcall virtual TComPortProperty(const Designintf::_di_IDesigner ADesigner, int APropCount) : Designeditors::TStringProperty(ADesigner, APropCount) { } #pragma option pop #pragma option push -w-inl /* TPropertyEditor.Destroy */ inline __fastcall virtual ~TComPortProperty(void) { } #pragma option pop }; class DELPHICLASS TComFontProperty; class PASCALIMPLEMENTATION TComFontProperty : public Designeditors::TClassProperty { typedef Designeditors::TClassProperty inherited; public: virtual void __fastcall Edit(void); virtual Designintf::TPropertyAttributes __fastcall GetAttributes(void); public: #pragma option push -w-inl /* TPropertyEditor.Create */ inline __fastcall virtual TComFontProperty(const Designintf::_di_IDesigner ADesigner, int APropCount) : Designeditors::TClassProperty(ADesigner, APropCount) { } #pragma option pop #pragma option push -w-inl /* TPropertyEditor.Destroy */ inline __fastcall virtual ~TComFontProperty(void) { } #pragma option pop }; //-- var, const, procedure --------------------------------------------------- extern PACKAGE void __fastcall Register(void); } /* namespace Cportreg */ using namespace Cportreg; #pragma option pop // -w- #pragma option pop // -Vx #pragma delphiheader end. //-- end unit ---------------------------------------------------------------- #endif // CPortReg
[ "Alexander Demin@localhost" ]
[ [ [ 1, 143 ] ] ]
b94ee2d6d0aa5e08f3110c28b2ecf20400e033be
83c85d3cae31e27285ca07e192cc9bbad8081736
/geo_pane.cpp
2b81a93fd0680e0cb684419f81f497362a0a9c76
[]
no_license
yjfcool/poitool
0768d7299a453335cbd1ae1045440285b3295801
1068837ab32dbb9c6df18bbab1ea64bc70942cbf
refs/heads/master
2016-09-05T11:37:18.585724
2010-04-09T06:16:14
2010-04-09T06:16:14
42,576,080
0
0
null
null
null
null
GB18030
C++
false
false
1,910
cpp
#include "stdafx.h" #include "geo_pane.h" /* pt - 焦点 radius 以pt为圆心的半径 pt 和radius 形成一个矩形范围bnd x_idx - bnd 左下角点x索引 y_idx - bnd 左下角点y索引 x_dem - 矩形x方向所占的方格数目 y_dem - * 左下角是索引是x_idx = 0, y_idx = 0 */ BOOL geo_pane::bnd_idx(POINT pt, unsigned radius, unsigned& x_idx, unsigned& y_idx, unsigned& x_dem, unsigned& y_dem) { //---------------------------------------------------------------------------------------边界交集 POINT ld, ru; ld.x = max((int)(pt.x - radius), (int)m_x_begin); ld.y = max((int)(pt.y - radius), (int)m_y_begin); ru.x = min((int)(pt.x + radius), (int)m_x_end); ru.y = min((int)(pt.y + radius), (int)m_y_end); //----------------------------------------------------------------------------------------超出范围 if(ru.x <= m_x_begin || ld.x >= m_x_end || ru.y <= m_y_begin || ld.y >= m_y_end) return FALSE; //----------------------------------------------------------------------------------------左下角索引 x_idx = (ld.x - m_x_begin) / m_pane_width; y_idx = (ld.y - m_y_begin) / m_pane_height; //----------------------------------------------------------------------------------------索引偏移量 unsigned int x_end = ((ru.x % m_pane_width) == 0)?(ru.x / m_pane_width):(ru.x / m_pane_width + 1); unsigned int y_end = ((ru.y % m_pane_height) == 0)?(ru.x / m_pane_height):(ru.x / m_pane_height + 1); x_dem = x_end - x_idx; y_dem = y_end - y_idx; return TRUE; } /* * 没有越界判断 */ int geo_pane::index(int x_idx, int y_idx) { return x_idx + y_idx * m_x_pane_num; } BOOL geo_pane::pane_coord(int idx, int& x, int& y) { if (idx > (m_x_pane_num * m_y_pane_num)) return FALSE; x = idx % m_x_pane_num * m_pane_width; y = idx / m_x_pane_num * m_pane_height; return TRUE; }
[ "dulton@370d939e-410d-02cf-1e1d-9a5f4ca5de21" ]
[ [ [ 1, 52 ] ] ]
cdb98404c8cf4c3a001691aea4ee38f7f1133508
c54d6e613e86d0f9b90b499feedb55c7d62cb3fa
/narly/narly.h
66ef5f67bdea85a3808450b9e45a9b188212d875
[]
no_license
mostwantedduck/narly
ea20c0c3fec0148f86c5f2aae5f91f853f78f035
2549850025cc9df7dc5d426b524d96d062060a90
refs/heads/master
2023-06-16T23:34:01.805312
2011-06-29T11:11:15
2011-06-29T11:11:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,694
h
// narly.h // N for gnarly! #ifndef _NARLY_H #define _NARLY_H #include <windows.h> #include <wdbgexts.h> #include <dbgeng.h> #include <vector> #include <ios> #include <iostream> #include <sstream> bool g_DebugMode = false; PDEBUG_SYMBOLS3 g_DebugSymbols; PDEBUG_CONTROL4 g_DebugControl; PDEBUG_DATA_SPACES3 g_DebugDataSpaces; PDEBUG_CLIENT4 g_DebugClient; WINDBG_EXTENSION_APIS ExtensionApis; extern "C" HRESULT ExtQuery(PDEBUG_CLIENT4 Client); void ExtRelease(void); ULONG64 resolveFunctionByName(char *funcName); #define DEBUG(...) if(g_DebugMode) { dprintf(__VA_ARGS__); } #define INIT_API() HRESULT Status; if ((Status = ExtQuery(Client)) != S_OK) return Status; #define EXT_RELEASE(Unk) ((Unk) != NULL ? ((Unk)->Release(), (Unk) = NULL) : NULL) EXT_API_VERSION g_ExtApiVersion = {1,1,EXT_API_VERSION_NUMBER,0} ; namespace ModuleUtils { bool hasSEH(ULONG moduleIndex) { IMAGE_NT_HEADERS64 moduleHeaders; ULONG64 moduleBase; g_DebugSymbols->GetModuleByIndex(moduleIndex, &moduleBase); g_DebugDataSpaces->ReadImageNtHeaders(moduleBase, &moduleHeaders); DEBUG("\n Checking for NO_SEH flag\n"); if(moduleHeaders.OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NO_SEH) { DEBUG(" IMAGE_OPTIONAL_HEADER.DllCharacteristics has IMAGE_DLLCHARACTERISTICS_NO_SEH\n"); DEBUG(" -does not have SEH!\n"); return false; } else { DEBUG(" IMAGE_DLLCHARACTERISTICS_NO_SEH in IMAGE_OPTIONAL_HEADER.DllCharacteristics is not present\n"); DEBUG(" -has at least SEH\n"); return true; } }; bool isDynBaseCompat(ULONG moduleIndex) { IMAGE_NT_HEADERS64 moduleHeaders; ULONG64 moduleBase; g_DebugSymbols->GetModuleByIndex(moduleIndex, &moduleBase); g_DebugDataSpaces->ReadImageNtHeaders(moduleBase, &moduleHeaders); DEBUG("\n Checking for DYNAMIC_BASE flag\n"); if(moduleHeaders.OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) { DEBUG(" IMAGE_OPTIONAL_HEADER.DllCharacteristics has IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE\n"); DEBUG(" -is ASLR compatible!\n"); return true; } else { DEBUG(" IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE in IMAGE_OPTIONAL_HEADER.DllCharacteristics is not present\n"); DEBUG(" -is NOT ASLR compatible\n"); return false; } }; bool isNXCompat(ULONG moduleIndex) { IMAGE_NT_HEADERS64 moduleHeaders; ULONG64 moduleBase; g_DebugSymbols->GetModuleByIndex(moduleIndex, &moduleBase); g_DebugDataSpaces->ReadImageNtHeaders(moduleBase, &moduleHeaders); DEBUG("\n Checking for NX_COMPAT flag\n"); if(moduleHeaders.OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT) { DEBUG(" IMAGE_OPTIONAL_HEADER.DllCharacteristics has IMAGE_DLLCHARACTERISTICS_NX_COMPAT\n"); DEBUG(" -is DEP compatible!\n"); return true; } else { DEBUG(" IMAGE_DLLCHARACTERISTICS_NX_COMPAT in IMAGE_OPTIONAL_HEADER.DllCharacteristics is not present\n"); DEBUG(" -is NOT DEP compatible\n"); return false; } }; bool hasSafeSEH(ULONG moduleIndex) { IMAGE_LOAD_CONFIG_DIRECTORY moduleConfig; IMAGE_NT_HEADERS64 moduleHeaders; DWORD loadConfigSize; ULONG bytesRead=0; ULONG64 moduleBase=0, loadConfigVA=0; g_DebugSymbols->GetModuleByIndex(moduleIndex, &moduleBase); g_DebugDataSpaces->ReadImageNtHeaders(moduleBase, &moduleHeaders); loadConfigVA = moduleHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress; loadConfigSize = moduleHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size; DEBUG("\n Checking for /SafeSEH\n"); DEBUG(" IMAGE_OPTIONAL_HEADER.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress: %08x\n", (DWORD)loadConfigVA); if(loadConfigVA == 0) { DEBUG(" IMAGE_OPTIONAL_HEADER.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress was 0\n"); DEBUG(" -can't have SafeSEH without an IMAGE_LOAD_CONFIG_DIRECTORY\n"); return false; } g_DebugDataSpaces->ReadVirtual(moduleBase+loadConfigVA, (PVOID)&moduleConfig, sizeof(moduleConfig), &bytesRead); DEBUG(" IMAGE_LOAD_CONFIG_DIRECTORY.SEHandlerTable: %08x\n", (DWORD)moduleConfig.SEHandlerTable); DEBUG(" IMAGE_LOAD_CONFIG_DIRECTORY.SEHandlerCount: %08x\n", (DWORD)moduleConfig.SEHandlerCount); if(moduleConfig.SEHandlerCount == 0) { DEBUG(" IMAGE_LOAD_CONFIG_DIRECTORY.SEHandlerCount was 0\n"); DEBUG(" -no registered handles == no SafeSEH\n"); return false; } DEBUG(" module has an IMAGE_LOAD_CONFIG_DIRECTORY and the SEHandlerCount > 0\n"); DEBUG(" -has SafeSEH\n"); return true; }; bool hasGS(ULONG moduleIndex) { IMAGE_NT_HEADERS64 moduleHeaders; IMAGE_LOAD_CONFIG_DIRECTORY32 moduleConfig; DWORD loadConfigSize=0, securityCookieAddr=0, securityCookieVal=0; ULONG bytesRead=0; ULONG64 moduleBase=0, loadConfigVA=0; g_DebugSymbols->GetModuleByIndex(moduleIndex, &moduleBase); g_DebugDataSpaces->ReadImageNtHeaders(moduleBase, &moduleHeaders); loadConfigVA = moduleHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress; DEBUG("\n Checking for /GS\n"); DEBUG(" IMAGE_OPTIONAL_HEADER.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress: %08x\n", (DWORD)loadConfigVA); if(loadConfigVA == 0) { DEBUG(" IMAGE_OPTIONAL_HEADER.DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress was 0\n"); DEBUG(" -can't have /GS without it\n"); return false; } g_DebugDataSpaces->ReadVirtual(moduleBase+loadConfigVA, (PVOID)&moduleConfig, sizeof(moduleConfig), &bytesRead); DEBUG(" IMAGE_LOAD_CONFIG_DIRECTORY.SecurityCookie (is an address): %08x\n", moduleConfig.SecurityCookie); // read the actual value of the security cookie if(moduleConfig.SecurityCookie == 0) { DEBUG(" IMAGE_LOAD_CONFIG_DIRECTORY.SecurityCookie was 0\n"); DEBUG(" -pointer to securitiy cookie == 0 (no /GS)\n"); return false; } g_DebugDataSpaces->ReadVirtual(moduleConfig.SecurityCookie, (PVOID)&securityCookieVal, sizeof(DWORD), &bytesRead); DEBUG(" Security cookie value: %08x\n", securityCookieVal); if(securityCookieVal == 0) { DEBUG(" Security cookie value was 0\n"); DEBUG(" -essentially makes /GS be turned off\n"); return false; } DEBUG(" module has an IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie != 0, and the value != 0\n"); DEBUG(" -has /GS\n"); return true; }; } #endif // #define _NARLY_H
[ "d0c.s4vage@03dbac94-f328-fbcf-efec-c6d8765723da", "[email protected]@03dbac94-f328-fbcf-efec-c6d8765723da" ]
[ [ [ 1, 6 ], [ 15, 91 ], [ 93, 180 ] ], [ [ 7, 14 ], [ 92, 92 ] ] ]
9b6fad0051811f0af7ae0e2a830f37254f916550
028d79ad6dd6bb4114891b8f4840ef9f0e9d4a32
/src/drivers/blockhl.cpp
476064c1d8ab1d4d2c73301cfadc55747b68d7a8
[]
no_license
neonichu/iMame4All-for-iPad
72f56710d2ed7458594838a5152e50c72c2fb67f
4eb3d4ed2e5ccb5c606fcbcefcb7c5a662ace611
refs/heads/master
2020-04-21T07:26:37.595653
2011-11-26T12:21:56
2011-11-26T12:21:56
2,855,022
4
0
null
null
null
null
UTF-8
C++
false
false
13,385
cpp
#include "../vidhrdw/blockhl.cpp" /*************************************************************************** Block Hole (GX973) (c) 1989 Konami driver by Nicola Salmoria Notes: Quarth works, but Block Hole crashes when it reaches the title screen. An interrupt happens, and after rti the ROM bank is not the same as before so it jumps to garbage code. If you want to see this happen, place a breakpoint at 0x8612, and trace after that. The code is almost identical in the two versions, it looks like Quarth is working just because luckily the interrupt doesn't happen at that point. It seems that the interrupt handler trashes the selected ROM bank and forces it to 0. To prevent crashes, I only generate interrupts when the ROM bank is already 0. There might be another interrupt enable register, but I haven't found it. ***************************************************************************/ #include "driver.h" #include "vidhrdw/generic.h" #include "cpu/konami/konami.h" /* for the callback and the firq irq definition */ #include "vidhrdw/konamiic.h" /* prototypes */ static void blockhl_init_machine( void ); static void blockhl_banking( int lines ); void blockhl_vh_stop( void ); int blockhl_vh_start( void ); void blockhl_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh); static int palette_selected; static unsigned char *ram; static int rombank; static int blockhl_interrupt( void ) { if (K052109_is_IRQ_enabled() && rombank == 0) /* kludge to prevent crashes */ return KONAMI_INT_IRQ; else return ignore_interrupt(); } static READ_HANDLER( bankedram_r ) { if (palette_selected) return paletteram_r(offset); else return ram[offset]; } static WRITE_HANDLER( bankedram_w ) { if (palette_selected) paletteram_xBBBBBGGGGGRRRRR_swap_w(offset,data); else ram[offset] = data; } WRITE_HANDLER( blockhl_sh_irqtrigger_w ) { cpu_cause_interrupt(1,0xff); } static struct MemoryReadAddress readmem[] = { { 0x1f94, 0x1f94, input_port_4_r }, { 0x1f95, 0x1f95, input_port_0_r }, { 0x1f96, 0x1f96, input_port_1_r }, { 0x1f97, 0x1f97, input_port_2_r }, { 0x1f98, 0x1f98, input_port_3_r }, { 0x0000, 0x3fff, K052109_051960_r }, { 0x4000, 0x57ff, MRA_RAM }, { 0x5800, 0x5fff, bankedram_r }, { 0x6000, 0x7fff, MRA_BANK1 }, { 0x8000, 0xffff, MRA_ROM }, { -1 } /* end of table */ }; static struct MemoryWriteAddress writemem[] = { { 0x1f84, 0x1f84, soundlatch_w }, { 0x1f88, 0x1f88, blockhl_sh_irqtrigger_w }, { 0x1f8c, 0x1f8c, watchdog_reset_w }, { 0x0000, 0x3fff, K052109_051960_w }, { 0x4000, 0x57ff, MWA_RAM }, { 0x5800, 0x5fff, bankedram_w, &ram }, { 0x6000, 0x7fff, MWA_ROM }, { 0x8000, 0xffff, MWA_ROM }, { -1 } /* end of table */ }; static struct MemoryReadAddress sound_readmem[] = { { 0x0000, 0x7fff, MRA_ROM }, { 0x8000, 0x87ff, MRA_RAM }, { 0xa000, 0xa000, soundlatch_r }, { 0xc001, 0xc001, YM2151_status_port_0_r }, { -1 } /* end of table */ }; static struct MemoryWriteAddress sound_writemem[] = { { 0x0000, 0x7fff, MWA_ROM }, { 0x8000, 0x87ff, MWA_RAM }, { 0xc000, 0xc000, YM2151_register_port_0_w }, { 0xc001, 0xc001, YM2151_data_port_0_w }, { 0xe00c, 0xe00d, MWA_NOP }, /* leftover from missing 007232? */ { -1 } /* end of table */ }; /*************************************************************************** Input Ports ***************************************************************************/ INPUT_PORTS_START( blockhl ) PORT_START /* PLAYER 1 INPUTS */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_START /* PLAYER 2 INPUTS */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_START /* DSW #1 */ PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) // PORT_DIPSETTING( 0x00, "Invalid" ) PORT_START /* DSW #2 */ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x01, "1" ) PORT_DIPSETTING( 0x00, "2" ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x60, "Easy" ) PORT_DIPSETTING( 0x40, "Normal" ) PORT_DIPSETTING( 0x20, "Difficult" ) PORT_DIPSETTING( 0x00, "Very Difficult" ) PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START /* DSW #3 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END /*************************************************************************** Machine Driver ***************************************************************************/ static struct YM2151interface ym2151_interface = { 1, /* 1 chip */ 3579545, /* 3.579545 MHz */ { YM3012_VOL(60,MIXER_PAN_LEFT,60,MIXER_PAN_RIGHT) }, { 0 }, { 0 } }; static struct MachineDriver machine_driver_blockhl = { /* basic machine hardware */ { { CPU_KONAMI, /* Konami custom 052526 */ 3000000, /* ? */ readmem,writemem,0,0, blockhl_interrupt,1 }, { CPU_Z80 | CPU_AUDIO_CPU, 3579545, /* ? */ sound_readmem,sound_writemem,0,0, ignore_interrupt,0 /* interrupts are triggered by the main CPU */ } }, 60, DEFAULT_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */ 1, /* 1 CPU slice per frame - interleaving is forced when a sound command is written */ blockhl_init_machine, /* video hardware */ 64*8, 32*8, { 14*8, (64-14)*8-1, 2*8, 30*8-1 }, 0, /* gfx decoded by konamiic.c */ 1024, 1024, 0, VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE, 0, blockhl_vh_start, blockhl_vh_stop, blockhl_vh_screenrefresh, /* sound hardware */ 0,0,0,0, { { SOUND_YM2151, &ym2151_interface } } }; /*************************************************************************** Game ROMs ***************************************************************************/ ROM_START( blockhl ) ROM_REGION( 0x18800, REGION_CPU1 ) /* code + banked roms + space for banked RAM */ ROM_LOAD( "973l02.e21", 0x10000, 0x08000, 0xe14f849a ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */ ROM_LOAD( "973d01.g6", 0x0000, 0x8000, 0xeeee9d92 ) ROM_REGION( 0x20000, REGION_GFX1 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973f07.k15", 0x00000, 0x08000, 0x1a8cd9b4 ) /* tiles */ ROM_LOAD_GFX_ODD ( "973f08.k18", 0x00000, 0x08000, 0x952b51a6 ) ROM_LOAD_GFX_EVEN( "973f09.k20", 0x10000, 0x08000, 0x77841594 ) ROM_LOAD_GFX_ODD ( "973f10.k23", 0x10000, 0x08000, 0x09039fab ) ROM_REGION( 0x20000, REGION_GFX2 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973f06.k12", 0x00000, 0x08000, 0x51acfdb6 ) /* sprites */ ROM_LOAD_GFX_ODD ( "973f05.k9", 0x00000, 0x08000, 0x4cfea298 ) ROM_LOAD_GFX_EVEN( "973f04.k7", 0x10000, 0x08000, 0x69ca41bd ) ROM_LOAD_GFX_ODD ( "973f03.k4", 0x10000, 0x08000, 0x21e98472 ) ROM_REGION( 0x0100, REGION_PROMS ) /* PROMs */ ROM_LOAD( "973a11.h10", 0x0000, 0x0100, 0x46d28fe9 ) /* priority encoder (not used) */ ROM_END ROM_START( quarth ) ROM_REGION( 0x18800, REGION_CPU1 ) /* code + banked roms + space for banked RAM */ ROM_LOAD( "973j02.e21", 0x10000, 0x08000, 0x27a90118 ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */ ROM_LOAD( "973d01.g6", 0x0000, 0x8000, 0xeeee9d92 ) ROM_REGION( 0x20000, REGION_GFX1 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973e07.k15", 0x00000, 0x08000, 0x0bd6b0f8 ) /* tiles */ ROM_LOAD_GFX_ODD ( "973e08.k18", 0x00000, 0x08000, 0x104d0d5f ) ROM_LOAD_GFX_EVEN( "973e09.k20", 0x10000, 0x08000, 0xbd3a6f24 ) ROM_LOAD_GFX_ODD ( "973e10.k23", 0x10000, 0x08000, 0xcf5e4b86 ) ROM_REGION( 0x20000, REGION_GFX2 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973e06.k12", 0x00000, 0x08000, 0x0d58af85 ) /* sprites */ ROM_LOAD_GFX_ODD ( "973e05.k9", 0x00000, 0x08000, 0x15d822cb ) ROM_LOAD_GFX_EVEN( "973e04.k7", 0x10000, 0x08000, 0xd70f4a2c ) ROM_LOAD_GFX_ODD ( "973e03.k4", 0x10000, 0x08000, 0x2c5a4b4b ) ROM_REGION( 0x0100, REGION_PROMS ) /* PROMs */ ROM_LOAD( "973a11.h10", 0x0000, 0x0100, 0x46d28fe9 ) /* priority encoder (not used) */ ROM_END /*************************************************************************** Game driver(s) ***************************************************************************/ static void blockhl_banking( int lines ) { unsigned char *RAM = memory_region(REGION_CPU1); int offs; /* bits 0-1 = ROM bank */ rombank = lines & 0x03; offs = 0x10000 + (lines & 0x03) * 0x2000; cpu_setbank(1,&RAM[offs]); /* bits 3/4 = coin counters */ coin_counter_w(0,lines & 0x08); coin_counter_w(1,lines & 0x10); /* bit 5 = select palette RAM or work RAM at 5800-5fff */ palette_selected = ~lines & 0x20; /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line( ( lines & 0x40 ) ? ASSERT_LINE : CLEAR_LINE ); /* bit 7 used but unknown */ /* other bits unknown */ //if ((lines & 0x84) != 0x80) logerror("%04x: setlines %02x\n",cpu_get_pc(),lines); } static void blockhl_init_machine( void ) { unsigned char *RAM = memory_region(REGION_CPU1); konami_cpu_setlines_callback = blockhl_banking; paletteram = &RAM[0x18000]; } static void init_blockhl(void) { konami_rom_deinterleave_2(REGION_GFX1); konami_rom_deinterleave_2(REGION_GFX2); } GAME( 1989, blockhl, 0, blockhl, blockhl, blockhl, ROT0, "Konami", "Block Hole" ) GAME( 1989, quarth, blockhl, blockhl, blockhl, blockhl, ROT0, "Konami", "Quarth (Japan)" )
[ [ [ 1, 392 ] ] ]
b1ce26910cc6c90de11bd59aa910d2d3a81dc957
faaac39c2cc373003406ab2ac4f5363de07a6aae
/ zenithprime/src/math/Matrix.cpp
b473fad232b18c1d73d330af6ae3537cde83bf1a
[]
no_license
mgq812/zenithprime
595625f2ec86879eb5d0df4613ba41a10e3158c0
3c8ff4a46fb8837e13773e45f23974943a467a6f
refs/heads/master
2021-01-20T06:57:05.754430
2011-02-05T17:20:19
2011-02-05T17:20:19
32,297,284
0
0
null
null
null
null
UTF-8
C++
false
false
3,614
cpp
#include "Matrix.h" using namespace std; Matrix::Matrix(void): width(-1), hieght(-1){ } Matrix::~Matrix(void){ hieght = -2; width = -2; } float Matrix::Get(int row, int col){ return values[row*width + col]; } Matrix Matrix::operator *(const Matrix &other) const{ Matrix returnMatrix; int endWidth = 0; int endHeight =0; if(!multiplyValid(*this, other, &endHeight, &endWidth)) return returnMatrix; returnMatrix.hieght = endHeight; returnMatrix.width = endWidth; for(int i = 0; i<endHeight; i++) for(int j = 0; j<endWidth; j++) { returnMatrix.values.push_back( multiplyCell(j, i, *this, other)); } return returnMatrix; } Matrix& Matrix::operator=(const Matrix& other){ if(this!=&other) { values.clear(); hieght = other.hieght; width = other.width; for(unsigned int i = 0 ; i < other.values.size(); i++) values.push_back(other.values[i]); } return *this; } Matrix& Matrix::operator*=(const Matrix& other) { return *this = other * *this; } float Matrix::multiplyCell(int col, int row, const Matrix &primary, const Matrix &secondary){ float retVal = 0; for(int j = 0, i = 0; j<secondary.hieght && i < primary.width; i++, j++) { retVal += primary.values[primary.width*row + i] * secondary.values[secondary.width*j + col]; } return retVal; } bool Matrix::multiplyValid(const Matrix &primary, const Matrix &secondary, int* outRows, int* outColunms){ if(primary.width != secondary.hieght) return false; *outRows = primary.hieght; *outColunms = secondary.width; return true; } Matrix Matrix::CreateTranslation(Vector3 translation){ Matrix retMatrix; float values[] = {1, 0, 0, translation.x, 0, 1, 0, translation.y, 0, 0, 1, translation.z, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } Matrix Matrix::CreateScale(Vector3 scaler){ Matrix retMatrix; float values[] = {scaler.x, 0, 0, 0, 0, scaler.y, 0, 0, 0, 0, scaler.z, 0, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } Matrix Matrix::CreateScale(float scaler){ Matrix retMatrix; float values[] = {scaler, 0, 0, 0, 0, scaler, 0, 0, 0, 0, scaler, 0, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } Matrix Matrix::CreateRotationX(float beta){ Matrix retMatrix; float values[] = {1, 0, 0, 0, 0, cos(beta), -sin(beta), 0, 0, sin(beta), cos(beta), 0, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } Matrix Matrix::CreateRotationY(float beta){ Matrix retMatrix; float values[] = {cos(beta), 0, sin(beta), 0, 0, 1, 0, 0, -sin(beta), 0, cos(beta), 0, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } Matrix Matrix::CreateRotationZ(float beta){ Matrix retMatrix; float values[] = {cos(beta), -sin(beta), 0, 0, sin(beta), cos(beta), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } Matrix Matrix::Identity(){ Matrix retMatrix; float values[] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}; loadMatrix(&retMatrix, 4, 4, values); return retMatrix; } void Matrix::loadMatrix(Matrix* matrix, int width, int height, float values[]){ matrix->width = width; matrix->hieght = height; for(int i = 0; i<width*height ;i++) { matrix->values.push_back(values[i]); } }
[ "mhsmith01@2c223db4-e1a0-a0c7-f360-d8b483a75394" ]
[ [ [ 1, 174 ] ] ]
366d75141bd5264ed1d6b16d7abc9db339e129c6
91b964984762870246a2a71cb32187eb9e85d74e
/SRC/OFFI SRC!/boost_1_34_1/boost_1_34_1/libs/program_options/example/regex.cpp
ae30de68bae1261233e65c91b40428e54c731b2e
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
willrebuild/flyffsf
e5911fb412221e00a20a6867fd00c55afca593c7
d38cc11790480d617b38bb5fc50729d676aef80d
refs/heads/master
2021-01-19T20:27:35.200154
2011-02-10T12:34:43
2011-02-10T12:34:43
32,710,780
3
0
null
null
null
null
UTF-8
C++
false
false
3,034
cpp
// Copyright Vladimir Prus 2002-2004. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) // This example shows how a user-defined class can be parsed using // specific mechanism -- not the iostream operations used by default. // // A new class 'magic_number' is defined and the 'validate' method is overloaded // to validate the values of that class using Boost.Regex. // To test, run // // regex -m 123-456 // regex -m 123-4567 // // The first invocation should output: // // The magic is "456" // // and the second invocation should issue an error message. #include <boost/program_options.hpp> #include <boost/regex.hpp> using namespace boost; using namespace boost::program_options; #include <iostream> using namespace std; /* Define a completely non-sensical class. */ struct magic_number { public: magic_number(int n) : n(n) {} int n; }; /* Overload the 'validate' function for the user-defined class. It makes sure that value is of form XXX-XXX where X are digits and converts the second group to an integer. This has no practical meaning, meant only to show how regex can be used to validate values. */ void validate(boost::any& v, const std::vector<std::string>& values, magic_number* target_type, int) { static regex r("\\d\\d\\d-(\\d\\d\\d)"); using namespace boost::program_options; // Make sure no previous assignment to 'a' was made. validators::check_first_occurrence(v); // Extract the first string from 'values'. If there is more than // one string, it's an error, and exception will be thrown. const string& s = validators::get_single_string(values); // Do regex match and convert the interesting part to // int. smatch match; if (regex_match(s, match, r)) { v = any(magic_number(lexical_cast<int>(match[1]))); } else { throw validation_error("invalid value"); } } int main(int ac, char* av[]) { try { options_description desc("Allowed options"); desc.add_options() ("help", "produce a help screen") ("version,v", "print the version number") ("magic,m", value<magic_number>(), "magic value (in NNN-NNN format)") ; variables_map vm; store(parse_command_line(ac, av, desc), vm); if (vm.count("help")) { cout << "Usage: regex [options]\n"; cout << desc; return 0; } if (vm.count("version")) { cout << "Version 1.\n"; return 0; } if (vm.count("magic")) { cout << "The magic is \"" << vm["magic"].as<magic_number>().n << "\"\n"; } } catch(exception& e) { cout << e.what() << "\n"; } }
[ "[email protected]@e2c90bd7-ee55-cca0-76d2-bbf4e3699278" ]
[ [ [ 1, 101 ] ] ]
aad5b261b2ca6cd2db93b81368fd203b36beb459
4a266d6931aa06a2343154cab99d8d5cfdac6684
/csci3081/project-phase3/test/ModelFactoryTest.h
7db08109f5c954d2234ad29e4c1ff2650b605a33
[]
no_license
Magneticmagnum/robotikdude-school
f0185feb6839ad5c5324756fc86f984fce7abdc1
cb39138b500c8bbc533e796225588439dcfa6555
refs/heads/master
2021-01-10T19:01:39.479621
2011-05-17T04:44:47
2011-05-17T04:44:47
35,382,573
0
0
null
null
null
null
UTF-8
C++
false
false
10,933
h
#ifndef MODELFACTORYTEST_H_ #define MODELFACTORYTEST_H_ #include "ModelFactory.h" #include "MockScheduler.h" #include <cxxtest/TestSuite.h> class ModelFactoryTest: public CxxTest::TestSuite { public: void test_Model() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Model()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getModel("blah") == 0); TS_ASSERT(factory->createModel("type", "blah", "", 0) == 0); TS_ASSERT(factory->getModel("blah") == 0); TS_ASSERT(factory->getModel("house") == 0); TS_ASSERT(factory->createModel("House", "house", "", 0) != 0); TS_ASSERT(factory->getModel("house") != 0); TS_ASSERT(factory->getModel("bath") == 0); TS_ASSERT(factory->createModel("Bath", "bath", "", 0) != 0); TS_ASSERT(factory->getModel("bath") != 0); TS_ASSERT(factory->getModel("dishwasher") == 0); TS_ASSERT(factory->createModel("Dishwasher", "dishwasher", "", 0) != 0); TS_ASSERT(factory->getModel("dishwasher") != 0); TS_ASSERT(factory->getModel("microwave") == 0); TS_ASSERT(factory->createModel("Microwave", "microwave", "", 0) != 0); TS_ASSERT(factory->getModel("microwave") != 0); TS_ASSERT(factory->getModel("oven") == 0); TS_ASSERT(factory->createModel("Oven", "oven", "", 0) != 0); TS_ASSERT(factory->getModel("oven") != 0); TS_ASSERT(factory->getModel("person") == 0); TS_ASSERT(factory->createModel("Person", "person", "", 0) != 0); TS_ASSERT(factory->getModel("person") != 0); TS_ASSERT(factory->getModel("refrigerator") == 0); TS_ASSERT(factory->createModel("Refrigerator", "refrigerator", "", 0) != 0); TS_ASSERT(factory->getModel("refrigerator") != 0); TS_ASSERT(factory->getModel("shower") == 0); TS_ASSERT(factory->createModel("Shower", "shower", "", 0) != 0); TS_ASSERT(factory->getModel("shower") != 0); TS_ASSERT(factory->getModel("stove") == 0); TS_ASSERT(factory->createModel("Stove", "stove", "", 0) != 0); TS_ASSERT(factory->getModel("stove") != 0); TS_ASSERT(factory->getModel("television") == 0); TS_ASSERT(factory->createModel("Television", "television", "", 0) != 0); TS_ASSERT(factory->getModel("television") != 0); TS_ASSERT(factory->getModel("toaster") == 0); TS_ASSERT(factory->createModel("Toaster", "toaster", "", 0) != 0); TS_ASSERT(factory->getModel("toaster") != 0); TS_ASSERT(factory->getModel("waterheater") == 0); TS_ASSERT(factory->createModel("WaterHeater", "waterheater", "", 0) != 0); TS_ASSERT(factory->getModel("waterheater") != 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Model()"); } void test_House() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_House()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getHouse("blah") == 0); TS_ASSERT(factory->createHouse("house", "") != 0); TS_ASSERT(factory->getHouse("house") != 0); TS_ASSERT(factory->getHouse("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_House()"); } void test_Bath() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Bath()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getBath("blah") == 0); TS_ASSERT(factory->createBath("bath", "", 0) != 0); TS_ASSERT(factory->getBath("bath") != 0); TS_ASSERT(factory->getBath("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Bath()"); } void test_Dishwasher() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Dishwasher()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getDishwasher("blah") == 0); TS_ASSERT(factory->createDishwasher("dishwasher", "", 0) != 0); TS_ASSERT(factory->getDishwasher("dishwasher") != 0); TS_ASSERT(factory->getDishwasher("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Dishwasher()"); } void test_Microwave() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Microwave()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getMicrowave("blah") == 0); TS_ASSERT(factory->createMicrowave("microwave", "", 0) != 0); TS_ASSERT(factory->getMicrowave("microwave") != 0); TS_ASSERT(factory->getMicrowave("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Microwave()"); } void test_Oven() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Oven()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getOven("blah") == 0); TS_ASSERT(factory->createOven("oven", "", 0) != 0); TS_ASSERT(factory->getOven("oven") != 0); TS_ASSERT(factory->getOven("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Oven()"); } void test_Person() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Person()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getPerson("blah") == 0); TS_ASSERT(factory->createPerson("person", "", 0) != 0); TS_ASSERT(factory->getPerson("person") != 0); TS_ASSERT(factory->getPerson("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Person()"); } void test_Refrigerator() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_getRefrigerator()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getRefrigerator("blah") == 0); TS_ASSERT(factory->createRefrigerator("refrigerator", "", 0) != 0); TS_ASSERT(factory->getRefrigerator("refrigerator") != 0); TS_ASSERT(factory->getRefrigerator("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_getRefrigerator()"); } void test_Shower() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Shower()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getShower("blah") == 0); TS_ASSERT(factory->createShower("shower", "", 0) != 0); TS_ASSERT(factory->getShower("shower") != 0); TS_ASSERT(factory->getShower("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Shower()"); } void test_Stove() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Stove()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getStove("blah") == 0); TS_ASSERT(factory->createStove("stove", "", 0) != 0); TS_ASSERT(factory->getStove("stove") != 0); TS_ASSERT(factory->getStove("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Stove()"); } void test_Television() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Television()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getTelevision("blah") == 0); TS_ASSERT(factory->createTelevision("television", "", 0) != 0); TS_ASSERT(factory->getTelevision("television") != 0); TS_ASSERT(factory->getTelevision("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Television()"); } void test_Toaster() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_Toaster()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getToaster("blah") == 0); TS_ASSERT(factory->createToaster("toaster", "", 0) != 0); TS_ASSERT(factory->getToaster("toaster") != 0); TS_ASSERT(factory->getToaster("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_Toaster()"); } void test_WaterHeater() { log4cxx::LoggerPtr log(log4cxx::Logger::getLogger("ModelFactoryTest")); LOG4CXX_DEBUG(log, "--> ModelFactoryTest::test_WaterHeater()"); MockScheduler* scheduler = new MockScheduler(); ModelFactory* factory = new ModelFactory(scheduler); TS_ASSERT(factory->getWaterHeater("blah") == 0); TS_ASSERT(factory->createWaterHeater("waterheater", "", 0) != 0); TS_ASSERT(factory->getWaterHeater("waterheater") != 0); TS_ASSERT(factory->getWaterHeater("blah") == 0); delete (scheduler); delete (factory); LOG4CXX_DEBUG(log, "<-- ModelFactoryTest::test_WaterHeater()"); } }; #endif /* MODELFACTORYTEST_H_ */
[ "robotikdude@e80761d0-8fc2-79d0-c9d0-3546e327c268" ]
[ [ [ 1, 307 ] ] ]
7fb50a0df51043800c67022ee49586e08b337165
e7c45d18fa1e4285e5227e5984e07c47f8867d1d
/Common/Scd/ScExec/ssgroups.cpp
eac337e76831c0145fe93f60ebae0933c96c3c30
[]
no_license
abcweizhuo/Test3
0f3379e528a543c0d43aad09489b2444a2e0f86d
128a4edcf9a93d36a45e5585b70dee75e4502db4
refs/heads/master
2021-01-17T01:59:39.357645
2008-08-20T00:00:29
2008-08-20T00:00:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,805
cpp
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++ // NOTE: Do not modify the contents of this file. If this class is regenerated by // Microsoft Visual C++, your modifications will be overwritten. #include "stdafx.h" #include "ssgroups.h" // Dispatch interfaces referenced by this interface #include "SSGroup.h" ///////////////////////////////////////////////////////////////////////////// // CSSGroups properties short CSSGroups::GetCount() { short result; GetProperty(0x1, VT_I2, (void*)&result); return result; } void CSSGroups::SetCount(short propVal) { SetProperty(0x1, VT_I2, propVal); } ///////////////////////////////////////////////////////////////////////////// // CSSGroups operations void CSSGroups::Remove(const VARIANT& Index) { static BYTE parms[] = VTS_VARIANT; InvokeHelper(0x3, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &Index); } void CSSGroups::Add(short Index) { static BYTE parms[] = VTS_I2; InvokeHelper(0x4, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Index); } void CSSGroups::RemoveAll() { InvokeHelper(0x5, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); } LPUNKNOWN CSSGroups::_NewEnum() { LPUNKNOWN result; InvokeHelper(0xfffffffc, DISPATCH_METHOD, VT_UNKNOWN, (void*)&result, NULL); return result; } CSSGroup CSSGroups::GetItem(const VARIANT& Index) { LPDISPATCH pDispatch; static BYTE parms[] = VTS_VARIANT; InvokeHelper(0x0, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, parms, &Index); return CSSGroup(pDispatch); } void CSSGroups::SetItem(const VARIANT& Index, LPDISPATCH newValue) { static BYTE parms[] = VTS_VARIANT VTS_DISPATCH; InvokeHelper(0x0, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, &Index, newValue); }
[ [ [ 1, 76 ] ] ]
78fd3abafab6b0117117e0e2073683d87f5e74ac
4d01363b089917facfef766868fb2b1a853605c7
/src/Graphics/TextRenderer.h
c9e9d775fc35e74daa9933415f3da1031f28d2ff
[]
no_license
FardMan69420/aimbot-57
2bc7075e2f24dc35b224fcfb5623083edcd0c52b
3f2b86a1f86e5a6da0605461e7ad81be2a91c49c
refs/heads/master
2022-03-20T07:18:53.690175
2009-07-21T22:45:12
2009-07-21T22:45:12
null
0
0
null
null
null
null
UTF-8
C++
false
false
491
h
#ifndef textrenderer_h #define textrenderer_h #include <string> #include "Glut/GraphicIncludes.h" using std::string; class TextRenderer { protected: void drawString(const string& text, float size, float leftX, float topY) { glPushMatrix(); glTranslatef(leftX, topY, 0); glScalef(size, -size, size); for (unsigned int i = 0; i < text.length(); i++) glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN, text.at(i)); glPopMatrix(); } }; #endif
[ "daven.hughes@92c3b6dc-493d-11de-82d9-516ade3e46db" ]
[ [ [ 1, 26 ] ] ]
6dbe974978cb0f107c853fa620c22597d7dc837e
accd6e4daa3fc1103c86d245c784182e31681ea4
/Chess/Chess/Chess.h
b11b69a4343af5ac107e6bd4be2dc7d949d8aff1
[]
no_license
linfuqing/zero3d
d87ad6cf97069aea7861332a9ab8fc02b016d286
cebb12c37fe0c9047fb5b8fd3c50157638764c24
refs/heads/master
2016-09-05T19:37:56.213992
2011-08-04T01:37:36
2011-08-04T01:37:36
34,048,942
0
1
null
null
null
null
GB18030
C++
false
false
479
h
// Chess.h : PROJECT_NAME 应用程序的主头文件 // #pragma once #ifndef __AFXWIN_H__ #error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件" #endif #include "resource.h" // 主符号 // CChessApp: // 有关此类的实现,请参阅 Chess.cpp // class CChessApp : public CWinApp { public: CChessApp(); // 重写 public: virtual BOOL InitInstance(); // 实现 DECLARE_MESSAGE_MAP() }; extern CChessApp theApp;
[ [ [ 1, 31 ] ] ]
a38a24a66ba8180a81e9ef36f83f194f18402634
1cacbe790f7c6e04ca6b0068c7b2231ed2b827e1
/Oolong Engine2/Examples/Renderer/Ported PowerVR Examples/01 POD Geometry/Media/tex_arm.cpp
60fef096fd955a74745b1b5ef98300e92b78b289
[]
no_license
tianxiao/oolongengine
f3d2d888afb29e19ee93f28223fce6ea48f194ad
8d80085c65ff3eed548549657e7b472671789e6a
refs/heads/master
2020-05-30T06:02:32.967513
2010-05-05T05:52:03
2010-05-05T05:52:03
8,245,292
3
3
null
null
null
null
UTF-8
C++
false
false
120,769
cpp
/****************************************************************************** @File tex_arm.cpp @Title @Copyright Copyright (C) 2000 - 2008 by Imagination Technologies Limited. @Platform @Description ******************************************************************************/ #include "../PVRTMemoryFileSystem.h" // using 32 bit to guarantee alignment. #ifndef A32BIT #define A32BIT static const unsigned long #endif // ******** Start: tex_arm.pvr ******** // File data A32BIT _tex_arm_pvr[] = { 0x34,0x100,0x100,0x8,0x319,0xab00,0x4,0x0,0x0,0x0,0x0,0x21525650,0x1,0x5797abaf,0xeffdad8a,0x17171757,0xe737ad8a,0xf4f4fdfe,0xced4a56a,0xb975f8f5,0xd2b4ba0e,0x17175757,0xeb59b1cd,0x3075767,0xef78b9ee,0x70b0f0f9,0xd2b4be0e,0xf2f17535,0xd2d4be2e,0xfdfefaff,0xd2d3b1ac,0xdaadbefe,0xdaf4c670,0xeaeaffff,0xdf59c5ee,0xf3f1e297,0xdf38d2d2,0xed99cdcb,0xdb15c64e,0xa2e0f9fe,0xdaf4c64e,0x1727b7f3,0xd2d5b9ee,0xf1f1f777,0xdb17cab3,0x478b8783,0xe737be2e,0x47474747,0xf7dace90,0xbda9f0f0,0xd2b4c64e,0xfa912579,0xd6d4be0e,0x1787878b,0xefb9c22e,0x4b1b1717,0xe77ace8e,0xe6fefefe,0xd6d4a128,0xfafad5c1,0xd6d4b1cc,0xbd3a3e3a,0xdef4ca4c,0x6f1968b8, 0xdef5c64e,0xfb637333,0xdb17d2d6,0xe7e7f6f7,0xdf59ced4,0x3fdeee6f,0xdaf4d2b0,0x87834256,0xe336d2b0,0x13575793,0xdf17b1cc,0xf7bb0212,0xdb17c250,0xfffffbfb,0xd718a18c,0x1cc2e6fb,0xdb39d2f6,0x67afffff,0xdb16b9cc,0x97f7a713,0xdaf6ca92,0xffffff7d,0xdf5ab611,0xa29787da,0xe35bd2d4,0xbfffdf4f,0xdf38d6d4,0xef6f0e0d,0xdaf6b5cc,0xe5eefefd,0xe358bdee,0xdeded9e0,0xe316ceb0,0xbe74287d,0xe2f2c5a8,0xbf773074,0xdf12c1c8,0x9da9fbea,0xe358d2b2,0xd6af5ece,0xdf15d290,0x41acffff,0xe28ec5c8,0x66adf8d1,0xda6cbd86,0xc7cfd6a7,0xdf3ad2f4,0xaec7c2ea,0xd6d6b5ee,0xfb7b0f0b,0xdaf6a56a,0xd38383eb,0xe3378000,0x78bbdbaf,0xdf38d2b2,0x2eecdfa9,0xe35ad2b2,0xaabfbff3,0xdf38a16a,0xbe3e3d69,0xdf17a14a,0xbfbf2782,0xe735d28e,0xd9deee7b, 0xe778def2,0x2c296e3f,0xde8dc9e8,0x47e3f3f5,0xde6ead24,0xa8eeead5,0xeb56a906,0xe9ecf4e4,0xdecf9ca2,0xdfebdbcf,0xda8dcde8,0x41a33b1f,0xda4dda6c,0x93939383,0xf39abe0c,0x87875757,0xf3bbce90,0xd9cadaea,0xd6f6d6d4,0xe2e1e5e9,0xe338adac,0xa3a3a797,0xf3b9b9ec,0x17035393,0xe317bdec,0x98f4f0f1,0xd6d4b1ac,0xf87a3e29,0xdaf5a548,0xbefdeaa6,0xdf16ca90,0x8febe7af,0xe336b9ee,0xe29256a7,0xdf38c250,0x672b27e3,0xd6f6be2e,0xdbd79b8b,0xe759ce8e,0xaf7ea9db,0xe337d2d2,0x2b03a377,0xdf37ce92,0x83575757,0xe35ac230,0x2b1b6b2b,0xfbfdb188,0xab73932b,0xe315c64e,0xbdeecaec,0xd6f5d2b0,0xa9d4e8fc,0xdf58def4,0x4b47879b,0xfffab188,0xb4b9757,0xf356c1ec,0x75fad969,0xdf37dad2,0xf8f9f564,0xe337c20c,0xdac7c3cb,0xe779e334,0xdaeae9d6, 0xeb7ace90,0xcfcf8b47,0xdb17be0e,0xd7c79adb,0xdf38d2b2,0x78dcc5c1,0xe737c22e,0x1d4aebb5,0xdf15c20e,0xf9facec7,0xdb18be30,0xa1a2faba,0xeb7aa56a,0x9e8e9c1e,0xe75aceb2,0xa9f9f8bc,0xe77bd6d4,0xbdf1b6fe,0xe359d6f6,0x6feab53b,0xe339d2f6,0x5e8e5aa9,0xe339b5ee,0xf4d48aae,0xe77bceb2,0xdf464a5f,0xe77bd2d2,0xbf5f0f9f,0xd6f5c670,0xfdf98aeb,0xded0ca2a,0x5e8ad8dc,0xe6d0ce2a,0xbdb8b4d8,0xe2adb524,0xa2f1f4fd,0xe26db0a0,0x772743aa,0xded0ce0a,0xe2e0e4a5,0xeaafbd44,0xea8646d2,0xd609c144,0xa4c1c699,0xe28cd1e8,0xffef8fdd,0xeb7bca72,0xf373357,0xd6d5c651,0x4befffff,0xdf37ca70,0x9fe9f062,0xd6d3b9ee,0x9ba3decf,0xd6d5ba0e,0x7397534f,0xe359d2d4,0xcdeeef3f,0xdaf5d6b0,0xd2814595,0xe799ca2e,0x979763a3,0xda8ed1e6,0x2e2f77b3, 0xda4ccda6,0xf1f2e6e4,0xda2bbd42,0x327064a1,0xde6ec166,0xee4a91e7,0xe66cc584,0x727bbfb,0xea49c504,0x29958441,0xde2bc586,0xffd8892d,0xdeafb944,0xb0f8f5f7,0xe2f3b566,0xe5f0f4f0,0xe314b588,0xa8a8edff,0xdf57c630,0xc3861356,0xdf17d6b0,0x2352c6dd,0xd66cc60a,0xaee3f322,0xdaafc1ea,0x293d6ba3,0xeb57b5aa,0x1aba5a5b,0xe315c62e,0xc2c6afef,0xe37bbe30,0xafa7f3e3,0xe77ad6f6,0xfbb7b7b7,0xe35aae0e,0xd0b1f7fb,0xeb7bb5ee,0xab77bebf,0xe79bceb4,0x34d5c7eb,0xe359c230,0x62d0c0d0,0xe77aba0e,0x6efefb77,0xdf39d2d4,0x4f5eeede,0xdeb2ca0a,0x7d0f8f8f,0xdad0da8e,0xdcd8ae2e,0xe2f2c1ec,0x2fadfcec,0xe2f3b146,0x3f3e2e5c,0xded1d26c,0x810a7e7a,0xe2d0d20a,0x8e4faf6f,0xe735b9a8,0xe6dfcacd,0xdab0ca4c,0xdbc3d735,0xe759ca70,0xe6d3d3eb, 0xe338d2b2,0xe1b2b6f,0xeb7bc672,0xfbb7030a,0xe359ce92,0xbf0a96d6,0xeb7adaf4,0x68f8baaf,0xe759ca72,0x8f4767bf,0xe77aca92,0xab674e8f,0xdf18ceb2,0x3f7efafe,0xdf39b5ee,0xf551162b,0xef9bc250,0xbf7fbdfa,0xeb9bc210,0xb0f0fcfd,0xe77aceb2,0xd6c25564,0xe77aca72,0xdbeb1f6f,0xe77bce92,0x9257aa78,0xeb7ab9ee,0xfcf8d4c4,0xef9bbe30,0x94a9feba,0xf3ffad8c,0xefcba0a0,0xf3bceb9a,0xbf7f7faf,0xeb9bb5ae,0x8fdb479b,0xeb9ccab2,0xcf5b6bff,0xeb9cceb4,0xdb960f4f,0xeb9cdb38,0xb75b1f0f,0xeb9aca72,0x86024263,0xf358c1cc,0xfae71b0b,0xeb7ad2d4,0x27d78ae5,0xdf17be0e,0x4fece8bd,0xeb9bd6d4,0xa91f0b07,0xe339c230,0xd261aa3f,0xdaf5ad8c,0x2c1f74f0,0xe358ca72,0xfdfaeab8,0xeb7ac230,0xbc2c6abd,0xeb7ad2b2,0xe6effff,0xef9cca92,0xfaef6f0b, 0xeb7bbdee,0x492d2eef,0xf3bce336,0xf8e8e948,0xef7bb20e,0xd8eafdfd,0xeb7bd2b4,0xfdd4c1d0,0xeb9bc650,0xde99e5e0,0xeb7ac62e,0xa0b47d7,0xe737bdaa,0xe9e8f5e3,0xe6d0a4e2,0x761558ee,0xe6afc9c8,0x7673a5a4,0xdab2c1ec,0x1ea6eabb,0xdef6a526,0x94470726,0xe68fc588,0x1c0b3bb9,0xde8fbd88,0x4a8ecf0d,0xd2b3c22c,0x2759ccd9,0xe314c60c,0x9f0e0b26,0xdf39c670,0xd6fefff,0xe759d2b2,0xecf29bdb,0xe759d2b4,0xc2f3a148,0xe338ca92,0x404c4e45,0xe359ca92,0xc8cb962,0xce92be0e,0x468f8b47,0xf3bdd2b4,0x42878681,0xd6f7ca92,0xad6d7c78,0xe2b0c188,0x574b8988,0xe2afc9ea,0x6178fc7a,0xded3bdaa,0xdaef3727,0xded3c60c,0xfbf26fab,0xdeafd24c,0x332545db,0xde4cc988,0x498cd5c3,0xe2f6bdcc,0xeec4c8a9,0xd6b2bdec,0x1596ca8f,0xe779c22e,0x8c9e8545, 0xe75aceb2,0xf4281942,0xeb9ad2d4,0x4a8fbdf9,0xe759d2b2,0x56c3c241,0xdf37c670,0xcfc74206,0xe75ace92,0x7b7b0b0b,0xdf17c20e,0x7b39396a,0xdf16be0e,0x6a91ee3a,0xe359d6f4,0xb120241e,0xdf389908,0x7d7e1f5d,0xe759c650,0xabbbbfbd,0xeb7ac64e,0xab273ff6,0xdf17c670,0xc9454f9b,0xeb7ac22e,0x963b39be,0xeb59dad4,0x94e4a550,0xeb58c650,0x52c58a7e,0xe77bdaf6,0xf6fb9202,0xe77bd2b4,0xb4f1a0c,0xef78bd88,0xee5e0f0f,0xeb57c164,0xfefe9a46,0xe35acab4,0x73b979bb,0xe359c272,0x234289d,0xeef2c5a8,0x31b26e45,0xd60abd44,0x401448c8,0xdaf6ca70,0x143d5d45,0xe779c650,0xd4c54180,0xe759c650,0xad9ad6e5,0xf3bbbe10,0x99205440,0xdaf6c670,0x60146cdc,0xe337ca50,0x6ebbfdfc,0xf3bcce92,0x82474f9e,0xfbbcca50,0x6b692e2f,0xe338ba0e,0xb1beafae, 0xdf178000,0xe1960321,0xef13cdc8,0x8686a9a5,0xf7bae2ae,0xf6f3f7e2,0xf3bda968,0x480969ea,0xf7dfe336,0x5211479b,0xfb58da2a,0x935b5783,0xffbbde8e,0xab970202,0xef55c1ea,0x9bcb866b,0xeb55ca4e,0xf575f4f4,0xdef3b986,0x5b5054e8,0xd2b3ad46,0x4b474b9b,0xfffcc64e,0x172b579b,0xef74c20e,0x77258c8d,0xdad3c64e,0xa9e9febb,0xe338be0c,0xebf4393e,0xe316be0e,0xeee9d8db,0xeb79ce92,0x93d634b0,0xdb17ca90,0x57470b0b,0xe339ce92,0x7970b0fc,0xdf17c650,0xd5efffbf,0xe758c650,0x7a366626,0xdf17be0e,0x7af9eaa9,0xe759a148,0x1b579343,0xfffcc64e,0xe3a36767,0xf79bc20a,0xf8f82525,0xeb78def2,0x66a9a59,0xdef4b5ac,0x175353a7,0xfffac20c,0x5b5b5757,0xffffc5ea,0x65bc6841,0xe316ce4e,0xc4e8b9a6,0xeb79d290,0xf3b060c1,0xe337be2e,0xbb7b35b6, 0xe738df14,0x669a9f2f,0xf3dcc650,0x2af4b465,0xeb7aca92,0x99bafabf,0xeb79ca70,0xb2f1c287,0xe337d6f2,0xfbf7f229,0xef9bdaf4,0xadac3dbe,0xeb7aca92,0xfaa3133b,0xdf37c692,0xe1e3b363,0xe339be2e,0xae7c2a97,0xdf16ce4e,0xbfaf6e6e,0xdb17c22c,0x5b0f0f0,0xe338ca70,0x64e9da8a,0xeb7aadaa,0x7f5f8f6f,0xdf1690a4,0xb65aaeff,0xdaf5c24e,0xb5b2606,0xf2678800,0xf4f5f71b,0xeaacb880,0xf8fdfeb7,0xda6cd144,0xefe1f4f8,0xe28cc5a8,0x204aaa95,0xddc7c542,0x74713428,0xda29d522,0x5b879aaf,0xea8cb0e0,0x4617e7d,0xd60cc104,0x2e25d598,0xdb16ad8a,0x2313075f,0xe317be2e,0xda6f8b9b,0xdab4ad68,0x65c0c1d6,0xe356c22c,0xf3b37233,0xdf16c22e,0xa7af4cd4,0xdf169d06,0x5f8fcb66,0xe319b18a,0x6b5b4135,0xd2b1ad68,0x68d4f5b4,0xea29cd22,0x43121519, 0xf28cdde6,0xc54a5f17,0xd9e9b4e2,0xb83cb8f4,0xeef1da0a,0x6f9b8b4b,0xff71cd84,0x52d86d2f,0xe62bc502,0x6978fcfc,0xeaefea08,0x7c786418,0xe68bd984,0x5b6b1b1b,0xffffc20a,0x9b5b1b1b,0xfbffd22c,0xa2e6f1f1,0xe758ce92,0x96f2faf6,0xe758ca92,0x53179b97,0xefd9df14,0x5b9b5b57,0xfffcce4e,0x2f0b0207,0xdad4b5cc,0x6251f6bf,0xeb7ad6d4,0x199deef5,0xe738ad6a,0x7f2f1f2f,0xeb79b9ca,0xf9ebda9a,0xf3dcbe0e,0xfeef1a64,0xe758d2b2,0xede87c2f,0xeb57ca50,0xba1a1e9d,0xef79dad2,0x3a3f76f9,0xe758ca70,0x36362231,0xeb58be0e,0x47575b57,0xfbfcdef2,0x83939387,0xfbdadef2,0x6aa9d999,0xeb7ad2b2,0x1a4f4e8a,0xdb16b5cc,0xa7675783,0xfbd9d26e,0x5b8b879b,0xfffbca2c,0x75322629,0xe758c62e,0xd1d261b0,0xeb79b9ce,0xc7d3d296,0xe757bdee,0xbbd3c199, 0xe757ca70,0xda875363,0xeb59b9cc,0xb83c2d5,0xef79c62e,0xf1e4859a,0xef79ca4e,0xa58e15b1,0xe2f3bdea,0x51f7df4f,0xdf15bdee,0xce8f0f06,0xe758b5cc,0xc1d6aa69,0xe317a548,0x5fdfeac1,0xd6d4b9cc,0x478b1665,0xdef4b988,0xb59f1e1a,0xdab2c20c,0xbb56c0a9,0xe338ca70,0x5acf8f4,0xe757be0e,0xf0f0b60,0xe337bdcc,0x2147631b,0xf357c5ea,0x2c1c4d8a,0xf2eebd04,0xc989992c,0xfeaed142,0xf8946464,0xe609b8c2,0x6d0d0d6c,0xdeb0d5e6,0xa4d8ccc,0xf752b4e2,0x6021707,0xe64dc4e2,0x44998dcd,0xe649c524,0xafb24048,0xde0ac566,0xdb4e0f0a,0xdaf5be0e,0xd4c047eb,0xca92b9ec,0x13627030,0xde4db546,0x10504051,0xd1cab588,0x6ca8e7a6,0xce92ad8a,0x5a5b9bc,0xd2b3c20c,0x46460145,0xe26cb588,0xec6d1d12,0xce50ad26,0x64eddc5,0xf22bc524,0xa7864142, 0xdde8b8a2,0x18253b7f,0xda8dcd44,0x781d0814,0xe66eb8e2,0x17179beb,0xf26eb8e2,0x387f1f15,0xd566ac80,0x93e0b470,0xd5e9c568,0x30362633,0xde2bb8c2,0x48fba717,0xe64bc584,0xaded8004,0xd62cb944,0xa786cfde,0xe715b98a,0xfff89496,0xd290ca2e,0xa5a6b331,0xeaf1c1c8,0x598c09b9,0xeed0c164,0x63666e7d,0xf378a4e4,0xdb4d5452,0xde90b968,0xe562f3f,0xdf38d6b2,0x67b99c5d,0xdef6c22e,0x392686de,0xdf17c650,0x5040657,0xdf36ca70,0x52c5d4a0,0xdef5c22e,0x67558546,0xd2b2b9cc,0x6c5d490a,0xe338ca72,0x7abae1b8,0xdaf4b9ee,0x2c7c7d1a,0xe6aecdc6,0x64c3d6a8,0xeaafcda6,0x52025f8f,0xe6f5ad46,0x9be7a3a2,0xe3169cc4,0x61506150,0xead3b504,0x72b2a1a2,0xdef5b148,0x9710c4ca,0xdb14c20e,0x7b6f9fdf,0xffffa526,0xf7c26e6f,0xd292c20e,0x8f4fdbab, 0xd2b4ca70,0xd6458415,0xdf16c22e,0x75f8b565,0xd2b3c62e,0xee0f8387,0xeb37ce70,0xf0f0f4fe,0xd6d48000,0x8aa98195,0xe336a106,0x4b5b7f5b,0xeb59ca4e,0xe8cc4915,0xd292c22e,0xe7ceccf4,0xef9bd292,0x6e759180,0xeb79ce70,0xf6af4f9d,0xf39ab5ac,0x999dcdd8,0xf7ddc650,0x83d3d1d5,0xdf17ca70,0xea1717e7,0xef79a526,0x921065fa,0xf3dbd292,0x3e0d89c8,0xdf3ac670,0xef7f7f3e,0xf7bcc66e,0xbfbfeac3,0xef14ca0c,0xbf7b179b,0xeb14da6e,0xbf0400ea,0xdef58000,0xdfdafeff,0xef9ad290,0xafdf8f0f,0xf775c9ec,0xf0f19b5f,0xead2c186,0x5141c383,0xeb59c650,0xf6400121,0xeb59d292,0xaeec7917,0xd6b3ca70,0xff7f7020,0xe315bdca,0x382519ba,0xf39ad6b2,0x141d5b4,0xf39bce70,0x82c5c6cb,0xe758ce70,0x2f9beb97,0xeb57ce90,0xa10157ef,0xf79ab9ee,0xa55a0, 0xdef3c60c,0xbae491a0,0xeb15d1e8,0xefaf2f3f,0xff97c5c8,0xf0d00000,0xef35cdeb,0x74b0f9f9,0xf778bda8,0x1ff8f0f7,0xeaf3d20a,0xd474294e,0xeeb0b104,0x92a5ae7a,0xf77abda8,0x414458d5,0xef57c5ca,0x8fcbe3b3,0xefbbca50,0xb91f0f0f,0xefdcca70,0x73c38747,0xf337b9aa,0xafd7e3b3,0xf79bad88,0x4b1b0b67,0xefbdc650,0xde86424b,0xf3bcc22e,0x995166e2,0xef7aca70,0x44e4e8ce,0xdaf5c22e,0xb95b0316,0xe336c62e,0xd0c049c9,0xf39bd2b2,0xcd092455,0xef7ace92,0xc95d50d8,0xeb59c650,0x61317afc,0xef9ad290,0x792a5f55,0xef9abdec,0xc8dca97b,0xeb14d64e,0xdbcac581,0xf778ce0c,0x7cb9879a,0xeb79ce92,0xbb7d381c,0xef9bad8c,0x8b9afcf6,0xda90b968,0x64c9ca9e,0xde6fbd46,0xae9e51a3,0xfbff98e4,0x7b0b475b,0xfbffceb2,0xdf8b4381,0xfbfdd2b2,0x86d6d6ca, 0xef9ad290,0xe6fa7939,0xef79c650,0xb4e10408,0xe736bdec,0xca9d5e5b,0xdeb0c1aa,0x174a4542,0xfb76c588,0xf0f6b424,0xef79c60e,0x3130b0f0,0xf7bace90,0xe87c2916,0xef79ce70,0x3a399251,0xef79ce70,0x8193f67e,0xe758ce90,0xc2c182d1,0xeb7ad290,0x102536fa,0xef78b5aa,0xf9ccc810,0xf3bbbdec,0x4eade5d6,0xe779ce90,0x3c2f474f,0xeb58df36,0xb5393aa,0xeef1c1ca,0x1b2b2f1b,0xef56c584,0xfbe3dbea,0xe735e28e,0x34b7bbb,0xfb11d20a,0x51e55f1b,0xeeb1bd24,0x4d401906,0xf375da2c,0xf2a14643,0xeaafd1c8,0x8b81d4f2,0xf333e28e,0xbbeee474,0xef79d270,0xb8f2f7b7,0xf7bbdab2,0x78a58760,0xf7bbc62e,0x5f9fdfae,0xef9ac62e,0xf4eaffed,0xf7dcdf36,0xf8fcfcf4,0xf3dcd6b2,0x2c2c4845,0xf377cdec,0x91000014,0xff36b904,0xa8fedda8,0xef14ce2c,0x8191c0c0, 0xff98b8e2,0x444b9f8f,0xf332d188,0x5070345,0xe68ec524,0x6c3e4ada,0xead2b946,0xa85c2824,0xf712c566,0xeaca4a09,0xf2f1cdc8,0xeeeeeef6,0xffb7ce08,0xf8e1b7bf,0xe35ac60a,0x5b4b172a,0xff73a54a,0xebd6e6bf,0xf3ddba10,0x652514b9,0xdef5be2e,0x83033b6b,0xded3ca2e,0x78180484,0xeb35c5a8,0xc6c6c0c5,0xefbbce92,0xf553efeb,0xe758d2d4,0x67a7fbff,0xebbfce30,0x69bcfe6b,0xef9bce72,0xffbfffff,0xebbea20c,0x77d7efff,0xf3bbceb2,0xdeae0c0d,0xef9cceb4,0x6a16dfdf,0xf7dee338,0x7b7b7b7a,0xefbdd2b4,0xbf2f3f3f,0xefbddaf6,0x290d263a,0xde6ebdaa,0xbbf7d312,0xf379c584,0xade8f0f4,0xe736c62e,0xd0f0f49a,0xe758d6f4,0xe8e0dffb,0xeaf2d64a,0x90e0a0bc,0xe2b1c542,0x6e4480a0,0xef7ace90,0x6a297dbd,0xeb56c64e,0xcb53b3b5,0xeb9bc230,0xcb8e1faf, 0xfbfec652,0x818ce8f4,0xf7ddd292,0xce9e2e12,0xf3bce336,0xbdffb393,0xef9cd6d4,0xf0f0f4fc,0xf3bcc650,0x575b8ead,0xef9bd2b4,0x9e4b0303,0xef9cce92,0xffffffff,0xefbd94cc,0xd0d9feff,0xe339a98c,0x1f0f5e5f,0xe7bdc250,0xefefeb3b,0xf7ddeb78,0xe2dbdae0,0xefbdc670,0xe6810101,0xef9cd2d4,0xd2c1929b,0xf3beeb7a,0xa376bdee,0xf3bddaf6,0xf4f4edfe,0xe79cb1cc,0xbf87a7e4,0xef9ceb7a,0xbf7bffff,0xe79cc9c8,0x3e2f6bbf,0xeb7ac60c,0x1ab7b3fa,0xe77ad2d4,0xba958101,0xeb7bc650,0x3d6b773b,0xefbbe712,0x292e2e3c,0xeb5ceb30,0xc7effffa,0xefbdd6f6,0xde9efcd5,0xf3bcdaf6,0x2fadf4f2,0xefbcc22e,0xe2a7bb7f,0xef9cc650,0xd0f7fbee,0xdf18be0e,0xfeb85589,0xe339ca72,0xc058b9f2,0xe759ce92,0x4ca6b4dc,0xe339c650,0xeeb73fbe,0xeb7bdb1a,0x7fae4f9f, 0xefbcc272,0x53333b3b,0xef79def0,0xb08040a1,0xf777ca2e,0x3fbfbb7f,0xeb7ac252,0x60b6673f,0xdaf6ba0e,0x848082c6,0xeb78dad0,0xc6eafde8,0xeb38ca0e,0x7168cd89,0xe68ec9a8,0xf6a44c59,0xda4dc188,0xb93797a6,0xd2b2b1cc,0xe08045cc,0xef7ace4e,0xf4743f6b,0xd26fc1a8,0xb4f4d4d8,0xeb57c5c8,0x386c4e4,0xef56ca0c,0x45434101,0xded3c1ec,0xdbb5d6e5,0xe759ca50,0x71240acf,0xd2b3be0e,0x474f4f59,0xe77ace92,0xa7f4b4f5,0xeb5ad6b4,0xeacfa673,0xdaf6c650,0x3e79b373,0xeb9bca92,0xe3b06017,0xd6d5be2e,0x116459f7,0xce93ca70,0xdfadfc74,0xf798d66e,0x5f2befef,0xf797ce0a,0xd8d0c382,0xded5ce2e,0xd47474f5,0xe316b9cd,0xb8a4125a,0xef34c9ca,0x7c5851f4,0xf755c1aa,0x3e1e1a19,0xeb59c20e,0xbfbe3c38,0xeb79c630,0x7e2a1a6b,0xfbfea128,0x8bdbfefd, 0xf3dddef6,0x7f2b1e65,0xe359c650,0x55233f7e,0xef9bc650,0x6c746436,0xdab5ca70,0xd0f0b64,0xeb79ca6e,0x615106c,0xe337bdee,0x505c1c1,0xe717ca70,0x410075fa,0xef9bd2b2,0x89489eda,0xe359c650,0xd4ec3010,0xeb7ace92,0x1a1342c1,0xe758ce50,0xc5c2cf9f,0xef7aca70,0x4510108a,0xe75ac230,0x874b4f4e,0xef9cc650,0xe2d9cfdb,0xf3bcdaf4,0x11407434,0xe358ca70,0xb1d5a76b,0xe75ad6d4,0x75b0e2c2,0xe736bdee,0xbbbe6b37,0xf3bbdaf4,0x7fb1a131,0xe738b9ee,0xc0455e6e,0xdf37be0e,0xd4e05f1,0xeb36d22c,0x6e94e024,0xef57d690,0xd8d08a4a,0xf3bdd2b4,0xe9eeddec,0xf3bcdf16,0xffbfba86,0xf3bce316,0xfaefeffe,0xf3dde758,0x48b9e9c4,0xf7dddf16,0xd1e1de9a,0xf3ddca70,0xa5762a17,0xf39bd2b4,0x12decf88,0xefbcce92,0x579ab5e0,0xf7ddce72,0xc887675f, 0xeb7bce92,0xa5bdbebf,0xfffd94a0,0xbbbba251,0xf753b128,0xa95a1b1,0xef58c1ee,0xf37eb5b,0xe316ca72,0x7675befd,0xf755d26c,0xb7b6ba79,0xf79ceacc,0xfdd9eaff,0xe77ad68e,0xd8d895ba,0xef7ad66e,0x4bfbffff,0xebbead8c,0xffff7202,0xe35abe32,0xc6e9f4f4,0xf3bcded0,0xf6f6faea,0xef9bd6d0,0xbf2bbaba,0xf3bdeb9a,0xd3e2f6ff,0xeb7b9d0a,0xbfffbffe,0xefbd80e6,0x7f5fffff,0xf3dde358,0x9bf7fbff,0xe39bce92,0xb456f3d3,0xef9cefbc,0x4e9cadff,0xefbde358,0x2d3efbaa,0xeb9be336,0xa5964ac9,0xf3dee358,0xe9c3c684,0xeb9beb7a,0xfbe3f2fa,0xef9ce334,0x8fcb56f7,0xef9ad290,0xd1a3fba3,0xeb7bce94,0xdffbf3e1,0xeb7bdaf6,0x3f7f5f0f,0xe3179083,0xfbfffb7f,0xeb789d48,0xf8bcbcbd,0xe75998e6,0xad9efefc,0xefbbc230,0x3f2f2f2e,0xe75a9908,0x2436bafa, 0xe77aca92,0xe6e0e4e5,0xeb9b90a4,0xfeffbcfd,0xeb7bce94,0x23b9d53d,0xeb7be758,0x8afebd16,0xeb7bd2d4,0x3faddaf6,0xf7ded6f6,0xdeda0213,0xeb9ce338,0xfffffbff,0xe35a914c,0xf6f3ffff,0xe77ad2d4,0xffffffff,0xe35a8968,0xf4feffff,0xeb7bca72,0x7e696aed,0xeb7be778,0x3f2fb7fe,0xe75a9d08,0x9aa13fa4,0xe77adf16,0x7aaa9a2e,0xf3bcca92,0xfbffffff,0xeb7b8c46,0xdb7aeebf,0xe77ae77a,0x7f3f7fff,0xe37bc273,0xfdfcdfef,0xeb5ad2d4,0x92967b5b,0xeb9ce778,0x5ae283a3,0xeb7be758,0xcfeffbfb,0xe759b1ac,0xeffffbde,0xeb7bdaf4,0xebffffff,0xe75ad6f6,0xe3c4ebbb,0xef9bce92,0x3a7fbfbe,0xe75ac650,0xb7a2fe7e,0xeb7bdaf6,0xeffae9e7,0xeb7adef6,0xacc4e17e,0xe75ad2b4,0xf82e4fef,0xeb7bca92,0xe909bfea,0xeb7adf16,0xabaeae4e,0xef7bd6f6,0xa9661717, 0xf3bcd6b4,0x994c5397,0xeb9be358,0xfbbebb77,0xe75ad2d4,0x42a9e4ec,0xe759d6b2,0x6aaaf713,0xef7bc650,0xbeffffff,0xe75ab9ee,0xfbfdbcf8,0xef9cd2d6,0x8a055beb,0xef79d290,0xc6fe5a0b,0xe735d24e,0xbcbda6a7,0xeb9bd290,0x1a7797a8,0xf3bbd6d4,0xebd7d2c6,0xe735ba30,0xab971326,0xf7b9ce6e,0x3a7f9b83,0xef78d6d2,0xf3daada4,0xeb7ae314,0x9fd7e282,0xefbcd6d6,0x8aafeeee,0xef9cce90,0xa70b0f6e,0xeb9be358,0xfafba191,0xef7bdaf4,0x75f3e78d,0xef9ce35a,0xcfeefbb5,0xef9cd2b4,0xf8792534,0xef9b94c6,0xbf2f7ff9,0xf7ddeb7a,0xa975367b,0xf798d64c,0xa6062f3a,0xf79aded0,0xfcffeef2,0xef9cd2b4,0x6faaf6fc,0xf7dee778,0xf0e0f1b6,0xf357c5aa,0xf5f1f0e0,0xf799ca6e,0x7fffaf7f,0xf3bcd2d2,0xfedfffbf,0xf7def7ba,0x3f7baa97,0xf3bddef6,0x2a2a6faf, 0xfbdedf16,0xab1f5eef,0xf3bcd2b4,0xe7adacbb,0xf3bddef6,0xb9b47b6b,0xef9cdad4,0xfbe392ab,0xfbffbe0e,0xeb5fafeb,0xfbfeeb7a,0x5311b5f3,0xf39bce72,0x2dbebe3e,0xe759be0e,0xe7062828,0xe359c650,0x4a0e56f3,0xef9bdaf4,0xefaff9e1,0xf7ded2b4,0xeffab9fa,0xf3bcce92,0xfcb9174f,0xf7dddf16,0x46c9eafe,0xf7deef9a,0xfbf29645,0xfbdeef7a,0x264286af,0xf3ddd2b4,0xfee9e1f5,0xf3bddf16,0xfb8b86b7,0xf3bdef9a,0x8bfffffb,0xefbcd2b4,0xaf2e0fef,0xf3bcd6d4,0xdbbf7aba,0xffffc630,0xfae3c3cb,0xf7bdc630,0xf8b0606a,0xfbdeca72,0xfaf2eeb9,0xef9bdef6,0xf8f8feff,0xf3bcb5cc,0xff9fe7fa,0xffffeb58,0xe1f6fbff,0xe759b18c,0xb6f2ffff,0xf39ce338,0xfefbb5e0,0xf7bceb58,0x1bff7f47,0xf3bce736,0xfef8ee8f,0xf3bcce92,0xe7d3e363,0xffffb5ac,0xd7e2f2f6, 0xe75990a4,0xffefe2f0,0xfbfedf16,0x528b9faf,0xfbdedf16,0x3faf0459,0xeb7ab9ee,0xc3e2f23f,0xf3bcce92,0xdfef9800,0xef9ad6b2,0x9fcf4fee,0xef7ad6d4,0x30b0852d,0xef13ce0a,0x874b2670,0xffb6d20a,0x74a1f3f3,0xe338ce92,0x6b6e68b5,0xef9aca92,0x1b876303,0xffbaded2,0x568ef3e,0xef55d24c,0x383c642,0xe77aca70,0x55824151,0xe35ac650,0xa5fe5b05,0xe757b5ac,0x7fad7a76,0xdef6bda8,0x66b16155,0xd2b3b1cc,0xb0949e6a,0xdef6b986,0xc61f3a2e,0xdef4d270,0xa4ef8b83,0xef78dad4,0xc74694e0,0xef57ca0c,0xdffe9dce,0xef9ad6b4,0x9e0f0605,0xf396c5ec,0xc10297df,0xef34d1ea,0xe2e3b36a,0xe717d2b2,0xf53534e5,0xf379c22e,0xe6a713c1,0xef54c9ec,0xd3e21a5f,0xef55d64c,0x844f6fa9,0xe738c64e,0xc2cfeab0,0xe758d2b2,0xdad2d3c2,0xf3bcca50,0xeed4899f, 0xe317d690,0xa0faefcf,0xf798dab0,0xf12d2930,0xf777da8e,0xd4b0f4ad,0xf7bbd270,0x45c4f4e4,0xeb58b9cc,0xc98abdf4,0xf7bad68e,0xbacecfde,0xf79aad68,0xd5001441,0xeb79ce92,0xf0f3af5,0xeb7ba54a,0xefa59082,0xffffeb78,0xaffeffef,0xfffdb546,0xfeddda2f,0xf3bcd2d4,0xf4f8fbfb,0xef7aca2e,0xbf2f1b5f,0xe337c62e,0xfb4a87fb,0xef9be758,0xfffffe8a,0xfbddded4,0x9affffff,0xfbdd8000,0xbbb7777b,0xf3bbffb4,0xaf7bbbbf,0xfffdef32,0xfaf9d580,0xe75894c4,0xff2757ba,0xeb7ad2b2,0xeace6fbf,0xf7dbce90,0xe0d0f9f6,0xf79bd64e,0xabeb1d29,0xef79a548,0xe1d21a1e,0xf7bae6f2,0xfffffeff,0xf7ddad8c,0x9fffffef,0xf7bdc630,0x73e3e1a4,0xeb78c60c,0xed85a9bb,0xef9ae316,0x1f9fef8f,0xf7bddef4,0xe6fe79b,0xf3bce758,0xffffffff,0xf3bcb542,0x50c2fbff, 0xf3bad6b2,0xdad3e3a7,0xff9aa526,0xf7f6cbde,0xf79cfbd8,0xdd8f8ed4,0xf39adef4,0xcecfbaec,0xef7adad2,0xffbeb9f4,0xf3bdf772,0x61f1ebff,0xfb98bd88,0x525a9f8b,0xeed0c1ac,0xae0a6f6b,0xe6d0c60c,0x7dfe8141,0xdf15c24e,0xedc9c94e,0xefbcd2b2,0xd2e3aefe,0xdef3c5a8,0xbe779684,0xef56cdca,0x4b6f2f6d,0xef79ce70,0x7eaf0d1b,0xdad4ca4e,0xc1d1e4a5,0xf7bad26e,0x2c0d998a,0xeb37d290,0x45c1b93a,0xef36d26e,0x6e3f2b1b,0xf398ca0c,0x91e4d454,0xdf38ce4e,0xde9b8283,0xe337ce2e,0x159bbbf,0xfb98c5a8,0xfbd19115,0xfbdbce2c,0x5a2f2f7b,0xdef28800,0x7cbcb869,0xe6b1c922,0x5eeffead,0xdab298c4,0x80810519,0xded2cdc8,0x495cb464,0xde4cc9a6,0x425d697a,0xde2acd86,0xd4945040,0xe79acda8,0xf8f8f4d4,0xeb57bd88,0x90b1fefe,0xeb57a928,0xffbfb9a0, 0xf79a9d4a,0x78b4b1fa,0xf79beaf2,0xf1faaf69,0xf399e6ae,0x6a82ebfb,0xdf17d2b0,0xa4beaeae,0xdef6b188,0x2041c1c0,0xfb99d64e,0x41d1f1b4,0xf335d608,0x7b1562b6,0xf3bbe736,0x86dcedff,0xfbbcce70,0xf4bb3b1,0xf3bcdaf4,0xefae1f0f,0xeb9bce70,0xe6b5d042,0xef79d690,0xfcf0f5a9,0xf379ef10,0x6f4bbf9b,0xf3bcef9a,0xda9ac386,0xf7bde738,0xe9fdfdff,0xf39bd252,0xfffab3a2,0xf3bcdf36,0x7cb8e0a0,0xfbdbe6ce,0x958be7e,0xf756ce0c,0xc7d69bfe,0xef99d292,0xe5bdf9fa,0xf3bce778,0xba652207,0xffbbcde8,0x793b7b7a,0xf39af350,0xfdfcfcbc,0xf3bcf374,0xeeaebefd,0xfbdce2f4,0xc6d7fefd,0xf7dce758,0xf6b8b99f,0xf7bcdef4,0xc9c3fabe,0xf39bd6d4,0xbbebcacc,0xe338ca92,0x321affff,0xf7bceb58,0x5e460637,0xf39ae316,0x67ebffeb,0xf7bce75a,0xebfbd96a, 0xf3bceb98,0x2f6f6b69,0xf79af750,0x8f6f2e1d,0xf778f732,0xe6f4e0c5,0xefbcdf16,0x24559793,0xef9ce356,0x7a7a6282,0xff77c9c8,0xebeadb6b,0xfbd8da70,0x950435f5,0xff95da4c,0xe8f8f9e9,0xf797e68e,0xfffaf9fe,0xf3bcc2d6,0x2f3f7fff,0xf3bcdaf4,0x4eca79b9,0xf332daae,0x82e76f2e,0xfb73ce2a,0xa9f4a451,0xef7ac20e,0xaf4e549c,0xe33ad292,0xffdbeaef,0xf7fefbdc,0xf9f7e1e5,0xf7ddd292,0x63175f5f,0xef9ace70,0x270b9753,0xf3bcc630,0xeafae4e4,0xf3dddaf4,0x80408ad7,0xef9bceb2,0xbf2e6caa,0xfbddbdee,0xdd8e2e7e,0xf3bbce70,0x693a7aca,0xffd9eb10,0xc4b0b095,0xf799e6ce,0x58110706,0xe779ca70,0x88dedfff,0xf39aca50,0xf4e4b4a4,0xf7b9eaf0,0xb57ab9b4,0xf7bafb50,0x9f478389,0xf7dcd2b2,0xf3f3d5d9,0xf39ac62e,0x52b06281,0xe738d6b2,0x17b6e996, 0xf39bbdee,0xac6f0712,0xf7bcdad4,0xa24a6eec,0xef9ad6d2,0x7fadd906,0xeb7ace72,0xc7ab6b6b,0xf7bde316,0x9decf8b5,0xef79d6b2,0xab474b8b,0xf7bce736,0xfa3c46bf,0xf39bdad4,0x480ecbd3,0xf39cd6b4,0x8794fdfa,0xf7ddd6b4,0xbf2f1f0f,0xf7bcca70,0x89acf4e4,0xef9ac650,0xcc9de5e0,0xf7bcdef4,0xffff3f6f,0xf39bd6d4,0x4dac3e3f,0xf7bcd6b2,0xf2f6b5a2,0xf39cd2b2,0xffffe7f1,0xf7bcdad4,0xafe8fa7f,0xf3bce756,0xffe0dbcb,0xf3bdeb78,0x2072f3fb,0xef9bdad4,0xfebab3b2,0xe758c62e,0xdcceebfa,0xf39bd2b2,0xead1253d,0xf39bdf14,0x74b82d6c,0xf39be314,0x9a30b262,0xf39adef4,0x3c3c1e1b,0xeb79d6b2,0x727ffa3c,0xe737d6b2,0xf3fbebdf,0xf7bbc650,0xeaeaffb3,0xf3bbe736,0xef0e0afa,0xf39adef4,0x6934264b,0xf7dce316,0xab8daf7b,0xf7dcdef4,0xe3efffeb, 0xf39abdee,0xa968bebf,0xf39be314,0xc3c2469f,0xef58e314,0x6eaf8a70,0xf399e2f4,0xa6455b5f,0xf7fbeb76,0xfaaeaeeb,0xf7bcca50,0xbabebae4,0xeb5790a6,0xb9b0b070,0xf7b9f752,0x3bbafefe,0xf773eaec,0xeecfdfea,0xf399daf2,0xc1e5b6fa,0xf3bcef78,0x9662313a,0xf752eeee,0xf468686a,0xfb94ef30,0xeba35787,0xf7ffe778,0x9dfcaced,0xf39bd6f8,0xa38febd3,0xeb7adef4,0x37270be3,0xf39ad6d2,0x2e2f8a47,0xf7bcdef4,0xbfb7b6be,0xf39bdef4,0xaf2a2aaf,0xf39bdad4,0xea86eebf,0xfbddeb58,0xb7b77fbf,0xeb79b5cc,0x603a3ebb,0xeb79ce70,0xa82070b4,0xf799ef32,0xfcad3c7c,0xf798e2ee,0xff3b376a,0xf39ce336,0x9b9fafbf,0xf3bce336,0xf8f4f4b9,0xf775e246,0xa2a1e0e4,0xf799e26a,0xef1f0ecb,0xf3deef9a,0xe1e1ffef,0xf39bb18c,0x73a3ebfb,0xf39ae736,0xa69a4e4a, 0xffffd292,0x420a1e1c,0xf37bce90,0x738fdf9b,0xe737def4,0x92c1e1e2,0xfbfdeb58,0xf4b8babb,0xf3bcca2e,0x572b3fef,0xef79b9cc,0x33cf4703,0xeb58e317,0xdb869aea,0xf7dce756,0xd89cfdff,0xf39ad6d2,0x6b5e0a8b,0xef7ad6b2,0x4e2dbaa3,0xf39ae316,0xadbcb0e0,0xf399ca2e,0xe2f1b2e9,0xef7adef4,0xc786468d,0xf39adef4,0xc6c0455e,0xef9beb56,0x67878a7f,0xf379d6b2,0xa74bf3b2,0xef79eb36,0xf2fafffb,0xf39ab9aa,0xababdbe2,0xf399c60e,0xe1e2b5bb,0xef77d290,0x9f1fb7b1,0xf378ded0,0xfecbcae9,0xeb79d6b2,0xd4e6fbf7,0xeb59e2f4,0xf8f8f4f1,0xef9ad6b2,0xf0f0eadd,0xf3bbd292,0x4498a4f,0xfbbbd6d2,0x5b171601,0xf79ad270,0x84ecfced,0xeb57ce70,0x7f559295,0xf379e714,0xb9650a1b,0xef79ce70,0x5a166af5,0xffff9080,0x465b979b,0xf37bded0,0x562b4a02, 0xf355ce4e,0x99deafd9,0xeb56def2,0xccf93e6a,0xeb57ce70,0x50e4d8c9,0xf358c9c8,0x6dbc7830,0xf779ce50,0xa1eadece,0xeaf3bd88,0xffefdac0,0xf7bbce2e,0xab6f5b6b,0xfff9b148,0xc7dfafab,0xf755d24e,0xd0f0a59,0xd2d5c1ea,0x78100408,0xf379b168,0x17838357,0xffdac5ea,0x3b2fe763,0xf796c168,0x20789e7e,0xdef4ca2e,0xbcfc4d08,0xd692b18a,0xf4b06060,0xeb56b58a,0xacddce99,0xeb55ce6e,0x474acdce,0xdad4c20c,0x8b8f0f07,0xe738b58a,0x94ca8f0e,0xf378d66e,0x1d5dc8c8,0xf355b124,0x1f0b8b5b,0xf39cc60c,0xb0f4d74b,0xdeb2a106,0x4b4b9ba7,0xfffbce2c,0x47070b1b,0xfffbb124,0xcb031365,0xe717b9cc,0x97c78f8f,0xdf16ca0e,0xc7c3ebcb,0xf7bace2c,0xcbcbdbcb,0xfbbac588,0xbffb7b6f,0xe314b526,0x3f2f3f3f,0xe315d22c,0xeff7fbae,0xef12bda6,0x7ebb5f9f, 0xfb53ce0a,0xcb460010,0xd6b3bdcc,0x70746ddf,0xef79c20e,0xd4d6845c,0xf314c1ea,0xeedf4e08,0xf777b166,0xbc7ebfbe,0xe779d2b2,0xf974b4f8,0xdf15c5ea,0xf4f4b848,0xef9aca72,0x264f8540,0xef57c60e,0xa454d0f8,0xf3dbc1cc,0x40f0faf5,0xef37b588,0xb9b4a161,0xef9bb98a,0x1977bbba,0xe759ce6e,0xdbeb8b86,0xf3989c60,0xa050eaeb,0xf735b126,0x70100024,0xee6ec504,0xa0914b40,0xf68fb8a0,0xb331e1a0,0xeeafcda6,0xcbcbebfb,0xff2fb902,0x8085adb8,0xee4dc104,0xe02058c9,0xe60bc0c0,0xd6dacbcb,0xfbb1b8c4,0xc3c3c3c6,0xff32b946,0xcd8d1e2c,0xf39ace70,0x4aecbbd3,0xeb58ca70,0xd3c1c8d5,0xef58b988,0xbefdfcf5,0xef56c9ea,0xfad45a4b,0xf3ddce92,0xf37b4bdb,0xeb59c20e,0x971f27a6,0xf353deae,0xdff9f0f2,0xf755c5a8,0xb19292d1,0xff2ecd04,0x62b2f0f0, 0xeeced9a6,0xfbdee7c3,0xf311da6a,0xaaefd7f7,0xeef0c100,0xe6e3d180,0xf754c8e2,0xf1b263e5,0xf30fe1a4,0x2b27d3d6,0xf2aeb566,0xedf4f0b6,0xf753b146,0xebf3e393,0xf395bde8,0x273bbbaf,0xf2f0c9a8,0xa8a94f0f,0xd62fc986,0xad6d5a45,0xde6cbd64,0xc74babb6,0xfb53c584,0x4bc7ab9b,0xff74cdc6,0x60504a8f,0xce2ebd46,0x76360151,0xdeb1bd46,0x461a1f5f,0xef779504,0x2d2e5643,0xc1ec8000,0xbaf9f9fe,0xf378cd66,0xf4f4faab,0xef79bd66,0xbdfe6d1d,0xce4db904,0xd080e0f8,0xda8fb9aa,0x5050b0f0,0xe2f3bd68,0x672b1d04,0xf356ce4c,0x2b6b5b0b,0xff90c0e4,0x2b5b8757,0xffb4a480,0x5a6a7ab6,0xfb74b0e4,0xfcead796,0xef14b988,0x8b4b7f6b,0xff11b966,0xb35b8beb,0xf6edc584,0xeae9f9fc,0xf3b8d9e8,0x3edacaea,0xf312c9c8,0xf8782454,0xf776bd86,0xe0a0b1f4, 0xe733aca0,0x554a5dff,0xe6f1cdec,0x47c3d144,0xeef2bd88,0x3236f2f2,0xfb52da28,0xd8c4e5f2,0xeef1c146,0x3e1a0787,0xea8ec188,0xeacaee7e,0xfb73bd64,0xecacf4f5,0xe758b630,0x4a14b0f5,0xef56b9aa,0xf0fdfcb,0xef12b946,0x70b0f0f,0xfb10acc2,0x4090647,0xda6fa0e4,0x572a1904,0xe2b19482,0x3f7faa86,0xfb74e208,0xd2d2d3e,0xf355de2c,0xf4d4d0f1,0xef12f208,0xf4f4f4f4,0xf731fde8,0x9f9aa2eb,0xffb5eb0e,0x6f6f1f2f,0xef54ea2a,0x95f0a4b4,0xef13cd44,0x64605448,0xfb98c920,0x5f4b0d0d,0xff74c566,0x1f6f2f6f,0xf3daf268,0x1e2f1a17,0xe2d4a906,0x15170a,0xdab1aca2,0x392c0c0c,0xf2f2c544,0x192d1414,0xd5caa040,0x1a1a1400,0xdab1a060,0xb9beab27,0xf754b964,0xefaf5717,0xf6cdd584,0x2b1b9fdf,0xf6eafa48,0xd0e08090,0xef54f60a,0xf6e2d0d4, 0xf774ee0a,0x6f6b5a0e,0xffdbcd82,0xcfcfcf4f,0xe6afb504,0xc0c1e6f7,0xf6cdc124,0xf0f0a884,0xf2aeb8e4,0x1c58c1c7,0xf28fd1a6,0x363fffcd,0xee69d5a6,0xae420120,0xfb13b0e4,0x4849b9b8,0xeb15c9ea,0x9689697a,0xe778a526,0x7a7ba3e6,0xf799a528,0xaa2e2d1c,0xea4f9040,0xf1e2eada,0xfb74d9c6,0xf0f4b4b4,0xded58000,0xeadfe6a1,0xf398cdec,0xf1a10307,0xf777c9ca,0xc3e2b2f2,0xef36c9ca,0x61713131,0xf39cd2b0,0x3e3a3d76,0xfbbcdb10,0xb70f0f47,0xde6ec988,0x30246a3,0xf2f5c9a6,0x3576747c,0xffbcda6e,0xabab9860,0xfff8b98a,0xc281f5f4,0xea8dbd04,0xb8f4e4a4,0xe6d3c922,0x7d5bc7e2,0xf79ace70,0xbd7eafc,0xf799c1ca,0xeff7f1b0,0xeef2cda6,0xf237267f,0xfb2fee88,0x3b29440e,0xfb96c1ec,0xf27a7e7e,0xf3bac1ce,0x4303171d,0xf356cdcb,0x8fbfbfdb, 0xf774ce08,0xce0d92a7,0xe2b1d22c,0xde8393c3,0xf778c1a8,0x17474f4f,0xfb55d1c8,0xb779262a,0xf751c984,0xc6d889de,0xeb15c1ca,0xf8f8f8e2,0xf79aee8c,0x7878f8f4,0xf7bcdab0,0xf8f8f8b4,0xf7bbb946,0x460418a9,0xe28ec146,0x54705000,0xe68ed5e9,0xfcb8347c,0xf39acab2,0xbfbdfcfc,0xf3bbc1ea,0x47070e0c,0xfb74d186,0x4faf9e9e,0xffb8b96a,0x475aafad,0xfb96d608,0xf5fafbef,0xf731b0e2,0xaa4d8e9a,0xffb7e22a,0xe4c48899,0xff52cdc8,0xdcdcc8b4,0xf311de6c,0xe4eaead5,0xffd9d9a0,0x83a3e7e5,0xffd7de8e,0x6f5f5f43,0xf7bbfb2e,0x498e5fbf,0xfb99ce4e,0x984e8994,0xf375ce4e,0xa0409217,0xffdcce0c,0xdad9e9f5,0xf7fee2d0,0x53b3f3e5,0xf334cde8,0xa0f5f9b2,0xfb75ca0c,0x91d3874a,0xf7d8c60e,0xecbea950,0xfbbad270,0xcbaba9a4,0xff74cda4,0x498b47c2, 0xeeafa420,0x9f4f4f9f,0xf7b8eace,0x1eafef5e,0xfb95da08,0x94b89c48,0xff53e24a,0x7f6f5a48,0xf3ddf710,0xbdb4b82d,0xfb52cd64,0xa8a098ad,0xff94e208,0x2ebaa564,0xfb0fd186,0xd8e61d2c,0xf6cdbd84,0xfde4c1e2,0xef58bd68,0x6f8fdffe,0xef55b946,0xf1f9a948,0xf6efd120,0xe4d0d0e1,0xf355e608,0xcae9fdfe,0xfbffb988,0x5de5cbcb,0xf379ca0c,0x7f2f5e66,0xfbd8faca,0xafbf3e3f,0xf354c964,0xe9c8c8f9,0xffd9dab0,0xe1f8fcf9,0xfb76d1e6,0x85aeafaa,0xfb0ee1e4,0x62bc9c82,0xfad0c586,0xf8f4e0b1,0xf776e22a,0xf9f8fcfc,0xf397dda2,0x8ac5c1d8,0xff35cd66,0xab6b1b0b,0xff0aa062,0x12907a3e,0xeaafc9a8,0x5f658192,0xf735b4c2,0x8635397a,0xff30d5e6,0xb27b158b,0xee4ae1a4,0x34204347,0xead3bd68,0x1a6aceed,0xff30cdc8,0x1f293960,0xff53bd04,0x7f3bbdfe, 0xf752b080,0xfcfcf9f9,0xfb96dd20,0xd4b4f4fc,0xfb12c8e2,0xc70d7879,0xee6cbce2,0x4483f7f3,0xf713d164,0xb9b2a0f0,0xff95d5a6,0xb5f2f3b2,0xff72c166,0xbd6c8e6e,0xf777f32e,0xbabebdbd,0xf395ea68,0xb1f27928,0xfbdae314,0xb574747a,0xfb98cdec,0xe0d6eae,0xf7b7f750,0x2e1f6f2f,0xffd9eace,0xe2c2a3b2,0xf799f752,0xf7f7f7f2,0xf7baf730,0xbfbe787d,0xf3bbde2a,0x2d2c2f6f,0xfbbef772,0xb4b4b4b8,0xffb9faec,0x4464a4b0,0xfb32ea8a,0x1f1f0f0f,0xf3dcf6ac,0x171f1f1f,0xf7b9fb0e,0xf5ba9989,0xfb72ee6a,0x93a2baba,0xfb74f30e,0x686e1a18,0xff96da6c,0xaa2a2551,0xfff5c9c6,0xd7eba7f7,0xfbdde2b0,0xe7d7c7c3,0xf79bc1ee,0x929a556,0xff72eeac,0x3ae9da8a,0xfeebee64,0x1f4babbb,0xffffe736,0x4e0faf8f,0xe733c188,0x8f6f675a,0xef74d9aa,0xd4e4b87, 0xffbabd66,0x83935797,0xfb32e66a,0xeae69596,0xff53f668,0xe2b1e7a5,0xfbb5ff32,0x33377b7a,0xf731da0a,0xfdfc3865,0xf711c946,0xfcfcfdfd,0xfb53e5ea,0xeba7a7a3,0xffd2d0e2,0xe7e7e7eb,0xf6cfd5a2,0xf0fdfe3e,0xee8cb586,0xf5f9f5f0,0xea6a9842,0x6b6babe7,0xfecaa000,0x5727675b,0xf62cb860,0xbeb86490,0xee6ba040,0x6b81bebe,0xcce3c4c2,0xc6faffff,0xe2acc164,0xb54a9ecb,0xf6cde68c,0x1f2f2ffe,0xeaaea8c4,0xfabe7f2f,0xef32ad04,0xbf7af6f5,0xf30ef646,0xd0f0f7fb,0xf229ed86,0x7470d4e9,0xf6edeaaa,0x4585ddfd,0xf649dd84,0xa7030347,0xee6ad104,0x938393e7,0xe6edccc2,0xee540026,0xe1c8b840,0xf67bafdf,0xee4adde4,0x51d29397,0xee0ba800,0x97e77b22,0xe5a6c080,0xf6bb6ae5,0xea49dda4,0xf3ebba31,0xe209d5a4,0xef694491,0xe1c7c902,0x90e8ffef, 0xee6ad544,0xfbe51015,0xee2bb880,0xa465bafe,0xf6edde06,0x6c948050,0xe5eac944,0xb4fc5c0c,0xea0acd04,0xe2b94d86,0xea2bc944,0x1909a2f1,0xe5e9d986,0x1924a060,0xe2b2a880,0xfcfcffdf,0xeaadad00,0x1b47474a,0xfecbc0c2,0xe04152b,0xfea9e188,0x94beffff,0xf28ae5a4,0x79a2a641,0xea0ab882,0x5f0f0f0f,0xf24bb8c6,0x8a896a5e,0xe188b484,0x13070161,0xe254a042,0xbd613333,0xf6cfb502,0xbdb56461,0xf2eeb882,0x5a29adac,0xff10e1e6,0xe9e6e8fd,0xf6abe9a4,0xfbebeeed,0xf649dd66,0xbf3f3f6a,0xfa89bca0,0x7fbfbfbf,0xf26abc00,0x9e76357a,0xe1c8e164,0x4a1119ae,0xf6add5a6,0x9f5e0459,0xe1aab4a2,0x4800014f,0xede9dd66,0x9aa0bc4e,0xea2cd144,0xc1859a4f,0xea09d164,0x95450009,0xe167c0e4,0x4e051594,0xe5cdc906,0xfbb60051,0xee29d102,0x936ebefe, 0xf6ecd984,0xfffe1020,0xee08b4a2,0x3f7fffff,0xfaebdde5,0xf3fa683,0xfaadd184,0x686cae8e,0xfaace1a4,0x8f9f3f3f,0xf66cd564,0xbfae9f8b,0xf68bea28,0xd3875b9b,0xf228cd02,0x87c7e7f3,0xe608d104,0xa7bb6bd3,0xe1e9c4e2,0x7b5b8783,0xe60acd24,0xc393571b,0xe9e6cce4,0x87d7dbd7,0xede9c0c2,0x1b2e3bbb,0xe1e9c4e4,0x5a4a0b1b,0xd9e7c906,0xdaf9b8e4,0xee49e1c6,0xfe6a0bc7,0xea09cd44,0xa5e68f0e,0xee6bd9a6,0xf9fbffba,0xee8bd5c6,0x164e8eae,0xee4ad544,0x5b0a0d15,0xe1aad124,0xbe9ac2e5,0xf24bcd22,0xc6c11075,0xe1e9d144,0x57574747,0xfe0aa400,0x57671717,0xd925a466,0xa9aa6955,0xdd88c944,0x3b9ec4a4,0xc108ac42,0x97572767,0xd586c084,0x1535797,0xd671a000,0x50a6f7a,0xc4c4b8a4,0x555559,0xca0f9c00,0xb317579b,0xd167b882,0x3a5633b7, 0xcd07bcc4,0xe6d44486,0xe5c9c904,0xf9d8a460,0xe5e7cd04,0x59fdff7b,0xc0c5c084,0x551515,0xce71a422,0x4a4e4eaa,0xd526c904,0x555546,0xd2319822,0xa6affffb,0xf28ccd64,0x56bff3e3,0xe60ac522,0xc5c1c040,0xee0bc926,0x92c78b8a,0xee28d146,0x272b5e86,0xf2acd986,0xdbdbbbbb,0xea09e1e6,0xa17377a3,0xe5eac0c4,0x6dbc6582,0xe1cac4c2,0x3d3975b5,0xe5cabcc0,0xf464a579,0xe1c9cd04,0x5d4e4f7f,0xfaacdda4,0xecedeeae,0xfa6bdda4,0xd9c9d0e0,0xf20bd544,0x9a8fc6d5,0xdda9c4e4,0xead8ccdc,0xf249e1a6,0x753172fa,0xe1a9d104,0x2f7b362c,0xe1e9c0e4,0xdf5f5f6f,0xdda8c504,0x44d0c0c,0xd56abcc4,0xb8786854,0xd148b4a6,0x5a1f1aea,0xcd28ac62,0x555555,0xced69402,0x54b8bcf9,0xc927b084,0x555555,0xd6b29802,0xb72323aa,0xd989b882,0xfea6b5b9, 0xdda9d524,0xc1c9cda8,0xdd67c4e6,0x72a0c5da,0xdd68c906,0x958682ff,0xc8c5c0a4,0x555555,0xe2f69442,0x65b67074,0xc528c0c6,0x550505,0xc5ca9042,0xf8fcfcb9,0xf2adb564,0xbbdaa5b8,0xf269de08,0xedad3d2c,0xfeccd5a6,0x7eb2a3ae,0xee4ad582,0xeefb8b5f,0xee6bee48,0xedeefefe,0xfecdc104,0xbfbf3f3f,0xf249d528,0xdbefebfb,0xe9c9b420,0x9699556c,0xf24bd164,0xa1723363,0xfe8bd964,0xdfdbd3b2,0xf6aafa88,0xc09948e,0xfaeee1e6,0xcb820251,0xfe2ce124,0xbafbf9f,0xe145c460,0xdfcfcadd,0xfa46edc4,0x2efefada,0xe0e4b440,0xebaa0050,0xf24ac4e4,0x2a276bbf,0xf62be5c4,0xfefe9541,0xe9e8ac20,0x92aeaefe,0xf64ad102,0x9f5e5c6d,0xf66be1a8,0xd091595e,0xf22bd124,0xafebd3d3,0xfa4bcd04,0x3f3fbfaf,0xf248dd64,0xffff5906,0xee299c00,0x9f8eefff, 0xfeecdda2,0xffff5505,0xf227b001,0x8b8fefff,0xff50f2a8,0xefefcfcf,0xfaabd184,0x4199ee,0xfecdee28,0xaf4e8a8b,0xfeeee1c6,0x4e4fdfef,0xfeede628,0xab26262b,0xff11cd20,0xe99996aa,0xfe48dda2,0x910b1f7e,0xee4cc0e4,0xee874350,0xf2cccd44,0x8f8b1b39,0xee0ce124,0xb9bedf4f,0xdda9bca4,0xdbcddced,0xfe49dd64,0xe0d090d5,0xf1c8b482,0x20353875,0xf24db4a2,0x751d1d5,0xee4cc483,0x683c3e7c,0xf2f1dde8,0xe1f6a58a,0xfe8bc0c0,0xe5d2974b,0xde07cce4,0x2abafafa,0xe1289820,0xefefdbd0,0xfaaed184,0x65469bef,0xf64ad524,0xefef6060,0xee28c0a2,0x4b8b8fdf,0xfb0ed966,0x7f5f4080,0xfaeeac42,0xaf2f6f6f,0xff50f28a,0x2f1f1f4f,0xff2fee08,0x2e0e4f6f,0xff4ff28a,0x9e4d5eaf,0xff2fe628,0xbe1f0fab,0xfecdea6a,0xff6a150a,0xed869402,0x7a246fbf, 0xf6aae546,0xba3d3814,0xdd24c480,0x110b4ba,0xfe6be184,0x152f2b7b,0xfa8ae9c6,0x17534010,0xf20add24,0x11425551,0xee0ae184,0x61e1a656,0xf24cd102,0xce8cc9c9,0xf22cd566,0x8a9687cb,0xf24bcd04,0xb3372f2f,0xee08d524,0x9fabb7a7,0xf209e5a6,0x1e0f1b4b,0xf26add88,0x17131b1f,0xea0acd06,0x9f9b9e9f,0xf1e8e5a6,0x4f8e5f6f,0xe9cad104,0x3874cd68,0xfaacea48,0xf8bc5455,0xfa8bea08,0xe2f5f9ee,0xff2ff28a,0xfafefae2,0xfacef626,0x7dbcbdfd,0xf66ad544,0x59c4e4bd,0xf22ad124,0xe1e5a0e0,0xf6efc8e4,0xe0e0e4f5,0xfeeedd86,0x1f0f071a,0xe5c9cd06,0x1f4f4f0f,0xe1cacd26,0x6cbcc88e,0xdda8d146,0xf8341908,0xdd89c8e4,0xe6be1d4f,0xbce7a842,0x556556,0xc5ee9024,0xe2e69dfd,0xc527bc82,0x545595,0xde748c20,0x8ad9e879,0xe188cd04,0xbefd898a, 0xdd89c506,0xb1e1e5e0,0xf26be586,0xf67272b2,0xee0add84,0x692e1dba,0xd527c8e6,0x555569,0xdab69000,0x55206091,0xdd48c4e6,0x555191,0xd271a402,0x3f7ebf7f,0xfb2fede8,0x7f7fbfbf,0xff4fe9ca,0xb8b9b8f8,0xff0ef248,0xbdbcacec,0xfaabee26,0x5f0faf6e,0xff2efb0e,0x64a86aab,0xff10eaaa,0xc7c6dbeb,0xff0ff68a,0xd7d7d7d7,0xff0df1e6,0x170b1f1b,0xfb0ecd04,0x16161717,0xf1cac0a4,0x2814a060,0xf1c8dd86,0xd0d0a169,0xfaf0e1a6,0x15181511,0xe5a7c4e4,0x75296829,0xe989b4c4,0xd490a0f4,0xee0ac8e4,0xd4c4d8d4,0xf62bc8e4,0x992b6f69,0xfaadee6a,0xa3f6eded,0xee0ad186,0xd7d78383,0xfa4ae9a6,0xab4f4f97,0xe5eacd04,0xb6b2a7e3,0xd968cce4,0x5565a6,0xca509400,0x55bab8f4,0xcd29c8a4,0x555555,0xeb398400,0xa79b9a69,0xee08bc82,0x68697ab7, 0xddaabd06,0x6cf8b878,0xf26bc4e4,0xb1a0e498,0xe188b8e4,0xa6fe7e5d,0xbce7bc62,0x5599a,0xd2718400,0x9afb67b2,0xbce7b862,0x155656,0xe2758800,0x4f1f1e03,0xe6afc9c8,0x1f574f8f,0xf777c5aa,0x79b4a8e8,0xf379ce70,0xbcbcb838,0xef79d6f2,0xcfcf6f2e,0xf756ce0a,0x30b1f4b,0xf312c986,0xf6f6687c,0xf7bace2e,0x4050b5f5,0xf39ac9ec,0x4b9bddd0,0xeb9bca50,0x91835357,0xf3bbd6b2,0xf675602,0xe26ec544,0xb4b4a0b,0xe6b1c986,0x1a521272,0xdef6d690,0x7d7aab5e,0xf7dcce50,0x154bbb17,0xeef2d22c,0xa0b0e2b1,0xe2d0ce08,0xb1f0f07,0xeab0cd86,0x1010784d,0xf333c5ca,0x1a1f1e18,0xda91c102,0xa0d4e0e,0xfbfec986,0x3474f834,0xf355c5ec,0xc1e1a568,0xeef1c124,0x3b0e0f0a,0xef15d5e8,0x52a0f2b,0xe2b1cd46,0x445468,0xd1c9b904,0x220e0940, 0xe609c124,0xe9e62716,0xe68ecdc6,0x54404044,0xce6ed186,0xe5c8d8f6,0xf2d0c986,0xdcacb7f1,0xff95c9e8,0x9391d054,0xef13c984,0x1f4af2eb,0xf731d1ea,0x2d2d5f6b,0xefbdde4c,0xbae9291c,0xe713ca0c,0xb47971bb,0xfbdedf14,0x556aa7f2,0xf37ad6d4,0x5c64f576,0xe716c60e,0x71456a5d,0xe735d690,0x3e174747,0xe759d6d2,0x7a6c481a,0xdf16d6d2,0xa0beaebe,0xeb58d6d4,0x4884c1c0,0xdb1adaf4,0xddccc8d9,0xf797de2a,0x86cedfda,0xf355eace,0x96955880,0xd719d6b2,0xd5958996,0xd718d6d2,0x3b0f4f9b,0xded2da08,0xffbf3e6e,0xe2f4d62a,0x5a5d1e7a,0xe338d26e,0xf7b3574b,0xeb58db14,0x6ebdfe97,0xdf16d2b2,0xe5e4e499,0xdf39d6b2,0x839a79f6,0xfffebdcc,0x70b08185,0xef35c588,0x97495595,0xeb58d2d2,0x2b577777,0xefbbdaf4,0xd9e9aa96,0xdef5ce90,0xeaea9d49, 0xdad2ca6e,0x61fbffb,0xdab0d5e8,0x57170605,0xda6dd986,0x7172966a,0xdaf4ce90,0x560d0d45,0xf399def2,0x8192112,0xde07d164,0x3d393968,0xde4bd584,0xf7b382c1,0xf775da6c,0xe793e7f6,0xffb6ef10,0x93331b0a,0xe290bd44,0x21bffea,0xf2efc146,0xd3c2d2d3,0xffd6f70e,0xb0d0d2e2,0xf752f28c,0xb2f2f242,0xf333e66a,0xb3b3b2b2,0xff74e668,0xc385445c,0xfaefc0e4,0x292d7896,0xfb73f6aa,0x4f4f5f37,0xfbdac5ea,0xafaf4b0f,0xf7bbe28e,0x294e8753,0xff73e66c,0x2e3e2e2a,0xfb30e9e6,0xcaaefefe,0xffdada6e,0xe8f8fcca,0xf375d60c,0x49a7f3f1,0xff75e28e,0xffafeaca,0xf710da8c,0xb03070b1,0xf772faee,0xb07074b8,0xff73ee6a,0xfebfbefe,0xf731c966,0xca1f3fff,0xf6efc5a8,0xb5b5f5a4,0xeecde1a6,0xbb9100a5,0xe20ca880,0xbe295a1e,0xff96eaac,0xfcbdbaba, 0xff53d988,0xa8f8f8fc,0xf796ee4e,0xd6d4f0e4,0xfb96ace2,0x7a7fbfad,0xf2ced66a,0x5fb8220a,0xe62bc904,0x1687cbda,0xeed3a8e4,0xd6e36829,0xeaf7a548,0xb3c1d8b4,0xdeb1de90,0x20193d3a,0xf7b9dad2,0x11060b3f,0xe758d6b2,0xc0e1f231,0xffdcdad2,0x7ffff7f6,0xfbb8def2,0xfbbb6066,0xffd9ef32,0x337ff2c1,0xfbdcdef4,0xfc0520a0,0xf7dcded4,0xb1a6a7e1,0xeb9ace92,0x598acde9,0xfbdeeb58,0x292e2e3e,0xe2b0d5e8,0xb1b8cd06,0xfb96d690,0x2f7f7d7e,0xf7bcb58a,0x1e1f1f2f,0xfffdb988,0xb67e3572,0xfffdf730,0xbebfbbf3,0xfbdcd22e,0xbbf7f5fb,0xf356c1a8,0xeeefefff,0xffd9e2c8,0x78bcfefd,0xf39bb98a,0x610e5f65,0xfbbbbdee,0xabe2e4ec,0xffd4e24a,0x7f77b0ab,0xfaf0cd64,0xeaf6f2f1,0xef58e270,0xa4b773ba,0xf378d290,0x3f336315,0xffdead4a,0x2f3f6b6f, 0xf796cde8,0x7c7db9ad,0xfbdde22a,0x4984a4b8,0xfb55c124,0xf2fbfb6b,0xfffbc9e8,0xe4e0a0b0,0xff95c904,0x14581505,0xc9cbb4c2,0x7b73b3b2,0xfbdad5e8,0x9adaeae2,0xf39aff0c,0xd0585d9d,0xff94d22a,0xa4e5abab,0xe315bdee,0xa5263494,0xe337c62e,0xea89c4c5,0xe715da4c,0x1162e4f6,0xea8dc144,0xfeeda6e9,0xdad4ce92,0xeac5debe,0xdf16daf2,0x2a2b5ae6,0xe737dad2,0xfbeaaaba,0xdf16c64e,0x936a767,0xf379dad4,0xff9e0b47,0xe337d290,0x2f2f3f3f,0xdad38000,0xbfbbff7f,0xdad2c5ec,0xfef9fdff,0xd6d48440,0xf4f9afaf,0xe2f4e2d0,0x80828a45,0xea05cd44,0xc448898d,0xe1a6d186,0xbefefdfe,0xdab18062,0xaafdfdb9,0xded39d28,0x4194a050,0xd20ccd84,0x8ace8e82,0xfaefd20a,0x33575a6a,0xf377ce6e,0x1c4c462,0xe756d6d2,0x647ebfbf,0xe2d0b502,0x6676060, 0xeeaeb924,0x85c69670,0xeaf2da6c,0x41c5c581,0xe28ed60a,0x99353506,0xfb78c9a8,0xcece49d9,0xf758ca08,0x90828140,0xde4bc5a8,0x431f180,0xef36d1ec,0x61a1e7f7,0xeb58ce4e,0x1a297967,0xf7bad270,0x2ac6eaee,0xffdbca2e,0xe3b7aa39,0xf799ca2e,0x3636266e,0xeb35d26e,0xf0201637,0xfffcca50,0xd6c5c1d3,0xeb35d68e,0x151480d1,0xead1d62a,0xf8fbeb6f,0xef35ca0c,0xd76ab8f4,0xf333ce2c,0x1fbbf6fe,0xe736a0e4,0x8a2ffbde,0xef16b96a,0x445b5fca,0xe290c986,0x9c742000,0xf756c1ca,0xa0c00051,0xf377c1aa,0xaae7c2f0,0xf7bcd24e,0x91c1e5f5,0xef7ad270,0xfd930314,0xef9adad2,0x15140112,0xfb77cdc8,0xbb3b5449,0xe6f3d20a,0x8dc7daff,0xfbffd6b2,0xfcfcdc8c,0xf7ffceb2,0xbb4788ea,0xf2f1cdea,0x5b17ffbe,0xf7baeef0,0xfcacfeff,0xfbfcdeb0,0x608199bc, 0xf755ce0a,0x41c89064,0xfbdbded0,0x28752560,0xeb34ce2c,0xb097d7b0,0xf756bd44,0xbaa4fdf0,0xf7b9e2ce,0xf42c184,0xfbdcce0e,0x8f57373f,0xeb35a8a2,0xc7e6bf7b,0xff31de4a,0x3a1f7fff,0xf6ced1c8,0x16170705,0xe359de6c,0x5083c645,0xf756b504,0x292d9a92,0xffb3d584,0x5c1c1c99,0xff93facc,0x9efe8a51,0xffbac1cc,0x5f0e4a5e,0xfbdbded0,0xfd7c1ccc,0xfb98d5ef,0x2babafae,0xfbfed22c,0xf9f0f4b9,0xf7bbc186,0x280052fe,0xfb569c82,0x6f3b7333,0xffdbef54,0x8bcfeffb,0xf775c186,0xaaa8be3e,0xfbffffb4,0xf0f1ebfe,0xf378c9ca,0x2f4d885d,0xff95f30e,0x8e4f2f6e,0xf357cd82,0x4b0b0f4f,0xffb9d5ea,0x6f87876f,0xffbbb968,0xf2e19185,0xff2f9c82,0x7e6dbeb6,0xff97fe84,0x83d7bb3f,0xf798da4e,0xb3a1b0e6,0xff97ad4a,0xf3d3c3c7,0xffb8bd66,0xb3e3ab73, 0xffb6c5ea,0x70301d0,0xfb5ab4a2,0xffff2b07,0xfbdab16a,0xb3b3b37b,0xfb54d1c8,0x923776b2,0xfb74eece,0xf3bbbffe,0xfbdbda92,0xfae4a4b2,0xfbdaef0e,0x4f6b3fad,0xf39ad24e,0x7e5e4f0f,0xf399c5ca,0x81e1e7e,0xf754cd88,0x76616000,0xffbab4e4,0x2e2f7f7e,0xf754aca2,0x9f8f8b5b,0xffb8d60a,0x393dbdfa,0xf356bd46,0x761e2f3f,0xff74c588,0xf4f0d0f3,0xf756b903,0x54242cfc,0xe66dbce4,0x2040e4f,0xfb76bd06,0xf8e0d093,0xfbb8bd88,0x4001102,0xe66db8a2,0x4f5dbc7c,0xf2cea420,0xfcbcbcbc,0xfbdac20c,0xf5f0f8b8,0xf775c188,0xdcdeaf5f,0xfbb6dece,0x5e4c8dcd,0xffb6f30e,0x92d2f5f1,0xfb94f30e,0xabffdb83,0xfb31de28,0xf1faf6f,0xfb74ea6a,0xcb8f1f9f,0xfb51eeaa,0x3e0f5daa,0xf2efea8a,0x2f292416,0xe649c0e4,0x1d3f4f4f,0xf2aad565,0x9d6c5828, 0xf6addd64,0xc71aaeeb,0xfb74e68c,0x90c4d2d7,0xfb75c9a8,0x5c484c5c,0xfb0fe5e8,0x1169ad5d,0xe9e9dd42,0x53535353,0xff73c165,0x160696a1,0xf2afd1e8,0xd5d8e8e1,0xfbb8f6ec,0x6aaeeeee,0xfb52ca4e,0xe7f7bbab,0xf6acc942,0x7aa469eb,0xfb11d584,0xfefe2e17,0xf6eee66c,0x1aa9b9fa,0xff34cd46,0xae1e0e6f,0xffb5faac,0x5eefbfbf,0xfb33b440,0xf4e0529b,0xf68ed162,0xf4f8f8f4,0xf333d54a,0x1e0b8bc9,0xc2d3a924,0x157fabd,0xfb56b250,0xdb2a39b4,0xf357c62e,0xddfefbfb,0xfb9ab1ce,0x64703810,0xd738be92,0x43c6ba6a,0xd26facc4,0xfeeaa806,0xee6bd566,0xbe7cfdfe,0xff0de608,0xffff9500,0xf26ba800,0x653ebeff,0xfeaccd24,0x12bfbeff,0xfecde5c4,0xbc7c5e0b,0xff0ef2aa,0x656a1a10,0xedc9d544,0x367bd7d2,0xf209c4c0,0xdefe6c08,0xee91bd02,0xd0d0c085, 0xffdaee0c,0x6f665002,0xd2f5b548,0xa2c56e3f,0xff74d60a,0xe1e4d4d0,0xffbaea0c,0xe4e0a050,0xfbbbe1ea,0x42635363,0xff73da2c,0x3f7f7e65,0xfb74fe48,0x793440ee,0xd22ca8c2,0xa945a5d4,0xd290be0e,0x850a1b59,0xffffa0e4,0xffd7b2e0,0xffb9d24e,0x9e4e49d5,0xe6d1a082,0xffea55a9,0xeb38b18a,0x95c64bdb,0xef79be72,0xbbb54001,0xfb77ce4c,0x4fcfeaf8,0xeb35a4e4,0xb36f5e5b,0xce919946,0xbdbfbfbf,0xf7329ca8,0xfab960a4,0xe66d9040,0x261259e5,0xba93c22e,0xbebff9a5,0xeaf3bd04,0xc4d4d1e2,0xe68fc1ea,0x4fdefbea,0xe26fd5a8,0x50410548,0xddecb9a8,0x56d4c200,0xd2d1b9a8,0xfeda451a,0xff31cd02,0xc08191b5,0xc670be2e,0x2121257,0xe653be4e,0x2a021241,0xef14be2e,0xe0e4f4e0,0xbe71ce08,0xe0f0f0e0,0xc24fc1ea,0x69150615,0xce90b186,0x3a3e266a, 0xc22eb9ca,0xd5e1944c,0xe22cbdcc,0xddc0c0c5,0xfb0fce2a,0x1e1b1b2b,0xc692ba4e,0x197d7e5e,0xd2b3ba0e,0x7074bcbd,0xfb31d9e8,0x6cf4f4b8,0xf24ad5e6,0x1d8e8d6e,0xfff4f2ac,0x4b8f4e0e,0xff52f68c,0x7e7a3a36,0xff10e164,0xaa7b7fbe,0xfeedda48,0x5f0f4947,0xffb2facc,0x9f8f5f6f,0xffd4ee8c,0x92d5efef,0xfe8bf2ae,0x9acace8b,0xfe6ae5a4,0xe9e8e5e4,0xfffff22a,0xd1d8d8d9,0xfbdee586,0x3f3f3f3f,0xff93fe6a,0x1f1f2f2f,0xfbb6ff2e,0xe5e0d0d0,0xffdadd88,0xe0e0e1e1,0xfffae1ec,0x1f1f1f1f,0xf795fb0e,0x6f5f5f1e,0xff95feca,0x5f83cfdf,0xfeabe5e6,0x895e1a2f,0xf64cc8a2,0xe4f8faaa,0xfe6ad4c2,0xe0d4d5e5,0xedc8c8a2,0x96df5450,0xcd08b442,0x555555,0xd24d8000,0x52028a91,0xd862ccc4,0x555555,0xbe109800,0xe8e4d0e0,0xfff9ddc8,0xe5d4d8e8, 0xff96e1a6,0xab8f8f5f,0xf6cdd162,0x6b1797bb,0xfaceee28,0xe9e9daea,0xfbb3fe6a,0x559494,0xff34b840,0x7f3f7f7a,0xf648c904,0x565a2a,0xf6f3b420,0x2e2a3b3f,0xffb5d208,0x6d2d6d7e,0xff31cda6,0xb4b4b4f4,0xc692b9ea,0x787878b8,0xba73b9aa,0xece8edf9,0xff93fe6a,0xfdfcfcfc,0xfb52d904,0x1e0f1765,0xf310c5ca,0x8b8b1f2f,0xff4eee46,0x1408005,0xf2ccc64e,0x10000004,0xfb11ca2c,0xaebff6b8,0xfeabf5c6,0x7f7f7fbf,0xff50feaa,0x7e7c34b0,0xfb33be8e,0xbc7cb6f,0xef34ca2a,0x7070383e,0xfeefddea,0x6db8f0a1,0xfaefe20a,0xfcfcf8f9,0xfaf0c8e6,0xbca8a8e8,0xf2addd04,0xe5f0e29b,0xfeeddda2,0xe9d4e9ea,0xff50fea8,0xa4e4f8fc,0xfa6dd104,0x455150,0xde94b020,0x95e5e5e9,0xe9e9e8c2,0x555555,0xf758a420,0x1e6f6e1e,0xfacbe226,0x93a7bf6e, 0xf68bea08,0xa0e5e1f,0xff52e5c6,0x2e3e2a0a,0xf64bd986,0xe5a0d5d7,0xfe47edc6,0x5555aa,0xf315b020,0x8687c70b,0xe589d104,0x519595,0xeeb1a420,0x39396d6e,0xef75fe8a,0xd3d1d85c,0xf6adc5a8,0xbebf7f33,0xef56ca30,0x1f6fbe6d,0xfb97ad88,0xbcbc7c7,0xf68cd184,0x67fffe7f,0xe9e9bca4,0x98e0911b,0xf2d1b880,0x459f8fad,0xee6ed586,0xfffcfcf4,0xf354b943,0x904419fa,0xc9cd8842,0x95e5955a,0xf3d9c188,0x590b0140,0xce70a968,0xfffffea0,0xfb31d288,0x4d9b6abf,0xfacde188,0x45fe3f56,0xf2cfe28c,0x65b9bc15,0xf66de9a6,0xfd6d2000,0xf68dd944,0x8d9d4e9d,0xfe8ae608,0xebd24504,0xfaeee5e8,0x978b6eaf,0xfb32f6cc,0xad2e2e1d,0xf68ce1c8,0xc4cddd6d,0xfeaee5c8,0xa61f2f83,0xfaeeee8a,0x13caee65,0xff10face,0xbfeba604,0xf731f248,0x4e1eafaf, 0xffd5f68a,0xb666b410,0xf26be228,0xd4e0a4fa,0xe6afd20a,0xbddb9b5a,0xff0ef28a,0x5f8f4f6a,0xff72facc,0xa5f2a150,0xdeb1d22c,0xe4c4c1c5,0xef12e26c,0x1eae6e8f,0xff10b860,0xacec6519,0xde8f9cc2,0x42d3e7e,0xc8c4a060,0xfafff0c0,0xe1e99800,0x7f58842d,0xeeadd1c8,0x90faffbe,0xfa8cd9a6,0xccc5ebfa,0xfa4ae9e6,0xabbebeee,0xe9ebd126,0x5c7d3d3d,0xe1a9c0a3,0xfbd20204,0xc5aa8400,0xbcbeffaa,0xd167b8c4,0xb82e0f4,0xb9498c00,0xd0d1eaff,0xd1c9b146,0xa4e98a96,0xc1ccacc4,0xffbf3f1b,0xb9478000,0x99ebfbba,0xe1cac128,0xaf6fde88,0xf68be206,0xb9c0f0b9,0xea6cc9c8,0xa3ef7f3a,0xdde9c544,0xd6f6babb,0xe62bd1c8,0x4ededbf5,0xf6efea8c,0x6f6f2d4c,0xf312eeae,0x73590f0b,0xe66bc9a6,0x1d1e0eb5,0xeeafce2a,0x666eaa10,0xc9aaac84,0x47bb7426, 0xc9c8c586,0x99e6e641,0xc5a8bd44,0x85c79b59,0xc9ebbd66,0xa4ac5949,0xd22cbd88,0x296cbd6d,0xc9ebb946,0xaafacecd,0xc60bb1a8,0x69fa7a79,0xc5ebb988,0xc0c0c4c4,0xf70fee2a,0xe4e4d8d5,0xff11d944,0xae474717,0xff2ffaee,0xaeacacad,0xff51da06,0xe8a8e8e4,0xfb32fe28,0xcde8e4e4,0xff32ea4a,0x8f878baf,0xff71feee,0xb834638f,0xff30eeee,0xafae9d5f,0xff72fb0c,0xaf2f9fef,0xff50eeaa,0xf7f3f2f1,0xfaefea2a,0xe0e6a3f3,0xf6cee20a,0x5b1f1faf,0xff73f648,0x1b1b2f5b,0xff50ee28,0xa9e9afe9,0xfa6cd9ea,0x37d949ea,0xfaadee4a,0x2d9dddcd,0xff32ea6c,0x2d3e6f6a,0xfacfe208,0x4dae8cd9,0xff0fee68,0xee3b3b5a,0xfacde648,0xb570746c,0xf1e9d502,0x5556a6,0xff75b000,0x5e1b429a,0xf1a6e164,0x55595a,0xde93a400,0x1a5a161f,0xfef0e1a6,0x8f9b4a16, 0xf22ce586,0xc3577f77,0xfa8ce629,0xb17377a7,0xfa6ce1c6,0x62eb3c3,0xd127c0e4,0x11511,0xf31a9c00,0xa5b8b8b5,0xedc8d0a2,0x6555a5,0xea53a400,0x3d3f3f3f,0xfb52f2cd,0xbbb7786c,0xff31f2ca,0x8a4b5659,0xe28ebdea,0x21356e8e,0xfad0e60a,0x75b6bcac,0xf6cdca0a,0x9669b97b,0xfacee628,0x8cbc4552,0xe26ede2c,0x7e6a240c,0xf6afc9c8,0x9e2e0909,0xce4dbda6,0x99d4e3ab,0xea6dc544,0xe8945559,0xc68ec5ca,0x50a0f4f5,0xda91bde8,0xb3ad7e2b,0xee0ad944,0xa7bfbe36,0xf208e966,0xa4bc78a4,0xca50b1cc,0xd1f26d4a,0xea4cddc8,0x49d0aa63,0xf6acf66a,0x1e8d4ac6,0xfaade608,0xbf0e97e,0xfa6ce5c8,0x44adbe2b,0xf22de1a8,0x6a3a76de,0xe9cad8e4,0x555555,0xfb9aa820,0x998daaa9,0xdd28ccc4,0x555599,0xe6f7b000,0x30053c90,0xe1abdd68,0x347d6ca8, 0xee0bd126,0x41347bd7,0xea0bcd46,0xb85194e8,0xee2dcd26,0xb9b4e5d9,0xdd6ac8a4,0x1556a6,0xdeb48000,0x8ace8494,0xd949cce6,0x55a5aa,0xf337a000,0xaaaaffff,0xe3bbde50,0xbf9f9eae,0xeb79e336,0xbfbebeff,0xf3bbca2e,0x9eecaebe,0xeb58def2,0x1f1b6fbf,0xe338d2b2,0xbaffffbf,0xeb79d6d2,0xbe6e2e2e,0xf399dad2,0x2d2fbebd,0xeb58d6b2,0xd9d9edfa,0xebbcd290,0xe4ecf5e9,0xeb79dad2,0x7f7fffff,0xe737a54a,0x6e7bbfbb,0xef79daf4,0x5e4d490,0xe358d6d2,0xd7f7a519,0xe737d6d2,0x243d7d6e,0xeb57e338,0xe7b7cb46,0xef9ae736,0x6135362a,0xef9bd290,0xef6a2651,0xf7dcd2b4,0xbdfffea8,0xef78d2b0,0x396c6c3c,0xef9ae314,0xfefffcfc,0xeb79bdee,0xbffaeffe,0xe758dad2,0x7e7effaa,0xef78d26e,0xfab87c3e,0xf399bdec,0xe6fbd78b,0xeb59df14,0x95e4c0d0, 0xeb5adaf4,0xebe7ebdf,0xf7bbbe2e,0xd2c2a7af,0xf3bae754,0xb7bffe99,0xeb79d6f4,0xaeded5e2,0xeb7ad6b2,0xafb75686,0xeb7be736,0x2165e999,0xe758c22e,0xbfafbfbf,0xeb9bdeae,0xb5bcbfbf,0xeb58d290,0xa9a9fdff,0xfffdbdec,0x9acf92a5,0xe756e312,0xedabaeab,0xe77ae712,0x686e3e6d,0xe337e2f2,0xb0e0d0c4,0xe779df12,0xad98a5b0,0xef79d6b2,0xaabaffff,0xeb78d630,0x3f3e2aaa,0xeb58d290,0xfefeffff,0xef9b9d02,0x5976fafe,0xeb58d2b0,0xbebdbd1f,0xeb7ad692,0xf9feefaf,0xeb7ae2f4,0x8549e8e,0xeb55c60e,0xf4b9a899,0xf39bdaac,0xf0f2f2e9,0xdef38462,0x7a7abff9,0xeb58bdcc,0xbe92d2ce,0xeb36e2f4,0xbcb4f0ed,0xe737d690,0x6fbf7fbe,0xe336c5a8,0x3f3e3d3e,0xe315e6d0,0xbc1c1cdc,0xe2f4b5aa,0xa4c0fcfd,0xe315d290,0xdeddfeee,0xe759ce70,0xeadecedf, 0xef7ab9ac,0xccf8fdf8,0xe716daf0,0xe294b046,0xe713d66e,0x26a6f6a6,0xf7dcca72,0xd5add955,0xeb9cd6b0,0x5997db97,0xe715da8e,0x8297675b,0xe6ced208,0x1f1fffbf,0xe737e2f4,0x4b575b9f,0xf39adf14,0xa5de9fa,0xef34b5a8,0xbcfdfaea,0xef76ca0c,0xbf56568b,0xef99d6b2,0x8f6fbbbb,0xf39adef2,0xf9fcbdb8,0xef56dece,0xf9f5f5b9,0xef36f34e,0xc6c3d66f,0xe759def4,0x978bc2d2,0xf7bce2f4,0xd6eaedb6,0xef78def4,0x9e8f4a82,0xf3dce336,0xafbafb93,0xeb78def4,0xbfebe2ee,0xef79d6b2,0x427fae6a,0xf7bcdf16,0xfaf9faa2,0xf39be336,0xbfbfbf9f,0xf7bcbdea,0x557fffff,0xf7bbdf14,0xfdfcbdb9,0xef33b166,0xbefefde5,0xef54e2ac,0x1f1f7ea8,0xfbdceb34,0xcf9fabbf,0xef99d270,0xfffff272,0xef54cdea,0x6f2f3fff,0xf355c9e8,0xacbebdbe,0xef78d66e,0xd88db9bc, 0xef57e2f0,0xb3ff8f4b,0xeb59d6d2,0x6fefefb7,0xf39aca70,0x8d8cf9b9,0xf355d24e,0xfaffbaad,0xf397c60a,0x8589a434,0xf798dab0,0xd8a9f765,0xf399e714,0xaf6f2f7f,0xe337de6a,0x2dbe7aae,0xe716d20a,0xe4e494a5,0xf7ffc1ea,0x8dd9a898,0xeb37d6f4,0x2979692e,0xef78dece,0x8e493a36,0xef79e2f2,0x96977bab,0xe738d6b0,0xdbf3f2e1,0xe716d6b0,0x22b6f6a1,0xf799da90,0x5e1e0a52,0xe35ad22c,0xd6d29554,0xf354d24c,0x74f4b9b5,0xe6d0cdc6,0xba8a4e2e,0xeb14da6e,0xaf3e3eae,0xe736ce0a,0xfe7d3e2d,0xe68ca8c2,0xce5d3cad,0xeaafc5a6,0xd94c4dae,0xef56e2f0,0xe9e27e9b,0xef34da6e,0x88599f5b,0xeb57e2f2,0xd898a9dd,0xe715d66e,0xf7faf8fc,0xef57de6a,0xbbf9f8f6,0xef56deae,0x230448b5,0xeb15d24e,0x7571b373,0xe6f3bd66,0x6f7f7b6f,0xe316d62c,0x773f1a1b, 0xeb36ca0e,0x95455add,0xf30ed60a,0xe9a97669,0xeed1ce06,0xafbf8683,0xeb56d68e,0x28baeb8f,0xeb57deb0,0xd0d1b4a9,0xf376e22a,0xf8b8b8a4,0xeb14ee88,0x5f5fbfbf,0xeaedd5c6,0x2c7d6f5f,0xea8cd1a4,0x9444e9ff,0xee68d162,0x484dada9,0xe1c8cd44,0x2a692e2d,0xf2cecd84,0x8b8b0f2f,0xeaacd5e6,0xeeecb994,0xe607dda6,0x7574f9ae,0xea4ad984,0xebfafaf7,0xdda6c902,0x8bef5b1b,0xd5a7c0c4,0x5292f3fb,0xd924b8a2,0x450d1571,0xd947cd04,0xdfdb9b83,0xe5e7d142,0x54a4acac,0xe9e8c902,0x63726a1a,0xd145c4e2,0x87d78e0d,0xdd88d104,0x2b6bf6b5,0xeaefcda6,0x9d6e2b3b,0xeaadcd84,0xb874f4e5,0xee49e1a4,0x2d4adaea,0xe608c102,0x65150a5a,0xf2abe228,0x1e6fba6a,0xd9e8b080,0x9b0a091d,0xe1ebb8a2,0x42468797,0xcd889c00,0x1e695c49,0xe1c8d544,0x4c6f7f1f, 0xd146c080,0x74363303,0xd566c0c2,0x62b37a7d,0xd545c0c2,0xecac585c,0xd988a000,0xab6f65e8,0xd585bca0,0x4acf892,0xc0e5b482,0x78746005,0xd167b8a2,0xcbefffff,0xcce3c080,0xd9e9d8db,0xd966c8c2,0xeee7e7e3,0xd986c4a0,0xa0b2f7eb,0xe1a6d122,0xafdd6884,0xd925c902,0xcac4999e,0xdd86c902,0xc282d5d5,0xea08d944,0x83865491,0xe1c7d524,0xefdeaefe,0xe164cca0,0x561265ea,0xc927bc60,0x7071767,0xc4409802,0x92404003,0xccc4a442,0xa6879baf,0xd504a000,0xfffffeb9,0xd9459c00,0xe0d1d192,0xe9e7a820,0xe1f0f0e4,0xe5e8c4a2,0xecdcc8ca,0xd546bca2,0xca96a6ee,0xd546b860,0x173f7783,0xd545cd02,0x7d8faf6a,0xdd45d924,0xdfabd0c2,0xc8e5b020,0x4e8deaea,0xd945bc60,0xf2b195b9,0xc503b060,0xea954d9e,0xd126c8e2,0xbfbefdff,0xdd659c00,0x7fbabdbe, 0xd9669c00,0xf0b4f4d0,0xe609ac62,0xfcf4f4f4,0xea4cc0c2,0x3e2f2f2f,0xd946a402,0xa96a393c,0xd104a020,0xfcfcfcfc,0xddc6b0c0,0xe4e4ecec,0xee2bac00,0x3994f62d,0xe229c942,0x41193c39,0xe1cbb460,0xd8920342,0xdd89b082,0x5b999ddc,0xeea9b8a0,0x90c04040,0xe1e9a840,0x8b0f1f5b,0xea48d9a4,0xbb7f2f2b,0xe208b082,0xe15dadea,0xe608d184,0x1e4d5c5f,0xe1e8c502,0xecefdb4d,0xd586c0e0,0xb0b07275,0xd146b442,0xa9f4656a,0xd145b040,0xcfdfead8,0xe5e8c922,0xfdaeaeeb,0xe1c7d982,0x13ed5d4e,0xc947b4a2,0xab534105,0xc505a840,0x8b47a7da,0xdde9d122,0x3d00418b,0xd9ebac60,0xf2b3fffb,0xd586bd24,0xf15100f1,0xcd67b4a3,0xf8befbf,0xff0fd5c8,0xdf5e5429,0xeeabd1a4,0xb6b491d0,0xe1e9c0e2,0xb8f8c542,0xe1c7c102,0xb25172b7,0xd986b880,0xbe122475, 0xcd67b480,0x72a3e7e,0xdda8bce2,0xaab87d0a,0xd946bc80,0x6b1bbabe,0xe9e7d124,0x5d52464f,0xe1e9d102,0x6cd5c5ca,0xdd45d522,0xadac683c,0xe1a6d102,0xd773e7cb,0xc0c3b8a0,0xcfc7d353,0xc905ac41,0x5b89c6ea,0xcd45b460,0x4998481e,0xdda7cd02,0x4995880e,0xcce2b440,0xca954286,0xd546b460,0x9b8a4f0e,0xe5a6cce2,0xd58a59a6,0xd946b860,0xffbeafaf,0xd946a040,0xbfbeafef,0xdd66c8a2,0xe0e4e4e4,0xe9e7b000,0xd1d1d1d0,0xea29a801,0xe1b1fbff,0xdd87c8e2,0xd0c0d1e2,0xee4bd966,0xd6e3e2e2,0xea2b9c00,0x1e0f4e9d,0xde2cb460,0x64befdca,0xcd04b860,0xcdcd1e10,0xe5a8c4c2,0x8f89cbd6,0xd925c8e2,0x5d489d8f,0xcd26c8e2,0x9ddb81ca,0xdd85c4a0,0x5d0e4a19,0xe9c8cd02,0xf26296ea,0xdd86d0e2,0xb23121d5,0xe187cce2,0xa494f0d0,0xff97d144,0xd04654a4, 0xe187cce4,0x85c68b0b,0xf2b1b880,0xe6cd8996,0xe1c9c902,0x5b47c1e0,0xd989c0a2,0x438ae3f1,0xe5c8c8e2,0x64a5b3f3,0xe5c7bc80,0xe1f2b579,0xee2abca2,0xcfcfdada,0xef79eb56,0xf4f5fcf,0xf7baef57,0xefff7a2b,0xef32d22a,0x73f2facf,0xf753e6ce,0xaa6a9c4d,0xf798eb54,0x2f66a6ab,0xf378d66e,0xfdaca816,0xf375e2f0,0xfffffefe,0xf375daae,0xe5561676,0xfb97e2f2,0x3b3dfde4,0xef78ef54,0x67e582ca,0xef98ef32,0xc4c4e597,0xf3bbeb34,0x96babb66,0xf356e2f0,0x351492e1,0xf332eaf0,0xc2e5f4e5,0xef9be712,0xf6b9b7e2,0xf399e332,0xf1a26aab,0xf376e732,0xa2314685,0xf775ef32,0xcedfefff,0xf797ca4e,0x9cddfce,0xef54da8e,0xbd6e7f5b,0xf376e2d0,0xbd6c185c,0xef34bd66,0x1f5f4e0f,0xf7b8c1ca,0x1e1e1e1e,0xf3b8c1cc,0x3f2b2f3e,0xef33da4c,0x3e6d673e, 0xf312de6c,0xd8d896ea,0xf378e2ce,0x8dc6d6d4,0xf377d64c,0xb8f9f9bd,0xf352e628,0x662646aa,0xf2abe248,0xa0d5d9ad,0xf355eace,0xc3c74961,0xf355d64e,0x276b6b1b,0xf2f2b126,0x42835737,0xf756e28e,0xc2e5e677,0xf356ce0a,0x7e4577b3,0xeeeee6ac,0x6f2e7d9a,0xef12c9c6,0x381f6fbf,0xf335bd24,0x9ad0e8be,0xf6cede2a,0xeae5a449,0xff52cdc6,0xb44aaf5d,0xeaf1de6c,0x4fcce9f5,0xeed0a8e4,0x46a1f5f9,0xf732b924,0xa79b9f4b,0xffb7bd22,0x7d6f5b17,0xded1b922,0x3c449ded,0xf313cdc8,0xf0b8ac6d,0xf2efcde6,0xf9e8e0f0,0xe28dddc6,0x323b5259,0xead1cdca,0x7e6e4b03,0xeef1c9e8,0xdecacee6,0xf710e26a,0xe6e284dd,0xf730d544,0x3f6f5fae,0xe6d0cda6,0x7b2e0e5f,0xe6add1c6,0xefccc4e6,0xf28adde6,0x8e8fcf8f,0xee8cc0e2,0x3c3e6e2d,0xead1b904,0x6e496cbc, 0xddc9b0c2,0x29467571,0xf28ce228,0x7e3ada5d,0xeeaeb904,0x4940456b,0xde2eb4c4,0xf282ebdf,0xe64ab902,0xbe7f2ae9,0xf2abc0c0,0xe979666,0xde2f8c00,0xb1a0e6e,0xf354eace,0x5b0f2713,0xeb12e6ce,0x5f5c1d1e,0xf399ce50,0xbfaeaeaf,0xef56ce4c,0x4e0f8b8b,0xf732eace,0xc66fafaa,0xf753b564,0xcae6673b,0xef32d68e,0x5f1f5b8a,0xf354eeee,0x1b62d6d6,0xf2eeea6a,0x251a6e6e,0xfb51e628,0xb3beeeef,0xef33deee,0xfcadfeb2,0xef12f6ee,0x2a3f1712,0xf710e228,0xb5b9ae2b,0xf2cdc942,0xfee1b0bc,0xef11d62a,0xfcf9febe,0xf312bcc0,0xbebb7383,0xf379bdaa,0x12b7b7be,0xeaf2cdc8,0x9e42455d,0xf310e2ac,0xc88de9fe,0xf6ede68a,0xfa5d0a04,0xeaf2bda8,0xe4f04e17,0xeb12d66c,0xefd8dbea,0xf30eeeac,0xd7ffffff,0xf7119c61,0x7f3ebbfa,0xf2cce626,0x7fbe3177, 0xf6efd9e8,0x6798befc,0xeacedeae,0x90a0f5bb,0xff95b4e0,0xbf3f3f7b,0xee8bbd02,0xefef3b3b,0xf70ff6aa,0x92ebedc4,0xeef2b0e4,0xfdfeac18,0xf331bd44,0x1b0e5f2f,0xeef0cda6,0x9f5f5f6f,0xe2efee2a,0x6b4b8ad9,0xf24ae1e6,0xf1548547,0xea06d5a4,0x2e3e2f8f,0xeeced5c6,0x460b0b1f,0xeaeee1e6,0xa7c3d3f2,0xea4ad164,0x1571435a,0xee29dde6,0xf6ffc6d2,0xd1eab0a2,0xd4c90f17,0xf2cfde08,0xfcedff6f,0xe1e5a862,0x85e5fcbd,0xe1e6d984,0x2a687095,0xea4ad1a4,0xd9e1e267,0xeecfbc82,0xbf3d7ad3,0xea4bc122,0x2a5b6b9b,0xea6aea06,0x9b1f4f46,0xee8ce206,0xbb6e1460,0xfaadb480,0x5d1f4f57,0xea28e1a6,0x162775b8,0xf26cc522,0xb333b672,0xf2acde06,0xa7271b69,0xfacfd584,0x767baf9,0xea2ad122,0x6733e7cb,0xf249e5e6,0x6faf6ffe,0xee6ade6c,0xafabe2e2, 0xff2fb040,0xfffab616,0xee69d5a2,0x75f5efb,0xea29d9c4,0x74faf6f,0xeeabe606,0x369fcfef,0xf6cdd9e6,0x464cac42,0xf6ade208,0x6b2367ab,0xfaccee48,0xcac9c9ca,0xfb51dde8,0x5fbe2d4e,0xe629d182,0xa8a96fe,0xe60ac0c2,0xead9ac15,0xee6ad5e6,0x393c6e4f,0xe28dd1a6,0x4a2b3f3f,0xf28cbd04,0x85865b9,0xea0acd22,0x74b4f2b6,0xe5e7dd84,0xf1995c6d,0xede7d942,0xfac98ba1,0xee07d562,0x89edfdfd,0xd945bc80,0x65705445,0xe587d104,0xf0f4859b,0xe1a6d122,0x8e9e9dd9,0xdd86a400,0xbeb91005,0xd987d100,0xcbc797be,0xd544a020,0xeda8a54a,0xf731d5c6,0xbcbfbfaf,0xf2cdb900,0xaf8bdde8,0xea07d9a4,0xebebebbf,0xf6abcd22,0xffada8b4,0xf2acc524,0xa8d7c5fe,0xe608c122,0x7b2f6eef,0xe5c4cd24,0xb3dbd62b,0xee08c8e2,0xadee4f8b,0xe1c7c0c0,0xf8aeabba, 0xe5a4bc80,0x96d1d9db,0xf1e8c0c2,0xc39a9f9a,0xd546b8a2,0x9cdc98f0,0xe9e9c8c0,0xa1d1eaa9,0xe5e6a840,0x7e9ece8b,0xdda7cd02,0xd7932e7e,0xe1c8d964,0x97c0c8ac,0xc925b880,0xd7d79b5b,0xea08cce2,0xa092e2f2,0xee08c8c0,0x87c291d0,0xe1a6d502,0x3635282,0xcd46a420,0x3424203,0xd18aa442,0x804103,0xd966ac80,0x13219014,0xcd46c4a2,0xac2e1e17,0xe186cce4,0x4c6c396c,0xe5c9cd24,0x6171f4e1,0xe186bc82,0x55f2a090,0xe5c7cce2,0x1727fad4,0xee4cdda6,0x6dfef5a5,0xee8bd9a4,0x92a196a6,0xee0ac4a2,0x8a0b4b87,0xe167c0a2,0x45061353,0xc545a000,0x4f6f5b56,0xc905b440,0xb0b0b0a1,0xee2ac8e2,0xf0b2a390,0xea4bc4e2,0x6d56c2d5,0xd105b040,0x1010116c,0xd528b462,0xedd4c1e4,0xee4bc504,0xf7e2f8ed,0xeeadd986,0x6f6e7e7c,0xf2f1f2a8,0xcfcfefaf, 0xee2bcd44,0x89ca874a,0xdd67bc60,0xe2e2a2d3,0xdd45b440,0xfafbffff,0xe5e7d142,0xea4e0eaa,0xe22ac4c2,0xf3f1d052,0xe5e8c0a2,0x974314d5,0xe986d544,0xd2aeb1b0,0xe64ea0e4,0x6363afe2,0xe608bcc0,0xfbf7f2f2,0xea07b820,0x9beae8f5,0xee49dd62,0xbdbeae6f,0xe1e8d124,0xea6f7ab8,0xee6adda4,0x8da7a767,0xea08d562,0x4cdce9c4,0xea08dda4,0xb4a6a7a,0xd987bc80,0xadcdd7a3,0xee29d162,0xe4fabbe3,0xdd84bca2,0x86d0ead2,0xd987c8e2,0x4b4bd2ba,0xe5c8d544,0x3f3a366b,0xe5c6d522,0xe5d6ab67,0xe1c8c8e2,0x387ddae9,0xdd86c0c2,0x7f9d58b6,0xee49d984,0xb3a3bb7f,0xee69dda4,0xfcd8d89d,0xf249e1a4,0xe1e2e1e8,0xf68ad102,0x99f2f5ab,0xee08ee06,0xbd7c7461,0xf68bcd42,0x62151869,0xe5a9c8e0,0xf097efe2,0xe9c5d564,0xa7a3766e,0xee29d944,0x4f4fafaf, 0xdd85bc82,0x7854a074,0xe1a7bc82,0xa5657d7c,0xee08b8a2,0xef8c4a1a,0xe629ac62,0x3ebeefe7,0xe1a7bcc2,0x36b17565,0xe5c7d104,0xf0f0a021,0xd966b880,0xa0a0a40,0xdd68b882,0xd4e9e959,0xd547ac40,0xbcfda72b,0xea2ac944,0xa595a4a8,0xf66bc0c2,0x5884c990,0xdd67c4a2,0xe4d49558,0xe9a8ac20,0xee0d5af6,0xe1e8c0c0,0xd8ecec9d,0xf26cc922,0x878fafbf,0xe1e9ac60,0xfdb8ab9b,0xee2ac942,0x76745182,0xe5a7d0e2,0xe5e2e362,0xd985c0a0,0x2c5e4fd7,0xe5eadd86,0xfede8e2d,0xea29c922,0xd6c7d9ee,0xedc8cce2,0xdac3c392,0xd124a840,0x4c4858a8,0xd569c8e2,0xc040580c,0xdd88ac20,0x5f5f1e0d,0xf28ce5e8,0xc7cbdf5f,0xf6cfdde8,0x44d8d9d8,0xcce4b840,0xa0b07414,0xe9a9c080,0x9febe2e7,0xf2ced564,0xf4a4e8ee,0xfeacc164,0x9baebfff,0xe64bc964,0x2f2f5b8b, 0xee6db8a2,0xf0e09191,0xe9e8c060,0xc4c586f3,0xe147c4a2,0x8b8b6f2f,0xe62ad144,0x1946deee,0xee6cd9a6,0xd1f1b795,0xe144c8a0,0x73b3cbde,0xdd46b860,0xfabdbeaf,0xd924bc82,0x5fdbc6c5,0xe1a7c902,0x4b9fffff,0xe1c6b8c0,0x553b7b6b,0xdda6d564,0x97172b6f,0xee48e1a4,0xaf7f3b7b,0xea08d9a4,0x3435a618,0xe62ad984,0x22233170,0xe649dda6,0xeaa9ffff,0xe227cda6,0xd0682ae3,0xea6dcd66,0xbfaeffff,0xeacdb524,0x86d4eebf,0xe28ed22a,0x28d89850,0xe26bd1a6,0xf8b87438,0xe24ad9c6,0xdfc78219,0xeaafe28a,0xf5e2519c,0xe68dcdc8,0x9ece8b6b,0xea49e1e6,0x9ac6cb9b,0xee28c4e2,0x3f727170,0xe5e8d142,0x7e3a3b2e,0xe5e7dd64,0xfdaa9b8a,0xe5a7d984,0x868aeffe,0xe1c5d962,0x30347abe,0xe608d984,0x3f2b5b65,0xea49d964,0xe6b9b8f4,0xe26cdde6,0xd5d9b1f1, 0xe68cd628,0xe3b3b6fd,0xe6cfc9c6,0xdf86a7e3,0xeacfe68c,0x795869e9,0xe6cde26a,0xa4689d69,0xe68bd9e6,0xefcfcfde,0xe6aed608,0x4b8b9eee,0xeef0d5e8,0xc888aabe,0xeeccc984,0xcfc2e291,0xe28ede6c,0xfefeffff,0xdf369446,0xfffcfcfd,0xdf15d6b0,0x81c6e7eb,0xe70fda4a,0xd693d282,0xe311e68c,0x2f2f6eef,0xe337e2d2,0x6eaeae5f,0xe737def2,0xbf3f7fff,0xdf16bd88,0x3efeffff,0xe315dad0,0xd1d9eabb,0xe2eeb546,0x6237bb56,0xde6dc9c6,0xe9d0aa2e,0xdf16df14,0xf9fcfced,0xdf16daf0,0x6bbb7b26,0xe6f1cdea,0x975b9b5b,0xe2d3dece,0xe7f19296,0xe711eace,0xd0e1e5e6,0xe713de6a,0xfebeba6f,0xe716d2ae,0x7b67effe,0xeb34e314,0xfbead9c4,0xe6f0d22a,0xebd3a7e7,0xe712e6ee,0xceefe3e7,0xeb35d68e,0xaf8f4e8f,0xe734def0,0xfae8ecf9,0xe338def2,0xf9f6faff, 0xe337e2f0,0x8b465b9b,0xe715daae,0x4506478b,0xe313e2f0,0xcfcffffe,0xe715d26e,0x43f3f9ef,0xe737d6b0,0x6a9a5595,0xf375d64e,0x6f6b6b6a,0xdf13de28,0xebdb93c2,0xd9a7c060,0xbf2b2b6b,0xdd86ac00,0x786e7f2f,0xe1c6c4e2,0x29aa7878,0xe1c8c4e2,0x626bbbf,0xe5a6d102,0xf0b4707,0xf609d944,0x7ab79b5d,0xea49dde4,0xc5c65f6b,0xee2ad584,0x1e4ecfd5,0xea4ad184,0xfdfebf7e,0xe208a860,0xd2c3cbc7,0xeb11e28c,0xa8fcf5e2,0xeaf3c586,0xf6e9fdfe,0xe649a420,0xcd9eeaea,0xddc6d164,0xeaedf490,0xef35ad48,0xa4d0e2fb,0xeb5694a4,0x49484849,0xeda5d942,0xc9e95909,0xea28dda4,0x7bbfbfaa,0xea8be606,0x66667b3b,0xf2abe5e6,0x6864e4d,0xfa4add64,0x95440106,0xea07d942,0xd6770b8b,0xea4ad9c6,0x6b6b7bf8,0xea29cd22,0xd8d8acbd,0xf28cd9e6,0x5999c9dd, 0xfacdcda6,0x43d3fafc,0xe2f5b588,0x9c4d8c59,0xe359ad28,0xbebdbdaa,0xea48e1a4,0x6a377ebe,0xf248e5c4,0xa09169bc,0xff76ce2c,0xe9f8a494,0xeb36dece,0x5f5fafaf,0xe714e6ae,0x8f8f5f4f,0xf396e6ce,0x3ebebfbf,0xe733d248,0xbf3f3e3e,0xe2b0b524,0x5f0a465a,0xeb54de8c,0x5f6f6f6f,0xef35eece,0xb5f47cbe,0xeb34eaee,0x71b1a4b9,0xeb13ce2c,0xbfbbfe6e,0xe736d6d8,0xfeffffff,0xe713ad28,0x180c1e6f,0xeb36daae,0xaeaf6e2f,0xe736de8c,0xfcfdfebe,0xe715ca0e,0x7a5afbfe,0xeb57df14,0xbcb9797c,0xe6f0d68c,0xbfbf3f7d,0xeb14d60a,0x6b4b1b0b,0xfb94eaee,0x3e7dbf7f,0xeef1d5e6,0xfaf1f171,0xef33d64a,0xabfbfaf6,0xe6f2ca0a,0xb31f2f6f,0xe6f1de6c,0xab59b5f2,0xf330e6ce,0xf4f0e8dc,0xef35e2ae,0xfdf8f8f8,0xef35f6e8,0xf7ab8a95,0xe757e732,0xe8b8ace5, 0xeb36dab0,0xa3276fea,0xeb13d20c,0xafab9b47,0xeb35da8e,0xa773bfbb,0xeb56df12,0xbb9ac2a3,0xeb57ce2c,0x96aaacfe,0xef56deb0,0xa3838b97,0xef34e2f2,0xbfbfffff,0xdb17cda8,0x763fedae,0xded2daf0,0xc9aa7bfb,0xdb16c62e,0x704d6da5,0xded3ce70,0xf8f4f2b2,0xded2d26c,0xbeaffffe,0xdef4d28e,0x6a198ae1,0xdb16d290,0xc8e9fada,0xdef5d2b0,0xadaeffff,0xd738c20e,0xb542cbee,0xdaf7d6f6,0xffffffff,0xd3188000,0xe094cfef,0xdf18ceb4,0xfefffffa,0xd6f7c210,0xafabbbfe,0xdf18ca70,0xbdfde9e5,0xd718ceb2,0xfebef8e8,0xdb18ce72,0x9fc89cbe,0xe314dab2,0xfa8e8f4a,0xdf14def2,0xea9598c8,0xdef6dad2,0xeae9faee,0xdf15ce90,0xc5ccdcfd,0xe2f3c60d,0x9dace8e5,0xe6f1ca4c,0xdfcfefe6,0xdaf5d6b2,0x5f0f8f9f,0xdf18d2b2,0x7aafbf7f,0xdb18daf4,0x9e5818bc, 0xdf38d2d4,0xacfdbcbd,0xdb18d6f4,0xa9f4f628,0xdb19daf6,0xb3a76267,0xe359ca70,0xdefdbcb1,0xdaf7d2d4,0xa5c9e5a9,0xdf39db16,0xb7b3f655,0xdf18ce92,0xffffffff,0xcef88166,0xfeefffff,0xd6d7ba10,0xf3f3f7f7,0xcab594c8,0xebe7f3f3,0xdb18a14a,0xfb2a6abe,0xd6f8ced6,0xaa5a9a92,0xd719d6f6,0x8fcfdeaa,0xced5be30,0xae8d8fef,0xd6f7ca72,0xb47d7db,0xbedaba0e,0x372b3b6b,0xceb4be50,0x4445869a,0xefffa96a,0x55555645,0xfbffb1ce,0xbfb3a3a7,0xceb6c252,0x7fbf3f2f,0xd2d7ba10,0x55511155,0xeb9cbe52,0x5a4a5956,0xdf3aca94,0x6a3f7fbb,0xd719c674,0x6f8de8b5,0xdb18d2d6,0xe07069b,0xdf19ce94,0xcc9fa959,0xdb17c672,0x2f7fbfae,0xdb19c672,0xf76f4b9b,0xdb18d2d4,0xffffdfcd,0xd2d7b5ef,0xa8647ebf,0xdb18ceb4,0x59797d3e,0xd2d7ced4,0xbbbb8e4e, 0xd2d6c252,0x51415456,0xefbdbe30,0x59454150,0xe35cc672,0x3ebfbf8b,0xd2d7ceb4,0xe5dab2e,0xd2d6ca92,0x42415141,0xf3dfba10,0x1010105,0xf7dfd2d6,0xf8f8f5e9,0xdef2e2ce,0xc5d9e9e5,0xe2f2da8e,0x7fefefef,0xdf16c20c,0x3f7f7f3f,0xdf16b568,0xa9a8f5e6,0xe314e2d0,0x9a4998b5,0xef55dab0,0xfe7f3f6f,0xe317b9ec,0x7ebefefe,0xdf16c66e,0xab93fbef,0xdef6a96a,0x8f8fbdbe,0xdef6ce90,0xcf4b8f9e,0xdaf8d6f6,0x1fdfbbef,0xdf38d6f6,0xecff5f4f,0xdad5ca70,0xea767a9d,0xe737dad2,0xb64e9a27,0xe359d6d4,0x9ec5e6f5,0xe319db16,0xf5f0b4b5,0xe713e28c,0xf2f7faf6,0xe2f2b566,0xbfff7e3e,0xe337c60e,0xbf9fdf7f,0xe338d6b0,0xfae6e2f6,0xe737c5e8,0xf2fbfafa,0xe315b164,0xbfffbbaf,0xe337d290,0xbfbb3f7f,0xe337dab2,0xbd0a69b9,0xe737d6d2,0xd2f8b8bc, 0xdef5ce70,0xedead190,0xe339d2b4,0xaf9ecfce,0xe35ad6f6,0xf3f6fcf2,0xe316bdee,0xa4b8fefa,0xe336d6d2,0xefdb3f3f,0xe339daf6,0x233fefff,0xe35ad2d4,0xbfeeaefa,0xdf18ceb4,0x2f2fbfef,0xdf19c250,0xf8fc6fbc,0xd6f7ce92,0xfdb6abe3,0xdb18ceb4,0x1eedc927,0xdb18ca92,0xfbee9b8e,0xdb18ca92,0xfbcfc7f7,0xd2d6a54a,0xffe7fbfe,0xd6f7b60e,0xbabebe7a,0xd6f7c672,0x6f2f2b2b,0xdb18d2d4,0x45190100,0xdf18ceb4,0x51546105,0xe79cd2d4,0xbf3fafbf,0xd6d6b9ee,0xf1b56ebf,0xdaf88000,0x965a0641,0xe77dca92,0x4a4a4642,0xefdeced4,0x6c8a846a,0xdb18ceb4,0x4a4ba3b6,0xdf18d2d4,0xeebafcfe,0xdaf7c670,0x85d0cace,0xdf18ca92,0xae7bbfff,0xdf18d2b4,0xfed1a68e,0xdf38db16,0xdeecfbba,0xdf18c650,0xeb024d8a,0xdf39d6f6,0xbffefff7,0xdb18b1ce,0xb7cbeabf, 0xd6f7ce92,0x48445556,0xef9cd2d4,0x6da9a356,0xe358ba10,0x2e4fb6ae,0xdb18d2d4,0xae968eee,0xdb17ce92,0x15251969,0xefbdc652,0x5a155545,0xe79ad2d4,0x96c6a6a7,0xf269e5c6,0xd7670696,0xf269d984,0x1f1b0f0b,0xf2addd86,0x33218e4f,0xe1e9c502,0xd6e66f1f,0xf24adda2,0x679ec949,0xe9e7d944,0xb8ed4e1e,0xdda89c00,0x18dc9c64,0xf26ed144,0xff0d6a6a,0xea69e1e6,0x7f3f7ebf,0xe649d142,0xc0c5c6d6,0xf7fde6d0,0xf6fac1c0,0xf334e2ce,0x7a7a7e7f,0xee8be1a4,0xf1e20225,0xee29dde6,0xe0a5af6,0xe2afc184,0xb9f4fe9e,0xe2adc9ec,0x959ddcd,0xe9e9c4e0,0xeefffef9,0xea6ab060,0x5958090d,0xe66cc8c2,0x86cbda9b,0xf26bdd82,0xeefe8ac6,0xe607b8e0,0xe9b2fbfe,0xea6ae1c6,0x652a4747,0xf26cdda6,0x93854899,0xf28ecd86,0x3e3d74b4,0xf2cddde6,0x171b2f2f, 0xf32fea6a,0xc1ecdeef,0xeaefc9c8,0xfedbcbd2,0xeeced5a8,0x6f282956,0xfaeede08,0x99291daf,0xffd6eace,0x75afdfe,0xf30ee26a,0xff6e6faa,0xf753f6ee,0x474b4b9b,0xe26dbce2,0x9f0b1f0f,0xe75aa4a4,0x2b0feefe,0xf310b522,0xfff3b027,0xeecec9a4,0xa62d0c69,0xf313ad02,0x9a1a1a56,0xe6b0cd62,0x4140a5bb,0xeeacd5c6,0x5f333139,0xf2ceda28,0xefefdfe7,0xe736c62e,0xfbfbfefa,0xeb57f772,0xffffbfeb,0xeb13ad24,0xffffbfff,0xeb15b4e6,0x8aebfbfa,0xeb56d68e,0x6357af2f,0xef75e2d0,0xefffffff,0xeb13c5e8,0xfffff5f0,0xeaf2ce2a,0x8bd7ebdf,0xef34b506,0xdf4f0f0f,0xeb36b106,0x59162a1e,0xf6cdde28,0x9377b4f8,0xf2acc142,0x7f2fafaf,0xfb75d26e,0xf2faf9f5,0xf355d6d0,0x5034796,0xfbdcee6a,0x75b1505,0xe6acf268,0x5f9b8faf,0xe734deae,0xae9195ce, 0xfb53e2ae,0xf9f9feef,0xeb12da6c,0x62faf7f2,0xef34c1a8,0xd9e8ddee,0xef33e6cc,0xee7d3dd9,0xf333d24c,0x8b5b9a56,0xf733e6ee,0xab1a1947,0xf332e2ae,0xe2a0bcfc,0xf28dcd42,0x1f2fa7d2,0xe9e8c902,0x6b3eb170,0xfacdd9a4,0xa9bdece4,0xe64bc964,0x67171b6f,0xdda4c060,0x34bbf6b,0xdd89b8c2,0x77e98855,0xe6afb544,0x14bc5a37,0xde4cb902,0xb6f5fbdb,0xff33ea8c,0xd2e1e2a3,0xea6c9420,0xabfb3b3f,0xef33da4a,0x57be7e6e,0xf374eaee,0x7db4a182,0xde6cbd66,0x66af8e6e,0xe28ecdc6,0x67be6f43,0xef11ce2c,0x753f7f8f,0xef11de4a,0x579aedfb,0xff2ed984,0x620e6f3b,0xf66ae5e6,0x8ad6e212,0xf2aeb4e0,0x957b7715,0xf28cd184,0x8bcf7e3a,0xee4ac0e2,0xbeaffbfb,0xf227e1a4,0xfabb6f4c,0xf6acd582,0xff5f69f9,0xf2f0e66a,0x5f5b0b09,0xe6cfcdc6,0x1a16d1e9, 0xea8eb902,0x5e1e2e96,0xeb35de08,0x3dfe5f1b,0xef32e28c,0xa6f9d042,0xe66acd64,0xe0d4f896,0xef0fee28,0x167c3c10,0xeaadd1e6,0x7f3f3b27,0xf311e228,0x7bba70b0,0xf356d24e,0xbb2838bd,0xf776e2d0,0x5464101,0xff2eea28,0x2f1a4a45,0xf2cde626,0xb2713fab,0xf334da6e,0xeded9471,0xef12d62a,0x6a2a656b,0xf2cce206,0xa35e6fea,0xf66aee66,0xf5fabfe,0xe6f2e6ee,0xac9e090d,0xf353eaae,0xbeb7b192,0xef11e28e,0xbefefafe,0xeaf1e2cc,0xacacae6c,0xf334d62a,0xc5c4e9ea,0xf773eace,0x602517e,0xfb50eaae,0x75baa656,0xf2cede48,0xe4fcb192,0xf331eaec,0xfefdfeb4,0xf733fb2e,0xaf5efdfb,0xea08c4a2,0x3f270b6b,0xd62a8000,0xe8bd7a7e,0xf773f2ce,0xe9e9e9e9,0xefb7f2ce,0x7f5f0f1f,0xe62a9c02,0x1b2e7e7e,0xf229c0a2,0xd4f4eae6,0xe6afc584,0xf9eddcdc, 0xeab0b020,0x1f1b4a6e,0xeaade64a,0x2f2b2b2b,0xf731e228,0xe0e0d0d4,0xeeae9840,0x64f9de8,0xb989a460,0x2f0f1b2b,0xef33ee6a,0xbd7e6f6f,0xeacde248,0xf3fbfaf1,0xe71698a2,0xeedffcf0,0xeb36ca4e,0x7e3f3fbf,0xe315ce4e,0xef495ebf,0xe336def2,0xf1f0f1f9,0xdad28400,0xfaf6f1f1,0xe7149020,0xefef9b9f,0xeb57d68e,0xdb9bdfef,0xeb57e2f0,0x965b6bba,0xeb58daf2,0xfae0e2e2,0xe759dad2,0xffc9ddee,0xe35ae358,0x8fffbfff,0xdf39be0e,0xf4fefefa,0xe736b5aa,0xbbffbbb0,0xe315b5ac,0xc79f7fcf,0xdf39daf6,0x771b1f6b,0xe77cd6f4,0xf7fafefb,0xeb34ce6c,0xf86722b2,0xf377b548,0x1a03e6eb,0xeb36e714,0xeaaefefa,0xe735e314,0xf9fefebc,0xeb56dab2,0xf0e6dccd,0xe758e312,0xaf8acada,0xef57e712,0x8bdfefaf,0xef55c1ca,0xd0d5e5fa,0xe779e734,0xa2c1c1d0, 0xe759e736,0x2bab6eaa,0xe75abe2e,0xfffeae2f,0xe35ab1ce,0xfaf9baf6,0xe77ad6f2,0xb8387aba,0xeb7ae356,0xb97cfeff,0xe339b9ee,0x50343d3f,0xe318be0f,0xbfffffff,0xdaf7b5ce,0xef6f3b3f,0xdf18ceb2,0xf1bdaeef,0xe338a98a,0xeff7aae3,0xdf38c210,0x84bebbff,0xdf18b1ce,0x67a5fdc0,0xdf38ca72,0xf7cb8aaf,0xdf38ce92,0xd9ccaec7,0xdf18db16,0xbfbfcf8f,0xd6f6d6f4,0xfefbebff,0xd6d6ca92,0xafbc682a,0xe77abe30,0xafaaa262,0xef9a9d06,0xdecfcfdb,0xd6f6ce92,0x4b47eae9,0xdb38ca50,0xbf0b0f1f,0xdef6b948,0x3fbf3f6f,0xdb17b928,0xaa78b6cb,0xe739df16,0xfbff9757,0xe338ad8c,0x9b8ba9ea,0xe77bca72,0xf9e4989e,0xe338be0e,0xff0c87f3,0xe338d6d4,0xfffff9df,0xe339b9ee,0x12331faa,0xe317d2b2,0xdeaef3f3,0xdef8b1ac,0x1e1b63d3,0xd6f5b1ce,0x7b4fc782, 0xdf18c230,0x69552a1f,0xef7bc1ec,0x11052569,0xefbdca50,0x221e4f67,0xe318ca92,0x6ba9f4f2,0xdaf8ce94,0x4e4f1a21,0xe318ce0c,0x42464f4e,0xef99d62c,0xfbfffffa,0xeb57c210,0xfeffe3d3,0xeb36c1ca,0x58586f8f,0xf378e710,0x5712175a,0xe779e6f0,0xfdecb5f6,0xeb57e6ee,0xe0fafefe,0xe713a060,0xaf9f4b5b,0xf376deae,0x5e4f9f9f,0xeb78eb10,0xf9edcd9a,0xeb7ace70,0xe9e8f9f9,0xeb9beb76,0x6fcfe694,0xeb7ac230,0xa4b2f3f,0xe35ab1ac,0xf4fdfefe,0xeb7ace50,0xfefaf3f2,0xeb7abe2e,0x8dcbdf0b,0xe338b9ee,0x7050434a,0xe315be0e,0xe691e9d1,0xef33ee8a,0xa4949494,0xeb56eeac,0x1f5f6f6f,0xe778eece,0x2f3f6f2f,0xef56da4c,0xf0f0b0b4,0xef56e6ce,0xe5d0e0e0,0xef7aef10,0x7f3f3e3e,0xe758ded0,0x3f2f6fbf,0xf378a4e4,0xfe7e2efe,0xe759c22e,0xfdfdfdfd, 0xeb9beaf1,0x73100004,0xd293b9ac,0xf2f5dde2,0xe759ba10,0xaeccfefe,0xef9aeb78,0xbfbefefe,0xeb7ab9ce,0x3b171bfb,0xeb7cb5ce,0x820b2f7f,0xe759be0e,0x9eeafaff,0xe339d2b4,0xedace9ce,0xe359c670,0x2429aeed,0xeb7ab9cc,0xe7633731,0xdf17ca70,0x2a47d6f8,0xf3bcb9ee,0x1f054011,0xe338a98a,0xe0e2eaef,0xe359c230,0x6e4bfbec,0xe339c630,0x7f3f2f3f,0xce939d6a,0x999c9cea,0xe7399d08,0x81848041,0xf798c188,0x1418182,0xfbb9c9ea,0xf93b3f8a,0xd272b5ce,0xfbb244ec,0xd6d4be0e,0x21171a12,0xf79cc9a8,0x1b0b0b16,0xef99a480,0xde6d2e2f,0xeb7aad8c,0x5c40848e,0xe77abdcc,0x7f9cdcfe,0xdf18ca72,0x4f0b5faf,0xdf18b5ce,0x86074f9e,0xe737b1ac,0xafff9c4c,0xe759ca50,0xffffff5f,0xe359a129,0xfbbb3f7f,0xe339ad8c,0x6bbb93c3,0xdf16b58c,0xe7c7ce8e, 0xdaf6ca92,0xb075519,0xef57da6e,0x2410a0a,0xffdbd64c,0xf6fffffa,0xdf17c62e,0x63570060,0xca50a96a,0x574b0a06,0xefbbda4c,0x1c1c1a5b,0xf799a8a4,0x9a8ce6f3,0xeef4b124,0x6f297dbf,0xff96deae,0xad9e97c3,0xff92cda4,0x4566ab9f,0xfaecf2ca,0xdbcb8b5b,0xfbb7fb70,0xcb8f8fdb,0xf733c986,0x77b56911,0xfb30eacc,0x3b3b6ba7,0xfb70e2cc,0xeebebeef,0xf710e668,0xfcfceeae,0xf72fee4a,0xf4b8f8fc,0xf774d966,0xf2f1c5e0,0xf2cfde08,0xf9b6b3e4,0xf6ccd9c4,0xbfb7e1f6,0xfaeec920,0xf4e095e1,0xf730d166,0xd888f8f9,0xf753f24c,0x45070383,0xef12c9aa,0x3abcf8a4,0xf398da70,0xe4f6ab3b,0xfb30ff4c,0xd5e5e7e7,0xf731fae8,0xcfcfc7f3,0xfbbac60f,0xcfcfcfcf,0xf7dbce50,0x829296d6,0xfb96fac8,0x83839282,0xff95faea,0xfffffffe,0xf6ebac60,0xe6ffffff, 0xfb72ac60,0xe4feeae9,0xfb53d984,0xcdcdddd4,0xff53ee8a,0xfffffbd2,0xf2edc962,0x4fefefef,0xf70fac80,0xdccccdcd,0xf730ee6a,0xcdc9c9d9,0xf752fa8c,0xfffff7e3,0xeeacb520,0xa298faff,0xfaedea68,0x7e6a6b57,0xfa8ae5e8,0xb6b0ac3d,0xf2cdee6a,0x8f8e4885,0xff30ea8a,0xfff78f8e,0xf2ede688,0x77aa7a7a,0xfa8ad142,0xa6bb3b3b,0xfe8bc0e2,0xa0d4a430,0xfb0ecd64,0xdfe7f5e5,0xf730eecc,0x3bafaeae,0xf68ce1a0,0xe9d2a363,0xf689e62a,0xceca9b9b,0xff72e24a,0xb69ecdcd,0xf30fe26a,0xf6faaeae,0xfaacc564,0xab7b5382,0xfaacd0e0,0x1b1f6fbf,0xf310f2cc,0x16556a6b,0xff72da08,0xf3f2e2a6,0xf689ee26,0x9ba77763,0xfa8be626,0xdba6ab2b,0xfb31e248,0x1b5bd7c7,0xf331f2cc,0xe363a397,0xfeece626,0x767323a3,0xfaedee88,0x691e4fe6,0xfb11c522,0xf6e1e0e4, 0xfb51e62a,0x6b8fbf6b,0xfaacee28,0x3d3d76b6,0xf68be9c4,0xfab5b2f1,0xfb51ef0e,0x3f7ffffa,0xf730ac42,0xaf2d6a7e,0xf6eee1c6,0x2f7fbfbe,0xea48dd84,0xcfcfcfcf,0xf7fcc62e,0xcfcfc7cb,0xf7dcc22e,0xe7d71703,0xff72f2aa,0xebe2e2e2,0xff94c984,0xcf8f8fcf,0xfbbcca4e,0x930f0f4f,0xffffce4e,0x444193eb,0xff92faca,0x86848440,0xff51ee06,0xbfbfdb87,0xf2cdc924,0x6fbfffbf,0xf6ece608,0xc8cddcdc,0xf751e9c6,0xdcdcd8d8,0xf795e9a6,0xbebebf6f,0xf751eda4,0xfffdbcad,0xff72d522,0xd4a4e4d8,0xf794e1e6,0x3c5cccd8,0xfb0eee8a,0xc5c5cad7,0xf7ffce2c,0x5fdfcb8b,0xf7ffd64e,0xfbebdb87,0xff51da06,0xf6e6fefe,0xf2abb8a0,0xdfcfdf5f,0xf3bbf397,0x4bdbefef,0xf7d9bd86,0x7ffffefe,0xf289fe44,0x452a3b3b,0xf66bd586,0x18151bfe,0xe608a820,0x9c080000, 0xc92ba820,0x418dac7c,0xfaf1d586,0xfeac2862,0xf6efc546,0x7a390786,0xe5e9b082,0xa4595e6e,0xc0e58864,0x90a0fcfe,0xf24aa884,0x15001050,0xb0ea8802,0x5b0b4757,0xf355eece,0xafaf5f5f,0xf754f6ca,0xe1e1f277,0xf6abea68,0xb1e5e5e6,0xf6ede606,0x1b1f5f6f,0xf356f72e,0x1f1f1f1f,0xf397f72e,0xb1b0e1b2,0xff10ea28,0xf4e1c1f1,0xf6eeea0a,0x6a5f4f2f,0xff94c124,0x45caebe5,0xfb53e24a,0x3f27677f,0xfaabe1e6,0x74747579,0xea07c922,0x93fbae0a,0xf730eece,0xdbcf8f83,0xf30fea8c,0x3b1f0769,0xf26bd964,0x596d2a22,0xfecddd84,0x6f2f1f1b,0xf7f9f6ce,0xcccdaf7f,0xf732e6ac,0xb07074f4,0xf70ff68a,0x60243878,0xfb0fee28,0xdfeaab9f,0xff93e68c,0xefef9e9f,0xfeece5a4,0x70307171,0xfaededc4,0x81454151,0xfa08e1c6,0xf8e8eafd,0xfb75ef0e,0xe5c0e5f6, 0xfb73eeee,0x1d1c1d5a,0xfb0de984,0x5a1e1d1d,0xf32eedc6,0xffdad6f9,0xfb52f2ec,0xfcbdffff,0xfb50ee8c,0xe060646,0xf2ccf248,0x1c1c1a49,0xfecee9e6,0xc4dbfefe,0xddc7a820,0x92edfdcc,0xf26cdda2,0x5f1174f8,0xea2bc4e0,0x3aeaef9f,0xe9e9d542,0xc3db4e46,0xea4ab8c2,0xfdfdc1c3,0xee6cb8c1,0xf9bfe5d,0xf229e186,0x8bbe3e1e,0xe5c7e5c4,0x5043977f,0xee0ba420,0xe6edeaa0,0xee4ba820,0xabebd6e2,0xe1a7c080,0x9b9bdba7,0xe5a7bca2,0x91989ce5,0xfa8bdd64,0xf1f7a691,0xf24ad984,0x9743475f,0xe9e9bcc2,0xcac3eaea,0xee29c902,0xf8d8f9f5,0xf68acd02,0x9a46daf9,0xea4cb4a0,0xe4e8a683,0xee09b882,0xfcf8a97a,0xea6bcd04,0xf96a3ebe,0xee48d562,0xe0510459,0xeeadb040,0xa7bb3e6d,0xde09bce2,0xf7f79a9e,0xee29e1e4,0xdad74762,0xee27dd84,0xe9feba6a, 0xede8c4e2,0x8bce8e9d,0xd989b880,0xe2d2c98d,0xe9e8c8e2,0xb9bbb1d0,0xe5e8b440,0xa09091a5,0xfa6bc4c2,0xcfcfcbcb,0xea08ccc2,0x2f3f2f9f,0xe1e9b880,0xf4f0f0f0,0xe1a6c482,0xf4f06434,0xddc8b860,0xf1f1e1f5,0xee8ad146,0x2eadaca4,0xea0ae1c4,0x4681c0d4,0xe188a840,0xa2a39252,0xd547b462,0x7166aefe,0xf2abddc6,0xf978b065,0xee4af1e4,0x2eafafbe,0xee4acda4,0x11efde29,0xe60ad9a6,0x1b1e0d42,0xe1a6c8a2,0xcdc79729,0xea2ac0c2,0x2ee9be2b,0xf6add586,0x3b32af6f,0xe1e8cd46,0xd1d25999,0xee08c4c2,0x72b2a090,0xe9c8c8a2,0xf1b1b3a3,0xd526b460,0x832372f6,0xd168bc62,0x8e9f7f3e,0xf649cd02,0x7ebeae49,0xe5e9dd42,0xc696c6c3,0xd904acc6,0x8081c7c6,0xc8a2b8c6,0x727676b3,0xede7ccc0,0x4b4797a7,0xfe69c0a2,0xfb3a2f7f,0xe1e7d9aa,0x9efebeae, 0xee4ad164,0xf1e96460,0xede8d122,0x1451c0e0,0xd502c8a4,0xbebefdbe,0xeeacf246,0x3d393aba,0xf6cee648,0x8b5e5d14,0xe147bc60,0x3f3e798a,0xee09d964,0x6ba2f1f0,0xf68cdda4,0xe0a0585d,0xf6efd984,0xf9f2773a,0xee4ad9c6,0xdbf1c2dd,0xee6cc966,0x6e1e8bd7,0xf6aceaac,0xfafbbabe,0xf2abd984,0xaf5ebe6f,0xfb33f26a,0xbeac8c9e,0xf28cddc4,0x2f6e68a4,0xf26cb880,0xe6afbb2b,0xf24cddc6,0xfefef96a,0xea09c0a0,0xffeffffe,0xee8bcce0,0xf1a1a1f2,0xf6f1e1c8,0x422611d1,0xfeafdda8,0xfbe7e2fe,0xf28cd564,0xebe7f7fb,0xe60ab0c0,0x7ecfeebd,0xf68ad9a6,0xdeeeef3e,0xf6cce228,0x1e2e7fff,0xfacef226,0x7c141816,0xfaabe9e6,0x7f7f3f1a,0xfacce9e6,0x5d5e2e7e,0xf6cae984,0x7d7c382d,0xf26aee06,0x95e4783c,0xf607e184,0xe6b13111,0xf24de5a8,0x7475f5e6, 0xf26ee5a4,0x383c048a,0xe9eab8c2,0x1510563a,0xedeab4c4,0x7d396665,0xf6b1dd86,0xb6b7f6f9,0xeecef1e6,0xbdbcb95a,0xee4bb8a0,0xad6f6ebe,0xfa6bc8c2,0x4080,0xe9e6c4e4,0x40404040,0xe1a3bc86,0x2b33777b,0xf1e9dd42,0x6f1f0b5b,0xee2ad904,0x41404140,0xede8bcc4,0x54545050,0xe1cbb842,0x1f2f2f6f,0xf6a9d546,0x2b2b1b1f,0xfeebc4c4,0xb8a9ba7e,0xf2cde5e6,0xb8bc6cb8,0xee6cd166,0x3a2d1d2f,0xe587c8c0,0x40d0c056,0xe9c8c8c2,0x3d7c7cb8,0xf28dc904,0x2d2d3d3d,0xea4bb4a4,0xd0d0c080,0xf5a3c0a4,0xfcf4d0d0,0xf26bd924,0x5c585454,0xe987bc82,0x4809191c,0xe1a7d126,0x2f3f3f2f,0xf2cebd06,0x3e3e2e2e,0xee08bd04,0x5c484c0c,0xe5c8c504,0x18182c2c,0xe9a8bcc4,0x3b3b3b3b,0xea0aaca2,0x37373737,0xf1e9bce5,0x80c1d2d,0xf1a8cce4,0x3d3d2d1d, 0xe5e9b0a2,0xedededed,0xfb2fe606,0xeefefded,0xfaede9e8,0x1e2e2e2e,0xe587b484,0x2c2c1d1e,0xcd05bcc6,0xdedeeeee,0xfeccd584,0xa4e6868a,0xfe6be184,0xffef8f4b,0xc64eb14a,0xd5eebeff,0xcda998c4,0x4b5f1f19,0xdd44b128,0x5f56be6e,0xb9efb906,0x7408090,0xad478400,0x66fbf2f,0xd56a8000,0x217eff,0xa8848820,0x0,0xa48d8000,0x682d29a9,0xa5099002,0xd5440011,0xc92a9000,0x55061526,0xb1078800,0xe46bbb5,0xc52ab0c8,0x15af8d4,0xa8c78400,0x0,0xc0888000,0x10966f1f,0xa9098022,0x0,0x90468000,0xb9bfae00,0xd168a440,0x1d2867b5,0xc588b946,0xffffff50,0xc5669482,0x8affabab,0xcda9bd86,0x62763f0e,0xc20cb966,0x6b2d7d5e,0xc62dc5ca,0x947c7c05,0xc1ebb9c8,0xcd844090,0xdf12c5ea,0xbfffbf01,0xbd479c62,0x297ffbff, 0xc569b926,0xefbffe40,0xc8e5a060,0x4940aaff,0xd22cc4e4,0x1010115,0xe22ac5aa,0x5050504,0xe62cbd88,0xde4f5f6f,0xfa0be1c8,0xbfffffef,0xf66add84,0xffffeaa2,0xeda8d904,0xca2a377f,0xc928b0a4,0x51514182,0xee0cc9e8,0xef637210,0xd1ebc926,0x15bbf6d8,0xa4c79402,0x0,0x80038000,0x5aabfff,0xb8c68820,0x0,0x90448000,0xb8f8fefd,0xee6be9a4,0xb6956968,0xe60cc4c4,0x19185c5d,0xff30d964,0x7e7a6959,0xd948b062,0x54787a,0xd16c9000,0x0,0xa98d8000,0xa5f5ba,0xa8a68c00,0x0,0x9d088000,0xfeeaef81,0xbd259c62,0x94cf6fe,0xcd28c0e4,0xfaeedb40,0xc1489c40,0xa054084a,0xb907acc6,0x7e3d2c14,0xe1c9c968,0x6fbf7f7f,0xe5cab106,0x3879a420,0xbd07acc4,0x41e6e14,0xb969b8e4,0xa1fbff40,0xc588a4c2,0x9795d4e4, 0xc56ab4c2,0xfffffb80,0xc5479862,0xc5cbe,0xc58bb928,0xeeaa9212,0xb927bcc6,0xb2a6e9fd,0xc9a8b944,0xdbab3620,0xc14ab4a4,0x1a55ead7,0xc1cabd68,0xafbe2e2e,0xca0bb902,0x6b5b2f2f,0xd290cd68,0x2f7f6598,0xda6dc1ea,0xe5e69966,0xf26eca4c,0x2293b7b,0xf66ab948,0x23060042,0xf28fc968,0xaee561b1,0xf28dd66c,0xfdfeee7f,0xf28fed84,0x40000105,0xea0bbd88,0x1011140,0xea0ac5a8,0xdecfdb27,0xfecdf648,0xdbeae9d6,0xfb0eede6,0xaa786004,0xf24de9ea,0x1616a6f6,0xf6f1d166,0xaf4f0d1e,0xfa6aee28,0x6e4e5f7f,0xfeeff22a,0x263f2b37,0xf290e5ca,0x6e677f2b,0xf6b0e5ea,0xe959aaed,0xf6d0ea4c,0xbae5dada,0xf6afe1ea,0x2e0a1f1f,0xe189cd48,0x556a6e,0xe230a464,0xe9c484da,0xeda9d126,0x555495,0xef18a464,0xf6eab5f,0xf26de5c8,0x9b251d0c, 0xf26fd568,0x25ae6a1a,0xfa6ddd68,0xf4f5c341,0xedc9d567,0xa3f3514a,0xd969d948,0x595951,0xf2d4a844,0x55a4f5f7,0xe5ecccc6,0x555555,0xeb599c44,0xaf6b2a1f,0xf24be566,0xb3ffffbf,0xee4cd986,0x6f5ede94,0xd4e5b928,0x905c9f9f,0xd928c8e4,0xfef5fdb9,0xfa8ce1c6,0xf8d1c4ef,0xf609d924,0x9ad6c3c2,0xdd69c0a4,0x1f0e4bdb,0xd948b8c4,0x14051171,0xc1abb926,0xccd57170,0xc568bd27,0x6ebdb969,0xc149acc4,0x4b5b7702,0xbd6ab0c4,0x66a4dc4c,0xc148b4c4,0x84f9909d,0xbd8aad08,0x98287f6b,0xc16ab0c4,0x84c8e9e5,0xc549ac62,0xf0f4e9fd,0xede8d504,0xd7ff1a51,0xe189d526,0x8f4f1f1f,0xe18bc8e6,0x2a4b4988,0xd968bcc4,0x55fdfd75,0xd549dce9,0x555595,0xf3179422,0x4cde2e,0xcd4ab4a4,0x554141,0xc6309022,0xfbd60140,0xdd8ac506,0x6ffbaafb, 0xe189d524,0x6f6a5529,0xc969a8a6,0x9d8edfee,0xd96bb884,0x95fbbf1f,0xd549c084,0x555595,0xe2b49042,0x87e3d2a9,0xb8e8a862,0x11556,0xe6b49864,0x30383c7d,0xf20add46,0xf068ad64,0xd588c506,0xbed9c494,0xe987d124,0x40a3b7b6,0xd5aaccc2,0xf4faf4f4,0xbd058c00,0x100050,0x84028000,0x479befaf,0xd18a8822,0x0,0x8c878000,0x8a474792,0xde0ab8e4,0xcfc39a4f,0xd9aac904,0xbebebab4,0xd946b106,0x5f1a6a6e,0xf208c926,0xd0d6ebab,0xc4e79800,0x0,0x91098000,0x6affff6e,0xc9089840,0x0,0xad298000,0xefefff11,0xb8e79442,0x5e4fafbf,0xd18abd26,0xeaffbf00,0xb508a484,0x3a34b8e6,0xc148b0e4,0x565a6d6d,0xcd68c126,0x4d4f1f2b,0xd169c56a,0xef5a46aa,0xd149b4e4,0xd5849aee,0xddcac926,0xbfabeb57,0xc9289c42,0x3d2f8fbb, 0xc508c0e6,0x5666af5a,0xc96b9822,0xb1f1e161,0xc929b4a6,0x9d4e5ea9,0xe1cccd26,0xecfd797d,0xdda9cd06,0x1629b571,0xcd69b8c4,0xd4f1ba26,0xd969c0e4,0x383c1c0c,0xc126ac62,0x1e2bf424,0xc94baca4,0x54263a3b,0xedeac104,0xfe160f09,0xd589c126,0x45e5f2d,0xbcc68000,0x40000,0x98008000,0x9aebffff,0xd9cb9ca2,0x10000,0xa4848000,0x7969282c,0xd167b528,0xa67c1424,0xd9cad184,0xa8b8b5b1,0xe1c9d4e2,0xa78fce95,0xd9caa000,0xffffeb96,0xe1c9b060,0x19,0xad2a8000,0x2526273,0xc1078c00,0x500000,0x80428000,0xaaabffad,0xb4e88c40,0xe191eae6,0xb52a9822,0xbefee151,0xa4c79044,0xcbeef666,0xa4e79c82,0xe4e8e5e4,0xc909a8c4,0xdae6a5e9,0xc54ab8e6,0xc1d5d9c1,0xb929a8c6,0x9de5d0c4,0xb949ad06,0x7f7ee681,0xb9099842,0x387dbe7f, 0xb527a084,0xe6a7faa5,0xa4858400,0xf8c04090,0xb529a084,0xe6e16231,0xc16ab4e4,0x91a1e6e6,0xc9acb506,0x95e9e8fd,0xb926aca4,0x5c18e5a1,0xc1a9ace4,0x3f1f6f6e,0xddcbd148,0x1a6a5969,0xc127b084,0xb4e0f6f5,0xd988c148,0x68bdbcf8,0xddabbcc4,0x96445c6f,0xc149b4c6,0xe1e585e9,0xcd49b4c4,0xdbdac814,0xd96abca4,0xe9bcaaeb,0xdd89d926,0x775280e1,0xddaac4e4,0x9c8161b7,0xe1aacd46,0x9f1b9786,0xd96ac906,0x6faf6e9f,0xd549b062,0xff8f1c1,0xe1aad126,0xb6b2444c,0xe1cbd568,0x633b2f17,0xc1299886,0xadd29e5e,0xcd29bcc4,0x2c5d7df4,0xc508bc84,0x645cfcb9,0xd14ab484,0xf83632b2,0xd9aacd46,0x7ebed9e4,0xe5a9b8c6,0x46c594d5,0xa888a084,0x145458,0xcdc88c46,0xa7b93d7f,0xc149a464,0x555696,0xd5ab9046,0xe2c1cdf9,0xe1aacd06,0xaaf6f6ba, 0xd149bcc6,0x7f2f2f1e,0xe1abbd28,0x3a291f3f,0xcd48a884,0xedf9bc48,0xbd09a022,0x555555,0xcd689487,0xa779263f,0xb4e99444,0xa55647,0xc94a9486,0xfbe11699,0xc568bd06,0xfcf8fdfe,0xcd289866,0xf995cf8e,0xc169b106,0x5a0742d6,0xc5acb106,0x55d1e4ac,0xc969a884,0xc0d0b1a6,0xd9aba8a6,0x67a7f6e1,0xe1ecc0c4,0xeeeb3737,0xddaacd04,0xf3fa2642,0xbd48b526,0xc291fbcf,0xbd89b528,0xbbd9fae9,0xca0cb568,0x7e392e2f,0xc1cbb146,0x56814687,0xc588b548,0x97d31156,0xc5abb126,0x63b7edbe,0xc5cbb526,0xeaa671f3,0xc1aab126,0xc48480c4,0xcdcba8a6,0xc491e0e0,0xe1a9b4c6,0x730763fb,0xe5aad546,0x3e293b33,0xe1aad526,0x89c0d4c8,0xb14c9c64,0x556559,0xc9468468,0x74686438,0xc96abcc4,0x90e5b9b5,0xd12b8442,0xe578356,0xc569b506,0xedcfdf5e, 0xd98bc528,0x599eae6,0xbdaba8c4,0x9f9ec945,0xc548b508,0xfdeca8e8,0xd549bcc4,0xa5baff,0xc92894a6,0xe37b6faf,0xc928a422,0x67aae6,0xb1089862,0x7f7f80a9,0xea08d142,0x23773f6f,0xee4bb8c0,0xbabba7fb,0xfb10ee4a,0xf9f7fbba,0xf70fee48,0x2f2fb7b2,0xeaafb902,0xbebeea9e,0xf6cdee06,0xf0f1e5ec,0xfb11b880,0xb9bdae5a,0xfaadbce4,0xb0d0d4f4,0xf2ace9c4,0xf5f1e0f0,0xee6bd522,0x2e1f6e2f,0xfb51e68c,0x2f6fafea,0xf6cda4c6,0x75b2b2f2,0xfaabf1e4,0x4650a0b2,0xea07a000,0xfaf93a2e,0xf710bd40,0xaecfdafa,0xf731ea6a,0xe783f7fb,0xee6bd164,0xb7fbbe7f,0xf26cc542,0xd2d4e9f6,0xfaced0e2,0xa0561191,0xd967a400,0x5f0b062a,0xfecbe5e6,0xe0d9eef,0xe60bc8e2,0xace5e0a0,0xddc8c0e2,0x53541d6d,0xe1e8cd42,0x66572b6b,0xfb0fd480,0xb53d1060, 0xe165c060,0x7d69a9ac,0xef33feea,0x5ffffef9,0xfb52eeaa,0x41415060,0xfa29dd02,0x70201515,0xe5ebd080,0x4f6e5a1a,0xfb93ea28,0xdaeeef8f,0xf2eec5c6,0xabbae9e9,0xf713deee,0x7a7f7f7b,0xef32eeaa,0x46597865,0xf24cd1a6,0xd5e9a9a5,0xee8bd8c0,0x3a2a6579,0xf375eaac,0x5b6f3e7a,0xf331eecc,0x75716191,0xf62bd942,0x78a4a8a8,0xee8de1c4,0x97020006,0xe5eda420,0x7071757,0xe1ec9000,0x5f5dacac,0xff50de28,0x1f1f5f6f,0xf396e608,0x16065516,0xe9eca000,0x46393723,0xddcab4a2,0x7dbe5c58,0xeeafde48,0x6b3f7f7d,0xea8eee08,0x4f5b5b4b,0xef78f268,0x3e3f1fcf,0xf356da8e,0xb0706468,0xee8bd9a6,0x74f4f0e0,0xee4aee46,0xcac9dd6c,0xf774de8e,0x52f0f8e9,0xf311d1a6,0x1a1b5260,0xf68be208,0x79360206,0xfacdf26a,0x82c2d2c1,0xf26dc4c4,0x979b8703, 0xea2ac904,0x6f7f7f6b,0xe68cfa24,0x2f2d2d6f,0xef95ddc8,0x46464283,0xf2ade5a6,0x2d1e0e0a,0xf26ed164,0xbfbfab6f,0xeaf1f5c4,0xbebfbfbf,0xf30ff500,0x4f0f1b4a,0xe608d964,0x869a9f9f,0xee07dd44,0x5e5e5e4e,0xff30d8a0,0x2f1f5f5e,0xeef0d4e2,0xab5f9f8a,0xeed0d984,0xfe1f4bde,0xee28d964,0xe7430a2f,0xf249a860,0x577bfce9,0xede9b060,0x15253434,0xf24ca000,0xd1e1d050,0xf313b082,0x68adadde,0xff75da46,0x1f1f5fa9,0xf7d8fb0e,0xdbd1d1c6,0xfb30ee8a,0xd0f5ffff,0xf753a840,0x1e17571b,0xe75aeeee,0x6faa6f5f,0xef11fee6,0x86899aea,0xf6cce962,0x47868787,0xee69ed84,0x1b63e3d3,0xfe2abc60,0x874b4b9b,0xea2add22,0x864a4a4b,0xee8edd44,0x8994d2d7,0xd9cbe184,0x83838383,0xf68be166,0x9bc7c587,0xe985e164,0xddcb63e2,0xda2cbd42,0xd55150e8, 0xfb13d8e0,0x59efae3f,0xf28cd584,0x4b3b3b05,0xe24eac80,0x5a176bea,0xe921c082,0x2f1f065a,0xe566bc42,0xb0f07057,0xc0c39c00,0x7c7490a0,0xd567ac20,0xfefeea9d,0xf353de8c,0x6d6e2e3e,0xfbbacdc6,0xbdbeb9a5,0xf26bde8a,0xf4f4f4f4,0xee8aed03,0x6d6d6d6c,0xfb93e1c4,0xa496a2d,0xfa0ac4a2,0xe4a090e8,0xea69d8c4,0xb911d0d8,0xedc8dd64,0x5e1f2125,0xf331c8e2,0x3f3f2e2e,0xf2ace5a6,0x1e2e6e6e,0xebbbf1e4,0x3f3f1a19,0xeeaedde6,0x172f1f2f,0xea09d9a4,0x81c4c510,0xfe8ed966,0x1a172b2f,0xf2cddd84,0x81c79312,0xee2bcd24,0x40904207,0xd4c39800,0xfef8f0d0,0xc880ac00,0x664f8efe,0xe1a7d144,0x9bc7d0fa,0xeaaecd86,0x26b3abbf,0xd124ccc0,0xd4954753,0xea29b8c2,0xd1e1e1d5,0xffd8d166,0x8742a184,0xe6add5e8,0x45f8be63,0xe166c8a0,0xfc8c021b, 0xe567d0e2,0x7a7fb8a0,0xee2bbce2,0x6aaaf5b5,0xe1c5a000,0x22520655,0xea4dc8e2,0x462e2f2a,0xe1a8c0e2,0xfce1ba7a,0xe166b8a2,0x62a7656c,0xe1a8d102,0xfe1e2de9,0xf334ad48,0xe5a5e9fa,0xe359f750,0x1fabba3e,0xeb57ce4c,0xbb5b4b9f,0xf378e6d0,0x7ffbfaf9,0xf355ce0c,0xe0e4f2e,0xeeceb588,0xd0e1e7ab,0xef33c5aa,0xfdfef4e0,0xef569d06,0xfee7e7ff,0xeb9bdf16,0xdbdeefef,0xeb7ae356,0xf0303d1,0xe739b9ca,0x8bcfefcf,0xeb7bc230,0xdfdfdbdb,0xeb9deb78,0xdfdfdfdf,0xef9deb78,0x4f4fcfcf,0xeb58b18b,0x8b0f2f5f,0xe338c20e,0xbd3d2d1e,0xf334b504,0xb8b8b8f8,0xeb78fac6,0xfffffefe,0xeb3499ae,0xfef5faff,0xef57dafa,0x41e9b8f8,0xf6efc544,0xf3d24101,0xf3118000,0xfffffffe,0xef56e64e,0xebebefef,0xe758f770,0xdf8b8f9f,0xebbfeb98,0x35b6fef, 0xdf58b98a,0x8e4a4787,0xf3bbb9aa,0x170ffdf,0xe2f6c5ed,0x2f5f0200,0xf3bda8e4,0xffff7f3f,0xeb7ac5ce,0x1596a112,0xd20db546,0xb6a4f8be,0xf3bbbdcc,0xffffe6ea,0xe759ca92,0xc2c1c6eb,0xe338ca50,0x7db9baff,0xe359b9cc,0x6b2b3f3d,0xefbcad48,0x7a5b0fcb,0xef7cadaa,0x43000865,0xda91b9ca,0x608edff,0xd6d4b9ca,0x80103,0xca2eb988,0x381c5473,0xdaf6a168,0x40d4d464,0xc20fad8a,0x9192929,0xded5a8a2,0x4505050a,0xdf79ace6,0x1743541,0xc650adaa,0x6d0c1c18,0xf7bda98c,0x11155445,0xef36a906,0x44000010,0xf7bdace4,0x21012fbf,0xe2f5c1ec,0x44d2d72,0xd6b2b58a,0x30302000,0xdef4a526,0x3e142030,0xeb37b18a,0xd0010114,0xe736bdca,0x4e9cbce8,0xef58c22e,0x2f0fefbf,0xe758b9cc,0x3f3f3522,0xe337bdcc,0xbc0d0f4,0xd6f7a96a,0xf4f8b0f, 0xd6f7b5ac,0x2b27765a,0xeb569c82,0x272a2e3e,0xeb37cd88,0xf6aa4e0f,0xdef6adac,0x5769b8f4,0xdaf698c4,0x53333737,0xf356c18a,0x7f1f0703,0xeb76b0e6,0xb00084f2,0xf711e24a,0xf8f8e4d4,0xeb12faea,0xf9d5eaef,0xeb79eb56,0xf1f1f6fa,0xf379c60e,0x6fafaf5,0xeef0d9c8,0xa6b6ba03,0xe62bc122,0xe4f1f5f9,0xeb9beece,0xa7dbe2f0,0xf798d20a,0xffffffff,0xeb7ab0c4,0xffc7e7ff,0xeb9ad6d4,0x721392d1,0xe315b106,0xcbc3cbfa,0xeb37d2b2,0xff4fafff,0xeb9ddef6,0xbf9fcfff,0xf35898c4,0xe6d1a1aa,0xeb9bf332,0x2eedfafa,0xeb36dab0,0xd5cad3a3,0xdef1cdc6,0x186cbce6,0xe66eb4e0,0x474b4b56,0xff31d5a6,0x59f9be83,0xeaafd5e8,0x61325d49,0xeef0e24a,0x4bbd68,0xeacfd62a,0xf9a47459,0xe6cdd166,0xbaaaaab6,0xf68dc102,0xeb7a191a,0xe713b986,0xf905b1fb, 0xe713d68e,0xbeabbe3e,0xf757c1ec,0xb5182f2e,0xe715ded0,0xee6d78b8,0xf757c1ec,0xa8c495fa,0xe714c1ea,0xeb91166b,0xf398d68e,0x2edaafbf,0xeb35bdcc,0xf0f0c182,0xef58ce2e,0xffbf2bb2,0xe358be2e,0x3b36763f,0xe338c650,0x79f1f4bd,0xdef59ce4,0x7bb3e5ee,0xeb79b5aa,0x693bf3f,0xe736bdee,0xf8fe7f3e,0xe337ca2e,0xa891faec,0xe316b16a,0xfdee8191,0xdb169082,0xdedffbfe,0xdf18df16,0x1f3f3737,0xe6d3c549,0x6a691f0f,0xe755b4e4,0xff7c098a,0xdb17c250,0xafcfcfef,0xdf18c650,0x1a1a6a6a,0xfbfdb902,0x9a8a9a6a,0xf3dbc1ee,0xfeefdf1e,0xe736d26e,0xa5d1d4e8,0xeb58da8e,0xe3c7cfdd,0xe316b58a,0xeafffffa,0xeb36d692,0x4a45b47d,0xfb78d270,0xa4eafdad,0xeb33ce2a,0xd1da5bd6,0xef76dab2,0x4a5f2f3e,0xfb79ad46,0xbf73a3af,0xdf17ce90,0xf3f3f3fb, 0xe2f4c1e8,0x10252a5a,0xf3bcca92,0x2e7f7e25,0xe339dab0,0x91f1b3f7,0xe716d68c,0x6aabb675,0xeb12ce6e,0x6a191a2a,0xefffda2e,0x1f0a6479,0xdf38ca0c,0xd4a5988,0xe167c4c2,0x2e1aefbe,0xd589c0e4,0x7dbefeeb,0xe587b4a2,0xd3616674,0xcd47ac60,0x90f9efee,0xc0c69000,0x0,0x90848000,0x7a7f7d7,0xc1288c00,0x1,0x84c48000,0xd0b5372a,0xdd67b020,0x2e681450,0xdca3b400,0x3190966,0xbc66bc40,0xf4a05003,0xcce4ac42,0x4e9f9b6f,0xb8839400,0x0,0x9cc48000,0x41070bf6,0xa0868c00,0x0,0x94c58000,0xeafbebd4,0xa8859002,0x625696ea,0xb0e6a8a4,0xaa5a9f47,0xa4648c02,0xede1b6ba,0xb5289842,0x4bbfbfb7,0xb1079c42,0x899e2faf,0xb507a8c4,0x7674a89d,0xb1089c62,0x2417d7a3,0xa8c69862,0x2dbeba69,0xa8c78c02,0xdbf6d165, 0xb108a4c4,0xb0f9ef85,0xacc68c00,0xbf16087c,0xace79c64,0xb476fbdf,0xb4e8a4a4,0x346babb8,0xb1289c62,0x683835bf,0xb107a8a4,0xb2c68dae,0xb508a484,0xc5ba6ae9,0xd9c9b080,0xebeaf5c0,0xe68fb0a4,0xff6dfef7,0xeab0d22a,0x1f8fcb9f,0xd2719c62,0x152a2f3,0xb1288c20,0x0,0x94a58000,0x14657,0xcd468800,0x0,0x98848000,0x42140a0f,0xd9c8b040,0xf5f2e793,0xeed2e64a,0xe14091e0,0xfecac4e2,0x5cfdfffa,0xf2f2bd24,0x99cbda,0xa4818800,0x0,0xc4c78000,0x392f0f,0x9cc58400,0x0,0xacc38000,0xffbfbf6a,0xb0e79402,0x65e4e1fa,0xb948a8e6,0x1f468d0c,0x9c869422,0x84a8e5f,0xbd499c84,0xb1799685,0xda2fb0c4,0xc4d691a1,0xb928b0a4,0x885d6958,0xace6a062,0xcc99abd5,0xc107a020,0x66e54905,0xb9099002,0x5e006069, 0xc9499422,0xd9e78381,0xf24eac20,0x69284c89,0xc506acc2,0x8189c5de,0xd5ce9c62,0x6f6e5743,0xea0d9c00,0x3a2fd7eb,0xd5aab4a2,0xb6ba5697,0xc906bc62,0x6e1aae45,0xc188b546,0xdeeeed6d,0xc1ebb168,0x5f353074,0xb969a0a5,0x2fbfbf6e,0xbd8a9440,0xf5a4691f,0xc1ecad66,0xee50e5eb,0xc5ebad26,0x4441931b,0xc5ccb106,0xbaf6d281,0xb107a8c4,0x8a3c7c6a,0xb128a8c4,0x681e6eea,0xb108a084,0x96a4a575,0xb108a884,0xa0a3bbab,0xb927ace6,0x6f9a7e7c,0xace7a4a4,0x7caca4e9,0xacc7a084,0x896865a5,0xb927a8a4,0x7172ab9a,0xb528a082,0x1b3f1baf,0xb948ace4,0x61271f51,0xb529a0a6,0x94faf7ef,0xb108a0a6,0xab143101,0xbd29a8c6,0x3dbda240,0xb908b084,0x5a4656,0xbcc68424,0x81d6dba,0xa8c89442,0x554155,0xc1478444,0xb1bbc6e2,0xb0e7a082,0xb6f16221, 0xbce8a064,0x58e5b776,0xb127aca4,0xfa5a092d,0xb92a9000,0xa87d2e66,0xa8a79442,0x545091,0xd9ab8404,0x5fce81e9,0xac86a444,0x29291e,0xc98b9842,0x95e87616,0xb907acc4,0x7b33b2ea,0xb507a8c4,0x6ead5889,0xbd08a042,0xeee56d6e,0xc508b0a2,0x7b6bbf7f,0xb968a906,0xef3f7f76,0xb968a8e4,0xd4c1064a,0xc168b0c4,0x56d69201,0xc20baca4,0x4f46515a,0xd9aa9402,0xc8dd1c08,0xb907a482,0x50656a36,0xcd498802,0xfa7a0501,0xc149a062,0x1e4a4a89,0xad06a064,0x16566e2c,0xb0a6a0a4,0xb87042a5,0xc928b082,0xe5f4b4b4,0xcd279c02,0xc1c6da9b,0xc927aca2,0x5aa6f0e9,0xc9079822,0xff8aa966,0xb528a8e4,0x695babbe,0xa4a68c00,0x56bbb925,0xbcc7bc62,0x141552,0xd64d9024,0x90d2fbc,0xb084a442,0x145055,0xd673a822,0x77792a16,0xb1289000,0xe8544051, 0xb1098000,0xc9ba77d4,0xb4e7a422,0xf17afbea,0xc0e69c20,0x4b5c2f9e,0xb8e7a422,0x140546,0xde4f8c02,0x3576b1e4,0xa8858800,0x10192a,0xd9ac8000,0xe7d5dc6d,0xfb77da4c,0xb667abff,0xde8fbda8,0x82a3f7f5,0xe64cd166,0x2c292e86,0xea91c964,0xf4f4e5,0x94828400,0x0,0xb94b8000,0xa0a43c,0x98208400,0x0,0xd2748000,0x695ce4f2,0xe314c1ec,0xed9cfebf,0xe715ce2c,0xc0245e3f,0xdef4ca2e,0xd6c5eae9,0xf399da8e,0x94faf6,0xb9488420,0x0,0xbe528000,0x95fefffa,0xda9198a2,0x0,0xb1ad8000,0xa0a0be7e,0xee2ec504,0x81c1c848,0xf336bd68,0x2e6ffab8,0xfb35b926,0x1c0ce5d,0xbdccb148,0x90c0c081,0xeeb2b126,0xa8f8b8a1,0xe22eb4a2,0x9060b0f,0xe716b18a,0x892a7faf,0xea6fcda8,0xbebeff97,0xf2f2a840,0xa0f4fcbd, 0xde6fb126,0x66afdf4,0xfeefa506,0xd1c3871e,0xef14bdca,0xf9b06041,0xe2b2ad26,0xfdeeafbb,0xe6d3de6e,0xf1d9c0d0,0xe6cfd20a,0xd7d3e1f0,0xe2b1e28e,0xe7eeaaa0,0xe6d0ad44,0x2b0397a7,0xde90c5a8,0xfaf9f451,0xe2d0cd88,0x950166fe,0xeb12ce2a,0x65bb6f6f,0xb9689020,0x0,0xc1258000,0x4bafff7,0xcdec9862,0x0,0xb9838000,0x1643fb5d,0xdef3ce6e,0xa6a4bdbf,0xe6f3c166,0x44140506,0xe714c9ca,0x34291511,0xdeafb16a,0x60baffea,0xc1899040,0x0,0x9c008000,0x197f7f3a,0xd22f8c20,0x1000000,0xdecf8000,0xe0416fbf,0xe6b0c144,0xdad4e9d8,0xe2aecdc8,0x5b66e9fe,0xee6ebce2,0x5891271f,0xe2f4ad26,0xc6d2f2f6,0xe6b1cda6,0xaecadbdf,0xe713d62c,0xffdb9729,0xe6cfe26a,0x3273f6f,0xe338a9ac,0x50d0e5f6,0xd9c798a2,0x3c2d2d10, 0xdab29d48,0x21371b1b,0xd9e9b504,0xab0a0e10,0xe229c5c6,0xc8fcfebd,0xdef6b1ae,0x400000c0,0xa5f4a18c,0x2fbfafaa,0xe315be2c,0x252b,0xd2929d8c,0xf65e4c44,0xc547b882,0x2924f8fa,0xddedb062,0xa6e1d0c4,0xe2b1c526,0xea7bbffb,0xe2b2c20c,0x988ce6e5,0xc928b8a4,0xf9302449,0xc948b082,0xd8c4c0e4,0xea70aca2,0x6395b975,0xddecc546,0xebefefaa,0xe2d3da90,0xecfe7eaa,0xeaf3e690,0xe5d1d2d7,0xe2f4de6c,0x55c192d6,0xe2d1de8e,0x55c3d7fd,0xe2f4da8f,0xedc5db9f,0xe2d4da6e,0xef876336,0xe6afde8e,0x6b0706ab,0xe6f2de6c,0xe1f5f4f4,0xbd069000,0xd49495f1,0xc1299c42,0x6f4b1622,0xd1ebbce4,0x4907436e,0xda91b926,0xa0501040,0xcd899c00,0xe46420,0xd1ed8800,0xdf9f9844,0xe670b946,0x5b81d4,0xd1eba400,0xacefe2e9,0xe6f4d20c,0xea54a46d, 0xeb17c168,0x3fff8f6b,0xe2b0de6c,0x6f66eb7f,0xe6b0d60a,0xeff9fdfe,0xe2b1eeca,0x182d91a6,0xd62f9c00,0xb5b6b5f,0xde8be544,0x51606,0xe2d59400,0xc2e7ffaf,0xe6f3d24e,0xe8edfeee,0xeaf2c5ea,0x62938303,0xd6f59908,0x43135190,0xcab49d2a,0xc4d5e9e9,0xe6f2da8e,0xfca899d1,0xe6d0deae,0x97060703,0xdeb3adac,0x6f4b4383,0xd6f5a526,0x439b5d0,0xc6749d4a,0x555b55,0xdf3c9928,0x44050607,0xe3339d6c,0x7070302,0xd6b19d8c,0xe080100,0xced7a98c,0x2b0b0f0f,0xe2f3a56a,0x70f0f0b,0xe337996c,0x40440002,0xcaf6994c,0x99d6d6e9,0xea8cd1c6,0xe8a4f9e9,0xe64bd5a4,0x80d19257,0xd66e9d48,0xbbf7d240,0xde4c98c4,0x584c8c,0xe567c4c2,0x909050,0xde6fac20,0x9ccce1f6,0xcda8b502,0x115b9bd9,0xe2b0bc80,0x3f7fffbb,0xdef4a96a,0xf6bffbbb, 0xda8fd60a,0xd080440,0xceb59d4a,0xaf0f4b49,0xd2d59d28,0x11b5f3b1,0xde0bcd24,0xe5d642,0xde0ea800,0xc50b1faf,0xde2bc144,0x5a9bda,0xd5ebb460,0x9393dbef,0xd316b5ac,0x9257879b,0xe716b5ec,0xda9aeefe,0xdf7ac60e,0xc8ee1a9a,0xd6d5ca90,0x57575386,0xe337c62e,0x930353a7,0xe758c64e,0xe1d4e5e5,0xdf59d6b0,0xf6051655,0xd6f5ce90,0xaa5aafff,0xdb9dc60e,0xbf2bffbf,0xdf18be30,0xbf9dae6f,0xdf13bdc8,0x1e0f1fbf,0xdad1d22a,0xa5aff3f,0xd2d5b1ce,0xbfbfffff,0xd6f698e8,0x1f5f1f2a,0xe314d20a,0x997cbe2e,0xde8ec1c8,0xcb97a5a6,0xe316ca70,0x932b8fcf,0xdef4b5cc,0x171a8eae,0xdf16ca92,0x2f6e3f57,0xdb17ceb2,0xe9d2b397,0xe337d28e,0xd3d7e3e3,0xe316ca0a,0xbf6e3f3f,0xe338d2d4,0x82feea75,0xdaf7ba0e,0xfddcebfb,0xe35bdb16,0xbcbbf3b6, 0xdb18c250,0x87daef87,0xde8cc986,0xdc7c5b07,0xda29cdc8,0x5285bffb,0xe759c250,0xefabe6a6,0xdaf5c62e,0x9689c6da,0xde29c584,0xe32f6659,0xe228c144,0xacacedfd,0xdf36b9a8,0x541010a5,0xe2f5d26e,0x8feeffff,0xe37cba0e,0xf4ff4f4f,0xdb18ceb5,0x36d68225,0xded1ce4c,0x916a3675,0xe2f3d22c,0xfd2e3ab9,0xe359ca92,0xad7f7fbe,0xe339c250,0xc9e6fbfe,0xe39bc230,0xef475998,0xeb7ac672,0xbfbdfebf,0xe77ab5ce,0x1f17ab7f,0xeb9cd250,0x6135bee7,0xe339ca72,0xe6fce0c2,0xdf18ca92,0xce53a7bf,0xef9cce70,0x3fbdbfdf,0xdaf6c1a8,0x24a9884c,0xda92c60c,0xb3ffb572,0xd26fbd68,0xab5fe7a6,0xe77bc250,0x15aba7b,0xdb18ca92,0xf7354bed,0xd670ca2e,0x41411e8b,0xdf15d24e,0x7be5d557,0xe338ceb2,0x6f66aa35,0xdb17c22e,0xf0f1fabf,0xdf18be0e,0x81c3f7fa, 0xdf17d2b2,0x7f3a3f3f,0xe759c988,0xe1f1f6b,0xdb17cdc8,0xa5d69045,0xe35ac230,0x5079f0e0,0xe759d2b2,0x94d79607,0xef34c20e,0xbb6e0d6c,0xf39be68e,0x1b4b9bc1,0xe313bdaa,0x92a7571b,0xef77ca90,0x7e799d86,0xe338ca72,0xdedf585c,0xdaf6ca72,0x1e6beb6a,0xe735ca0e,0x87e7960b,0xe315d68e,0xaedaad74,0xe759c290,0xa9b6faef,0xe759d2d4,0xfdbefebb,0xdaf6c22c,0xa8fa383c,0xdf16c20e,0xfcdae2f1,0xde6ab062,0x4b070b5,0xd5e8cd42,0x96936264,0xdf17bdcc,0x22007eaa,0xdf16b9ec,0xe5d11428,0xe68cd984,0x5052abf7,0xf6ccd584,0x9b9397c3,0xefbbd6b0,0xeffb2b1b,0xe757be0c,0xf7a3e1e9,0xe758b9ee,0x5b4bbde6,0xdf17d290,0x3f7fffff,0xe315c20c,0x9b8b9f6b,0xef77ca2e,0x2ec95a4a,0xdf17ce92,0x75249c7a,0xe336c22e,0xeb293406,0xd6b2c20e,0x667d3f59, 0xe316bdca,0x7a7a4202,0xde09d162,0x61121376,0xe28ec8e2,0x4071b83,0xd66fb9a8,0xa92e2819,0xc62eb588,0x55005275,0xea28c924,0x4552938b,0xe5a6b8e4,0xea405522,0xd692ce0a,0x664a5eb9,0xe2afb988,0xa165b6b,0xdb17d2b2,0xe5c5b96c,0xd2b3be0e,0x65890536,0xded2c5ca,0xb8b44444,0xeb7ab9ac,0xebffae57,0xca72c64e,0xa8b96b5a,0xef799ce6,0xff79a480,0xe739c22e,0x9aee2f6f,0xe338c650,0xffbfb7aa,0xe735b988,0x8f7fb070,0xf355c1ca,0xbe4aa9a7,0xe2f6c22e,0x75bdad6f,0xe737d2b0,0xb074944b,0xf376d62c,0x4c1d6cc0,0xf333cdca,0xb038b8da,0xeb7aca50,0x7b1c3532,0xe758d2d2,0xd4beba69,0xdaf5c64e,0xa6789af5,0xe358ca4e,0xff59e96e,0xe338ca4e,0xb5b6b64d,0xe316bd8a,0x8a0fffa6,0xe737ce70,0x83c1c182,0xeb9ace2e,0x9b855ee6,0xe759d2b2,0xfef4b0ea, 0xdf17c60c,0x33f3f2a5,0xead1cdc8,0xb6d28413,0xeef1ddea,0xbdffdfec,0xef79c22e,0xe0e6e1f,0xf7dcc9cc,0x24286fbf,0xdeafcd24,0xf5e0a626,0xf333cd86,0x5392fdff,0xdb58bdec,0x90f0a196,0xe737ce2e,0xaafffbff,0xeb9ecab0,0xbb7faba2,0xf3bddaf6,0xde9091c1,0xeb78ce0c,0x54e4a88b,0xe715d24c,0xb71301c9,0xefbddf16,0x6c1d6f6a,0xf3bdce94,0xf4ff7f7f,0xe79dad6d,0xe9f0eef9,0xef9bca94,0x3f7ebdff,0xe39cda8e,0x7a70bbbf,0xe738e712,0x8bac3bcf,0xeb9ce358,0x6ed544ca,0xdf18c650,0x4b476e7f,0xef9ad290,0x94d74b5f,0xe716ce90,0xc4505451,0xdab2ca0c,0x1c0814c2,0xe714ca0c,0xd0c2396d,0xe339ceb2,0xf5e4b06,0xdaf7c670,0x838f4f1c,0xef56d66e,0xf5947811,0xe717ce2e,0x1f7f3212,0xeb7bd2b4,0x13420405,0xdf17ca70,0x214be44e,0xe318d2b2,0xd0b03437, 0xeb7ad2b4,0xfdbb8084,0xe758ca50,0x64822958,0xe737ca4e,0xfefaf8a1,0xf3bddaf6,0xad2f9d6d,0xeb7adaf6,0xa6079bfd,0xf798c60e,0xe6e691a8,0xf376ce4e,0xe404beff,0xe3bfd6b2,0x4ddefaec,0xf39cd6d4,0xffffffff,0xe79c8cca,0xfaffffff,0xeb7aceb4,0xf7da9f9e,0xeb7ace92,0xafdbc393,0xeb79b9cc,0xfaeec3c3,0xe359a98c,0xaa0afefe,0xeb9ce358,0xefffffff,0xe77b8e6e,0xe3ffffff,0xe339be0e,0xffffffff,0xe3598d6c,0xff5f3fff,0xeb7ae338,0xdaff7fff,0xe75adaf6,0x50e45f7e,0xeb7adf16,0xfaf3bfbb,0xe75adaf4,0xf5c5e0f8,0xe77bd6b4,0xa6e2e1ea,0xe758e2f2,0xe7d1a650,0xe337e312,0xe7afbfb9,0xeb7bce92,0xfbef8f0b,0xef9cd2b4,0xf5d6e4d6,0xf3bcef32,0xfdfcf8f8,0xf39bd22a,0xa38737b6,0xf3bdeb7a,0xfd6f9fb,0xf3bcdaf6,0xf1c01192,0xef9bd6d4,0xfe92aeec, 0xf7bde758,0x6efcf0e6,0xf3bde778,0xcb4a9713,0xfbdfd6d4,0x8cfffdfe,0xf39bc210,0xee6dbe6f,0xf3bce736,0xa4fcfac9,0xf7bdc630,0xb8baf780,0xeb7ac672,0xb38588d1,0xef57dab0,0xf3b27,0xe315d2b2,0x866a4e52,0xdaf6b9ca,0xfea65682,0xef79da90,0xd0dae3e1,0xdef6d64e,0xbde77eb4,0xdef3ce4e,0x9e9bdebe,0xeb37d68e,0x203c6cee,0xf399d290,0xf3faf9e5,0xf7bca52a,0xfdffbf7b,0xe759a52a,0xbaffffbb,0xfbdce2ae,0x8beaadb0,0xf7bac60c,0xb9b2f6f2,0xfbddd2b2,0xbdf9b478,0xeb7ae736,0xf4af4f8f,0xf3bceb12,0x8bfffbe9,0xf379de8e,0xe2669142,0xe757d290,0xbf75b9ba,0xdef5b5cc,0x72360858,0xef57d690,0xda0509b5,0xef79d24e,0x592973a7,0xe290ad04,0xc1c18144,0xe336d60a,0xdfa884de,0xfbdbce6e,0x49cb5a8f,0xdef6d22c,0xb53f7add,0xef9cd2b4,0xfcfdf8b4, 0xef7af730,0x1fbeee8f,0xf398ce0c,0x6f6f5a1b,0xefbceef0,0xcfaeaefe,0xf3bceb76,0xaa9596ff,0xefbcdef6,0x7f2e7f6f,0xf39bf354,0xfebf6e1e,0xef78e64a,0x79a9e1e9,0xfbfde2f2,0x7557c645,0xeb14d28e,0x2e1d2f3f,0xf3bddad4,0xa4bb7e5c,0xef9cca92,0x15b80929,0xf79adef2,0xce4d3d19,0xf398e314,0x91f8f464,0xe738d6b4,0xbf3b9bc0,0xef7bdef4,0x713a59e6,0xf7bcd292,0x7a7cf57c,0xef9ad6b2,0xdfecedf8,0xf3bcef98,0x850444de,0xef9ce316,0x195e6e3b,0xeb78def4,0x9f5d7c1b,0xf3bbeb58,0x986f9bfa,0xef79e314,0x6a9beba4,0xf3bbce4e,0xe5eaadbc,0xf39afb50,0xf4f0f0e0,0xef7af772,0xf7fababe,0xeb7ac252,0x5f6f9bb7,0xf3bcd6b2,0xf9f4f8f8,0xef9af750,0x89f8f8f8,0xf7bbd24e,0x6b731a2f,0xef9bd6d4,0xbc1f2e3e,0xeb7ae316,0xaaaf6f2f,0xf39ad2b2,0xeda8a96c, 0xef79dad2,0xab8ec6eb,0xef58e2d2,0xe7e9a89a,0xef79def2,0x7c1e0dbc,0xef78ded2,0x2baaa82d,0xf39ab5aa,0x96f2f7fb,0xe316d26e,0xfa544465,0xf39bd22e,0x5f1f3b2b,0xe714b988,0x870f87bb,0xeaf1d24e,0x7e3a6ca4,0xe315bdec,0x82b97ebb,0xe315a926,0xa273371f,0xeb56c1ca,0x7b7bbb7b,0xeb57d1c8,0xcfbb6f0e,0xe2d1c60e,0x8b81e4f4,0xe77bce4e,0x47d5dddd,0xeb9ab569,0x4affbe29,0xe2f4b98a,0x74f1e480,0xeeadd102,0xa4a0e0b9,0xe28dd564,0xebdf9f9b,0xe759ca0a,0xeec7beab,0xeb56da6e,0xb9fcf9f8,0xeaacd502,0xedc97da8,0xeaadcda4,0x571f4f3e,0xe6adc9ca,0x570b032a,0xfb0ec588,0xc0f0e1e3,0xe2f59ce4,0xb86849c1,0xdad1bd68,0xe3a263a3,0xef54c124,0xa593e3d7,0xf754da28,0x688cadf4,0xeb12c1a8,0xf9fd7a6d,0xe6aeace4,0x263e3e7d,0xef34b0c4,0xb3b1f1a2, 0xe6d0ad04,0xbdbdfdfc,0xf332e984,0xb8713929,0xf776e5e6,0x2113b773,0xc9a9b0c2,0xbffbf270,0xeeceb0a2,0x7e3dbd69,0xf754e1e6,0xbdf5555f,0xee49d186,0xf6ee66e0,0xded3b148,0xfdefc6c2,0xe6b09ca2,0xf9edcc92,0xeb37d66e,0xb286d6d2,0xe737d60a,0x68d4a4ed,0xfbbcc5e8,0xdaa66a18,0xfbd9d1c8,0x6b5b2263,0xeb10d64e,0xd9c14263,0xf355de4c,0x4d0d1e1e,0xef78c9a8,0x7f7e2e2a,0xf399cda8,0x8c8eb6ba,0xf70ed1ea,0xb979a9d4,0xf799f6ca,0xe5d5865b,0xf39ace4e,0xe84c8468,0xf378dab0,0xb2f1bbb8,0xf753c104,0x8f669891,0xfb74e66c,0x34b1c685,0xef33d22c,0xfdb8ecf0,0xeaf4da0a,0x87d7abd6,0xfbb8e648,0xd5c1c186,0xef75e64a,0x7b925abd,0xde2bb0e4,0x39b20a3a,0xee8cda0a,0x87cfd3d4,0xfb73d144,0xc0cdd185,0xff50d5e8,0x8a8ada97,0xf3dbe6ae,0xd3d39686, 0xfbdbfb72,0x4a8bcfde,0xf779f2cc,0xa6939313,0xf3b8faee,0xe560e5e1,0xeb7ceaee,0x2abaf6f5,0xf774da26,0xe3a35366,0xf731d9ca,0xeaebef6f,0xf753d1ec,0xdfcfcfba,0xee69c144,0x5b6bab4f,0xfe6a9800,0xfe7b3abf,0xeaceb5e8,0x59eeefee,0xf2cced42,0xfabe5b17,0xe629dcc2,0xe5d1f0e6,0xe1e7d904,0xedffd504,0xee6ac104,0x1dc1d665,0xe1e9d586,0x6c6b2068,0xeeeecd04,0x4113a3f,0xf627cd48,0xfdf5d140,0xe66caca5,0xbefebebe,0xf669c4c2,0x6b7f7a05,0xe1c8c8e4,0x1407091b,0xee0ad146,0xffffea04,0xf6abc8c2,0xf97777b9,0xf68bdde6,0x7b2fba67,0xe9c6d144,0x763b3ab7,0xe1a6c8e4,0xe6e2de7c,0xee6bddc6,0x4241a287,0xe24ad966,0x6693f7b3,0xc8e5b462,0x551666,0xda4ea462,0xd5858142,0xe5c6c8e4,0x5555a5,0xd1eea862,0x6a6d9f0f,0xe609cd24,0x6f0f5ba7, 0xe609d146,0xe4f560b4,0xee4add66,0x4194e998,0xf229d126,0x9b070716,0xdd46c0e6,0x454296,0xd20da064,0x9ead4440,0xd968cce4,0x155555,0xe66f9c64,0x9f099c1d,0xf6a9ea28,0x7fffff7f,0xea0ac0a5,0x7ce4f0d0,0xf269e9e6,0x52abfaf4,0xf1c6cc42,0xabfffa00,0xede8cd24,0x3472bb9a,0xf64ae186,0xfbffff00,0xf6cbc0e0,0x30b97bb7,0xfaedf288,0xff5f2b36,0xea07c4e4,0x8997fbff,0xede9b882,0xc15990a4,0xf2add146,0x91faf996,0xede8bca4,0xf7bb7a04,0xfb0ec0c4,0x777777f7,0xfb0eea49,0x5a9b5640,0xfa29c8c2,0x815056ab,0xf26add44,0xb2631225,0xf228e1a8,0x3173b373,0xe9e9dd66,0xe9e5e8e9,0xff2fe9e6,0xc4d9898a,0xfaeed524,0x97276322,0xe188c8e6,0x555551,0xd62f9864,0xdac0c1c4,0xee08e186,0x555545,0xcdeeb064,0x9f9febdf,0xfaecee28,0xbebfbfbf, 0xfaedfa68,0xc0915343,0xf2adcd04,0x80404080,0xff0fc506,0x6a7fbf7f,0xee0aed64,0x59599a,0xda2f9c00,0x99efe6d5,0xd147c062,0x555555,0xe6f79000,0xe3d3d3c1,0xeb79d24e,0x42d2e797,0xf7bbc5aa,0x3f3f3f1d,0xdeb2cd86,0x8f9b2a7a,0xe2f5d24c,0x35362212,0xe6f4c986,0x1434783d,0xe6f3cda8,0x4251e024,0xde07c124,0x3aed598d,0xf711d5c8,0xe9e5eaeb,0xef9bce0a,0xc4d2f4a9,0xd6d4def4,0x3e2e3e7f,0xdef5fb72,0xbf7f3f3e,0xdaf5de28,0x9f9b9796,0xdf9edab0,0xa4f0a69e,0xeb7ace50,0x2a2a3ebf,0xd290dde8,0x2b1b1a1a,0xdb13d186,0x2eae1e15,0xff93cd86,0xc8cdee5e,0xfb30eecc,0xf9393070,0xfb76de2a,0xc392b6f5,0xf374f28c,0xcfcacacd,0xf731eeae,0x170b9fdf,0xf2cdc924,0x9ecfefe7,0xf732cda8,0xd9151f7f,0xe20abdaa,0xc5c605a4,0xef9cdaf2,0xaf89bfde, 0xf7bbd692,0xef3f2e2e,0xeb35e6ce,0xf3e3f7eb,0xfbdcce2c,0x1f1f8aee,0xfbfbd690,0xdbedefdc,0xef33de0a,0x7c7e7e0,0xef36d20a,0xfc9c0e0b,0xf776c146,0x544a4f6e,0xf753d26e,0xe0f8f9a8,0xd6d3d62c,0xfebebaf9,0xdef6b612,0xebbb92e3,0xdf15a946,0xe4e5e0e0,0xd690c0c2,0xfaf5f4a4,0xdab1e206,0x5294a9eb,0xeef0bd64,0x7470a06,0xe317d62e,0xfbff69ff,0xe715de8e,0xe469a9a,0xf378d66e,0x2aac2eeb,0xef35c1ee,0xf9c08102,0xef58c9c8,0x6e161a1e,0xef9bd20a,0xbebe2a1f,0xf39bf2ee,0x548aaedf,0xe738da6e,0x2e3d3888,0xef56c16a,0x25f7e7e,0xf2efc9aa,0x7561f201,0xfbb8f6ce,0xb5bcfda,0xfbfec9ca,0xc7ffffff,0xf357bdaa,0x7377373a,0xf355da2a,0xefdeacf0,0xf311b948,0xfe3b2e4a,0xf356b906,0xdac9e9fa,0xffdafb0e,0x9a472b7b,0xeb34c166,0x6b7763eb, 0xfb96c524,0xc0991c3d,0xef57b8e4,0xc2c5e0e0,0xf775c168,0x7b7baeeb,0xf353fb0a,0x1707636b,0xff52e608,0x8190a1e2,0xf3b9d9a6,0x50405191,0xef14e1e8,0x9b6fae6e,0xf753f608,0x7affffbb,0xfb12b8c6,0xbdfc3c25,0xdab1b524,0x1f6f9fae,0xdf18b5ac,0x6fffae05,0xf6ace144,0x1e070a0f,0xf6eee5c8,0xadb96a04,0xf715c146,0xbca8adad,0xffb8e166,0xe5c40050,0xf7dcbe0e,0xfe99d2a1,0xdb37c166,0x9642f3fd,0xeacfa526,0x7ffe9695,0xd66fc5a8,0x140e010,0xfa8bc22c,0x46854646,0xb294c22c,0x80404001,0xff30c20c,0xd0c3c1d0,0xee2aca4e,0xbfbbbf2f,0xfaeedd8a,0x6f6fafbf,0xff2fdda8,0x7c7d7e7d,0xff99ff0a,0x7c7c7c78,0xfbb8f68c,0x46979baf,0xfe69d882,0x555554,0xd9ef9c22,0x6d6d2c3c,0xfb73e608,0x696e6e,0xff73c862,0x206074f,0xff0cc22e,0x7d3d3d1e, 0xfb50de4a,0xf0f0b0e0,0xfeedd22c,0x92878aa8,0xf712d64c,0xe9f8ccac,0xfaaae984,0x54589d,0xf6d3bc62,0x6a2b3776,0xfaace5a6,0x59596a,0xfaf1b882,0x79b9febf,0xf732b146,0x556a865a,0xfecdcd04,0x50469ead,0xe3359d06,0x465bafa9,0xf70fe9c8,0xf6f6e910,0xf6eeeda6,0xf9f7b7b2,0xfaacfe48,0x475f5f45,0xfb31e22a,0x4b074a0b,0xfb94eaae,0xe9860717,0xe64aa440,0xbdfffbe6,0xee09e1e8,0x19c0a9a5,0xc9479c40,0xe4e5a92b,0xd9ea98a6,0xe8fc6f39,0xe609cdc8,0x7fbebf3e,0xe66cc24e,0xa6a09090,0xc9c9c146,0x91a6f9b5,0xc60bb966,0xa8a9f8b8,0xf730fdc8,0xeebcb9bd,0xfb30fe68,0x475b9b8b,0xffb2f26a,0x53170317,0xfb50f26a,0xbabfbfbf,0xf2adeda4,0x696969,0xf6b0ac00,0x868263b3,0xfa49ee2a,0x514145,0xea94bc60,0x9e7d2f1f,0xf6cee24c,0xb9094458, 0xf66bde2c,0x84d59650,0xca92c586,0xef7f9a86,0xe5e9c9aa,0x57bfaeff,0xee6cf5c6,0x555555,0xe716c002,0x998500b5,0xedc9d526,0x555555,0xef38ac02,0xbfffffff,0xeb79c690,0x7ffff2bb,0xe737e2f2,0xfefebffe,0xe759adce,0xfef1e9f9,0xe758daf4,0xaf91f5d2,0xef79def4,0xdf5fbefc,0xe737dad2,0xfefefefb,0xeb799d28,0xfadffff,0xe738d6d2,0xbeafefff,0xe778c64e,0xeadbdfef,0xe317e310,0xabeaffff,0xefbbb98a,0xdf9f0f6b,0xeb7aded0,0xefefece9,0xe2f4ad6c,0x87e64b5b,0xdf16da8e,0x8f87dbdf,0xe359d690,0x6f6eaebe,0xe716e2aa,0xebeb27df,0xeb56c60c,0x474a96a6,0xf399e712,0xffbefeee,0xeb58dab0,0xdac4aafe,0xf39ae736,0xab4f8b07,0xf7b9ded0,0x3bbfbb8f,0xef56da6e,0xb5b8d468,0xef78e6f2,0xdee95188,0xf397da8e,0x8282c782,0xe37cdeb0,0x92819191, 0xe37ce712,0xc7e6ee9e,0xeaf2cdea,0xbbabaa27,0xe6cfc5a6,0x448651a2,0xe338e6f0,0x4f4e0e4c,0xe716da6e,0x9b929bab,0xeb33d1ea,0xdecbcfd6,0xe734e68c,0x16579bff,0xeecad564,0xc2e3a552,0xea49ddc4,0x66525ffe,0xdd43c0e4,0xf83a1f26,0xd966cd24,0x26a6d6dd,0xee69d584,0x126a3a26,0xdde7b482,0x91a35636,0xd566c4c2,0xdf5c0980,0xc8e4b082,0xd9e5e6ef,0xe1a5c4a2,0xb9eafae4,0xd545d942,0x10a1f2f,0xd502b062,0x8bc98187,0xe9e8b062,0xb5ba79a9,0xd944c082,0xa77f8654,0xcd04b880,0xd6cac68a,0xee29b482,0xc1d5d2d2,0xd9a7b862,0xb1eaaa1a,0xdde7a840,0xebf7f4b0,0xe1e7b460,0x8f1b8beb,0xd165c0a2,0x2f1f6f2e,0xd986b0a2,0x404196fa,0xe607b8c2,0x8705974f,0xf26acd64,0xc020347e,0xd124c504,0xf5b2fbae,0xd944d502,0x91505156,0xd944c0c2,0x5550a070, 0xe164c082,0xcfcfcfc7,0xd545b463,0x3d2999cf,0xea2cb8c4,0x6f71a5a5,0xd125c4a0,0xd793ebb5,0xd965cd02,0x55595e3d,0xf6f1bc80,0xc7dd4298,0xe187c8e4,0x571b6b2a,0xf399eb10,0xf2b6aa5a,0xf375e712,0xeaedede5,0xef79ef0e,0xe4e4d9ea,0xef9aeaee,0x2a3a7ef6,0xf774e2d0,0x34343a3b,0xf354c5ec,0xa6c1c2e2,0xeb34e2ae,0x9191cced,0xeb13ea8c,0xbbfbd2d2,0xe6aec9c8,0xd24793fb,0xf2f0da0a,0xb23d0adb,0xeef1c9ca,0xd9cac7e2,0xe6cfcda6,0xdba3f6f1,0xeaaecda8,0x3773a7d7,0xea8cd5a6,0xa195a697,0xeaaecd44,0x286bf1a1,0xe22aa8a4,0xa2b27232,0xeb34e6ee,0xb266a266,0xf354de6a,0xe1e6e1e5,0xef33ee8a,0xc5e2d2d1,0xef32e628,0xa5efafa8,0xf310d1e8,0x68b2a5a0,0xff72ce0a,0x8bfaebea,0xeecec544,0xff064696,0xf2efd60a,0x4b176353,0xeaaddde6,0x66736797, 0xe229ddc6,0xbee3deb4,0xddc6c988,0xbcbdb5ac,0xe64ad984,0x1b907b7b,0xee4bd164,0x56561999,0xff10d984,0x3bbcffaf,0xea49d5c6,0xb6faa69b,0xf2abe608,0xf7432eae,0xe228ddc6,0x82d70ad7,0xea08d586,0xef6a2dfa,0xe585c4c2,0x73bafcaf,0xd124b060,0xeeff7f82,0xf28aea26,0xe9ae7fbc,0xea07b8c4,0x6dbaeef3,0xd944b460,0xa8baba7c,0xe1a6c8c0,0xbfcbc0d4,0xd966c8e2,0x51510115,0xd966a842,0x9a8b4bc3,0xe585c8e2,0x1f2e9bae,0xee6bd0e2,0xc281c1c1,0xe609c0c2,0xd0d091c0,0xeaadc0c4,0x70f1f1f,0xee6ccd05,0xb797df0f,0xdd65c902,0xf0c9e5cc,0xea08cd44,0xafcd9ae3,0xe607e1c4,0x6fae92a6,0xdda6bca2,0x6baaa7be,0xdd86cd02,0xcecbdbd9,0xee48e184,0xeffe6f6f,0xe1a6c0e2,0x93ab5f8b,0xe5a6b8a4,0x8b5faba2,0xdda6b840,0x94c5e1a0,0xe208c0c2,0xd8e060a0, 0xe1e8cce4,0x4e47424b,0xea09d124,0xf0b6a6b,0xe5c7cd04,0xf0f0f0b4,0xea4bc8e2,0xc8d0f0d0,0xea4bd124,0x757cb0f,0xea4ac4c2,0x161b0757,0xf28bd0e2,0xbfbabefa,0xdd85b062,0x6f9fefbf,0xe207dda4,0x59a6beff,0xe6ecd9e8,0xcd58f9a5,0xe24bd9e8,0x66276b4b,0xe228dd84,0x766f4aa6,0xe5e7dd84,0xbeecddec,0xe28dde28,0x38ba7ebe,0xe6ade648,0xe5d4e4fa,0xe336d62a,0xf4f0f0fa,0xe314e730,0x1f1f9baf,0xdf14cde8,0x2f2f6f2f,0xdef5e2ae,0xfcfefdf9,0xe713e2ce,0xbf7ef9d0,0xe313daf2,0x1f2f2e2e,0xe337e2f0,0x2a2f675f,0xe316e28e,0x13434775,0xddc4cd04,0xa3b2f16b,0xe9e7e562,0xc9d6e2a6,0xeaafcdc6,0x85d9e989,0xeb13b0e4,0xa9b1f1f1,0xee48e9e4,0x25516536,0xee6add62,0x261a5aea,0xeef0c1ca,0xe1c1c5d5,0xe6f1ea6a,0x2b2b6bbb,0xef77ce0a,0x8b8b97aa, 0xeb55e2ae,0x7d3e2f3f,0xe2f5e2d0,0xbe2f4e49,0xe715e2ae,0x518bcb8b,0xeb35deae,0xebdac683,0xef54eaac,0xbd7d6f7e,0xe314de6c,0xaab9bfff,0xe715def0,0x99aaffaf,0xd2d4deae,0xaaeea8a8,0xdef4d28e,0xefbfffff,0xd719a58a,0xffcfefef,0xd6f7ce92,0xaaf6eaaa,0xdef4d6d2,0xb4b8b0e9,0xdf15d28e,0xda99efef,0xdb39d6d4,0xdaddeee9,0xdb18d2d4,0xafcfdfef,0xced8b20e,0x7f7f3f6b,0xd2d7ce92,0x9656165a,0xdb1ab630,0xaba39a59,0xd6f7c252,0x2b5d377f,0xd6f8d2d4,0xafb7b32f,0xd6f7ca94,0x5542559a,0xdf39c672,0x51550545,0xe339ca92,0x3834b9b4,0xdf15d68e,0xb6f8b938,0xe315dab0,0xf7faf0aa,0xdf17c652,0xeee5e9e3,0xdf18d6d4,0xbcb8f87c,0xe316d66e,0xfcbdfdf8,0xe316d24c,0xf4f9e6c9,0xdf38d2d4,0x59faf8f8,0xe338db16,0xe36f8f7f,0xd718d2d4,0xfffbbb6b, 0xd6d6a98c,0xeb410505,0xdf38d2d6,0xfcfbffaf,0xceb6a12a,0x5b7ffbfb,0xd6d6ca72,0xfe2babff,0xdb18d6f4,0x55469fef,0xe77aceb4,0xbba72719,0xdf17cab4,0xf3a7e3e,0xee49d544,0xbaaaae3b,0xe5c6bca2,0xe6d6e6e5,0xef57d9a2,0xeefa2aaa,0xe64bc184,0x6eac0039,0xea08d964,0x5e0f4a20,0xee8bddc8,0x975b9bfd,0xef51ddc8,0xbe570195,0xff95ef0e,0xf39322e2,0xef11b0e4,0xb28246a2,0xe6aeda08,0xffffffbb,0xeb35b126,0xffefffff,0xe713b0e4,0x578366af,0xeef0c586,0x2e1d3b7f,0xeb13ee6a,0x9ecaebff,0xef32de8e,0x7e3a7e6f,0xeaf1eace,0xa6d9bcce,0xea4ac902,0x41659152,0xe26bbce4,0xe4e8aebf,0xf732c20c,0xaab6a4a0,0xeaf0ce2a,0xba7f7f4e,0xea08d1a6,0xf9edf239,0xee6ae5a4,0xe0b8b7a2,0xef11c9a6,0xa9554480,0xf393e64a,0x2f1f1f1c,0xe734ea48,0x6f2c2d2f, 0xeecef6aa,0xfefabb9e,0xeaf0da6c,0x6e6e6dae,0xef32e208,0x2f3f6fae,0xf2cea062,0x7fbf7f3f,0xeeae9400,0xbdb9686e,0xeef0d562,0xe1f5b8b8,0xeaadb4c2,0xffbcbdbc,0xe314ce2c,0xfefcfcfd,0xe3149ce4,0x3efdfafb,0xe339df36,0xab79dd3f,0xe338daf4,0xe8e4feff,0xeb35ca4e,0x2d7fbffd,0xeb57e6f0,0xfe3f3fae,0xe339d6d4,0xd3e8fff,0xe339d2b2,0xfbd7cbbf,0xdaf7c230,0xfaf4f0be,0xdaf7ca94,0xbf8fffab,0xdaf6c20e,0xb77f3f3b,0xd6f6c16a,0xcfa57eff,0xdf18c250,0x6fca6a79,0xdf17ce92,0x1b95933a,0xe317c250,0x193d3657,0xdf19d22e,0x5e544f3f,0xef79e2f2,0xb8bebe7d,0xe756e26c,0x2e3e7e9a,0xe77aca4e,0x4e6e6e7f,0xe75ab9cc,0x397579b4,0xeb55f330,0x3e7ebeae,0xef78d24e,0xdf9f0b0b,0xe75ac62e,0x1e7e3fbf,0xe75ad292,0xbe6a1faf,0xdf17be52,0xb1f0d7fd, 0xd6d6b5ee,0x5040202,0xef79c60c,0x2a255656,0xeb9ab526,0x3071b6e3,0xdf38c250,0xffb5f1b3,0xdf18adac,0x5a266a55,0xeb78d62c,0x1230be7f,0xdef4c1aa,0x6b7f6008,0xf731e68a,0xb3b7af6f,0xfb71e28a,0x8d8acedf,0xf30fea4a,0x9ad8c989,0xff31ddc4,0xeefde2b2,0xf30fda2a,0x1b07479f,0xf3bdfb2e,0xadcfcbda,0xfb30e22a,0xa2a69aa4,0xff0ed5e8,0x844a5b18,0xf6eeee6a,0x4b170755,0xeeeeee48,0xaf9d68a4,0xfb0ee1e6,0xbe2eefbf,0xf28cd584,0x1107474b,0xf310f28a,0x47074643,0xf752f2cc,0x6d9cb1b6,0xfaeee5e6,0x67aebead,0xfb2ed944,0x5b8b6b1b,0xfbd9de6a,0x7030767,0xefbcf2cc,0x96965691,0xff73e5e8,0x9a898a86,0xfb51f248,0x9fbbfa6f,0xf332d166,0x5b6f6faf,0xf398f5e4,0xe0905095,0xff50a840,0x189e1,0xdd669442,0x4b474746,0xf775f2aa,0x4b47874b, 0xf3b7f2ac,0x55d7773,0xf6abd185,0x2a1a2e1a,0xf70ee9e6,0x4a4f8f4b,0xf354f28c,0x1f0f4f8f,0xfb2ee9e6,0x2d2e2e2e,0xfb71ede6,0x2e1f2e1e,0xf730f268,0xbef960ce,0xe5e8c902,0xaea0b5f2,0xf649d164,0xbeb8b09b,0xe1a7bca2,0x6efe3e3e,0xe5e7cd44,0xd1ddcd5d,0xe608c924,0xf8b1be7b,0xe207c0e2,0xde2f3f3a,0xdda6c902,0x38397eb8,0xe9e9c8e4,0xecd4d8dc,0xea08c4a2,0xe4e0e0f4,0xea08bca4,0x6b1b2b1b,0xe62ac904,0x864b8f6f,0xea2ad124,0xe0a4b8f4,0xe5a6c4e4,0x209080d0,0xede6cd04,0xf4f9f4b,0xe608d104,0x7f6f2f0f,0xf28cd504,0x9c85dabc,0xee6ce1e6,0x9999fafa,0xfb10e5e6,0xfef7e394,0xee6bcd24,0xaafafeee,0xee6cc0a0,0x9f5ab2f9,0xf248ee4a,0x8746aba3,0xfa69e9c6,0xe6f5e1a,0xea0bc924,0xbebeaf6a,0xea6de142,0xb0b0b0e0,0xe9c7c0a4,0x707070b0, 0xf26ac906,0x4e0e2f2f,0xea4ad544,0xd6864a4e,0xf26ac4a4,0x75717070,0xe609c4e4,0xb0b17071,0xdd66c106,0xe1e1e1e2,0xff2fd546,0xd1a1e2e2,0xf649c4e4,0xfeff6f57,0xbdaa9c42,0x30700b4,0xbce78000,0xb9e11511,0xb4e88802,0x51bd,0xb4c68000,0xfafaff95,0xc566a4a4,0xe64699a7,0xc26ec1c8,0xabffff95,0xc968a042,0xf1f1f5f6,0xf64bc168,0xf68b8f5e,0xe168c946,0x5f9,0x99098000,0x6e6a6e7f,0xea08c8c6,0x9e,0xa8a78000,0x9b6fff95,0xc5059c64,0xb1b5f5b,0xd988b526,0xaaa9feaa,0xd1a99842,0xbdfda995,0xbd68b0e6,0xeba37692,0xde4dc1ea,0xf2f0e1db,0xee6ec988,0xe1e0f0f0,0xfaabcda8,0xf2febaa5,0xf68de9c8,0x9aebebfb,0xee70f68c,0x454102,0xe6b3c4c6,0x9653a7bb,0xf22add46,0x554595,0xf317b8a6,0xf1b1b07,0xf24dd926,0x3e2f6f0f, 0xe5a8c906,0x241460a4,0xc56ab106,0x89444b0,0xb949ace6,0x19013c3e,0xe988d526,0x50555,0xeab3a464,0x6abe3e10,0xd968c0e6,0x151556,0xe692a064,0x9ce9a94b,0xd988d104,0x7dfc,0xace68000,0xbfb7a196,0xe187b8e4,0xb9ff,0xb4c78000,0xabeffb55,0xc1089ca4,0x9b43666b,0xd5aad148,0xebefafba,0xc1089c22,0xce5a2fdf,0xdd89cd26,0xa76490f0,0xd589b0c4,0xa1f6,0xd5ab8000,0x3f1586d1,0xd5a8cd26,0x11f5f,0xcd468400,0xa89aaa46,0xace99464,0xae889c9c,0xb909b0e6,0xde4f5f05,0xacc59862,0x198e9ee9,0xc589b504,0xd0d5dbef,0xd989bcc6,0xe8f5a041,0xd548bce6,0x7e7eba68,0xd969b8a4,0xaf6b1f2e,0xe189a8c6,0xf4d8d0d8,0xd569c4e6,0x5490a0,0xd1679068,0x1a7ebe7f,0xd989b8a6,0x150914,0xc4e6a4c8,0x1c0e9a36,0xc549b528,0xf4b8e4d8, 0xd989b4c6,0x9422e9e1,0xc1cbbd88,0x9ac2a5e1,0xc1aab966,0xf8fcf4f4,0xd968b108,0x80e4d4e8,0xc1089084,0xbf5b0392,0xd18ab106,0x46fafbe,0xc9079c86,0xe5f6f6f4,0xf2cde162,0xffbfc7dd,0xea4bb8c2,0x2994a4a9,0xfb51e228,0xe0e4d919,0xfb30d144,0xe0fdeff,0xea09bcc4,0x627fab4a,0xe1c7c4c0,0xe4e0e6e6,0xfb51d8e0,0xe0b0b0a4,0xeecde186,0x5f5f6faf,0xeaafe9a6,0x4b5f4f0e,0xeaaeea28,0xf1f1f1e0,0xeeae9c42,0xf1f5f1e0,0xe20aa822,0xb0b4b0b,0xe756e64a,0x580e1f0f,0xeecfea8a,0xb0b0b0b4,0xeeaddd86,0xb2b2b5b0,0xf310dd44,0x767a7676,0xeeacd8a0,0x27871b36,0xee29d186,0xf8f4e0e0,0xef33b906,0xfcfffefd,0xf332b4c2,0x7636268a,0xea29f164,0xe68ab7b3,0xe9c7e5a6,0x7e7dbaf8,0xde09a882,0x9742465f,0xe123ac00,0x8b4b5f5f,0xf352e5e8,0x92cb8f4f, 0xede6d904,0x762272b0,0xeef1e9e6,0x1d193232,0xea07dda6,0xa4d49091,0xf26bb420,0x5481c4d5,0xead1d584,0x1ac2b5ca,0xdd88c8e2,0x51124652,0xe22acce4,0xbf3f1357,0xeb57ef54,0xe3c78faf,0xf354b188,0x7fbf2f4f,0xeb7abdcc,0x2f3f3f7f,0xeb9cd290,0xfdedfae3,0xef56da8c,0xf8f0f5fe,0xef33a8e4,0x2fb3f2f,0xe35aca2e,0x9f9b0300,0xefdfbd68,0x797aaffe,0xe338be70,0x102af3,0xd292b9aa,0x14141515,0xdf56ace6,0x6061415,0xd2d5a926,0x6146440b,0xd6b4b188,0x764934f0,0xeb78c22e,0x6323106c,0xef78c1cc,0x712c5aa2,0xe2f4b56a,0xc8d4e4f8,0xef7aef0e,0xa4c0c5d9,0xef99da0a,0xafaf0f4f,0xe758d24e,0x47d7efef,0xef9adab2,0x90fd3e25,0xe26cc9c6,0x665edd5a,0xe68de208,0x9a7ea650,0xeb35d66e,0x64bceeac,0xeb36ce70,0x8f8a6ca4,0xe338c20e,0x41dbeebe, 0xdef5bdee,0xaf3f7e60,0xdf15b926,0x676b2a6a,0xe379d250,0xfdfc5f26,0xe316dab0,0x397ee6fe,0xef34c62c,0xb8ad8a6a,0xe316d2b2,0x3baebd7e,0xe2f4d22e,0x9b9ff2f6,0xd526b880,0x68ef,0xb0c68000,0xca041c17,0xd0a3b840,0x176b,0xa4638000,0xeaea5a14,0xacc69822,0x65697af,0xb106a084,0xbf69daa9,0xace79022,0x40795dbf,0xb0e7a8c4,0x3f78e4e5,0xde90c166,0x2d,0xace78000,0xfefa8082,0xeeaeb8c2,0x2a,0xb4e88000,0x2e7e2f1a,0xb0e79044,0x4041e5a,0xd60cb0c6,0x5164f961,0xcd26a062,0xab6570fa,0xcd48b482,0x3f6a2746,0xbdaaad06,0x5a0e1d37,0xb9cab126,0xd0f55545,0xb107a8a6,0x80504291,0xb926a8a6,0xb5a687a7,0xa8e8a8a4,0x551a65,0xcce58846,0xad26a9d4,0xb4c7a062,0x645555,0xd9698824,0xeabe6905,0xb8e6b082,0xef0acf2f, 0xb568b126,0xea120365,0xc0e59842,0xd2c2d296,0xbcc5a862,0x16acfaef,0xb8e6a024,0x551555,0xde6e9c02,0xa4f4baa2,0xac848800,0x115556,0xe64e8000,0x6a6f6faf,0xe6d1c104,0x4,0xde2f8000,0xeaef852c,0xe315ca0c,0x90e9,0xeef38000,0x596abdeb,0xeeb19cc4,0x5cbc2839,0xe270c188,0xdcbd6fdb,0xde6eb126,0xffcfdcc4,0xe290d22c,0xa7e6ea88,0xdab0cda6,0x55f7,0xc5458000,0x9e0f062b,0xded1c5ec,0x79bf,0xb5068000,0x9e7ebdfb,0xde6cb104,0x2fbbfaae,0xe6f2be0e,0xb651a879,0xd9e8a946,0x50baff,0xdf599d6c,0xf1fdc580,0xda2fc506,0x54904589,0xddedbd06,0x9f9fdfef,0xeb13de6e,0xbe6f6e5f,0xe2f3ea8c,0x64646408,0xce0db4c6,0x44b490,0xda90a822,0xbefeffbe,0xe2b1e5c2,0x1697fbf,0xe6b0a000,0x1e4f5e2f,0xdab1a96a,0x3e2e2e2e, 0xdab1bdea,0x30261028,0xc62f998e,0x3033230,0xdaf69d6c,0xea4e4a5e,0xea49b166,0x10a45196,0xce4fc460,0x7e3f1b0f,0xd291a18a,0x65557d,0xe28ec4a2,0x95a6fafb,0xd339c1ec,0x4307c3d6,0xdaf5d2d2,0x2b7fbfbf,0xd717ce0a,0xb2f322b,0xd6d5ca2c,0xb0a3a7ba,0xdf16ca70,0x94d8f9fa,0xd6f7dab0,0x1f1e1f2f,0xd718d5e8,0x1f1f1b1f,0xd6b2d1c6,0xe474f9fe,0xd75ace4e,0xf0f0a0e0,0xdaf6def2,0x7bbafeff,0xdf7bc1ec,0x7ebcbaff,0xdf17ca2e,0x94e4f4e0,0xd6f7c20c,0xb4a5f4e4,0xd6d5ca70,0x3a7fbd7f,0xdb17c9ea,0xbd3c5e26,0xdf17e2b0,0xfee7f2a0,0xdaf5c60c,0xebf1f3ea,0xe337ceb2,0xe0f5f4f,0xce72cd86,0x15a4609,0xd717d9e8,0xbfe7efdb,0xe316c24e,0x9bababaf,0xe735ba50,0xb1b1a05,0xce71d1a6,0x6110116,0xd26fc544,0x80e9b4b4,0xce93ce2c,0x8c206450, 0xdf17c20e,0x7e8bbfa9,0xeb57c1ec,0x2e4fca6a,0xded3d64e,0xafedacae,0xdf16ce70,0x8c456efe,0xdf39d670,0x5d0d5b9f,0xdef5da4c,0xc3570f6b,0xf776cda8,0xf8e5f5fe,0xe39ece6e,0xb4f5f5a4,0xe759deae,0xeefefefb,0xe35abe6e,0x46363fbf,0xe759d2b2,0x7174d4e0,0xd2d4ca2e,0x1814b7a6,0xef7aca50,0xc1ae606,0xe759d292,0x5a0a1fae,0xf3bcdad2,0xfbfffaff,0xe77bb20e,0xfae0ee1b,0xe359dad2,0xfabfffff,0xe35bc250,0x8acbeefb,0xe75adf16,0xf939f9f9,0xe759dab0,0x6cecfdfd,0xef9cef12,0x7f6eecd5,0xf3bcdb16,0x9f4bc6df,0xef9bd6d4,0xf61b1d18,0xdef5d690,0x89a464f9,0xe737dab0,0x5f87fcfc,0xf79ad270,0x2edced3c,0xef9beb34,0x550c5c10,0xe2f4d6b2,0x6870f0d4,0xdef5ce0a,0xbe2d2b2b,0xf39beb10,0xbe2fbfbf,0xf7bcf310,0x80613e7c,0xef99daf4,0xf5414541, 0xef79e314,0x499cf9ea,0xef7be336,0x7feba5e6,0xef79d6b2,0x7cacd8a8,0xef7aeb34,0xb87cad3d,0xef7ae314,0xfee8bfeb,0xeb58d6d2,0xd345d7fa,0xe2f6d690,0x47ffb387,0xdab2ca0c,0xafcfbd37,0xe315ce4e,0x4b8f8f4f,0xd690cd86,0x5f0f5f8b,0xe314e22a,0x9753c3c7,0xda4db568,0xeebe5dea,0xe2aec1a8,0xd85ce2db,0xeed1d5c8,0xafa8b0e5,0xee8cb504,0x8ed0e994,0xe2f5c9ea,0xcd507c5c,0xeaf1de8e,0xefd763a3,0xf332da0a,0x7a498ee7,0xef56de4c,0x890c68f5,0xef55e68e,0xee423186,0xeaacd9ea,0xaf2a36bf,0xf797fb50,0xebbe9d6d,0xf356de08,0xa2f2ebbb,0xea8be186,0x9999ee01,0xea28d544,0xf0f7d744,0xea29cd47,0xf1e2f611,0xee29cd46,0x56f6f6fa,0xe1c7dd24,0x515055,0xd60cb084,0x747c793,0xe5e8e186,0x555602,0xe66da864,0xbdfabde,0xf228dd44,0xd5a6e600, 0xfaede1a6,0x409a4686,0xfe67cd06,0x1f2f2e00,0xf6ace164,0x4000d0d1,0xfacdf228,0x559585,0xe64cb464,0xf0f4b1f,0xfecadd86,0x565a5b,0xea6fa442,0x796f3e39,0xdef6ce0c,0xa0590441,0xf334c966,0xbebebd7e,0xdaf5f28c,0x3d3f2f7e,0xd6d4d5c8,0x99d1d281,0xf774eaac,0x42677afa,0xf2eed5c8,0xdbafbe39,0xef7aef32,0xee3f3bdf,0xef34c588,0xfc8df5e6,0xd6b2ca2e,0x69280454,0xded3cda8,0x820a5fbf,0xeb36d24e,0x2f070673,0xf39ade90,0xb9f431f5,0xf777de4c,0xfbfcfa2a,0xef13c60c,0x9aca4217,0xe315c546,0x43579b9b,0xf396f606,0x7ebfab1b,0xeaf4b98a,0xd2a29a11,0xf712ddea,0xba6d2de4,0xd2b3c1a8,0x40404008,0xfe69c250,0xe7daebf7,0xfb75f64a,0xb0a5a6,0xf2f0ccc2,0x6b53c282,0xff0cce4e,0x5569a6,0xfb74d8c4,0xf5f60dbf,0xea8dc566,0xfdbebeb8, 0xf6effda8,0xaf6f0542,0xe1c89864,0xb475a5b,0xda4dc9e8,0xaa6db9fd,0xfb50fe88,0x555a9a,0xf756cc82,0x66151b07,0xfe48c9ec,0x555a5a,0xf715c084,0xdb9affff,0xe379ded2,0x52fadaee,0xeb58daf4,0xfabbffff,0xe379bdec,0xfaf2baf8,0xe315ce4e,0xe6e5e6d1,0xeb9be6f0,0xe247d7d3,0xef56e6f0,0xbfbfbefa,0xded3d5a4,0xf7f7aabf,0xe713d22c,0x5f1a5bbf,0xe5c3d966,0x11075b6f,0xdd82c0c4,0x7d1d1e3a,0xdd44bc82,0x45d0fd79,0xd125c0c2,0x3a786861,0xdda6b082,0x56630059,0xe9e6cd02,0x74783420,0xd966c8a2,0x550050b4,0xe1c8d524,0xc9d2e3d2,0xf398ef32,0x84eb9ade,0xeb12de8c,0xa581d5a4,0xe2cfde2a,0x168a8aad,0xee8bc966,0x8999ddd9,0xeb12ee8a,0xbd2c6aaa,0xeeacd62a,0xd1825345,0xea49dde6,0xf5f1a0f5,0xea6ae1c6,0x1a6b7f6b,0xe1a4c504,0x995a6f6f, 0xee28bcc2,0x70b06a24,0xe5c7bc80,0x6c383474,0xe209c8e4,0xbfbe7d58,0xdd85c506,0x2b576f7f,0xe9e6c4e2,0x3c78342c,0xddc7d0e2,0x3c3c3c3c,0xe209d0e2,0xabebfafe,0xe648cd24,0x95e1e6eb,0xe28bea26,0xbf7f7fbf,0xdf36e20a,0x7f7ebfbf,0xe315e6ac,0x5555080,0xeecccd86,0xc0401958,0xeeefe648,0x771b677f,0xe316e2d0,0xafb6563b,0xeb34deb0,0xfaf9faff,0xd718ca6c,0xe8e8eafa,0xdf17d2b2,0xffbbffbf,0xc696c62e,0xaf3bbfbf,0xd6d6c672,0xd8d4d0c4,0xdb17dad2,0xd9c8c8d8,0xe339ded2,0x8ffaffbf,0xd2d6c250,0xbf6ba6be,0xd6f7d6d4,0x8163e2d6,0xe64ad9c6,0xf690a690,0xf2efea08,0xb4f0f4f4,0xeb12ce2c,0x636751a2,0xeb55ea8c,0x9080c5f5,0xeb12cdc8,0xee49c692,0xeecedde6,0x7673a363,0xeaeff6cc,0x87c79397,0xf2cdb906,0xdcece9e8,0xe338d290,0x3a7af8ba, 0xe737df18,0xae3e3afb,0xd6f6ce92,0x6b29260f,0xd6d6d690,0x3dbf7ebb,0xe337c250,0x7bbfbe3e,0xe738ca92,0x185a1a17,0xe359c1cc,0xebd686a,0xdf16ca0e,0x5a1b6bb4,0xff70e22a,0x574b7a68,0xf2efeace,0x22f1b6c6,0xf2cdee8a,0xbbfba6c3,0xf2cdea08,0x676b5b0b,0xf775fa88,0x1b5f4b4f,0xf2cfa042,0x7b3b2797,0xf2efee6a,0xfbbbbb7b,0xfb0ef9e6,0xb87caa41,0xe5c6c924,0x98967976,0xe9e6c504,0x7c7c7c3d,0xe1e8c904,0xb4743878,0xee29d0e2,0xeffff9aa,0xee4bc0e4,0xffbf3b3e,0xee08d9a6,0xa83c3878,0xe608d0e4,0xd9d4d8dc,0xea2ac8c4,0x1545a1a,0xd9ad8000,0xd5e5a955,0xf20990e6,0x69bafa,0xd9268000,0xa7a7a6a5,0xc18aa462,0xd880c4c4,0xfeede62a,0x555aaa,0xf6f3c484,0x6031757,0xe966c128,0x556555,0xf2b1a884,0xeafeaf,0xcd288000,0xffbbaba5, 0xd148a4a6,0xbefee9,0xc5478000,0xfafa6565,0xb5079864,0xbd34b9ff,0xd548b8c6,0x68bdfd,0xcd279888,0x9d8896ea,0xd1ebb948,0x14b9be6d,0xd12798a6,0xcb9a9ded,0xf2efd984,0xc5d6c2da,0xe66dccc2,0x4747c747,0xeecdc905,0x8a878747,0xfb70e5e8,0xe6d2c5c5,0xf752d9a8,0x6f2fab97,0xeda5b060,0x103578b,0xea8ce5e6,0x6e1d1800,0xde4bcca2,0xb4b7ff3a,0xeb5adb12,0xbc1daebd,0xe738bdaa,0x101a1e1f,0xd6b3ad28,0xa6ca051,0xdad3c20e,0xa8fdbe3d,0xeb79d26e,0xeae5a485,0xe713de4a,0xf15a3249,0xdf15d290,0xfbdfdef7,0xdef5e6d0,0x6aab6f,0xc8a58000,0xa6aaaa55,0xb5288c02,0x55ff9e,0xda2d8000,0xbaeb9a96,0xc5079002,0x46069fab,0xad68b0e6,0x555556,0xcd259044,0x5b1f2e6a,0xb4c5a884,0x15451a,0xd62d9002,0xd5fbeb,0xde6f8000,0xfeaaaabe, 0xe6b0ace4,0xaabfba,0xda4b8000,0x5fffab5a,0xd6909cc6,0xf4f0fdf9,0xe2b1d9aa,0xb8f4f4,0xde6fb482,0x17571317,0xe26c9e12,0x495b637,0xce90c0c2,0x3a69babe,0xcf18d24c,0x3e3f3d3a,0xd6d4d20a,0xbdfdfdfe,0xd718d22c,0xfd7d7cbc,0xd6d4ce0c,0x6e2e3e3c,0xd2d4d1c6,0x1b1f3f2f,0xd292c588,0x396878fc,0xd6d4d24e,0x7a3f7f7f,0xdef4d9c8,0x6dbdfefe,0xdf3bce4e,0x217a1458,0xeb7ad292,0xa9a6efff,0xdf9fdeb0,0x3e5df4d9,0xef7aeb7a,0xf5f925d1,0xeb57e312,0xf4f8e5b5,0xf379ceb2,0xfad5d4da,0xeb7adef4,0x5fefefff,0xe737df14,0x7b7a2a3a,0xdef4d1ea,0x6fc691e5,0xe26cc5ca,0xbab9f9ad,0xeaf2e24c,0xf5b4fafe,0xf332ee6a,0xda8add1f,0xf1e5d986,0x556aaa,0xeaaeb8a4,0x7e290206,0xf28ae144,0x697a7e,0xfaefb484,0x74b0baf6,0xdad3d1e8,0x60a6faf5, 0xf377de8e,0xb5e015ba,0xe315ce2c,0xaeba6e69,0xef34d586,0x9e4a5b42,0xe68fc60c,0x4a9afaf,0xfb73d504,0x7f6f6d06,0xea6ab166,0x6aafbf,0xf710cce4,0xeaeaffff,0xdf7bd60a,0xebffbeae,0xe714d66a,0x11626,0xfe21cce4,0x55904000,0xe164c4a2,0x191b6faf,0xef11da2a,0xd9de5b1e,0xea69ddc6,0x41424116,0xf606cd02,0x91534600,0xe1a6d144,0xf9f9faf9,0xe2f2d9a6,0xf9f6f1f4,0xe6f1e28c,0xbebfffbf,0xd2d8ca90,0xbfae5efe,0xdaf7ced6,0xfd88c0c9,0xef11de4a,0x2faef8fd,0xe68cd1c8,0x5f1e589d,0xdf39d6d4,0x6f9b5b2f,0xe759be0e,0xeb9ad7ee,0xf70ef28a,0xf3f7ffbb,0xf2eeb4a2,0xc060a8a0,0xd986d124,0x9f874f8e,0xf208d566,0xaeaa00e1,0xd1468822,0x5a6ebe,0xf28ec0c6,0xaf5a009a,0xc5499462,0x40bdfeff,0xc127a086,0xb425272f,0xeecee9e8,0x630a6eba, 0xea4bd104,0x6a4f1e2f,0xdb18b9cc,0xfefdefaf,0xdef5de4a,0xa9a500f2,0xc1078800,0x155656,0xe68c9c44,0xbf6f00af,0xde8f8844,0x4adbdbe,0xce92bca2,0x979bebff,0xcab6ce6e,0x63734383,0xd6d4ce2e,0xe9d4eaff,0xe39fe2b0,0xace9d9d9,0xeb9def10,0xc2d09a92,0xef12e28c,0x555501,0xef11dd04,0xfebec499,0xe713c1ec,0xbb6616,0xeef0d9a6,0xf0b0f1f,0xe712d144,0x5a17171b,0xee23d546,0xfdfdfdfd,0xdaf5e542,0xbabefef9,0xe2f4c5aa,0xbe7f6f6f,0xf249c082,0x1561000,0xe64dacc6,0xe1fa7976,0xe2d2d1e8,0x50b1a000,0xd24fa0a4,0xeae6eafe,0xe35ad26c,0x5055aa9a,0xe335e5c6,0xe1e2e3e3,0xdad3e564,0x4040e6a2,0xeaadaca6,0x45a9e9e,0xe736cd66,0x45a9e9e,0xe736cd66,0x45a9e9e,0xe736cd66,0x45a9e9e,0xe736cd66,0x11771177,0xded3d1a9,0x11771177, 0xded3d1a9,0x11771177,0xded3d1a9,0x11771177,0xded3d1a9,0x33cc33cc,0xda4eda4e,0x33cc33cc,0xda4eda4e,0x33cc33cc,0xda4eda4e,0x33cc33cc,0xda4eda4e,0x0, }; // Register tex_arm.pvr in memory file system at application startup time static CPVRTMemoryFileSystem RegisterFile_tex_arm_pvr("tex_arm.pvr", _tex_arm_pvr, 43828); // ******** End: tex_arm.pvr ********
[ "wolfgang.engel@7fa7efda-f44a-0410-a86a-c1fddb4bcab7" ]
[ [ [ 1, 203 ] ] ]
1bb49c20b6d004003ed98c39f7b704a2b3374fa0
b7c505dcef43c0675fd89d428e45f3c2850b124f
/Src/SimulatorQt/Util/qt/Win32/include/Qt/qsemaphore.h
9d8ae42b4070b567a8dd31ac476a28176e7802f6
[ "BSD-2-Clause" ]
permissive
pranet/bhuman2009fork
14e473bd6e5d30af9f1745311d689723bfc5cfdb
82c1bd4485ae24043aa720a3aa7cb3e605b1a329
refs/heads/master
2021-01-15T17:55:37.058289
2010-02-28T13:52:56
2010-02-28T13:52:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,617
h
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information ([email protected]) ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain ** additional rights. These rights are described in the Nokia Qt LGPL ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this ** package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSEMAPHORE_H #define QSEMAPHORE_H #include <QtCore/qglobal.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Core) #ifndef QT_NO_THREAD class QSemaphorePrivate; class Q_CORE_EXPORT QSemaphore { public: explicit QSemaphore(int n = 0); ~QSemaphore(); void acquire(int n = 1); bool tryAcquire(int n = 1); bool tryAcquire(int n, int timeout); void release(int n = 1); int available() const; private: Q_DISABLE_COPY(QSemaphore) QSemaphorePrivate *d; }; #endif // QT_NO_THREAD QT_END_NAMESPACE QT_END_HEADER #endif // QSEMAPHORE_H
[ "alon@rogue.(none)" ]
[ [ [ 1, 83 ] ] ]
48cd17b017904a14b9c004b62b1abbac373dfc9d
91b964984762870246a2a71cb32187eb9e85d74e
/SRC/OFFI SRC!/boost_1_34_1/boost_1_34_1/libs/config/test/config_test.cpp
3162a463b9d2235b9ae11be638e97f32d9acea21
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
willrebuild/flyffsf
e5911fb412221e00a20a6867fd00c55afca593c7
d38cc11790480d617b38bb5fc50729d676aef80d
refs/heads/master
2021-01-19T20:27:35.200154
2011-02-10T12:34:43
2011-02-10T12:34:43
32,710,780
3
0
null
null
null
null
UTF-8
C++
false
false
35,191
cpp
// This file was automatically generated on Wed Feb 15 14:14:06 2006 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/config for the most recent version. // Test file for config setup // This file should compile, if it does not then // one or more macros need to be defined. // see boost_*.ipp for more details // Do not edit this file, it was generated automatically by #include <boost/config.hpp> #include <iostream> #include "test.hpp" int error_count = 0; #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP #include "boost_no_arg_dep_lookup.ipp" #else namespace boost_no_argument_dependent_lookup = empty_boost; #endif #ifndef BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS #include "boost_no_array_type_spec.ipp" #else namespace boost_no_array_type_specializations = empty_boost; #endif #ifndef BOOST_NO_AUTO_PTR #include "boost_no_auto_ptr.ipp" #else namespace boost_no_auto_ptr = empty_boost; #endif #ifndef BOOST_BCB_PARTIAL_SPECIALIZATION_BUG #include "boost_no_bcb_partial_spec.ipp" #else namespace boost_bcb_partial_specialization_bug = empty_boost; #endif #ifndef BOOST_NO_CTYPE_FUNCTIONS #include "boost_no_ctype_functions.ipp" #else namespace boost_no_ctype_functions = empty_boost; #endif #ifndef BOOST_NO_CV_SPECIALIZATIONS #include "boost_no_cv_spec.ipp" #else namespace boost_no_cv_specializations = empty_boost; #endif #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS #include "boost_no_cv_void_spec.ipp" #else namespace boost_no_cv_void_specializations = empty_boost; #endif #ifndef BOOST_NO_CWCHAR #include "boost_no_cwchar.ipp" #else namespace boost_no_cwchar = empty_boost; #endif #ifndef BOOST_NO_CWCTYPE #include "boost_no_cwctype.ipp" #else namespace boost_no_cwctype = empty_boost; #endif #ifndef BOOST_DEDUCED_TYPENAME #include "boost_no_ded_typename.ipp" #else namespace boost_deduced_typename = empty_boost; #endif #ifndef BOOST_NO_DEPENDENT_NESTED_DERIVATIONS #include "boost_no_dep_nested_class.ipp" #else namespace boost_no_dependent_nested_derivations = empty_boost; #endif #ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS #include "boost_no_dep_val_param.ipp" #else namespace boost_no_dependent_types_in_template_value_parameters = empty_boost; #endif #ifndef BOOST_NO_EXCEPTIONS #include "boost_no_exceptions.ipp" #else namespace boost_no_exceptions = empty_boost; #endif #ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE #include "boost_no_excep_std.ipp" #else namespace boost_no_exception_std_namespace = empty_boost; #endif #ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #include "boost_no_exp_func_tem_arg.ipp" #else namespace boost_no_explicit_function_template_arguments = empty_boost; #endif #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING #include "boost_no_func_tmp_order.ipp" #else namespace boost_no_function_template_ordering = empty_boost; #endif #ifndef BOOST_NO_MS_INT64_NUMERIC_LIMITS #include "boost_no_i64_limits.ipp" #else namespace boost_no_ms_int64_numeric_limits = empty_boost; #endif #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION #include "boost_no_inline_memb_init.ipp" #else namespace boost_no_inclass_member_initialization = empty_boost; #endif #ifndef BOOST_NO_INTEGRAL_INT64_T #include "boost_no_integral_int64_t.ipp" #else namespace boost_no_integral_int64_t = empty_boost; #endif #ifndef BOOST_NO_IS_ABSTRACT #include "boost_no_is_abstract.ipp" #else namespace boost_no_is_abstract = empty_boost; #endif #ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS #include "boost_no_iter_construct.ipp" #else namespace boost_no_templated_iterator_constructors = empty_boost; #endif #ifndef BOOST_NO_LIMITS #include "boost_no_limits.ipp" #else namespace boost_no_limits = empty_boost; #endif #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS #include "boost_no_limits_const_exp.ipp" #else namespace boost_no_limits_compile_time_constants = empty_boost; #endif #ifndef BOOST_NO_LONG_LONG_NUMERIC_LIMITS #include "boost_no_ll_limits.ipp" #else namespace boost_no_long_long_numeric_limits = empty_boost; #endif #ifndef BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS #include "boost_no_mem_func_spec.ipp" #else namespace boost_no_member_function_specializations = empty_boost; #endif #ifndef BOOST_NO_MEMBER_TEMPLATES #include "boost_no_mem_templates.ipp" #else namespace boost_no_member_templates = empty_boost; #endif #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #include "boost_no_mem_templ_frnds.ipp" #else namespace boost_no_member_template_friends = empty_boost; #endif #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD #include "boost_no_mem_tem_keyword.ipp" #else namespace boost_no_member_template_keyword = empty_boost; #endif #ifndef BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS #include "boost_no_mem_tem_pnts.ipp" #else namespace boost_no_pointer_to_member_template_parameters = empty_boost; #endif #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE #include "boost_no_ops_in_namespace.ipp" #else namespace boost_no_operators_in_namespace = empty_boost; #endif #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #include "boost_no_partial_spec.ipp" #else namespace boost_no_template_partial_specialization = empty_boost; #endif #ifndef BOOST_NO_PRIVATE_IN_AGGREGATE #include "boost_no_priv_aggregate.ipp" #else namespace boost_no_private_in_aggregate = empty_boost; #endif #ifndef BOOST_NO_POINTER_TO_MEMBER_CONST #include "boost_no_ptr_mem_const.ipp" #else namespace boost_no_pointer_to_member_const = empty_boost; #endif #ifndef BOOST_NO_UNREACHABLE_RETURN_DETECTION #include "boost_no_ret_det.ipp" #else namespace boost_no_unreachable_return_detection = empty_boost; #endif #ifndef BOOST_NO_SFINAE #include "boost_no_sfinae.ipp" #else namespace boost_no_sfinae = empty_boost; #endif #ifndef BOOST_NO_STRINGSTREAM #include "boost_no_sstream.ipp" #else namespace boost_no_stringstream = empty_boost; #endif #ifndef BOOST_NO_STDC_NAMESPACE #include "boost_no_stdc_namespace.ipp" #else namespace boost_no_stdc_namespace = empty_boost; #endif #ifndef BOOST_NO_STD_ALLOCATOR #include "boost_no_std_allocator.ipp" #else namespace boost_no_std_allocator = empty_boost; #endif #ifndef BOOST_NO_STD_DISTANCE #include "boost_no_std_distance.ipp" #else namespace boost_no_std_distance = empty_boost; #endif #ifndef BOOST_NO_STD_ITERATOR #include "boost_no_std_iterator.ipp" #else namespace boost_no_std_iterator = empty_boost; #endif #ifndef BOOST_NO_STD_ITERATOR_TRAITS #include "boost_no_std_iter_traits.ipp" #else namespace boost_no_std_iterator_traits = empty_boost; #endif #ifndef BOOST_NO_STD_LOCALE #include "boost_no_std_locale.ipp" #else namespace boost_no_std_locale = empty_boost; #endif #ifndef BOOST_NO_STD_MESSAGES #include "boost_no_std_messages.ipp" #else namespace boost_no_std_messages = empty_boost; #endif #ifndef BOOST_NO_STD_MIN_MAX #include "boost_no_std_min_max.ipp" #else namespace boost_no_std_min_max = empty_boost; #endif #ifndef BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN #include "boost_no_std_oi_assign.ipp" #else namespace boost_no_std_output_iterator_assign = empty_boost; #endif #ifndef BOOST_NO_STD_USE_FACET #include "boost_no_std_use_facet.ipp" #else namespace boost_no_std_use_facet = empty_boost; #endif #ifndef BOOST_NO_STD_WSTREAMBUF #include "boost_no_std_wstreambuf.ipp" #else namespace boost_no_std_wstreambuf = empty_boost; #endif #ifndef BOOST_NO_STD_WSTRING #include "boost_no_std_wstring.ipp" #else namespace boost_no_std_wstring = empty_boost; #endif #ifndef BOOST_NO_SWPRINTF #include "boost_no_swprintf.ipp" #else namespace boost_no_swprintf = empty_boost; #endif #ifndef BOOST_NO_TEMPLATE_TEMPLATES #include "boost_no_template_template.ipp" #else namespace boost_no_template_templates = empty_boost; #endif #ifndef BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #include "boost_no_using_breaks_adl.ipp" #else namespace boost_function_scope_using_declaration_breaks_adl = empty_boost; #endif #ifndef BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE #include "boost_no_using_decl_overld.ipp" #else namespace boost_no_using_declaration_overloads_from_typename_base = empty_boost; #endif #ifndef BOOST_NO_USING_TEMPLATE #include "boost_no_using_template.ipp" #else namespace boost_no_using_template = empty_boost; #endif #ifndef BOOST_NO_VOID_RETURNS #include "boost_no_void_returns.ipp" #else namespace boost_no_void_returns = empty_boost; #endif #ifndef BOOST_NO_INTRINSIC_WCHAR_T #include "boost_no_wchar_t.ipp" #else namespace boost_no_intrinsic_wchar_t = empty_boost; #endif #ifdef BOOST_HAS_TWO_ARG_USE_FACET #include "boost_has_2arg_use_facet.ipp" #else namespace boost_has_two_arg_use_facet = empty_boost; #endif #ifdef BOOST_HAS_BETHREADS #include "boost_has_bethreads.ipp" #else namespace boost_has_bethreads = empty_boost; #endif #ifdef BOOST_HAS_CLOCK_GETTIME #include "boost_has_clock_gettime.ipp" #else namespace boost_has_clock_gettime = empty_boost; #endif #ifdef BOOST_HAS_DIRENT_H #include "boost_has_dirent_h.ipp" #else namespace boost_has_dirent_h = empty_boost; #endif #ifdef BOOST_HAS_EXPM1 #include "boost_has_expm1.ipp" #else namespace boost_has_expm1 = empty_boost; #endif #ifdef BOOST_HAS_FTIME #include "boost_has_ftime.ipp" #else namespace boost_has_ftime = empty_boost; #endif #ifdef BOOST_HAS_GETTIMEOFDAY #include "boost_has_gettimeofday.ipp" #else namespace boost_has_gettimeofday = empty_boost; #endif #ifdef BOOST_HAS_HASH #include "boost_has_hash.ipp" #else namespace boost_has_hash = empty_boost; #endif #ifdef BOOST_HAS_LOG1P #include "boost_has_log1p.ipp" #else namespace boost_has_log1p = empty_boost; #endif #ifdef BOOST_HAS_LONG_LONG #include "boost_has_long_long.ipp" #else namespace boost_has_long_long = empty_boost; #endif #ifdef BOOST_HAS_MACRO_USE_FACET #include "boost_has_macro_use_facet.ipp" #else namespace boost_has_macro_use_facet = empty_boost; #endif #ifdef BOOST_HAS_MS_INT64 #include "boost_has_ms_int64.ipp" #else namespace boost_has_ms_int64 = empty_boost; #endif #ifdef BOOST_HAS_NANOSLEEP #include "boost_has_nanosleep.ipp" #else namespace boost_has_nanosleep = empty_boost; #endif #ifdef BOOST_HAS_NL_TYPES_H #include "boost_has_nl_types_h.ipp" #else namespace boost_has_nl_types_h = empty_boost; #endif #ifdef BOOST_HAS_NRVO #include "boost_has_nrvo.ipp" #else namespace boost_has_nrvo = empty_boost; #endif #ifdef BOOST_HAS_PARTIAL_STD_ALLOCATOR #include "boost_has_part_alloc.ipp" #else namespace boost_has_partial_std_allocator = empty_boost; #endif #ifdef BOOST_HAS_PTHREADS #include "boost_has_pthreads.ipp" #else namespace boost_has_pthreads = empty_boost; #endif #ifdef BOOST_HAS_PTHREAD_DELAY_NP #include "boost_has_pthread_delay_np.ipp" #else namespace boost_has_pthread_delay_np = empty_boost; #endif #ifdef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE #include "boost_has_pthread_ma_st.ipp" #else namespace boost_has_pthread_mutexattr_settype = empty_boost; #endif #ifdef BOOST_HAS_PTHREAD_YIELD #include "boost_has_pthread_yield.ipp" #else namespace boost_has_pthread_yield = empty_boost; #endif #ifdef BOOST_HAS_SCHED_YIELD #include "boost_has_sched_yield.ipp" #else namespace boost_has_sched_yield = empty_boost; #endif #ifdef BOOST_HAS_SGI_TYPE_TRAITS #include "boost_has_sgi_type_traits.ipp" #else namespace boost_has_sgi_type_traits = empty_boost; #endif #ifdef BOOST_HAS_SIGACTION #include "boost_has_sigaction.ipp" #else namespace boost_has_sigaction = empty_boost; #endif #ifdef BOOST_HAS_SLIST #include "boost_has_slist.ipp" #else namespace boost_has_slist = empty_boost; #endif #ifdef BOOST_HAS_STDINT_H #include "boost_has_stdint_h.ipp" #else namespace boost_has_stdint_h = empty_boost; #endif #ifdef BOOST_HAS_STLP_USE_FACET #include "boost_has_stlp_use_facet.ipp" #else namespace boost_has_stlp_use_facet = empty_boost; #endif #ifdef BOOST_HAS_TR1_ARRAY #include "boost_has_tr1_array.ipp" #else namespace boost_has_tr1_array = empty_boost; #endif #ifdef BOOST_HAS_TR1_BIND #include "boost_has_tr1_bind.ipp" #else namespace boost_has_tr1_bind = empty_boost; #endif #ifdef BOOST_HAS_TR1_COMPLEX_OVERLOADS #include "boost_has_tr1_complex_over.ipp" #else namespace boost_has_tr1_complex_overloads = empty_boost; #endif #ifdef BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG #include "boost_has_tr1_complex_trig.ipp" #else namespace boost_has_tr1_complex_inverse_trig = empty_boost; #endif #ifdef BOOST_HAS_TR1_FUNCTION #include "boost_has_tr1_function.ipp" #else namespace boost_has_tr1_function = empty_boost; #endif #ifdef BOOST_HAS_TR1_HASH #include "boost_has_tr1_hash.ipp" #else namespace boost_has_tr1_hash = empty_boost; #endif #ifdef BOOST_HAS_TR1_MEM_FN #include "boost_has_tr1_mem_fn.ipp" #else namespace boost_has_tr1_mem_fn = empty_boost; #endif #ifdef BOOST_HAS_TR1_RANDOM #include "boost_has_tr1_random.ipp" #else namespace boost_has_tr1_random = empty_boost; #endif #ifdef BOOST_HAS_TR1_REFERENCE_WRAPPER #include "boost_has_tr1_ref_wrap.ipp" #else namespace boost_has_tr1_reference_wrapper = empty_boost; #endif #ifdef BOOST_HAS_TR1_REGEX #include "boost_has_tr1_regex.ipp" #else namespace boost_has_tr1_regex = empty_boost; #endif #ifdef BOOST_HAS_TR1_RESULT_OF #include "boost_has_tr1_result_of.ipp" #else namespace boost_has_tr1_result_of = empty_boost; #endif #ifdef BOOST_HAS_TR1_SHARED_PTR #include "boost_has_tr1_shared_ptr.ipp" #else namespace boost_has_tr1_shared_ptr = empty_boost; #endif #ifdef BOOST_HAS_TR1_TUPLE #include "boost_has_tr1_tuple.ipp" #else namespace boost_has_tr1_tuple = empty_boost; #endif #ifdef BOOST_HAS_TR1_TYPE_TRAITS #include "boost_has_tr1_type_traits.ipp" #else namespace boost_has_tr1_type_traits = empty_boost; #endif #ifdef BOOST_HAS_TR1_UNORDERED_MAP #include "boost_has_tr1_unordered_map.ipp" #else namespace boost_has_tr1_unordered_map = empty_boost; #endif #ifdef BOOST_HAS_TR1_UNORDERED_SET #include "boost_has_tr1_unordered_set.ipp" #else namespace boost_has_tr1_unordered_set = empty_boost; #endif #ifdef BOOST_HAS_TR1_UTILITY #include "boost_has_tr1_utility.ipp" #else namespace boost_has_tr1_utility = empty_boost; #endif #ifdef BOOST_HAS_UNISTD_H #include "boost_has_unistd_h.ipp" #else namespace boost_has_unistd_h = empty_boost; #endif #ifdef BOOST_MSVC6_MEMBER_TEMPLATES #include "boost_has_vc6_mem_templ.ipp" #else namespace boost_msvc6_member_templates = empty_boost; #endif #ifdef BOOST_MSVC_STD_ITERATOR #include "boost_has_vc_iterator.ipp" #else namespace boost_msvc_std_iterator = empty_boost; #endif #ifdef BOOST_HAS_WINTHREADS #include "boost_has_winthreads.ipp" #else namespace boost_has_winthreads = empty_boost; #endif int main( int, char *[] ) { if(0 != boost_has_two_arg_use_facet::test()) { std::cerr << "Failed test for BOOST_HAS_TWO_ARG_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_bethreads::test()) { std::cerr << "Failed test for BOOST_HAS_BETHREADS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_clock_gettime::test()) { std::cerr << "Failed test for BOOST_HAS_CLOCK_GETTIME at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_dirent_h::test()) { std::cerr << "Failed test for BOOST_HAS_DIRENT_H at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_expm1::test()) { std::cerr << "Failed test for BOOST_HAS_EXPM1 at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_ftime::test()) { std::cerr << "Failed test for BOOST_HAS_FTIME at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_gettimeofday::test()) { std::cerr << "Failed test for BOOST_HAS_GETTIMEOFDAY at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_hash::test()) { std::cerr << "Failed test for BOOST_HAS_HASH at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_log1p::test()) { std::cerr << "Failed test for BOOST_HAS_LOG1P at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_long_long::test()) { std::cerr << "Failed test for BOOST_HAS_LONG_LONG at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_macro_use_facet::test()) { std::cerr << "Failed test for BOOST_HAS_MACRO_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_ms_int64::test()) { std::cerr << "Failed test for BOOST_HAS_MS_INT64 at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_nanosleep::test()) { std::cerr << "Failed test for BOOST_HAS_NANOSLEEP at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_nl_types_h::test()) { std::cerr << "Failed test for BOOST_HAS_NL_TYPES_H at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_nrvo::test()) { std::cerr << "Failed test for BOOST_HAS_NRVO at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_partial_std_allocator::test()) { std::cerr << "Failed test for BOOST_HAS_PARTIAL_STD_ALLOCATOR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_pthreads::test()) { std::cerr << "Failed test for BOOST_HAS_PTHREADS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_pthread_delay_np::test()) { std::cerr << "Failed test for BOOST_HAS_PTHREAD_DELAY_NP at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_pthread_mutexattr_settype::test()) { std::cerr << "Failed test for BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_pthread_yield::test()) { std::cerr << "Failed test for BOOST_HAS_PTHREAD_YIELD at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_sched_yield::test()) { std::cerr << "Failed test for BOOST_HAS_SCHED_YIELD at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_sgi_type_traits::test()) { std::cerr << "Failed test for BOOST_HAS_SGI_TYPE_TRAITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_sigaction::test()) { std::cerr << "Failed test for BOOST_HAS_SIGACTION at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_slist::test()) { std::cerr << "Failed test for BOOST_HAS_SLIST at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_stdint_h::test()) { std::cerr << "Failed test for BOOST_HAS_STDINT_H at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_stlp_use_facet::test()) { std::cerr << "Failed test for BOOST_HAS_STLP_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_array::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_ARRAY at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_bind::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_BIND at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_complex_overloads::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_COMPLEX_OVERLOADS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_complex_inverse_trig::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_function::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_FUNCTION at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_hash::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_HASH at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_mem_fn::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_MEM_FN at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_random::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_RANDOM at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_reference_wrapper::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_REFERENCE_WRAPPER at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_regex::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_REGEX at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_result_of::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_RESULT_OF at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_shared_ptr::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_SHARED_PTR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_tuple::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_TUPLE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_type_traits::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_TYPE_TRAITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_unordered_map::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_UNORDERED_MAP at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_unordered_set::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_UNORDERED_SET at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_tr1_utility::test()) { std::cerr << "Failed test for BOOST_HAS_TR1_UTILITY at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_unistd_h::test()) { std::cerr << "Failed test for BOOST_HAS_UNISTD_H at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_msvc6_member_templates::test()) { std::cerr << "Failed test for BOOST_MSVC6_MEMBER_TEMPLATES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_msvc_std_iterator::test()) { std::cerr << "Failed test for BOOST_MSVC_STD_ITERATOR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_has_winthreads::test()) { std::cerr << "Failed test for BOOST_HAS_WINTHREADS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_argument_dependent_lookup::test()) { std::cerr << "Failed test for BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_array_type_specializations::test()) { std::cerr << "Failed test for BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_auto_ptr::test()) { std::cerr << "Failed test for BOOST_NO_AUTO_PTR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_bcb_partial_specialization_bug::test()) { std::cerr << "Failed test for BOOST_BCB_PARTIAL_SPECIALIZATION_BUG at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_ctype_functions::test()) { std::cerr << "Failed test for BOOST_NO_CTYPE_FUNCTIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_cv_specializations::test()) { std::cerr << "Failed test for BOOST_NO_CV_SPECIALIZATIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_cv_void_specializations::test()) { std::cerr << "Failed test for BOOST_NO_CV_VOID_SPECIALIZATIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_cwchar::test()) { std::cerr << "Failed test for BOOST_NO_CWCHAR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_cwctype::test()) { std::cerr << "Failed test for BOOST_NO_CWCTYPE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_deduced_typename::test()) { std::cerr << "Failed test for BOOST_DEDUCED_TYPENAME at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_dependent_nested_derivations::test()) { std::cerr << "Failed test for BOOST_NO_DEPENDENT_NESTED_DERIVATIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_dependent_types_in_template_value_parameters::test()) { std::cerr << "Failed test for BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_exceptions::test()) { std::cerr << "Failed test for BOOST_NO_EXCEPTIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_exception_std_namespace::test()) { std::cerr << "Failed test for BOOST_NO_EXCEPTION_STD_NAMESPACE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_explicit_function_template_arguments::test()) { std::cerr << "Failed test for BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_function_template_ordering::test()) { std::cerr << "Failed test for BOOST_NO_FUNCTION_TEMPLATE_ORDERING at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_ms_int64_numeric_limits::test()) { std::cerr << "Failed test for BOOST_NO_MS_INT64_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_inclass_member_initialization::test()) { std::cerr << "Failed test for BOOST_NO_INCLASS_MEMBER_INITIALIZATION at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_integral_int64_t::test()) { std::cerr << "Failed test for BOOST_NO_INTEGRAL_INT64_T at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_is_abstract::test()) { std::cerr << "Failed test for BOOST_NO_IS_ABSTRACT at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_templated_iterator_constructors::test()) { std::cerr << "Failed test for BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_limits::test()) { std::cerr << "Failed test for BOOST_NO_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_limits_compile_time_constants::test()) { std::cerr << "Failed test for BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_long_long_numeric_limits::test()) { std::cerr << "Failed test for BOOST_NO_LONG_LONG_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_member_function_specializations::test()) { std::cerr << "Failed test for BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_member_templates::test()) { std::cerr << "Failed test for BOOST_NO_MEMBER_TEMPLATES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_member_template_friends::test()) { std::cerr << "Failed test for BOOST_NO_MEMBER_TEMPLATE_FRIENDS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_member_template_keyword::test()) { std::cerr << "Failed test for BOOST_NO_MEMBER_TEMPLATE_KEYWORD at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_pointer_to_member_template_parameters::test()) { std::cerr << "Failed test for BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_operators_in_namespace::test()) { std::cerr << "Failed test for BOOST_NO_OPERATORS_IN_NAMESPACE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_template_partial_specialization::test()) { std::cerr << "Failed test for BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_private_in_aggregate::test()) { std::cerr << "Failed test for BOOST_NO_PRIVATE_IN_AGGREGATE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_pointer_to_member_const::test()) { std::cerr << "Failed test for BOOST_NO_POINTER_TO_MEMBER_CONST at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_unreachable_return_detection::test()) { std::cerr << "Failed test for BOOST_NO_UNREACHABLE_RETURN_DETECTION at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_sfinae::test()) { std::cerr << "Failed test for BOOST_NO_SFINAE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_stringstream::test()) { std::cerr << "Failed test for BOOST_NO_STRINGSTREAM at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_stdc_namespace::test()) { std::cerr << "Failed test for BOOST_NO_STDC_NAMESPACE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_allocator::test()) { std::cerr << "Failed test for BOOST_NO_STD_ALLOCATOR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_distance::test()) { std::cerr << "Failed test for BOOST_NO_STD_DISTANCE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_iterator::test()) { std::cerr << "Failed test for BOOST_NO_STD_ITERATOR at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_iterator_traits::test()) { std::cerr << "Failed test for BOOST_NO_STD_ITERATOR_TRAITS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_locale::test()) { std::cerr << "Failed test for BOOST_NO_STD_LOCALE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_messages::test()) { std::cerr << "Failed test for BOOST_NO_STD_MESSAGES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_min_max::test()) { std::cerr << "Failed test for BOOST_NO_STD_MIN_MAX at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_output_iterator_assign::test()) { std::cerr << "Failed test for BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_use_facet::test()) { std::cerr << "Failed test for BOOST_NO_STD_USE_FACET at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_wstreambuf::test()) { std::cerr << "Failed test for BOOST_NO_STD_WSTREAMBUF at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_std_wstring::test()) { std::cerr << "Failed test for BOOST_NO_STD_WSTRING at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_swprintf::test()) { std::cerr << "Failed test for BOOST_NO_SWPRINTF at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_template_templates::test()) { std::cerr << "Failed test for BOOST_NO_TEMPLATE_TEMPLATES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_function_scope_using_declaration_breaks_adl::test()) { std::cerr << "Failed test for BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_using_declaration_overloads_from_typename_base::test()) { std::cerr << "Failed test for BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_using_template::test()) { std::cerr << "Failed test for BOOST_NO_USING_TEMPLATE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_void_returns::test()) { std::cerr << "Failed test for BOOST_NO_VOID_RETURNS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } if(0 != boost_no_intrinsic_wchar_t::test()) { std::cerr << "Failed test for BOOST_NO_INTRINSIC_WCHAR_T at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } return error_count; }
[ "[email protected]@e2c90bd7-ee55-cca0-76d2-bbf4e3699278" ]
[ [ [ 1, 1048 ] ] ]
69b4f8612619b4d7f9c57030ce2f770d05e01bd9
e1f7c2f6dd66916fe5b562d9dd4c0a5925197ec4
/Engine/Project/include/AGEntity.h
b4c85dba15b6674ba3363770ffd0ab5e37b37973
[]
no_license
OtterOrder/agengineproject
de990ad91885b54a0c63adf66ff2ecc113e0109d
0b92a590af4142369e2946f692d5f30a06d32135
refs/heads/master
2020-05-27T07:44:25.593878
2011-05-01T14:52:05
2011-05-01T14:52:05
32,115,301
0
0
null
null
null
null
UTF-8
C++
false
false
386
h
#pragma once #include "AGUtilities.h" #include "AGDeviceManager.h" //------------------------------------------------------------------------------------------------------------------------------ class AGEntity { public: DefineVectorIterator(AGEntity, Iterator); private: cStr _mName; public: AGEntity (); virtual ~AGEntity (); virtual void Update () =0; };
[ "alban.chagnoleau@fe70d4ac-e33c-11de-8d18-5b59c22968bc" ]
[ [ [ 1, 20 ] ] ]
25b0cc716fc64b46521bdda9ab4bce387980c009
b24d5382e0575ad5f7c6e5a77ed065d04b77d9fa
/GCore/GCore/GC_LogListener.h
48475b19dfa5410440c54224baf3f08bb82d598c
[]
no_license
Klaim/radiant-laser-cross
f65571018bf612820415e0f672c216caf35de439
bf26a3a417412c0e1b77267b4a198e514b2c7915
refs/heads/master
2021-01-01T18:06:58.019414
2010-11-06T14:56:11
2010-11-06T14:56:11
32,205,098
0
0
null
null
null
null
UTF-8
C++
false
false
2,541
h
/****************************************************************** Inspired by Ogre::Log; www.ogre3D.org. *******************************************************************/ #ifndef GCORE_LOGCATCHER_H #define GCORE_LOGCATCHER_H #pragma once #include <string> #include <map> #include <vector> #include <functional> #include "GC_Common.h" namespace gcore { class LogManager; /** TODO : review this comment! Listener class for logMessage event of the Log class of a LogManager. This class possess the abstract method catchLogMessage, which is called when the method logMessage of a log is called. An instance of the class is notified of (e.g. have the OnLogMessage being called), when it's registered to a LogManager. So in order to have use this class, you have to: -inherit from it and provide your own implementation of OnLogMessage -instanciate it -register it to a LogManager Once those three step are done, whenever a Log of the LogManager have its logMessage method called, the OnLogMessge is called. @remark Managed by LogManager. */ class GCORE_API LogListener { public: /** TODO : review this comment! The methods is called when a the method logMessage of a log is called (e.g This method is an event called when a log writes data to a file). Inherit and provide an implementation of this method for managing logMessage events. @param logName The name of the Log which method logMessage has been called. @param message The message the log has to write to the file. **/ virtual void catchLogMessage(Log& log ,const std::string& message)=0; LogListener(){}; /** *The destructor is virtual in order to avoid memory problems. **/ virtual ~LogListener(){}; private: }; /// Function-like object that can catch log messages. typedef std::tr1::function< void ( Log&, const std::string& ) > LogListenerFunction; /** Proxy event listener that only redirect event catches to a provided function-like object. note : seems obsolete ... should be replaced by boost::signal */ class ProxyLogListener : public LogListener { public: ProxyLogListener( const LogListenerFunction& logListenerFunction ) : m_logListenerFunction( logListenerFunction ) {} inline void catchLogMessage(Log& log ,const std::string& message) { m_logListenerFunction( log, message ); } private: LogListenerFunction m_logListenerFunction; }; } #endif
[ [ [ 1, 92 ] ] ]
11d031a54f7367c0e424361d8c4639bee53f265f
cfc9acc69752245f30ad3994cce0741120e54eac
/bikini/private/source/base/watch.cpp
1a1806f9d069ea5d27daf0989ca245841056dbe7
[]
no_license
Heartbroken/bikini-iii
3b7852d1af722b380864ac87df57c37862eb759b
93ffa5d43d9179b7c5e7f7c2df9df7dafd79a739
refs/heads/master
2020-03-28T00:41:36.281253
2009-04-30T14:58:10
2009-04-30T14:58:10
37,190,689
0
0
null
null
null
null
UTF-8
C++
false
false
6,269
cpp
/*---------------------------------------------------------------------------------------------*//* Binary Kinematics 3 - C++ Game Programming Library Copyright (C) 2008 Viktor Reutzky [email protected] *//*---------------------------------------------------------------------------------------------*/ #include "header.hpp" namespace bk { /*--------------------------------------------------------------------------------*/ // watch::type uint watch::type::member_count() const { uint l_count = m_members.size(); for (uint i = 0, s = base_count(); i < s; ++i) { const base &l_base = get_base(i); const type &l_type = m_watch.get_type(l_base.type); l_count += l_type.member_count(); } return l_count; } const watch::type::member& watch::type::get_member(uint _i) const { if (_i < m_members.size()) { return *m_members[_i]; } uint l_i = _i - m_members.size(); for (uint i = 0, s = base_count(); i < s; ++i) { const base &l_base = get_base(i); const type &l_type = m_watch.get_type(l_base.type); uint l_count = l_type.member_count(); if (l_i < l_count) return l_type.get_member(l_i); l_i -= l_count; } std::cerr << "ERROR: (Watch) Bad member index\n"; assert(0); return *(member*)0; } handle watch::type::member_base_cast(uint _i, handle _p) const { if (_i < m_members.size()) { return _p; } uint l_i = _i - m_members.size(); for (uint i = 0, s = base_count(); i < s; ++i) { const base &l_base = get_base(i); const type &l_type = m_watch.get_type(l_base.type); uint l_count = l_type.member_count(); if (l_i < l_count) return l_type.member_base_cast(l_i, l_base.base_cast(_p)); l_i -= l_count; } std::cerr << "ERROR: (Watch) Bad member index\n"; assert(0); return _p; } uint watch::type::find_member(const achar *_name) const { for (uint i = 0, s = member_count(); i < s; ++i) { const member &l_member = get_member(i); if (l_member.name == _name) return i; } return bad_ID; } // watch::varaible const watch::type::member& _varaible_resolve_member(const watch::varaible &_v) { uint l_type = 0; for (uint i = 0, s = _v.path.size(); i < s; ++i) { const watch::type::member &l_member = _v.get_watch().get_type(l_type).get_member(_v.path[i]); l_type = l_member.type; if (i + 1 == s) return l_member; } assert(0); return *(watch::type::member*)0; } struct _varaible_tmp_object { uint type; handle object; }; void _varaible_resolve_get(const watch::varaible &_v, handle _value) { array_<_varaible_tmp_object> l_tmp_objects; uint l_type = 0; handle l_object = 0; for (uint i = 0, s = _v.path.size(); i < s; ++i) { uint l_step = _v.path[i]; const watch::type &l_object_type = _v.get_watch().get_type(l_type); const watch::type::member &l_member = l_object_type.get_member(l_step); handle l_value = i + 1 < s ? calloc(l_member.get->value_size, 1) : _value; (*l_member.get)(l_value, l_object_type.member_base_cast(l_step, l_object)); if (i + 1 == s) break; if (l_member.get->by_value) { _varaible_tmp_object l_tmp; l_tmp.type = l_member.type; l_tmp.object = l_value; l_tmp_objects.push_back(l_tmp); l_object = l_value; } else { l_object = *(void**)l_value; } l_type = l_member.type; } while (!l_tmp_objects.empty()) { const _varaible_tmp_object &l_tmp = l_tmp_objects.back(); _v.get_watch().get_type(l_tmp.type).destroy_value(l_tmp.object); l_tmp_objects.pop_back(); } } void _varaible_resolve_set(const watch::varaible &_v, pointer _value) { array_<_varaible_tmp_object> l_tmp_objects; uint l_type = 0; handle l_object = 0; for (uint i = 0, s = _v.path.size(); i < s; ++i) { uint l_step = _v.path[i]; const watch::type &l_object_type = _v.get_watch().get_type(l_type); const watch::type::member &l_member = l_object_type.get_member(l_step); handle l_value = 0; if (i + 1 < s) { l_value = calloc(l_member.get->value_size, 1); (*l_member.get)(l_value, l_object_type.member_base_cast(l_step, l_object)); } else { (*l_member.set)(_value, l_object_type.member_base_cast(l_step, l_object)); } if (i + 1 == s) break; if (l_member.get->by_value) { _varaible_tmp_object l_tmp; l_tmp.type = l_member.type; l_tmp.object = l_value; l_tmp_objects.push_back(l_tmp); l_object = l_value; } else { l_object = *(void**)l_value; } l_type = l_member.type; } while (!l_tmp_objects.empty()) { const _varaible_tmp_object &l_tmp = l_tmp_objects.back(); _v.get_watch().get_type(l_tmp.type).destroy_value(l_tmp.object); l_tmp_objects.pop_back(); } } // watch watch::watch() { clear(); } watch::~watch() { while (!m_types.empty()) { delete m_types.back(); m_types.pop_back(); } } uint watch::type_count() const { return m_types.size(); } const watch::type& watch::get_type(uint _i) const { return *m_types[_i]; } uint watch::global_count() const { assert(!m_types.empty()); const type &l_root = get_type(0); return l_root.member_count(); } watch::varaible watch::get_global(uint _i) const { assert(_i < global_count()); varaible l_v(*this); l_v.path.push_back(_i); return l_v; } watch::varaible watch::find_varaible(const achar *_path) const { assert(!m_types.empty()); astring l_path = _path; astring l_name = l_path.substr(0, l_path.find("::")); l_path.erase(0, l_name.length() + 2); type &l_root = *m_types[0]; uint l_i = l_root.find_member(l_name.c_str()); if (l_i == bad_ID) return varaible(*this); varaible l_v(*this); l_v.path.push_back(l_i); while (l_path != "") { l_name = l_path.substr(0, l_path.find("::")); l_path.erase(0, l_name.length() + 2); l_v = l_v[l_name.c_str()]; } return l_v; } void watch::clear() { while (!m_types.empty()) { delete m_types.back(); m_types.pop_back(); } m_types.push_back(new type(*this)); type &l_type = *m_types.back(); l_type.name = "root"; l_type.ID = _get_ID_of_<watch>(); } } /* namespace bk -------------------------------------------------------------------------------*/
[ [ [ 1, 275 ] ] ]
02d23a0059a4b1b8163b540f4e50969da7436772
a0155e192c9dc2029b231829e3db9ba90861f956
/Libs/mwnlm/Libraries/MSL C++/Include/ansi_parms.h
4f4a8392cbd4d606b7966ecdf2626d0239b02e9b
[]
no_license
zeha/mailfilter
d2de4aaa79bed2073cec76c93768a42068cfab17
898dd4d4cba226edec566f4b15c6bb97e79f8001
refs/heads/master
2021-01-22T02:03:31.470739
2010-08-12T23:51:35
2010-08-12T23:51:35
81,022,257
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
3,493
h
/* Metrowerks Standard Library * Copyright © 1995-2001 Metrowerks Corporation. All rights reserved. * * $Date: 2002/07/01 21:13:31 $ * $Revision: 1.4 $ */ #ifndef _MSL_ANSI_PARMS_H #define _MSL_ANSI_PARMS_H #include <mslGlobals.h> /* hh 980120 added */ /* rjk 980313 added the _MSL_IMP_EXP macro This macro is set to NULL for targets that link to MSL statically and to __declspec(dllimport) for targets that link to MSL in a DLL Here is it defaulted to NULL if undefined. */ #ifndef _MSL_IMP_EXP #define _MSL_IMP_EXP #endif #ifndef _MSL_IMP_EXP_C #define _MSL_IMP_EXP_C _MSL_IMP_EXP #endif #ifndef _MSL_IMP_EXP_SIOUX #define _MSL_IMP_EXP_SIOUX _MSL_IMP_EXP #endif #ifndef _MSL_IMP_EXP_RUNTIME #define _MSL_IMP_EXP_RUNTIME _MSL_IMP_EXP #endif #define __MODENALIB__ /*soon to be obsolete...*/ /* Even though the __MSL__ identifier is a hex value, it is tracking a * more or less decimal identity - that is, for builds 10 - 16, we will * use a decimal appearing number - e.g., 0x4010 means the major Pro * release name as in Pro4, the second digit is the patch level, and * the last two digits refer to the build number within that release. * Hence, the last two digits of 10 mean build 10, and 20 means 20, * and so on. The identifier, although increasing, is not monatomical * for each build. */ /* MSL Pro 8 */ #define __MSL__ 0x8000 /* 990811 vss * The following define is supplied to update library functions and * definitions to the C9X specification. This does not guarantee * the full functionality of C9X, but does guard around behavior * that differs from defacto or the 1989 ANSI C Standard where the * difference is signficant. */ #if __dest_os != __emb_68k #define _MSL_C9X_ #endif #ifdef __cplusplus /*- cc 010409 -*/ #define _MSL_BEGIN_EXTERN_C extern "C" { #define _MSL_END_EXTERN_C } #ifdef _MSL_USING_NAMESPACE #define _MSL_BEGIN_NAMESPACE_STD namespace std { #define _MSL_END_NAMESPACE_STD } #define __std(ref) ::std::ref #define __global() :: #else #define _MSL_BEGIN_NAMESPACE_STD #define _MSL_END_NAMESPACE_STD #define __std(ref) ref #define __global() #endif #else #define _MSL_BEGIN_EXTERN_C #define _MSL_END_EXTERN_C #define _MSL_BEGIN_NAMESPACE_STD #define _MSL_END_NAMESPACE_STD #define __std(ref) ref #define __global() #endif /*- cc 010409 -*/ #if (__dest_os == __win32_os || __dest_os == __wince_os) #define __tls __declspec(thread) #define _MSL_CDECL __cdecl #else #define __tls #define _MSL_CDECL #endif #endif /* ndef _MSL_ANSI_PARMS_H */ /* Change record: * MEA 972306 Added __dest_os __ppc_eabi_bare. New symbol __no_os * is only defined for bare board embedded systems. * Do not define long long yet for PPC EABI. * SCM 971507 Added __nec_eabi_bare and __nec_eabi_os. * MEA 972007 Changed __ppc_eabi_bare to __ppc_eabi. * MEA 971109 Added support for long long. * vss 971015 New version 2.2 * hh 971206 reworked macro magic for namespace support * hh 971206 Added "define OS" code * hh 980120 added <mslGlobals.h> * hh 980217 added __ANSI_OVERLOAD__ * rjk 909313 ADDED _MSL_IMP_EXP macro * ah 010121 hawk dsp housekeeping * cc 010125 added _MSL_CDECL * ah 010131 removed hawk dsp housekeeping -- back to _Old_DSP_IO_Interface * cc 010409 updated defines to JWW new namespace macros */
[ [ [ 1, 118 ] ] ]
6a77dbd769a01b3914d798f5374da3fd235523e5
d64ed1f7018aac768ddbd04c5b465c860a6e75fa
/DlgEditNet.cpp
634683879cebdd2b47434050b7be770d37523040
[]
no_license
roc2/archive-freepcb-codeproject
68aac46d19ac27f9b726ea7246cfc3a4190a0136
cbd96cd2dc81a86e1df57b86ce540cf7c120c282
refs/heads/master
2020-03-25T00:04:22.712387
2009-06-13T04:36:32
2009-06-13T04:36:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,716
cpp
// DlgEditNet.cpp : implementation file // #include "stdafx.h" #include "FreePcb.h" #include "DlgEditNet.h" #include ".\dlgeditnet.h" // CDlgEditNet dialog IMPLEMENT_DYNAMIC(CDlgEditNet, CDialog) CDlgEditNet::CDlgEditNet(CWnd* pParent /*=NULL*/) : CDialog(CDlgEditNet::IDD, pParent) , CSubDlg_ViaWidth(static_cast<CSubDlg_TraceWidth*>(this)) , CSubDlg_Clearance( E_NO_AUTO_MODE ) { m_pins_edited = FALSE; } CDlgEditNet::~CDlgEditNet() { } void CDlgEditNet::Initialize( CNetList const * netlist, netlist_info * nl, int i, CPartList * plist, BOOL new_net, BOOL visible, int units, CArray<int> * w, CArray<int> * v_w, CArray<int> * v_h_w ) { m_units = units; m_nl = nl; m_in = i; m_plist = plist; m_visible = visible; m_new_net = new_net; if( new_net ) { m_name = ""; // Set all attib to use parent m_width_attrib = CConnectionWidthInfo(); m_width_attrib = CClearanceInfo(); } else { m_name = (*nl)[i].name; m_width_attrib = (*nl)[i].width_attrib; } m_width_attrib.SetParent( netlist->Get_def_width_attrib() ); m_w = w; m_v_w = v_w; m_v_h_w = v_h_w; } // enter with the following variables set up by calling function: // m_new_net = TRUE to add net, FALSE to edit net // m_name = pointer to CString with net name (or "" if adding new net) // m_use_nl_not_nlist = TRUE to use m_nl, FALSE to use m_nlist for net info // m_nl = pointer to net_info array // m_in = index into m_nl for this net // m_plist = pointer to partlist // m_w = pointer to CArray of trace widths // m_v_w = pointer to CArray of via pad widths // m_v_h_w = pointer to CArray of via hole widths // m_visible = visibility flag // BOOL CDlgEditNet::OnInitDialog() { CDialog::OnInitDialog(); CString str; m_width_attrib.Update(); m_edit_name.SetWindowText( m_name ); m_check_visible.SetCheck( m_visible ); // set up list box for pins if( !m_new_net ) { int npins = (*m_nl)[m_in].ref_des.GetSize(); for( int i=0; i<npins; i++ ) { str.Format( "%s.%s", (*m_nl)[m_in].ref_des[i], (*m_nl)[m_in].pin_name[i] ); m_list_pins.InsertString( i, str ); } } // Enable Modification of Traces, Vias, and Clearance m_check_t_modify.SetCheck(1); m_check_v_modify.SetCheck(1); m_check_c_modify.SetCheck(1); // default is to apply new trace width & clearances m_check_t_apply.SetCheck(0); m_check_v_apply.SetCheck(0); m_check_c_apply.SetCheck(0); // Do these last after other dialog items are setup CSubDlg_TraceWidth::OnInitDialog(m_width_attrib); CSubDlg_ViaWidth ::OnInitDialog(m_width_attrib); CSubDlg_Clearance ::OnInitDialog(m_width_attrib); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDlgEditNet::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_EDIT_NAME, m_edit_name); DDX_Control(pDX, IDC_CHECK_VISIBLE, m_check_visible); DDX_Control(pDX, IDC_RADIO1_PROJ_DEF, m_rb_t_default); DDX_Control(pDX, IDC_RADIO1_SET_TO, m_rb_t_set); DDX_Control(pDX, IDC_COMBO_WIDTH, m_combo_t_width); DDX_Control(pDX, IDC_CHECK_TRACE, m_check_t_apply); DDX_Control(pDX, IDC_CHECK_TRACE_MOD, m_check_t_modify); DDX_Control(pDX, IDC_RADIO2_PROJ_DEF, m_rb_v_default); DDX_Control(pDX, IDC_RADIO2_DEF_FOR_TRACE, m_rb_v_def_for_width); DDX_Control(pDX, IDC_RADIO2_SET_TO, m_rb_v_set); DDX_Control(pDX, IDC_TEXT_PAD, m_text_v_pad_w); DDX_Control(pDX, IDC_EDIT_VIA_PAD_W, m_edit_v_pad_w); DDX_Control(pDX, IDC_TEXT_HOLE, m_text_v_hole_w); DDX_Control(pDX, IDC_EDIT_VIA_HOLE_W, m_edit_v_hole_w); DDX_Control(pDX, IDC_CHECK_VIA, m_check_v_apply); DDX_Control(pDX, IDC_CHECK_VIA_MOD, m_check_v_modify); DDX_Control(pDX, IDC_RADIO3_PROJ_DEF, m_rb_c_default); DDX_Control(pDX, IDC_RADIO3_SET_TO, m_rb_c_set); DDX_Control(pDX, IDC_EDIT_CLEARANCE, m_edit_c_clearance); DDX_Control(pDX, IDC_CHECK_CLEARANCE, m_check_c_apply); DDX_Control(pDX, IDC_CHECK_CLEARANCE_MOD, m_check_c_modify); DDX_Control(pDX, IDC_LIST_PIN, m_list_pins); DDX_Control(pDX, IDC_EDIT_ADD_PIN, m_edit_addpin); DDX_Control(pDX, IDC_BUTTON_ADD, m_button_add_pin); DDX_Control(pDX, ID_MY_OK, m_button_OK); if( pDX->m_bSaveAndValidate ) { // now implement edits into netlist_info m_edit_name.GetWindowText( m_name ); if( m_name.GetLength() > MAX_NET_NAME_SIZE ) { CString mess; mess.Format( "Max length of net name is %d characters", MAX_NET_NAME_SIZE ); AfxMessageBox( mess ); pDX->Fail(); } int i; if( !CSubDlg_TraceWidth::OnDDXOut() || !CSubDlg_ViaWidth ::OnDDXOut() || !CSubDlg_Clearance ::OnDDXOut() ) { pDX->Fail(); return; } else { m_width_attrib.Undef(); m_width_attrib = CSubDlg_TraceWidth::m_attrib.get_data(); m_width_attrib = CSubDlg_ViaWidth::m_attrib; m_width_attrib = CSubDlg_Clearance::m_attrib; } m_visible = m_check_visible.GetState(); for( int in=0; in<m_nl->GetSize(); in++ ) { if( m_name == (*m_nl)[in].name && m_in != in && !(*m_nl)[in].deleted ) { AfxMessageBox( "duplicate net name" ); pDX->Fail(); } } // now update netlist_info if( m_new_net ) { // add entry to netlist_info for new net, set index m_in int num_nets = m_nl->GetSize(); m_nl->SetSize( num_nets + 1 ); m_in = num_nets; (*m_nl)[m_in].net = NULL; } (*m_nl)[m_in].apply_trace_width = m_check_t_apply.GetCheck(); (*m_nl)[m_in].apply_via_width = m_check_v_apply.GetCheck(); (*m_nl)[m_in].apply_clearance = m_check_c_apply.GetCheck(); (*m_nl)[m_in].modified = TRUE; (*m_nl)[m_in].name = m_name; (*m_nl)[m_in].visible = m_visible; (*m_nl)[m_in].width_attrib = m_width_attrib; if( m_pins_edited ) { int npins = m_list_pins.GetCount(); (*m_nl)[m_in].ref_des.SetSize( npins ); (*m_nl)[m_in].pin_name.SetSize( npins ); for( int i=0; i<npins; i++ ) { // now parse pin string from listbox CString str; m_list_pins.GetText( i, str ); str.Trim(); int len = str.GetLength(); if( len <= 3 ) ASSERT(0); int dot_pos = str.FindOneOf( "." ); if( dot_pos < 2 || dot_pos >= (len-1) ) ASSERT(0); CString refstr = str.Left(dot_pos); CString pinstr = str.Right( len - dot_pos - 1 ); int pin = atoi( pinstr ); (*m_nl)[m_in].ref_des[i] = refstr; (*m_nl)[m_in].pin_name[i] = pinstr; // now remove pin from other net, if necessary for( int in=0; in<m_nl->GetSize(); in++ ) { if( (*m_nl)[in].deleted == FALSE && m_in != in ) { for( int ip=0; ip<(*m_nl)[in].ref_des.GetSize(); ip++ ) { if( refstr == (*m_nl)[in].ref_des[ip] && pinstr == (*m_nl)[in].pin_name[ip] ) { (*m_nl)[in].modified = TRUE; (*m_nl)[in].ref_des.RemoveAt( ip ); (*m_nl)[in].pin_name.RemoveAt( ip); } } } } } } } } BEGIN_MESSAGE_MAP(CDlgEditNet, CDialog) ON_BN_CLICKED(IDC_RADIO1_PROJ_DEF, OnBnClicked_t_Default) ON_BN_CLICKED(IDC_RADIO1_SET_TO, OnBnClicked_t_Set) ON_CBN_SELCHANGE(IDC_COMBO_WIDTH, OnCbnSelchange_t_width) ON_CBN_EDITCHANGE(IDC_COMBO_WIDTH, OnCbnEditchange_t_width) ON_BN_CLICKED(IDC_RADIO2_PROJ_DEF, OnBnClicked_v_Default) ON_BN_CLICKED(IDC_RADIO2_DEF_FOR_TRACE, OnBnClicked_v_DefForTrace) ON_BN_CLICKED(IDC_RADIO2_SET_TO, OnBnClicked_v_Set) ON_BN_CLICKED(IDC_RADIO3_PROJ_DEF, OnBnClicked_c_Default) ON_BN_CLICKED(IDC_RADIO3_SET_TO, OnBnClicked_c_Set) ON_BN_CLICKED(IDC_BUTTON_DELETE, OnBnClickedButtonDelete) ON_BN_CLICKED(IDC_BUTTON_ADD, OnBnClickedButtonAdd) ON_EN_UPDATE(IDC_EDIT_ADD_PIN, OnEnUpdateEditAddPin) ON_BN_CLICKED(ID_MY_OK, OnBnClickedOk) END_MESSAGE_MAP() // CDlgEditNet message handlers void CDlgEditNet::OnBnClickedButtonDelete() { // Get the indexes of all the selected pins and delete them int nCount = m_list_pins.GetSelCount(); CArray<int,int> aryListBoxSel; aryListBoxSel.SetSize(nCount); m_list_pins.GetSelItems(nCount, aryListBoxSel.GetData()); for( int j=(nCount-1); j>=0; j-- ) { int iItem = aryListBoxSel[j]; m_list_pins.DeleteString( iItem ); } m_pins_edited = TRUE; } void CDlgEditNet::OnBnClickedButtonAdd() { CString str; m_edit_addpin.GetWindowText( str ); str.Trim(); int len = str.GetLength(); if( len < 3 ) { AfxMessageBox( "Illegal pin" ); return; } else { int test = m_list_pins.FindString( 0, str ); if( test != -1 ) { AfxMessageBox( "Pin already in this net" ); return; } int dot_pos = str.FindOneOf( "." ); if( dot_pos >= 2 && dot_pos < (len-1) ) { CString refstr = str.Left( dot_pos ); cpart * part = m_plist->GetPart( refstr ); if( !part ) { str.Format( "Part \"%s\" does not exist", refstr ); AfxMessageBox( str ); return; } if( !part->shape ) { str.Format( "Part \"%s\" does not have a footprint", refstr ); AfxMessageBox( str ); return; } CString pinstr = str.Right( len - dot_pos - 1 ); if( !CheckLegalPinName( &pinstr ) ) { str = "Pin name must consist of zero or more letters\n"; str += "Followed by zero or more numbers\n"; str += "For example: 1, 23, A12, SOURCE are legal\n"; str += "while 1A, A2B3 are not\n"; AfxMessageBox( str ); return; } int pin_index = part->shape->GetPinIndexByName( pinstr ); if( pin_index == -1 ) { str.Format( "Pin \"%s\" not found in footprint \"%s\"", pinstr, part->shape->m_name ); AfxMessageBox( str ); return; } // now search for pin in m_nl int i_found = -1; for( int i=0; i<m_nl->GetSize(); i++ ) { if( (*m_nl)[i].deleted == FALSE ) { for( int ip=0; ip<(*m_nl)[i].ref_des.GetSize(); ip++ ) { if( refstr == (*m_nl)[i].ref_des[ip] && pinstr == (*m_nl)[i].pin_name[ip] ) { i_found = i; break; } } } } if( i_found != -1 ) { if( i_found == m_in ) { AfxMessageBox( "Pin already in this net" ); return; } else { CString mess; mess.Format( "Pin %s.%s is assigned to net \"%s\"\nRemove it from \"%s\"? ", refstr, pinstr, (*m_nl)[i_found].name, (*m_nl)[i_found].name ); int ret = AfxMessageBox( mess, MB_OKCANCEL ); if( ret != IDOK ) return; } } m_list_pins.AddString( refstr + "." + pinstr ); m_pins_edited = TRUE; m_button_OK.SetButtonStyle( BS_DEFPUSHBUTTON ); m_button_add_pin.SetButtonStyle( BS_PUSHBUTTON ); m_edit_addpin.SetWindowText( "" ); } } } void CDlgEditNet::OnEnUpdateEditAddPin() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialog::OnInitDialog() // function to send the EM_SETEVENTMASK message to the control // with the ENM_UPDATE flag ORed into the lParam mask. m_button_OK.SetButtonStyle( BS_PUSHBUTTON ); m_button_add_pin.SetButtonStyle( BS_DEFPUSHBUTTON ); } void CDlgEditNet::OnBnClickedOk() { // if we are adding pins, trap "Enter" key void * focus_ptr = this->GetFocus(); void * addpin_ptr = &m_edit_addpin; CString str; m_edit_addpin.GetWindowText( str ); if( focus_ptr == addpin_ptr && str.GetLength() > 0 ) OnBnClickedButtonAdd(); else OnOK(); }
[ "freepcb@9bfb2a70-7351-0410-8a08-c5b0c01ed314", "jamesdily@9bfb2a70-7351-0410-8a08-c5b0c01ed314" ]
[ [ [ 1, 14 ], [ 17, 24 ], [ 117, 119 ], [ 121, 122 ], [ 147, 148 ], [ 150, 150 ], [ 152, 158 ], [ 160, 165 ], [ 169, 170 ], [ 172, 172 ], [ 174, 174 ], [ 180, 180 ], [ 182, 200 ], [ 205, 207 ], [ 210, 255 ], [ 268, 269 ], [ 273, 283 ], [ 285, 342 ], [ 344, 414 ] ], [ [ 15, 16 ], [ 25, 116 ], [ 120, 120 ], [ 123, 146 ], [ 149, 149 ], [ 151, 151 ], [ 159, 159 ], [ 166, 168 ], [ 171, 171 ], [ 173, 173 ], [ 175, 179 ], [ 181, 181 ], [ 201, 204 ], [ 208, 209 ], [ 256, 267 ], [ 270, 272 ], [ 284, 284 ], [ 343, 343 ] ] ]
6ac0c8f404160ca1c69ec3f623d8b1e3d07a207f
836523304390560c1b0b655888a4abef63a1b4a5
/OEClient/OEControl.cpp
c67e7bdb7e9b2980954177de428978c2c5d6426d
[]
no_license
paranoiagu/UDSOnlineEditor
4675ed403fe5acf437ff034a17f3eaa932e7b780
7eaae6fef51a01f09d28021ca6e6f2affa7c9658
refs/heads/master
2021-01-11T03:19:59.238691
2011-10-03T06:02:35
2011-10-03T06:02:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,332
cpp
// OEControl.cpp : Implementation of COEControl #include "stdafx.h" #include "OEControl.h" // COEControl LRESULT COEControl::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { /* //MessageBox(_T("Hello OnlineEditor")); IDispatch* pDisp = NULL; CLSID clsid; DISPID dispID; HRESULT hr; hr = CLSIDFromProgID(L"Word.Application", &clsid); if ( FAILED(hr) ){ MessageBox(_T("Word is not installed.")); } else { hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&pDisp); if ( FAILED(hr) ){ MessageBox(_T("Couldn't start Word.")); } else { OLECHAR* szVisible = L"Visible"; DISPPARAMS dispParams = {NULL, NULL, 0, 0}; DISPID dispidNamed = DISPID_PROPERTYPUT; CComVariant vrTrue = VARIANT_TRUE; pDisp->GetIDsOfNames(IID_NULL, &szVisible, 1, LOCALE_USER_DEFAULT, &dispID); dispParams.cArgs = 1; dispParams.rgvarg = &vrTrue; dispParams.cNamedArgs = 1; dispParams.rgdispidNamedArgs = &dispidNamed; // Set "Visible" property to true. pDisp->Invoke(dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT | DISPATCH_METHOD, &dispParams, NULL, NULL, NULL); //MessageBox(_T("We're done."), _T("Finish"), MB_SETFOREGROUND); pDisp->Release(); } } */ return TRUE; }
[ [ [ 1, 48 ] ] ]
249634f620a691cd1dc0f3a1084407577d35d75a
d9d008a8defae1fda50c9f67afcc6c2f117d4957
/src/Tree/Dator.hpp
d14c858e9f95fee75b16b4d568f0fee487b6fd5f
[]
no_license
treeman/My-Minions
efb902b34214ab8103fc573293693e7c8cc7930f
80f85c15c422fcfae67fa2815a5c4da796ef4450
refs/heads/master
2021-01-23T22:15:33.635844
2011-05-02T07:42:50
2011-05-02T07:42:50
1,689,566
0
1
null
null
null
null
UTF-8
C++
false
false
2,271
hpp
#pragma once #include <string> #include <list> #include <map> #include <boost/function.hpp> #include <boost/lexical_cast.hpp> #include "BaseDator.hpp" namespace Tree { class CallDator : public BaseDator { public: CallDator( boost::function<std::string()> func ) : call_func( func ) { } std::string Get() { return ""; } std::string Set( const std::string ) { return call_func(); } private: boost::function<std::string()> call_func; }; template<typename T> class Dator : public BaseDator { public: Dator( T new_val ) : val( new_val ), change_func(0) { } Dator( T new_val, boost::function<std::string( const T )> func ) : val( new_val ), change_func( func ) { } virtual ~Dator() { } T Val() { return val; } std::string Get() { return boost::lexical_cast<std::string>( val ); } std::string Set( const std::string new_val ) { try { return Set( boost::lexical_cast<T>( new_val ) ); } catch( ... ) { return ""; } } std::string Set( T new_val ) { val = new_val; if( change_func ) { return change_func( val ); } else { return ""; } } protected: T val; boost::function<std::string( const T )> change_func; }; template<> class Dator<std::string> : public BaseDator { public: Dator( std::string new_val ) : val( new_val ), change_func(0) { } Dator( std::string new_val, boost::function<std::string( const std::string )> func ) : val( new_val ), change_func( func ) { } virtual ~Dator() { } std::string Val() { return Get(); } std::string Get() { return val; } std::string Set( const std::string new_val ) { val = new_val; if( change_func ) { return change_func( val ); } else { return ""; } } protected: std::string val; boost::function<std::string( const std::string )> change_func; }; }
[ [ [ 1, 83 ] ] ]
9ce2475885b58365c39d3bbb35d17ce3bcfb096a
5e6ff9e6e8427078135a7b4d3b194bcbf631e9cd
/EngineSource/dpslim/dpslim/stdafx.cpp
a2fef066e119c99f90c7492618315561f795b4e8
[]
no_license
karakots/dpresurrection
1a6f3fca00edd24455f1c8ae50764142bb4106e7
46725077006571cec1511f31d314ccd7f5a5eeef
refs/heads/master
2016-09-05T09:26:26.091623
2010-02-01T11:24:41
2010-02-01T11:24:41
32,189,181
0
0
null
null
null
null
UTF-8
C++
false
false
202
cpp
// stdafx.cpp : source file that includes just the standard includes // dpslim.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
[ "Isaac.Noble@fd82578e-0ebe-11df-96d9-85c6b80b8d9c" ]
[ [ [ 1, 5 ] ] ]
31b7e636fa9c21a8f6962720a1ea2f553521d769
6c8c4728e608a4badd88de181910a294be56953a
/TextureDecoderModule/OpenJpegDecoder.h
d7ff66e3093a43ca50e007fb6269b0ec779ece3b
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
caocao/naali
29c544e121703221fe9c90b5c20b3480442875ef
67c5aa85fa357f7aae9869215f840af4b0e58897
refs/heads/master
2021-01-21T00:25:27.447991
2010-03-22T15:04:19
2010-03-22T15:04:19
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,075
h
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_TextureDecoder_OpenJpegDecoder_h #define incl_TextureDecoder_OpenJpegDecoder_h #include "AssetInterface.h" #include "TextureInterface.h" #include "TextureRequest.h" #include "ThreadTask.h" namespace TextureDecoder { //! OpenJpeg decoder that runs in a thread and serves decode requests, used internally by TextureService class OpenJpegDecoder : public Foundation::ThreadTask { public: //! Constructor OpenJpegDecoder(); //! Work function virtual void Work(); //! Set maximum amount of decodes to perform per frame /*! \param decodes Amount of decodes per frame */ void SetDecodesPerFrame(uint decodes); private: //! perform a decode & queue result /*! \param request decode request to serve */ void PerformDecode(DecodeRequestPtr request); uint decodes_per_frame_; }; } #endif
[ "cadaver@5b2332b8-efa3-11de-8684-7d64432d61a3" ]
[ [ [ 1, 38 ] ] ]
307db96a220c76d66022321a682f43053916a574
e580637678397200ed79532cd34ef78983e9aacd
/Grapplon/LogManager.cpp
b1c2496ba6f8fb2e491ccf728bf336278f2d9b3e
[]
no_license
TimToxopeus/grapplon2
03520bf6b5feb2c6fcb0c5ddb135abe55d3f344b
60f0564bdeda7d4c6e1b97148b5d060ab84c8bd5
refs/heads/master
2021-01-10T21:11:59.438625
2008-07-13T06:49:06
2008-07-13T06:49:06
41,954,527
0
0
null
null
null
null
UTF-8
C++
false
false
1,200
cpp
#include "LogManager.h" #include <stdio.h> #include <sstream> #include <time.h> CLogManager *CLogManager::m_pInstance = 0; CLogManager::CLogManager() { // Reset log FILE *pFile = fopen("log.txt", "wt+"); if ( pFile ) fclose(pFile); } CLogManager::~CLogManager() { } std::string itoa2(const int x) { std::ostringstream o; if (!(o << x)) return "ERROR"; return o.str(); } std::string ftoa2(const float x) { std::ostringstream o; if (!(o << x)) return "ERROR"; return o.str(); } void CLogManager::LogMessage( std::string message ) { FILE *pFile = fopen("log.txt", "at+"); if ( pFile ) { //Find the current time time_t curtime = time(0); //convert it to tm tm now=*localtime(&curtime); //Format string determines the conversion specification's behaviour const char format[]="%H:%M:%S"; //strftime - converts date and time to a string char dest[32]={0}; // Buffer if (strftime(dest, sizeof(dest)-1, format, &now)>0) fprintf( pFile, "[%s] %s\n", dest, message.c_str() ); else // Still print log message if time is unavailable.. fprintf( pFile, "%s\n", message.c_str() ); fclose(pFile); } }
[ [ [ 1, 57 ] ] ]
5e1cbfc4915c9db9f221bbfe6b705ed18741156f
1e976ee65d326c2d9ed11c3235a9f4e2693557cf
/CommonSources/MediaSlider.cpp
c25be485fb84eaa5b72610ff3ac21ddea6cd7762
[]
no_license
outcast1000/Jaangle
062c7d8d06e058186cb65bdade68a2ad8d5e7e65
18feb537068f1f3be6ecaa8a4b663b917c429e3d
refs/heads/master
2020-04-08T20:04:56.875651
2010-12-25T10:44:38
2010-12-25T10:44:38
19,334,292
3
0
null
null
null
null
UTF-8
C++
false
false
12,931
cpp
// /* // * // * Copyright (C) 2003-2010 Alexandros Economou // * // * This file is part of Jaangle (http://www.jaangle.com) // * // * This Program is free software; you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by // * the Free Software Foundation; either version 2, or (at your option) // * any later version. // * // * This Program is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU General Public License for more details. // * // * You should have received a copy of the GNU General Public License // * along with GNU Make; see the file COPYING. If not, write to // * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // * http://www.gnu.org/copyleft/gpl.html // * // */ #include "stdafx.h" #include "MediaSlider.h" COLORREF CMediaSlider::MixColors(COLORREF col1, COLORREF col2, INT part1/* = 1*/, INT part2/* = 1*/) { return RGB( (part1 * GetRValue(col1) + part2 * GetRValue(col2)) / (part1 + part2), (part1 * GetGValue(col1) + part2 * GetGValue(col2)) / (part1 + part2), (part1 * GetBValue(col1) + part2 * GetBValue(col2)) / (part1 + part2) ); } // CMediaSlider IMPLEMENT_DYNAMIC(CMediaSlider, CWnd) CMediaSlider::CMediaSlider(): m_maxPos(100), m_curPos(0), m_cursorWidth(9), m_bHorizontal(TRUE), m_bMouseIsDown(FALSE), m_bUseHandCursor(TRUE), m_pListener(NULL), m_tickInterval(0), m_bTransparentMode(FALSE) { m_colors[COL_Bk] = RGB(57,57,57); m_colors[COL_Border] = RGB(28,28,28); m_colors[COL_FirstPart] = RGB(255,192,0); m_colors[COL_SecondPart] = RGB(255,255,0); m_colors[COL_CursorBorder] = RGB(0,0,0); m_colors[COL_TickColor] = RGB(128,128,128); } CMediaSlider::~CMediaSlider() { } BEGIN_MESSAGE_MAP(CMediaSlider, CWnd) ON_WM_ERASEBKGND() ON_WM_PAINT() ON_WM_MOUSEMOVE() ON_WM_LBUTTONDOWN() ON_WM_LBUTTONUP() ON_WM_SETCURSOR() END_MESSAGE_MAP() // CMediaSlider message handlers BOOL CMediaSlider::Create(MediaSliderListener* pListener, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) { SetListener(pListener); return CWnd::Create(_T("STATIC"), NULL, dwStyle | SS_NOTIFY | SS_OWNERDRAW, rect, pParentWnd, nID); } BOOL CMediaSlider::OnEraseBkgnd(CDC* pDC) { return TRUE;//CWnd::OnEraseBkgnd(pDC); } const INT cMargin = 2; void CMediaSlider::OnPaint() { CPaintDC _dc(this); // device context for painting CClientDC dc(this); // There are artifacts while resizing if i don't use this CRect rc; GetClientRect(&rc); if (!m_bTransparentMode) dc.FillSolidRect(&rc, m_colors[COL_Bk]); CPen* oldPen = (CPen*)dc.SelectStockObject(DC_PEN); INT distFromCenter = (m_cursorWidth - 1) / 2; COLORREF midColor = MixColors(m_colors[COL_Border], m_colors[COL_FirstPart]); if (m_bHorizontal) { //=== Draw the border INT centerLineY = rc.Height() / 2; dc.SetDCPenColor(m_colors[COL_Border]); POINT pBorder[] = { {cMargin + 1, centerLineY - 2}, {rc.right - cMargin - 2, centerLineY - 2}, {rc.right - cMargin - 1, centerLineY - 1}, {rc.right - cMargin - 1, centerLineY + 1}, {rc.right - cMargin - 2, centerLineY + 2}, {cMargin + 1, centerLineY + 2}, {cMargin, centerLineY + 1}, {cMargin, centerLineY - 1}, {cMargin - 1, centerLineY - 2} }; dc.Polyline(pBorder, 9); dc.SetDCPenColor(midColor); //Draw Up MidLine dc.MoveTo(cMargin + 1, centerLineY - 1); dc.LineTo(rc.right - cMargin - 1, centerLineY - 1); //Draw Down MidLine dc.MoveTo(cMargin + 1, centerLineY + 1); dc.LineTo(rc.right - cMargin - 1, centerLineY + 1); INT startX = cMargin + 1 + distFromCenter; INT endX = rc.right - startX ; INT availablePixelsForSlidinig = endX - startX + 1; INT cursorX = startX + INT(availablePixelsForSlidinig * (DOUBLE)(m_curPos / (DOUBLE)m_maxPos)); //Draw First Part if (cursorX > cMargin + distFromCenter + 1) { dc.SetDCPenColor(m_colors[COL_FirstPart]); dc.MoveTo(cMargin + 1, centerLineY); dc.LineTo(cursorX - distFromCenter, centerLineY); } //Draw Second Part if (rc.right - cMargin - 1 > cursorX + m_cursorWidth) { dc.SetDCPenColor(m_colors[COL_SecondPart]); dc.MoveTo(cursorX + distFromCenter + 1, centerLineY); dc.LineTo(rc.right - cMargin - 1, centerLineY); } //Draw Ticks if (m_tickInterval > 0) { dc.SetDCPenColor(m_colors[COL_TickColor]); for (INT i = m_tickInterval; i < m_maxPos; i += m_tickInterval) { INT xPos = cMargin + 1 + (i * (rc.Width() - 2 * cMargin - 2)) / m_maxPos; dc.MoveTo(xPos, centerLineY - 0); dc.LineTo(xPos, centerLineY + 3); } } //DrawCursor Border dc.SetDCPenColor(m_colors[COL_CursorBorder]); POINT pNormalCursorBorder[] = { {cursorX - distFromCenter - 1, centerLineY - 3}, {cursorX + distFromCenter + 1, centerLineY - 3}, {cursorX + distFromCenter + 3, centerLineY - 1}, {cursorX + distFromCenter + 3, centerLineY + 1}, {cursorX + distFromCenter + 1, centerLineY + 3}, {cursorX - distFromCenter - 1, centerLineY + 3}, {cursorX - distFromCenter - 3, centerLineY + 1}, {cursorX - distFromCenter - 3, centerLineY - 1}, {cursorX - distFromCenter - 1, centerLineY - 3} }; POINT pReducedCursorBorder[] = { {cursorX - distFromCenter - 0, centerLineY - 2}, {cursorX + distFromCenter + 0, centerLineY - 2}, {cursorX + distFromCenter + 2, centerLineY - 1}, {cursorX + distFromCenter + 2, centerLineY + 1}, {cursorX + distFromCenter + 0, centerLineY + 2}, {cursorX - distFromCenter - 0, centerLineY + 2}, {cursorX - distFromCenter - 2, centerLineY + 1}, {cursorX - distFromCenter - 2, centerLineY - 1}, {cursorX - distFromCenter - 0, centerLineY - 2} }; LPPOINT pCursorBorder = m_bTransparentMode ? pReducedCursorBorder : pNormalCursorBorder; dc.Polyline(pCursorBorder, 9); COLORREF tmpColor = MixColors(m_colors[COL_FirstPart], RGB(255,255,255)); dc.FillSolidRect(cursorX - distFromCenter - 2, centerLineY - 1, m_cursorWidth + 4, 3, tmpColor); tmpColor = MixColors(m_colors[COL_FirstPart], RGB(255,255,255), 1, 5); dc.SetDCPenColor(tmpColor); dc.MoveTo(cursorX - distFromCenter - 1, centerLineY - 2); dc.LineTo(cursorX + distFromCenter + 2, centerLineY - 2); //tmpColor = MixColors(m_colors[COL_FirstPart], RGB(0,0,0), 1, 1); dc.SetDCPenColor(m_colors[COL_FirstPart]); dc.MoveTo(cursorX - distFromCenter - 1, centerLineY + 2); dc.LineTo(cursorX + distFromCenter + 2, centerLineY + 2); tmpColor = MixColors(m_colors[COL_FirstPart], RGB(255,0,0), 2, 3); dc.SetDCPenColor(tmpColor); dc.MoveTo(cursorX - distFromCenter, centerLineY); dc.LineTo(cursorX + distFromCenter + 1, centerLineY); } else { INT centerLineX = rc.Width() / 2; dc.SetDCPenColor(m_colors[COL_Border]); POINT pBorder[] = { {centerLineX - 1, cMargin + 0}, {centerLineX + 1, cMargin + 0}, {centerLineX + 2, cMargin + 1}, {centerLineX + 2, rc.bottom - cMargin - 2}, {centerLineX + 1, rc.bottom - cMargin - 1}, {centerLineX - 1, rc.bottom - cMargin - 1}, {centerLineX - 2, rc.bottom - cMargin - 2}, {centerLineX - 2, cMargin + 1}, {centerLineX - 1, cMargin + 0} }; dc.Polyline(pBorder, 9); dc.SetDCPenColor(midColor); //Draw Up MidLine dc.MoveTo(centerLineX - 1, cMargin + 1); dc.LineTo(centerLineX - 1, rc.bottom - cMargin - 1); //Draw Down MidLine dc.MoveTo(centerLineX + 1, cMargin + 1); dc.LineTo(centerLineX + 1, rc.bottom - cMargin - 1); INT startY = cMargin + 1 + distFromCenter; INT endY = rc.bottom - startY; INT availablePixelsForSlidinig = endY - startY + 1; INT cursorY = startY + (m_curPos * availablePixelsForSlidinig) / m_maxPos; //Draw First Part if (cursorY - distFromCenter > cMargin + 1) { dc.SetDCPenColor(m_colors[COL_FirstPart]); dc.MoveTo(centerLineX, cMargin + 1); dc.LineTo(centerLineX, cursorY - distFromCenter); } //m_tickInterval //Draw Second Part if (rc.bottom - cMargin - 1 > cursorY + distFromCenter + 1) { dc.SetDCPenColor(m_colors[COL_SecondPart]); dc.MoveTo(centerLineX, cursorY + distFromCenter + 1); dc.LineTo(centerLineX, rc.bottom - cMargin - 1); } //DrawCursor Border dc.SetDCPenColor(m_colors[COL_CursorBorder]); POINT pCursorBorder[] = { {centerLineX - 1, cursorY - distFromCenter - 3 }, {centerLineX + 1, cursorY - distFromCenter - 3 }, {centerLineX + 3, cursorY - distFromCenter - 1 }, {centerLineX + 3, cursorY + distFromCenter + 1 }, {centerLineX + 1, cursorY + distFromCenter + 3 }, {centerLineX - 1, cursorY + distFromCenter + 3 }, {centerLineX - 3, cursorY + distFromCenter + 1 }, {centerLineX - 3, cursorY - distFromCenter - 1 }, {centerLineX - 1, cursorY - distFromCenter - 3 } }; dc.Polyline(pCursorBorder, 9); COLORREF tmpColor = MixColors(m_colors[COL_FirstPart], RGB(255,255,255)); dc.FillSolidRect(centerLineX - 2, cursorY - distFromCenter - 1, 5, m_cursorWidth + 2, tmpColor); tmpColor = MixColors(m_colors[COL_FirstPart], RGB(255,255,255), 1, 5); dc.SetDCPenColor(tmpColor); dc.MoveTo(centerLineX - 1, cursorY - distFromCenter - 2); dc.LineTo(centerLineX + 2, cursorY - distFromCenter - 2); //tmpColor = MixColors(m_colors[COL_FirstPart], RGB(0,0,0), 1, 1); dc.SetDCPenColor(m_colors[COL_FirstPart]); dc.MoveTo(centerLineX - 1, cursorY + distFromCenter + 2); dc.LineTo(centerLineX + 2, cursorY + distFromCenter + 2); tmpColor = MixColors(m_colors[COL_FirstPart], RGB(255,0,0), 2, 3); dc.SetDCPenColor(tmpColor); dc.MoveTo(centerLineX, cursorY - distFromCenter); dc.LineTo(centerLineX, cursorY + distFromCenter + 1); } dc.SelectObject(oldPen); } void CMediaSlider::SetMaxPos(INT maxPos) { if (maxPos < 1) maxPos = 1; m_maxPos = maxPos; SetPos(GetPos()); } void CMediaSlider::SetPos(INT value) { ASSERT(value >= 0);// && value <= m_maxPos); INT oldValue = m_curPos; m_curPos = value; if (value < 0) m_curPos = 0; else if (value > m_maxPos) m_curPos = m_maxPos; if (m_curPos != oldValue && m_hWnd) Invalidate(FALSE); } void CMediaSlider::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if (m_bMouseIsDown) { INT newPos = GetPosByPoint(point.x, point.y); if (newPos != -1) { SetPos(GetPosByPoint(point.x, point.y)); if (m_pListener != NULL) m_pListener->OnMediaSliderClick(this); } } CWnd::OnMouseMove(nFlags, point); } INT CMediaSlider::GetPosByPoint(INT x, INT y) { CRect rc; GetClientRect(&rc); if (m_bHorizontal) { INT startX = cMargin + 1 + (m_cursorWidth - 1) / 2; INT endX = rc.right - cMargin - 1 - (m_cursorWidth - 1) / 2; if (x < startX) x = startX; if (x > endX) x = endX; INT availablePixelsForSlidinig = endX - startX + 1; return INT((x - startX) * DOUBLE(m_maxPos / (DOUBLE)availablePixelsForSlidinig)); } //Vertical INT startY = cMargin + 1 + (m_cursorWidth - 1) / 2; INT endY = rc.bottom - cMargin - 1 - (m_cursorWidth - 1) / 2; if (y < startY) y = startY; if (y > endY) y = endY; INT availablePixelsForSlidinig = endY - startY + 1; return INT((y - startY) * DOUBLE(m_maxPos / (DOUBLE)availablePixelsForSlidinig)); } void CMediaSlider::OnLButtonDown(UINT nFlags, CPoint point) { m_bMouseIsDown = TRUE; if (::GetCapture() != m_hWnd) { SetCapture(); //TRACE(_T("SetCapture\r\n")); } INT newPos = GetPosByPoint(point.x, point.y); if (newPos != -1) { SetPos(GetPosByPoint(point.x, point.y)); if (m_pListener != NULL) m_pListener->OnMediaSliderClick(this); } CWnd::OnLButtonDown(nFlags, point); } void CMediaSlider::OnLButtonUp(UINT nFlags, CPoint point) { m_bMouseIsDown = FALSE; if (::GetCapture() == m_hWnd) { ReleaseCapture(); //TRACE(_T("ReleaseCapture\r\n")); } CWnd::OnLButtonUp(nFlags, point); } void CMediaSlider::SetColor(CMediaSlider::COLORS idx, COLORREF value) { ASSERT(idx < COL_Last); if (idx < COL_Last) { m_colors[idx] = value; Invalidate(); } } COLORREF CMediaSlider::GetColor(CMediaSlider::COLORS idx) { ASSERT(idx < COL_Last); if (idx < COL_Last) return m_colors[idx]; return 0; } BOOL CMediaSlider::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if (m_bUseHandCursor) { SetCursor(AfxGetApp()->LoadStandardCursor (IDC_HAND)); return TRUE;//__super::OnSetCursor(pWnd, nHitTest, message); } return __super::OnSetCursor(pWnd, nHitTest, message); }
[ "outcast1000@dc1b949e-fa36-4f9e-8e5c-de004ec35678" ]
[ [ [ 1, 432 ] ] ]
0b952eceecf320a236a67d9f9ebd618cf29f8990
42a799a12ffd61672ac432036b6fc8a8f3b36891
/cpp/IGC_Tron/IGC_Tron/CameraOverall.h
e5c89dab96f857c05f7c256cd5bf9695a251ee97
[]
no_license
timotheehub/igctron
34c8aa111dbcc914183d5f6f405e7a07b819e12e
e608de209c5f5bd0d315a5f081bf0d1bb67fe097
refs/heads/master
2020-02-26T16:18:33.624955
2010-04-08T16:09:10
2010-04-08T16:09:10
71,101,932
0
0
null
null
null
null
UTF-8
C++
false
false
297
h
// CameraOverall.h // Declaration de la classe CameraOverall #ifndef __CAMERA_OVERALL_H__ #define __CAMERA_OVERALL_H__ #include "AbstractCamera.h" class CameraOverall : public AbstractCamera { public: CameraOverall ( ); ~CameraOverall ( ); }; #endif // __CAMERA_OVERALL_H__
[ "[email protected]", "fenrhil@de5929ad-f5d8-47c6-8969-ac6c484ef978" ]
[ [ [ 1, 15 ] ], [ [ 16, 16 ] ] ]
e4d1fa8f846efb7c85b43ec8b26e7d92d1c97378
b84a38aad619acf34c22ed6e6caa0f7b00ebfa0a
/Code/TootleRender/TScreen.h
ebbe157b559d41efd8c5bd4d6e18263b4692ae83
[]
no_license
SoylentGraham/Tootle
4ae4e8352f3e778e3743e9167e9b59664d83b9cb
17002da0936a7af1f9b8d1699d6f3e41bab05137
refs/heads/master
2021-01-24T22:44:04.484538
2010-11-03T22:53:17
2010-11-03T22:53:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,848
h
/*------------------------------------------------------ A screen is the owner for render targets. In windows the screen is the Win32 window control. Win could have multiple screens and they're flexible. Other platforms have just 1 screen, fixed resolution etc -------------------------------------------------------*/ #pragma once #include <TootleCore/TLTypes.h> #include <TootleCore/TPtrArray.h> #include <TootleCore/TKeyArray.h> #include <TootleCore/TRelay.h> #include <TootleCore/TFlags.h> #include "TRenderTarget.h" // gr: needed to include the array type because of templated destructor... would be good to find a way to avoid that //#include "TLRender.h" // gr: needed to include the array type because of templated destructor... would be good to find a way to avoid that #include "TRasteriser.h" // gr: needed to include the array type because of templated destructor... would be good to find a way to avoid that #include <TootleGui/TWindow.h> #include <TootleGui/TOpenglCanvas.h> #include "TScreenShape.h" // the default size is the iphone size #define TLScreen_DefaultSize Type2<u16>( 320, 480 ) namespace TLRender { class TScreen; class TRenderTarget; class TRenderNodeText; class TScreenWide; // should be deprecated now... class TScreenWideLeft; // rotated-left display for ipod (or ipod emulation) class TScreenWideRight; // rotated-right display for ipod (or ipod emulation) static const s32 g_MaxSize = -1; // for screen & render target sizes -1 indicates max extents } // forward declaration namespace TLGui { class TWindow; } //--------------------------------------------------------- // base screen type //--------------------------------------------------------- class TLRender::TScreen : public TLMessaging::TRelay { public: enum Flags { Flag_SyncFrameRate=0, // synchronise frames to refresh rate Flag_TakeScreenshot, // Take a screenshot }; public: TScreen(TRefRef ScreenRef,const Type2<u16>& Size=TLScreen_DefaultSize,TScreenShape ScreenShape=ScreenShape_Portrait); ~TScreen(); virtual TRefRef GetSubscriberRef() const { return GetRef(); } FORCEINLINE TRefRef GetRef() const { return m_Ref; } Type2<u16> GetSize() const { return m_pCanvas ? m_pCanvas->GetSize() : Type2<u16>(0,0); } FORCEINLINE TFlags<Flags>& GetFlags() { return m_Flags; } FORCEINLINE Bool GetFlag(TScreen::Flags Flag) const { return m_Flags(Flag); } FORCEINLINE TScreenShape GetScreenShape() const { return m_ScreenShape; } FORCEINLINE const TLMaths::TAngle& GetScreenAngle() const { return TLRender::GetScreenAngle( GetScreenShape() ); } virtual SyncBool Init(); virtual SyncBool Update(); virtual SyncBool Shutdown(); virtual void Draw(); // render our render targets TLGui::TWindow* GetWindow() { return m_pWindow; } // get the GUI window for this screen TPtr<TLRender::TRenderTarget> CreateRenderTarget(TRefRef TargetRef); // Creates a new render target SyncBool DeleteRenderTarget(TRefRef TargetRef); // shutdown a render target void OnRenderTargetZChanged(const TRenderTarget& RenderTarget); // z has changed on render target - resorts render targets TPtr<TRenderTarget>& GetRenderTarget(TRefRef TargetRef); // fetch render target Type4<s32> GetRenderTargetMaxSize(); // get the render target max size (in "render target space") - this is the viewport size, but rotated Type4<s32> GetViewportSize() const { return Type4<s32>( 0, 0, GetSize().x, GetSize().y ); } DEPRECATED Type4<s32> GetViewportMaxSize() const { return GetViewportSize(); } Bool GetRenderTargetSize(Type4<s32>& Size,const TRenderTarget& RenderTarget); // get the dimensions of a render target Bool GetRenderTargetSize(Type4<s32>& Size,TRefRef TargetRef); Bool GetWorldRayFromScreenPos(const TRenderTarget& RenderTarget,TLMaths::TLine& WorldRay,const Type2<s32>& ScreenPos); Bool GetWorldPosFromScreenPos(const TRenderTarget& RenderTarget,float3& WorldPos,float WorldDepth,const Type2<s32>& ScreenPos); Bool GetScreenPosFromWorldPos(const TRenderTarget& RenderTarget,const float3& WorldPos, Type2<s32>& ScreenPos); FORCEINLINE void RequestScreenshot() { m_Flags.Set(Flag_TakeScreenshot); } // Screenshot request TLRender::TRenderNodeText* Debug_GetRenderNodeText(TRefRef DebugTextRef); // return text render node for this debug text FORCEINLINE Bool operator==(const TRef& ScreenRef) const { return GetRef() == ScreenRef; } FORCEINLINE Bool operator==(const TScreen& Screen) const { return GetRef() == Screen.GetRef(); } protected: void GetDesktopSize(Type4<s32>& DesktopSize) const; // get the desktop dimensions void GetCenteredSize(Type4<s32>& Size) const; // take a screen size and center it on the desktop Bool GetRenderTargetPosFromScreenPos(const TRenderTarget& RenderTarget,Type2<s32>& RenderTargetPos,Type4<s32>& RenderTargetSize,const Type2<s32>& ScreenPos); // Get a render target-relative cursor position from a screen pos - fails if outside render target box Bool GetScreenPosFromRenderTargetPos(Type2<s32>& ScreenPos, const TRenderTarget& RenderTarget,const Type2<s32>& RenderTargetPos, Type4<s32>& RenderTargetSize); // Get a screen pos render target-relative cursor position- fails if outside render target box void CreateDebugRenderTarget(TRefRef FontRef=TRef("FDebug")); protected: TPtrArray<TRenderTarget,4,TSortPolicyPtrSorted<TRenderTarget,u8> > m_RenderTargets; // render targets sorted by depth TPtrArray<TRenderTarget> m_ShutdownRenderTargets; // list of render targets we're destroying Bool m_HasShutdown; // TRef m_Ref; // reference to screen TFlags<Flags> m_Flags; // screen flags TScreenShape m_ScreenShape; // screen orientation Type2<u16> m_InitialSize; // desired size from constructor TRef m_DebugRenderTarget; // debug render target TKeyArray<TRef,TRef> m_DebugRenderText; // keyed list of debug strings -> render nodes TPtr<TLRaster::TRasteriser> m_pRasteriser; // rasteriser (tied to the canvas - maybe it should be owned and created by the canvas?) TPtr<TLGui::TWindow> m_pWindow; // window for the screen which contains the canvas (todo; remove this and just have the screen work from a canvas - move window construction external) TPtr<TLGui::TOpenglCanvas> m_pCanvas; // canvas we render to. todo; when rasterisation goes in, the rasteriser will instance a base RasterCanvas type }; //---------------------------------------------------------- // widescreen screen //---------------------------------------------------------- class TLRender::TScreenWide : public TLRender::TScreen { public: TScreenWide(TRefRef ScreenRef,const Type2<u16>& Size=TLScreen_DefaultSize) : TScreen ( ScreenRef, Type2<u16>( Size.y, Size.x ), TLRender::ScreenShape_Wide ) { } }; //---------------------------------------------------------- // widescreen screen //---------------------------------------------------------- class TLRender::TScreenWideLeft : public TLRender::TScreen { public: TScreenWideLeft(TRefRef ScreenRef,const Type2<u16>& Size=TLScreen_DefaultSize) : TScreen ( ScreenRef, Size, TLRender::ScreenShape_WideLeft ) { } }; //---------------------------------------------------------- // widescreen screen //---------------------------------------------------------- class TLRender::TScreenWideRight : public TLRender::TScreen { public: TScreenWideRight(TRefRef ScreenRef,const Type2<u16>& Size=TLScreen_DefaultSize) : TScreen ( ScreenRef, Size, TLRender::ScreenShape_WideRight ) { } };
[ [ [ 1, 12 ], [ 16, 16 ], [ 18, 21 ], [ 23, 48 ], [ 50, 86 ], [ 88, 90 ], [ 92, 103 ], [ 105, 163 ] ], [ [ 13, 15 ], [ 17, 17 ], [ 22, 22 ], [ 49, 49 ], [ 87, 87 ], [ 91, 91 ], [ 104, 104 ] ] ]
892695822872ea8a26b9fe1b8b3d6738550cb5f4
b7c505dcef43c0675fd89d428e45f3c2850b124f
/Src/SimulatorQt/Util/qt/Win32/include/Qt/qdbusextratypes.h
8644c520b21b8b4b3a935bbac6f0beb9dc254b3b
[ "BSD-2-Clause" ]
permissive
pranet/bhuman2009fork
14e473bd6e5d30af9f1745311d689723bfc5cfdb
82c1bd4485ae24043aa720a3aa7cb3e605b1a329
refs/heads/master
2021-01-15T17:55:37.058289
2010-02-28T13:52:56
2010-02-28T13:52:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,234
h
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information ([email protected]) ** ** This file is part of the QtDBus module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain ** additional rights. These rights are described in the Nokia Qt LGPL ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this ** package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at [email protected]. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDBUSEXTRATYPES_H #define QDBUSEXTRATYPES_H // define some useful types for D-BUS #include <QtCore/qvariant.h> #include <QtCore/qstring.h> #include <QtDBus/qdbusmacros.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(DBus) // defined in qhash.cpp Q_CORE_EXPORT uint qHash(const QString &key); class QDBUS_EXPORT QDBusObjectPath : private QString { public: inline QDBusObjectPath() { } inline explicit QDBusObjectPath(const char *path); inline explicit QDBusObjectPath(const QLatin1String &path); inline explicit QDBusObjectPath(const QString &path); inline QDBusObjectPath &operator=(const QDBusObjectPath &path); inline void setPath(const QString &path); inline QString path() const { return *this; } private: void check(); }; inline QDBusObjectPath::QDBusObjectPath(const char *objectPath) : QString(QString::fromLatin1(objectPath)) { check(); } inline QDBusObjectPath::QDBusObjectPath(const QLatin1String &objectPath) : QString(objectPath) { check(); } inline QDBusObjectPath::QDBusObjectPath(const QString &objectPath) : QString(objectPath) { check(); } inline QDBusObjectPath &QDBusObjectPath::operator=(const QDBusObjectPath &_path) { QString::operator=(_path); check(); return *this; } inline void QDBusObjectPath::setPath(const QString &objectPath) { QString::operator=(objectPath); check(); } inline bool operator==(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs) { return lhs.path() == rhs.path(); } inline bool operator!=(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs) { return lhs.path() != rhs.path(); } inline bool operator<(const QDBusObjectPath &lhs, const QDBusObjectPath &rhs) { return lhs.path() < rhs.path(); } inline uint qHash(const QDBusObjectPath &objectPath) { return qHash(objectPath.path()); } class QDBUS_EXPORT QDBusSignature : private QString { public: inline QDBusSignature() { } inline explicit QDBusSignature(const char *signature); inline explicit QDBusSignature(const QLatin1String &signature); inline explicit QDBusSignature(const QString &signature); inline QDBusSignature &operator=(const QDBusSignature &signature); inline void setSignature(const QString &signature); inline QString signature() const { return *this; } private: void check(); }; inline QDBusSignature::QDBusSignature(const char *dBusSignature) : QString(QString::fromAscii(dBusSignature)) { check(); } inline QDBusSignature::QDBusSignature(const QLatin1String &dBusSignature) : QString(dBusSignature) { check(); } inline QDBusSignature::QDBusSignature(const QString &dBusSignature) : QString(dBusSignature) { check(); } inline QDBusSignature &QDBusSignature::operator=(const QDBusSignature &dbusSignature) { QString::operator=(dbusSignature); check(); return *this; } inline void QDBusSignature::setSignature(const QString &dBusSignature) { QString::operator=(dBusSignature); check(); } inline bool operator==(const QDBusSignature &lhs, const QDBusSignature &rhs) { return lhs.signature() == rhs.signature(); } inline bool operator!=(const QDBusSignature &lhs, const QDBusSignature &rhs) { return lhs.signature() != rhs.signature(); } inline bool operator<(const QDBusSignature &lhs, const QDBusSignature &rhs) { return lhs.signature() < rhs.signature(); } inline uint qHash(const QDBusSignature &signature) { return qHash(signature.signature()); } class QDBusVariant : private QVariant { public: inline QDBusVariant() { } inline explicit QDBusVariant(const QVariant &variant); inline void setVariant(const QVariant &variant); inline QVariant variant() const { return *this; } }; inline QDBusVariant::QDBusVariant(const QVariant &dBusVariant) : QVariant(dBusVariant) { } inline void QDBusVariant::setVariant(const QVariant &dBusVariant) { QVariant::operator=(dBusVariant); } QT_END_NAMESPACE Q_DECLARE_METATYPE(QDBusVariant) Q_DECLARE_METATYPE(QDBusObjectPath) Q_DECLARE_METATYPE(QList<QDBusObjectPath>) Q_DECLARE_METATYPE(QDBusSignature) Q_DECLARE_METATYPE(QList<QDBusSignature>) QT_END_HEADER #endif
[ "alon@rogue.(none)" ]
[ [ [ 1, 187 ] ] ]
dcd56bd8f4e7b4929211e74c8211b16143ed4e1a
e2e49023f5a82922cb9b134e93ae926ed69675a1
/tools/aoslcpp/include/aosl/object_ref.hpp
11fd3a3900850392662b52cfd9f9eed237a9541a
[]
no_license
invy/mjklaim-freewindows
c93c867e93f0e2fe1d33f207306c0b9538ac61d6
30de8e3dfcde4e81a57e9059dfaf54c98cc1135b
refs/heads/master
2021-01-10T10:21:51.579762
2011-12-12T18:56:43
2011-12-12T18:56:43
54,794,395
1
0
null
null
null
null
UTF-8
C++
false
false
5,489
hpp
// Copyright (C) 2005-2010 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD, an XML Schema // to C++ data binding compiler, in the Proprietary License mode. // You should have received a proprietary license from Code Synthesis // Tools CC prior to generating this code. See the license text for // conditions. // /** * @file * @brief Generated from object_ref.xsd. */ #ifndef AOSLCPP_AOSL__OBJECT_REF_HPP #define AOSLCPP_AOSL__OBJECT_REF_HPP // Begin prologue. // #include <aoslcpp/common.hpp> // // End prologue. #include <xsd/cxx/config.hxx> #if (XSD_INT_VERSION != 3030000L) #error XSD runtime version mismatch #endif #include <xsd/cxx/pre.hxx> #include "aosl/object_ref_forward.hpp" #include <memory> // std::auto_ptr #include <limits> // std::numeric_limits #include <algorithm> // std::binary_search #include <xsd/cxx/xml/char-utf8.hxx> #include <xsd/cxx/tree/exceptions.hxx> #include <xsd/cxx/tree/elements.hxx> #include <xsd/cxx/tree/containers.hxx> #include <xsd/cxx/tree/list.hxx> #include <xsd/cxx/xml/dom/parsing-header.hxx> #include <xsd/cxx/tree/containers-wildcard.hxx> #ifndef XSD_DONT_INCLUDE_INLINE #define XSD_DONT_INCLUDE_INLINE #undef XSD_DONT_INCLUDE_INLINE #else #endif // XSD_DONT_INCLUDE_INLINE /** * @brief C++ namespace for the %artofsequence.org/aosl/1.0 * schema namespace. */ namespace aosl { /** * @brief Union class corresponding to the %object_ref * schema type. * * The mapping represents unions as strings. * * Reference to a specific object or to an autmatic find of one or more * references. */ class Object_ref: public ::xml_schema::String { public: /** * @brief Create an instance from a C string. * * @param v A string value. */ Object_ref (const char* v); /** * @brief Create an instance from a string. * * @param v A string value. */ Object_ref (const ::std::string& v); /** * @brief Create an instance from a DOM element. * * @param e A DOM element to extract the data from. * @param f Flags to create the new instance with. * @param c A pointer to the object that will contain the new * instance. */ Object_ref (const ::xercesc::DOMElement& e, ::xml_schema::Flags f = 0, ::xml_schema::Container* c = 0); /** * @brief Create an instance from a DOM attribute. * * @param a A DOM attribute to extract the data from. * @param f Flags to create the new instance with. * @param c A pointer to the object that will contain the new * instance. */ Object_ref (const ::xercesc::DOMAttr& a, ::xml_schema::Flags f = 0, ::xml_schema::Container* c = 0); /** * @brief Create an instance from a string fragment. * * @param s A string fragment to extract the data from. * @param e A pointer to DOM element containing the string fragment. * @param f Flags to create the new instance with. * @param c A pointer to the object that will contain the new * instance. */ Object_ref (const ::std::string& s, const ::xercesc::DOMElement* e, ::xml_schema::Flags f = 0, ::xml_schema::Container* c = 0); /** * @brief Copy constructor. * * @param x An instance to make a copy of. * @param f Flags to create the copy with. * @param c A pointer to the object that will contain the copy. * * For polymorphic object models use the @c _clone function instead. */ Object_ref (const Object_ref& x, ::xml_schema::Flags f = 0, ::xml_schema::Container* c = 0); /** * @brief Copy the instance polymorphically. * * @param f Flags to create the copy with. * @param c A pointer to the object that will contain the copy. * @return A pointer to the dynamically allocated copy. * * This function ensures that the dynamic type of the instance is * used for copying and should be used for polymorphic object * models instead of the copy constructor. */ virtual Object_ref* _clone (::xml_schema::Flags f = 0, ::xml_schema::Container* c = 0) const; }; } #ifndef XSD_DONT_INCLUDE_INLINE #endif // XSD_DONT_INCLUDE_INLINE #include <iosfwd> namespace aosl { ::std::ostream& operator<< (::std::ostream&, const Object_ref&); } #include <iosfwd> #include <xercesc/sax/InputSource.hpp> #include <xercesc/dom/DOMDocument.hpp> #include <xercesc/dom/DOMErrorHandler.hpp> namespace aosl { } #include <iosfwd> #include <xercesc/dom/DOMDocument.hpp> #include <xercesc/dom/DOMErrorHandler.hpp> #include <xercesc/framework/XMLFormatter.hpp> #include <xsd/cxx/xml/dom/auto-ptr.hxx> namespace aosl { void operator<< (::xercesc::DOMElement&, const Object_ref&); void operator<< (::xercesc::DOMAttr&, const Object_ref&); void operator<< (::xml_schema::ListStream&, const Object_ref&); } #ifndef XSD_DONT_INCLUDE_INLINE #include "aosl/object_ref.inl" #endif // XSD_DONT_INCLUDE_INLINE #include <xsd/cxx/post.hxx> // Begin epilogue. // // // End epilogue. #endif // AOSLCPP_AOSL__OBJECT_REF_HPP
[ "klaim@localhost" ]
[ [ [ 1, 214 ] ] ]
9ff01db0468f81a28528fb4b621f5c9370bce93a
14b3d57ed3d60b8934dad450a1edf96c573c9e40
/Renamer .NET/clrUtility.cpp
9dc817b0927ec5e0fcf9a7b5912a072b20bfa938
[]
no_license
arturh85/Renamer.NET
02f251f7c41a3f15397faa9bbc63dcb14fa10b67
e883f8558cdddaa9b88a13261611e9ae429e70aa
refs/heads/master
2020-08-27T02:29:29.137558
2009-06-24T15:34:49
2009-06-24T15:34:49
3,036,515
0
0
null
null
null
null
UTF-8
C++
false
false
2,937
cpp
/************************************************************************ Copyright (c) 2008, Artur H., Lennart W. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /************************************************************************/ #include "StdAfx.h" #include "clrUtility.h" using namespace System; static bool To_string( String^ source, string &target ) { pin_ptr<const wchar_t> wch = PtrToStringChars( source ); int len = (( source->Length+1) * 2); char *ch = new char[ len ]; bool result = wcstombs( ch, wch, len ) != -1; target = ch; delete ch; return result; } static bool To_CharStar( String^ source, char*& target ) { pin_ptr<const wchar_t> wch = PtrToStringChars( source ); int len = (( source->Length+1) * 2); target = new char[ len ]; return wcstombs( target, wch, len ) != -1; } string toStlString(String^ source) { string target; To_string(source, target); return target; } wstring toStdWString(System::String^ source) { using namespace Runtime::InteropServices; const wchar_t* chars = (const wchar_t*)(Marshal::StringToHGlobalUni(source)).ToPointer(); wstring ret(chars); Marshal::FreeHGlobal(IntPtr((void*)chars)); return ret; } String^ toClrString( string source ) { String^ target = gcnew String( source.c_str() ); return target; } String^ toClrString( wstring source ) { String^ target = gcnew String(source.c_str()); return target; }
[ [ [ 1, 73 ] ] ]
2f485ad4eba82cdfa1a71bd07e6445b669891a30
1b75922773bf9e61f5c9c8572ffcdae73d34a158
/examples/testbed/BulletSystem.cpp
c69ff58b9f8320c18060b03deb89d5d2125f282e
[]
no_license
warvair/bulletscript
a6db7ad4caa661e830373f4953e35053852008bc
3f499c3afba07c251fa95cb012801ef820705f7f
refs/heads/master
2021-01-10T20:46:53.665684
2010-07-03T18:50:43
2010-07-03T18:50:43
35,000,416
5
1
null
null
null
null
UTF-8
C++
false
false
9,197
cpp
#include <cmath> #include <iostream> #include <algorithm> #include "Main.h" #include "Boss.h" #include "BulletSystem.h" #include "RendererGL.h" extern BossManager* g_bosses; float BulletBattery::mSinTable[]; float BulletBattery::mCosTable[]; BulletBattery* g_bossBullets = 0, *g_playerBullets = 0; bs::UserTypeBase* bullet_emitAngle(float x, float y, float angle, const float* args, void* userObj) { return static_cast<BulletBattery*>(userObj)->emitAngle(x, y, angle, args, userObj); } bs::UserTypeBase* bullet_emitTarget(float x, float y, float angle, const float* args, void* userObj) { return static_cast<BulletBattery*>(userObj)->emitTarget(x, y, angle, args, userObj); } void bullet_kill(bs::UserTypeBase* object, void* userObj) { static_cast<BulletBattery*>(userObj)->killBullet(object); } void bullet_setX(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->x = value; } float bullet_getX(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->x; } void bullet_setY(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->y = value; } float bullet_getY(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->y; } void bullet_setAngle(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->angle = value; if (value < 0.0f) value += 360.0f; int index = (int) (value * 10) % 3600; b->vx = BulletBattery::getSine(index) * b->speed; b->vy = BulletBattery::getCosine(index) * b->speed; } float bullet_getAngle(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->angle; } void bullet_setSpeed(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->speed = value; float angle = b->angle; if (angle < 0.0f) angle += 360.0f; int index = (int) (angle * 10) % 3600; b->vx = BulletBattery::getSine(index) * value; b->vy = BulletBattery::getCosine(index) * value; } float bullet_getSpeed(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->speed; } void bullet_setRed(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->red = value; } float bullet_getRed(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->red; } void bullet_setGreen(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->green = value; } float bullet_getGreen(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->green; } void bullet_setBlue(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->blue = value; } float bullet_getBlue(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->blue; } void bullet_setAlpha(bs::UserTypeBase* object, float value) { Bullet* b = static_cast<Bullet*>(object); b->alpha = value; } float bullet_getAlpha(bs::UserTypeBase* object) { Bullet* b = static_cast<Bullet*>(object); return b->alpha; } void bullet_gravity(bs::UserTypeBase* object, float frameTime, const float* args) { Bullet* b = static_cast<Bullet*>(object); // b->vy -= args[-1] * frameTime; } // -------------------------------------------------------------------------------- BulletBattery::BulletBattery(bs::Machine* machine) : mMachine(machine), mStoreIndex(0), mUseIndex(1) { mBullets.resize(BATTERY_SIZE); mFreeList[mStoreIndex].reserve(BATTERY_SIZE); mFreeList[mUseIndex].reserve(BATTERY_SIZE); for (int i = 0; i < BATTERY_SIZE; ++ i) mFreeList[mUseIndex].push_back(BATTERY_SIZE - i - 1); } // -------------------------------------------------------------------------------- void BulletBattery::initialiseTables() { // trig tables for (int i = 0; i < 3600; ++i) { mSinTable[i] = (float) sin((i / 10.0f) * bs::DEG_TO_RAD); mCosTable[i] = (float) cos((i / 10.0f) * bs::DEG_TO_RAD); } } // -------------------------------------------------------------------------------- float BulletBattery::getSine(int index) { return mSinTable[index]; } // -------------------------------------------------------------------------------- float BulletBattery::getCosine(int index) { return mCosTable[index]; } // -------------------------------------------------------------------------------- unsigned int BulletBattery::getFreeBulletSlot() { unsigned int id; if (mFreeList[mUseIndex].size()) { id = mFreeList[mUseIndex].back(); mFreeList[mUseIndex].pop_back(); } else { if (mFreeList[mStoreIndex].size()) { std::sort(mFreeList[mStoreIndex].begin(), mFreeList[mStoreIndex].end(), BulletSorter()); mStoreIndex = mUseIndex; mUseIndex = (mStoreIndex == 0) ? 1 : 0; id = mFreeList[mUseIndex].back (); mFreeList[mUseIndex].pop_back (); } else { id = (unsigned int) mBullets.size(); mBullets.push_back(Bullet()); } } return id; } // -------------------------------------------------------------------------------- int BulletBattery::getCapacity() const { return (int) mBullets.capacity(); } // -------------------------------------------------------------------------------- bs::UserTypeBase* BulletBattery::emitAngle(float x, float y, float angle, const float* args, void* user) { Bullet b; b._active = true; b._time = 0; b._texture = args[-1]; b.x = x; b.y = y; b.speed = args[-3]; b.angle = args[-2]; if (b.angle < 0.0f) b.angle += 360.0f; int index = (int) (b.angle * 10) % 3600; b.vx = mSinTable[index] * args[-3]; b.vy = mCosTable[index] * args[-3]; b.alpha = 1; b.red = 1; b.green = 1; b.blue = 1; size_t count = mSpawnedBullets.size(); mSpawnedBullets.push_back(b); return &(mSpawnedBullets[count]); } // -------------------------------------------------------------------------------- bs::UserTypeBase* BulletBattery::emitTarget(float x, float y, float angle, const float* args, void* user) { Bullet b; b._active = true; b._time = 0; b._texture = args[-1]; b.x = x; b.y = y; b.speed = args[-1]; float dx = args[-2] - x; float dy = args[-3] - y; float tgtAngle = (float) atan2(dy, -dx) * bs::RAD_TO_DEG - 90.0f + args[-4]; if (tgtAngle < 0.0f) tgtAngle += 360.0f; b.angle = tgtAngle; int index = (int) (tgtAngle * 10) % 3600; b.vx = mSinTable[index] * args[-5]; b.vy = mCosTable[index] * args[-5]; b.alpha = 1; b.red = 1; b.green = 1; b.blue = 1; size_t count = mSpawnedBullets.size(); mSpawnedBullets.push_back(b); return &(mSpawnedBullets[count]); } // -------------------------------------------------------------------------------- void BulletBattery::killBullet(Bullet* b) { mBullets[b->_index]._active = false; mFreeList[mStoreIndex].push_back(b->_index); mMachine->releaseType(b); } // -------------------------------------------------------------------------------- void BulletBattery::killBullet(bs::UserTypeBase* object) { killBullet(static_cast<Bullet*>(object)); } // -------------------------------------------------------------------------------- int BulletBattery::update(float frameTime) { // Add recently spawned bullets for (size_t i = 0; i < mSpawnedBullets.size(); ++i) { unsigned int slot = getFreeBulletSlot(); // UserTypeBase relocation occurs here mBullets[slot] = mSpawnedBullets[i]; } mSpawnedBullets.clear(); int index = 0; int count = 0; std::vector<Bullet>::iterator it = mBullets.begin(); while (it != mBullets.end()) { Bullet &b = *it; b._index = index; if (b._active) { b._time += frameTime; // Apply normal movement update b.x += b.vx * frameTime; b.y += b.vy * frameTime; // bulletscript: apply affectors and control functions mMachine->updateType(&b, b.x, b.y, b.angle, frameTime); // Check for death if (b.y < 0 || b.y > SCREEN_HEIGHT || b.x < 0 || b.x > SCREEN_WIDTH) { killBullet(&b); } else { count++; } } ++it; ++index; } return count; } // -------------------------------------------------------------------------------- int BulletBattery::checkCollisions(float x0, float y0, float x1, float y1) { int hits = 0; int index = 0; std::vector<Bullet>::iterator it = mBullets.begin(); while (it != mBullets.end()) { Bullet &b = *it; b._index = index; if (b._active) { if (b.x >= x0 && b.y >= y0 && b.x <= x1 && b.y <= y1) { killBullet(&b); hits++; } } ++it; ++index; } return hits; } // -------------------------------------------------------------------------------- void BulletBattery::render(RendererGL *renderer) { std::vector<Bullet>::iterator it = mBullets.begin(); while (it != mBullets.end ()) { Bullet &b = *it; if (b._active) renderer->addBullet(b); ++ it; } } // --------------------------------------------------------------------------------
[ "[email protected]@fe84ce02-70a6-11de-8b73-c1edde54a3c7" ]
[ [ [ 1, 381 ] ] ]
fbe6200a126d874ac214caf260818e857f44f433
772690258e7a85244cc871d744bf54fc4e887840
/ms22vv/Castle Defence Ogre3d/Castle Defence Ogre3d/View/Camera/Camera.cpp
11338246188e188e07694cc84e7d3a94ac66d85b
[]
no_license
Argos86/dt2370
f735d21517ab55de19cea933b467f46837bb6401
4a393a3c83deb3cb6df90b36a9c59e2e543917ee
refs/heads/master
2021-01-13T00:53:43.286445
2010-02-01T07:43:50
2010-02-01T07:43:50
36,057,264
0
0
null
null
null
null
UTF-8
C++
false
false
2,089
cpp
#include <OgreSceneManager.h> #include <OgreRoot.h> #include <OgreCamera.h> #include <OgreVector2.h> #include <OgreVector3.h> #include <OgreQuaternion.h> #include <OgreRenderWindow.h> #include <OgreViewport.h> #include "Camera.h" CameraManager::CameraManager(Ogre::SceneManager *a_scenemgr, Ogre::RenderWindow *a_window, Ogre::String a_name) { m_cameraName = a_name; m_cameraNode = a_scenemgr->getRootSceneNode()->createChildSceneNode(); m_cameraNode->setPosition(Ogre::Vector3(0,0,0)); m_camera = a_scenemgr->createCamera(m_cameraName); m_camera->setNearClipDistance(10); m_camera->setPosition(Ogre::Vector3(0,0,0)); m_window = a_window; m_offsetX = 0; m_offsetY = 0; //Ogre::CompositorManager::getSingleton().addCompositor(m_camVp, "blur"); //Ogre::CompositorManager::getSingleton().setCompositorEnabled(m_camVp, "blur", false); //m_camera->setAspectRatio(m_camVp->getActualWidth() / m_camVp->getActualHeight()); } void CameraManager::Update(Ogre::Vector3 a_weaponPosition, Ogre::Quaternion a_weaponOrientation, Ogre::Vector2 a_mousePosition) { } void CameraManager::Move(Ogre::Vector3 a_movementVector, float a_timeSinceLastFrame) { m_cameraNode->setPosition( m_cameraNode->getPosition() + m_camera->getOrientation() * a_movementVector * a_timeSinceLastFrame ); } void CameraManager::Rotate(Ogre::Vector2 a_mousePosition) { m_camera->yaw(Ogre::Degree(- a_mousePosition.x)); m_camera->pitch(Ogre::Degree(- a_mousePosition.y)); } void CameraManager::DisableViewport() { m_window->removeViewport(0); } void CameraManager::EnableViewport() { m_camVp = m_window->addViewport(m_camera, 0, 0, 0, 1.0, 1.0 ); } Ogre::Vector3 CameraManager::GetPosition() { if(m_camera) { return m_camera->getPosition(); } else { return Ogre::Vector3(); } } Ogre::Quaternion CameraManager::GetOrientation() { if(m_camera) { return m_camera->getOrientation(); } else { return Ogre::Quaternion(); } } void CameraManager::ResetOrientation() { } CameraManager::~CameraManager() { }
[ "[email protected]@3422cff2-cdd9-11de-91bf-0503b81643b9" ]
[ [ [ 1, 83 ] ] ]
d0995618e40877319e6312f97e47604b4b3c19e3
b799c972367cd014a1ffed4288a9deb72f590bec
/project/NetServices/services/http/server/impl/RPCHandler.cpp
cd08976bf16b6cb67865f2d9e51bb1bace82a056
[]
no_license
intervigilium/csm213a-embedded
647087de8f831e3c69e05d847d09f5fa12b468e6
ae4622be1eef8eb6e4d1677a9b2904921be19a9e
refs/heads/master
2021-01-13T02:22:42.397072
2011-12-11T22:50:37
2011-12-11T22:50:37
2,832,079
2
1
null
null
null
null
UTF-8
C++
false
false
3,068
cpp
/* Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "RPCHandler.h" #include "rpc.h" //#define __DEBUG #include "dbg/dbg.h" #define RPC_DATA_LEN 128 RPCHandler::RPCHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket) : HTTPRequestHandler(rootPath, path, pTCPSocket) {} RPCHandler::~RPCHandler() { DBG("\r\nHandler destroyed\r\n"); } void RPCHandler::doGet() { DBG("\r\nIn RPCHandler::doGet()\r\n"); char resp[RPC_DATA_LEN] = {0}; char req[RPC_DATA_LEN] = {0}; DBG("\r\nPath : %s\r\n", path().c_str()); DBG("\r\nRoot Path : %s\r\n", rootPath().c_str()); //Remove path strncpy(req, path().c_str(), RPC_DATA_LEN-1); DBG("\r\nRPC req : %s\r\n", req); //Remove %20, +, from req cleanReq(req); DBG("\r\nRPC req : %s\r\n", req); //Do RPC Call mbed::rpc(req, resp); //FIXME: Use bool result //Response setContentLen( strlen(resp) ); //Make sure that the browser won't cache this request respHeaders()["Cache-control"]="no-cache;no-store"; // respHeaders()["Cache-control"]="no-store"; respHeaders()["Pragma"]="no-cache"; respHeaders()["Expires"]="0"; //Write data respHeaders()["Connection"] = "close"; writeData(resp, strlen(resp)); DBG("\r\nExit RPCHandler::doGet()\r\n"); } void RPCHandler::doPost() { } void RPCHandler::doHead() { } void RPCHandler::onReadable() //Data has been read { } void RPCHandler::onWriteable() //Data has been written & buf is free { DBG("\r\nRPCHandler::onWriteable() event\r\n"); close(); //Data written, we can close the connection } void RPCHandler::onClose() //Connection is closing { //Nothing to do } void RPCHandler::cleanReq(char* data) { char* p; static const char* lGarbage[2] = {"%20", "+"}; for(int i = 0; i < 2; i++) { while( p = strstr(data, lGarbage[i]) ) { memset((void*) p, ' ', strlen(lGarbage[i])); } } }
[ [ [ 1, 115 ] ] ]
3db7056d26ec15d6914e77365db82c75043edc8f
1e976ee65d326c2d9ed11c3235a9f4e2693557cf
/Database/SQLManager.cpp
c645bc3d25e838702114e6b15d0c57938ce2d7dc
[]
no_license
outcast1000/Jaangle
062c7d8d06e058186cb65bdade68a2ad8d5e7e65
18feb537068f1f3be6ecaa8a4b663b917c429e3d
refs/heads/master
2020-04-08T20:04:56.875651
2010-12-25T10:44:38
2010-12-25T10:44:38
19,334,292
3
0
null
null
null
null
UTF-8
C++
false
false
144,270
cpp
// /* // * // * Copyright (C) 2003-2010 Alexandros Economou // * // * This file is part of Jaangle (http://www.jaangle.com) // * // * This Program is free software; you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by // * the Free Software Foundation; either version 2, or (at your option) // * any later version. // * // * This Program is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU General Public License for more details. // * // * You should have received a copy of the GNU General Public License // * along with GNU Make; see the file COPYING. If not, write to // * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. // * http://www.gnu.org/copyleft/gpl.html // * // */ #include "stdafx.h" #include "SQLManager.h" #include "Ado/AdoWrap.h" #include "stlStringUtils.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //#define USE_INTEGRITY_CHECKS #define USE_CACHED_QUERIES #ifdef USE_CACHED_QUERIES GenreRecord sGenreCache; AlbumRecord sAlbumCache; ArtistRecord sArtistCache; #endif #ifdef _UNITTESTING BOOL SQLManager::UnitTest() { TRACE(_T("@2 SQLManager:Unit-Testing\r\n")); LPCTSTR dbPath = _T("c:\\test.mdb"); DeleteFile(dbPath); { SQLManager sm; UNITTEST(sm.Init(dbPath)); } { SQLManager sm; UNITTEST(sm.Init(dbPath)); //---Collection records---------------- CollectionRecord col; col.location = _T("d:\\mmm.mp3"); col.type = CTYPE_LocalFolder; //------Should Success -Add - Update - Exists - GetById - GetUnique UNITTEST(sm.AddNewCollectionRecord(col)); UNITTEST(col.IsValid()); col.name = _T("new col name"); UNITTEST(sm.UpdateCollectionRecord(col)); UNITTEST(col.IsValid()); UNITTEST(sm.GetCollectionRecord(col.ID, col)); UNITTEST(col.name == _T("new col name")); UNITTEST(col.IsValid()); CollectionRecord col2; UNITTEST(sm.GetCollectionRecordUnique(col.serial, col.location.c_str(), col2)); UNITTEST(col2.name == _T("new col name")); UNITTEST(col2.IsValid()); UNITTEST(sm.CollectionRecordExists(col2.ID)); UNITTEST(col2.name == _T("new col name")); UNITTEST(col.IsValid()); //------Should Fail -Add - Update - Exists - GetById - GetUnique //col.ID = 0; //UNITTEST(!sm.AddNewCollectionRecord(col) && _T("Record is not Unique")); col.ID = 947; UNITTEST(!sm.UpdateCollectionRecord(col) && _T("Record is not Existent")); UNITTEST(!sm.GetCollectionRecord(col.ID, col) && _T("Record is not Existent")); UNITTEST(!sm.GetCollectionRecordUnique(12, col.location.c_str(), col) && _T("Record is not Existent")); UNITTEST(!sm.CollectionRecordExists(col.ID) && _T("Record is not Existent")); //---GenreRecord---------------- GenreRecord gen; gen.name = _T("This is a new fucking genre with a very large name"); gen.name += gen.name; gen.name += gen.name; gen.name += gen.name; INT len = gen.name.size(); UNITTEST(sm.AddNewGenreRecord(gen)); UNITTEST(gen.IsValid()); gen.name = _T("new name"); UNITTEST(sm.UpdateGenreRecord(gen, FALSE)); UNITTEST(gen.name == _T("new name")); UNITTEST(gen.IsValid()); UNITTEST(sm.GetGenreRecord(gen.ID, gen)); UNITTEST(gen.name == _T("new name")); UNITTEST(gen.IsValid()); GenreRecord gen2; UNITTEST(sm.GetGenreRecordUnique(gen.name.c_str(), gen2)); UNITTEST(gen2.name == _T("new name")); UNITTEST(gen2.IsValid()); UNITTEST(sm.GenreRecordExists(gen2.ID)); UNITTEST(gen2.name == _T("new name")); UNITTEST(gen2.IsValid()); //gen.ID = 0; //UNITTEST(!sm.AddNewGenreRecord(gen) && _T("Record is not Unique")); gen.ID = 947; UNITTEST(!sm.UpdateGenreRecord(gen, FALSE) && _T("Record is not Existent")); UNITTEST(!sm.GetGenreRecord(gen.ID, gen) && _T("Record is not Existent")); UNITTEST(!sm.GetGenreRecordUnique(_T("Not Existent"), gen) && _T("Record is not Existent")); UNITTEST(!sm.GenreRecordExists(gen.ID) && _T("Record is not Existent")); //---ArtistRecord---------------- ArtistRecord art; art.name = _T("This is a new fucking artist with a very large name"); art.name += art.name; art.name += art.name; art.name += art.name; art.genID = 1; UNITTEST(sm.AddNewArtistRecord(art)); UNITTEST(art.IsValid()); art.name = _T("new name"); UNITTEST(sm.UpdateArtistRecord(art, FALSE)); UNITTEST(art.IsValid()); UNITTEST(art.name == _T("new name")); UNITTEST(sm.GetArtistRecord(art.ID, art)); UNITTEST(art.IsValid()); UNITTEST(art.name == _T("new name")); ArtistRecord art2; UNITTEST(sm.GetArtistRecordUnique(art.name.c_str(), art2)); UNITTEST(art2.IsValid()); UNITTEST(art2.name == _T("new name")); UNITTEST(sm.ArtistRecordExists(art2.ID)); UNITTEST(art2.IsValid()); UNITTEST(art2.name == _T("new name")); //art.ID = 0; //UNITTEST(!sm.AddNewArtistRecord(art) && _T("Record is not Unique")); art.ID = 947; UNITTEST(!sm.UpdateArtistRecord(art, FALSE) && _T("Record is not Existent")); UNITTEST(!sm.GetArtistRecord(art.ID, art) && _T("Record is not Existent")); UNITTEST(!sm.GetArtistRecordUnique(_T("Not Existent"), art) && _T("Record is not Existent")); UNITTEST(!sm.ArtistRecordExists(art.ID) && _T("Record is not Existent")); //---ArtistRecord---------------- AlbumRecord alb; alb.name = _T("This is a new fucking album with a very large name"); alb.name += alb.name; alb.name += alb.name; alb.name += alb.name; alb.artID = 1; UNITTEST(sm.AddNewAlbumRecord(alb)); UNITTEST(sm.UpdateAlbumRecord(alb, FALSE)); UNITTEST(sm.GetAlbumRecord(alb.ID, alb)); UNITTEST(sm.GetAlbumRecordUnique(alb.artID, alb.name.c_str(), alb)); UNITTEST(sm.AlbumRecordExists(alb.ID)); //alb.ID = 0; //UNITTEST(!sm.AddNewAlbumRecord(alb) && _T("Record is not Unique")); alb.ID = 947; UNITTEST(!sm.UpdateAlbumRecord(alb, FALSE) && _T("Record is not Existent")); UNITTEST(!sm.GetAlbumRecord(alb.ID, alb) && _T("Record is not Existent")); UNITTEST(!sm.GetAlbumRecordUnique(456, _T("Not Existent"), alb) && _T("Record is not Existent")); UNITTEST(!sm.AlbumRecordExists(alb.ID) && _T("Record is not Existent")); TrackRecord tra; tra.name = _T("This is a new fucking track name with a very large name"); tra.name += tra.name; tra.name += tra.name; tra.name += tra.name; tra.location = _T("This is a new fucking location with a very large name"); tra.location += tra.location; tra.location += tra.location; tra.location += tra.location; tra.artID = 1; tra.genID = 1; tra.colID = 1; tra.albID = 1; tra.trackType = TTYPE_ac3; UNITTEST(sm.AddNewTrackRecord(tra)); UNITTEST(sm.UpdateTrackRecord(tra)); UNITTEST(sm.GetTrackRecord(tra.ID, tra)); UNITTEST(sm.GetTrackRecordUnique(tra.colID, tra.location.c_str(), tra)); UNITTEST(sm.TrackRecordExists(tra.ID)); //tra.ID = 0; //UNITTEST(!sm.AddNewTrackRecord(tra) && _T("Record is not Unique")); tra.ID = 947; UNITTEST(!sm.UpdateTrackRecord(tra) && _T("Record is not Existent")); UNITTEST(!sm.GetTrackRecord(tra.ID, tra) && _T("Record is not Existent")); UNITTEST(!sm.GetTrackRecordUnique(456, _T("Not Existent"), tra) && _T("Record is not Existent")); UNITTEST(!sm.TrackRecordExists(tra.ID) && _T("Record is not Existent")); CollectionRecord collection; collection.location = _T("d:\\musi1"); collection.type = CTYPE_LocalFolder; UNITTEST(sm.AddNewCollectionRecord(collection)); UINT ID = collection.ID; GenreRecord genre; genre.name = _T("Genre#1"); UNITTEST(sm.AddNewGenreRecord(genre)); ID = genre.ID; genre.ID = ID; ArtistRecord artist; artist.name = _T("Artist#1"); artist.genID = genre.ID; UNITTEST(sm.AddNewArtistRecord(artist)); ID = artist.ID; artist.ID = 0; artist.ID = ID; AlbumRecord album; album.name = _T("Album#1"); album.artID = artist.ID; UNITTEST(sm.AddNewAlbumRecord(album)); ID = album.ID; album.ID = 0; album.ID = ID; TrackRecord track; track.location = _T("d:\\path#1.mp3"); track.name = _T("Track#1"); track.artID = artist.ID; track.genID = genre.ID; track.colID = collection.ID; track.albID = album.ID; track.trackType = GetTrackType(track.location.c_str()); UNITTEST(sm.AddNewTrackRecord(track)); ID = track.ID; track.ID = 0; track.ID = ID; TagInfo tag; INT trackID = sm.AddNewTrackFromTagInfo(collection.ID, _T("xmm.mp3"), tag); UNITTEST(trackID != 0); tag.Title = _T("Title2#"); //UNITTEST(!sm.AddNewTrackFromTagInfo(collection.ID, _T("xmm.mp3"), tag)); UNITTEST(sm.UpdateTrackFromTagInfo(trackID, collection.ID, _T("xmm.mp3"), tag)); UNITTEST(sm.UpdateTrackFromTagInfo(trackID, collection.ID, _T("222xmm.mp3"), tag)); HistArtistRecord hart; hart.name = _T("Art name"); UNITTEST(sm.AddNewHistArtistRecord(hart)); HistArtistRecord hart2 = hart; hart2.ID = 0; //UNITTEST(!sm.AddNewHistArtistRecord(hart2)); UNITTEST(hart.IsValid()); UNITTEST(sm.GetHistArtistRecord(hart.ID, hart)); UNITTEST(hart.IsValid()); HistTrackRecord htra; htra.artID = hart.ID; htra.name = _T("track Name"); UNITTEST(sm.AddNewHistTrackRecord(htra)); UNITTEST(htra.IsValid()); HistTrackRecord htra2 = htra; htra2.ID = 0; //UNITTEST(!sm.AddNewHistTrackRecord(htra2)); UNITTEST(sm.GetHistTrackRecord(htra.ID, htra)); UNITTEST(hart.IsValid()); SYSTEMTIME st; GetLocalTime(&st); UNITTEST(sm.LogTrackInHistory(_T("ArtName#2"), _T("TraName#2"), HLA_Clicked, st)); UNITTEST(sm.LogTrackInHistory(_T("ArtName#2"), _T("TraName#2"), HLA_Played, st)); UNITTEST(sm.LogTrackInHistory(_T("ArtName#2"), _T("TraName#2"), HLA_Played, st)); UNITTEST(sm.LogTrackInHistory(_T("ArtName#2"), _T("TraName#2"), HLA_Played, st)); UNITTEST(sm.LogTrackInHistory(_T("ArtName#2"), _T("TraName#3"), HLA_Played, st)); UNITTEST(sm.LogTrackInHistory(_T("ArtName#2"), _T("TraName#4"), HLA_Played, st)); UNITTEST(sm.LogTrackInHistory(_T("ArtName#3"), _T("TraName#4"), HLA_Clicked, st)); SQLManager::HistoryLogStats stats; UNITTEST(sm.GetHistoryLogStats(stats)); UNITTEST(stats.actions == 2); UNITTEST(stats.plays == 5); } DeleteFile(dbPath); return TRUE; } #endif LPCTSTR const sDBPassword = _T("DontMessWithIt"); const INT cMaxStringLen = 256; //============================================================== // INITIALIZATION - DESTRUCTION //============================================================== SQLManager::~SQLManager() { delete m_pDB; } BOOL SQLManager::Init(LPCTSTR DatabasePath) { TRACE(_T("@3 SQLManager::Init. DatabasePath: %s\r\n"), DatabasePath); ASSERT(m_pDB == NULL);//Initialize only once if (m_pDB != NULL) return FALSE; if (_taccess(_T("cdb.ins"), 00) == 0) { DeleteFile(_T("cdb.ins")); std::tstring tmp = DatabasePath; tmp += _T(".tmp"); if (AdoWrap::CompactDatabase(DatabasePath, tmp.c_str(), sDBPassword)) { DeleteFile(DatabasePath); MoveFile(tmp.c_str(), DatabasePath); } } BOOL newDb = FALSE; TCHAR sConnection[600]; _sntprintf(sConnection, 600, _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;") _T("Jet OLEDB:Database Password=%s;") _T("Jet OLEDB:Encrypt Database=True;") ,DatabasePath, sDBPassword); if (!PathFileExists(DatabasePath)) { TRACE(_T("@2 SQLManager::Init. Creating Database\r\n")); ADOXCatalog cat; if (cat.Init()) { TRACE(_T("@3 SQLManager::Init. ADOXCatalog-CreateDatabase\r\n")); if (!cat.CreateDatabase(sConnection)) { TRACE(_T("@0 SQLManager::Init. ADOXCatalog-CreateDatabase FAILED. Aborting\r\n")); return FALSE; } } else { TRACE(_T("@0 SQLManager::Init. ADOXCatalog failed to initialize. Aborting\r\n")); return FALSE; } newDb = TRUE; } TRACE(_T("@3 SQLManager::Init. Connecting to Database\r\n")); m_pDB = new ADODatabase; if (!m_pDB->Open(sConnection)) { TRACE(_T("@0 SQLManager::Init. DB Connection Failed. Aborting.\r\n")); delete m_pDB; m_pDB = NULL; return FALSE; } TRACE(_T("@3 SQLManager::Init. DB Connection Succeeded\r\n")); INT latestDBVersion = 6; INT currentDBVersion = 0; if (newDb) { //===Creating Tables============================================= //======DBInfo====== TRACE(_T("@3 SQLManager::Init. Creating DBInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE DBInfo (version int NOT NULL)")); TCHAR bf[500]; _sntprintf(bf, 500, _T("INSERT INTO DBInfo VALUES (%d)"), latestDBVersion); m_pDB->Execute(bf); currentDBVersion = latestDBVersion; //======Genres====== TRACE(_T("@3 SQLManager::Init. Creating Genres Table\r\n")); m_pDB->Execute( _T("CREATE TABLE Genres ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(100) WITH COMP NOT NULL)") ); m_pDB->Execute(_T("CREATE INDEX GenresName ON Genres (Name)")); m_pDB->Execute(_T("INSERT INTO Genres (Name) VALUES ('[Unknown]')")); //======Artists====== TRACE(_T("@3 SQLManager::Init. Creating Artists Table\r\n")); m_pDB->Execute(_T("CREATE TABLE Artists ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(100) WITH COMP NOT NULL,") _T("GenreID int NOT NULL,") _T("Rating smallint NOT NULL)") ); m_pDB->Execute( _T("CREATE INDEX ArtistsName ON Artists (Name)")); m_pDB->Execute( _T("INSERT INTO Artists (Name, GenreID, Rating) VALUES ('[Unknown]', 1, 0)")); m_pDB->Execute( _T("INSERT INTO Artists (Name, GenreID, Rating) VALUES ('[Various]', 1, 0)")); //======Albums====== TRACE(_T("@3 SQLManager::Init. Creating Albums Table\r\n")); m_pDB->Execute( _T("CREATE TABLE Albums ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(100) WITH COMP NOT NULL,") _T("artID int NOT NULL,") _T("[Year] smallint NOT NULL,") _T("Rating smallint NOT NULL)") ); m_pDB->Execute(_T("CREATE INDEX AlbumsName ON Albums(Name)")); //======Collections====== TRACE(_T("@3 SQLManager::Init. Creating Collections Table\r\n")); m_pDB->Execute( _T("CREATE TABLE Collections ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(255) WITH COMP NOT NULL,") _T("PathName varchar(255) WITH COMP NOT NULL,") _T("Serial int NOT NULL,") //Media Serial Number _T("Type smallint NOT NULL,") //CollectionTypesEnum CTYPE_LocalFolder,CTYPE_Media... //_T("Status smallint NOT NULL,") //CollectionStatusEnum CSTAT_Ready, CSTAT_Pending... _T("DateAdded date NOT NULL,") _T("DateUpdated date)") ); m_pDB->Execute( _T("CREATE INDEX Name ON Collections (Name)")); //======Tracks====== TRACE(_T("@3 SQLManager::Init. Creating Tracks Table\r\n")); m_pDB->Execute( _T("CREATE TABLE Tracks ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(100) WITH COMP NOT NULL,") _T("Type smallint NOT NULL,") //TrackTypesEnum TTYPE_mp3,TTYPE_mp2... _T("DateAdded date NOT NULL,") _T("albID int NOT NULL,") _T("artID int NOT NULL,") _T("CollectionID int NOT NULL,") _T("genreID int NOT NULL,") _T("Path varchar(255) WITH COMP NOT NULL,") _T("Bitrate smallint,") //In Kbps _T("Duration int,") //In seconds _T("[Size] int,") _T("TrackNo smallint,") _T("[Year] smallint NOT NULL,") _T("Rating smallint NOT NULL)") ); m_pDB->Execute( _T("CREATE INDEX TracksName ON Tracks (Name)")); m_pDB->Execute( _T("CREATE INDEX TracksPath ON Tracks (Path)")); //======HistArtists====== TRACE(_T("@3 SQLManager::Init. Creating HistArtists Table\r\n")); m_pDB->Execute( _T("CREATE TABLE HistArtists ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(100) WITH COMP NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX HistArtistsName ON HistArtists (Name)")); m_pDB->Execute( _T("INSERT INTO HistArtists (Name) VALUES ('[Unknown]')")); //======HistTracks====== TRACE(_T("@3 SQLManager::Init. Creating HistTracks Table\r\n")); m_pDB->Execute( _T("CREATE TABLE HistTracks ( ") _T("ID COUNTER PRIMARY KEY,") _T("Name varchar(100) WITH COMP NOT NULL,") _T("artID int NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX HistTracksName ON HistTracks (Name)")); //======HistLog====== TRACE(_T("@3 SQLManager::Init. Creating HistLog Table\r\n")); m_pDB->Execute( _T("CREATE TABLE HistLog ( ") _T("ID COUNTER PRIMARY KEY,") _T("actID smallint NOT NULL,") _T("DateAdded date NOT NULL,") _T("trackID int NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX HistLogTrackID ON HistLog (trackID)")); //======TracksInfo====== TRACE(_T("@3 SQLManager::Init. Creating TracksInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE TracksInfo ( ") _T("ID COUNTER PRIMARY KEY,") _T("trackID int NOT NULL,") _T("Name LONGTEXT NOT NULL,") _T("DateAdded date NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX TracksInfoTrackID ON TracksInfo (trackID)")); //======AlbumsInfo====== TRACE(_T("@3 SQLManager::Init. Creating AlbumsInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE AlbumsInfo ( ") _T("ID COUNTER PRIMARY KEY,") _T("albID int NOT NULL,") _T("Name LONGTEXT NOT NULL,") _T("DateAdded date NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX AlbumsInfoAlbID ON AlbumsInfo (albID)")); //======ArtistsInfo====== TRACE(_T("@3 SQLManager::Init. Creating ArtistsInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE ArtistsInfo ( ") _T("ID COUNTER PRIMARY KEY,") _T("artID int NOT NULL,") _T("Name LONGTEXT NOT NULL,") _T("DateAdded date NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX ArtistsInfoArtID ON ArtistsInfo (artID)")); //======LocalPic====== TRACE(_T("@3 SQLManager::Init. Creating LocalPic Table\r\n")); m_pDB->Execute( _T("CREATE TABLE LocalPic ( ") _T("parID int NOT NULL,") _T("infoType smallint NOT NULL,") _T("Path varchar(255) NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE UNIQUE INDEX LocalPicID ON LocalPic (parID, infoType)")); //======InfoRequests====== TRACE(_T("@3 SQLManager::Init. Creating InfoRequests Table\r\n")); m_pDB->Execute( _T("CREATE TABLE InfoRequests ( ") _T("requestTimeStamp int NOT NULL,") _T("hash int NOT NULL)")); m_pDB->Execute( _T("CREATE UNIQUE INDEX hashInfoRequests ON InfoRequests (parID)")); } else { ADORecordset rs(m_pDB); if (rs.Open(_T("SELECT version FROM DBInfo")) && !rs.IsEOF()) currentDBVersion = rs.GetINTFieldValue(_T("version")); } if (currentDBVersion > latestDBVersion) { ::MessageBox(0, _T("Database (music.mdb) is not compatible with this version of Jaangle.\r\n") _T("Delete it or get the latest program version."), _T("Database Error"), MB_OK); return FALSE; } //Start some Initializations/correction in the database //m_pDB->Execute(_T("Update Collections Set Status = 1 WHERE Status <> 1")); BOOL bDBNeedsUpgrade = (currentDBVersion != latestDBVersion); if (bDBNeedsUpgrade) CopyFile(_T("music.mdb"), _T("music.mdb.bkp"), TRUE); if (currentDBVersion == 0) { TRACE(_T("@1 SQLManager::Init. Applying 0-->1 DBPatch\r\n")); //Alter Tables for 0.92e m_pDB->Execute(_T("ALTER TABLE Tracks ALTER COLUMN Name TEXT(100)")); m_pDB->Execute(_T("ALTER TABLE Artists ALTER COLUMN Name TEXT(100)")); m_pDB->Execute(_T("ALTER TABLE Albums ALTER COLUMN Name TEXT(100)")); m_pDB->Execute(_T("ALTER TABLE Genres ALTER COLUMN Name TEXT(100)")); m_pDB->Execute(_T("ALTER TABLE HistTracks ALTER COLUMN Name TEXT(100)")); //m_pDB->Execute(_T("ALTER TABLE HistArtists ALTER COLUMN Name TEXT(100)")); m_pDB->Execute(_T("CREATE TABLE DBInfo (version int NOT NULL)")); currentDBVersion = 1; } if (currentDBVersion == 1) { TRACE(_T("@1 SQLManager::Init. Applying 1-->2 DBPatch\r\n")); //Alter Tables for 0.92g. I have forgotten to change the script that //was creating HistArtistsTable. The name len was 70 and not 100 m_pDB->Execute(_T("ALTER TABLE HistArtists ALTER COLUMN Name TEXT(100)")); currentDBVersion = 2; } if (currentDBVersion == 2) { TRACE(_T("@1 SQLManager::Init. Applying 2-->3 DBPatch START\r\n")); INT records = m_pDB->Execute(_T("UPDATE Albums Set Rating = 0 WHERE Rating=76")); records += m_pDB->Execute(_T("UPDATE Artists Set Rating = 0 WHERE Rating=76")); records += m_pDB->Execute(_T("UPDATE Tracks Set Rating = 0 WHERE Rating=76")); records += m_pDB->Execute(_T("UPDATE DBInfo SET version=3")); TRACE(_T("@1 SQLManager::Init. Applying 2-->3. Updated Records: %d\r\n"), records); currentDBVersion = 3; } if (currentDBVersion == 3)//Upgrade from 3 (0.94) ->4 (0.95 beta) { TRACE(_T("@1 SQLManager::Init. Applying 3-->4 DBPatch START\r\n")); //===CREATE NEW TABLES //======TracksInfo====== TRACE(_T("@3 SQLManager::Init. Creating TracksInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE TracksInfo ( ") _T("ID COUNTER PRIMARY KEY,") _T("trackID int NOT NULL,") _T("Name LONGTEXT NOT NULL,") _T("DateAdded date NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX TracksInfoTrackID ON TracksInfo (trackID)")); //======AlbumsInfo====== TRACE(_T("@3 SQLManager::Init. Creating AlbumsInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE AlbumsInfo ( ") _T("ID COUNTER PRIMARY KEY,") _T("albID int NOT NULL,") _T("Name LONGTEXT NOT NULL,") _T("DateAdded date NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX AlbumsInfoAlbID ON AlbumsInfo (albID)")); //======ArtistsInfo====== TRACE(_T("@3 SQLManager::Init. Creating ArtistsInfo Table\r\n")); m_pDB->Execute( _T("CREATE TABLE ArtistsInfo ( ") _T("ID COUNTER PRIMARY KEY,") _T("artID int NOT NULL,") _T("Name LONGTEXT NOT NULL,") _T("DateAdded date NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE INDEX ArtistsInfoArtID ON ArtistsInfo (artID)")); //===TRANFER INFO ADORecordset rs(m_pDB); if (rs.Open(_T("SELECT artists.ID, info.name, info.dateAdded FROM artists INNER JOIN info on artists.infoID = info.ID WHERE artists.infoID > 0"))) { ADORecordset rsInsert(m_pDB); if (rsInsert.Open(_T("artistsinfo"), adOpenKeyset, adLockOptimistic, adCmdTable)) { std::tstring name; SYSTEMTIME dateAdded; while (!rs.IsEOF()) { UINT ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, name); dateAdded = rs.GetSYSTEMTIMEFieldValue(2); rsInsert.AddNew(); rsInsert.SetVariantFieldValue(_T("artID"), ID); rsInsert.SetVariantFieldValue(_T("type"), IIT_ArtistBio); rsInsert.SetVariantFieldValue(_T("name"), name.c_str()); rsInsert.SetSystemTimeFieldValue(_T("dateAdded"), dateAdded); if (!rsInsert.Update()) return FALSE; rs.MoveNext(); } } else return FALSE; } if (rs.Open(_T("SELECT albums.ID, info.name, info.dateAdded FROM albums INNER JOIN info on albums.infoID = info.ID WHERE albums.infoID > 0"))) { ADORecordset rsInsert(m_pDB); if (rsInsert.Open(_T("albumsinfo"), adOpenKeyset, adLockOptimistic, adCmdTable)) { std::tstring name; SYSTEMTIME dateAdded; while (!rs.IsEOF()) { UINT ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, name); dateAdded = rs.GetSYSTEMTIMEFieldValue(2); rsInsert.AddNew(); rsInsert.SetVariantFieldValue(_T("albID"), ID); rsInsert.SetVariantFieldValue(_T("type"), IIT_AlbumReview); rsInsert.SetVariantFieldValue(_T("name"), name.c_str()); rsInsert.SetSystemTimeFieldValue(_T("dateAdded"), dateAdded); if (!rsInsert.Update()) return FALSE; rs.MoveNext(); } } else return FALSE; } if (rs.Open(_T("SELECT tracks.ID, info.name, info.dateAdded FROM tracks INNER JOIN info on tracks.comID = info.ID WHERE tracks.comID > 0"))) { ADORecordset rsInsert(m_pDB); if (rsInsert.Open(_T("tracksinfo"), adOpenKeyset, adLockOptimistic, adCmdTable)) { std::tstring name; SYSTEMTIME dateAdded; while (!rs.IsEOF()) { UINT ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, name); dateAdded = rs.GetSYSTEMTIMEFieldValue(2); rsInsert.AddNew(); rsInsert.SetVariantFieldValue(_T("trackID"), ID); rsInsert.SetVariantFieldValue(_T("type"), IIT_TrackComment); rsInsert.SetVariantFieldValue(_T("name"), name.c_str()); rsInsert.SetSystemTimeFieldValue(_T("dateAdded"), dateAdded); if (!rsInsert.Update()) return FALSE; rs.MoveNext(); } } else return FALSE; } if (rs.Open(_T("SELECT tracks.ID, info.name, info.dateAdded FROM tracks INNER JOIN info on tracks.lyrID = info.ID WHERE tracks.lyrID > 0"))) { ADORecordset rsInsert(m_pDB); if (rsInsert.Open(_T("tracksinfo"), adOpenKeyset, adLockOptimistic, adCmdTable)) { std::tstring name; SYSTEMTIME dateAdded; while (!rs.IsEOF()) { UINT ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, name); dateAdded = rs.GetSYSTEMTIMEFieldValue(2); rsInsert.AddNew(); rsInsert.SetVariantFieldValue(_T("trackID"), ID); rsInsert.SetVariantFieldValue(_T("type"), IIT_TrackLyrics); rsInsert.SetVariantFieldValue(_T("name"), name.c_str()); rsInsert.SetSystemTimeFieldValue(_T("dateAdded"), dateAdded); if (!rsInsert.Update()) return FALSE; rs.MoveNext(); } } else return FALSE; } if (rs.Open(_T("SELECT tracks.ID, info.name, info.dateAdded FROM tracks INNER JOIN info on tracks.perID = info.ID WHERE tracks.perID > 0"))) { ADORecordset rsInsert(m_pDB); if (rsInsert.Open(_T("tracksinfo"), adOpenKeyset, adLockOptimistic, adCmdTable)) { std::tstring name; SYSTEMTIME dateAdded; while (!rs.IsEOF()) { UINT ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, name); dateAdded = rs.GetSYSTEMTIMEFieldValue(2); rsInsert.AddNew(); rsInsert.SetVariantFieldValue(_T("trackID"), ID); rsInsert.SetVariantFieldValue(_T("type"), IIT_TrackPersonal); rsInsert.SetVariantFieldValue(_T("name"), name.c_str()); rsInsert.SetSystemTimeFieldValue(_T("dateAdded"), dateAdded); if (!rsInsert.Update()) return FALSE; rs.MoveNext(); } } else return FALSE; } rs.Close(); //DROP oldData m_pDB->Execute(_T("ALTER TABLE artists DROP COLUMN infoID")); m_pDB->Execute(_T("ALTER TABLE albums DROP COLUMN infoID")); m_pDB->Execute(_T("ALTER TABLE tracks DROP COLUMN comID")); m_pDB->Execute(_T("ALTER TABLE tracks DROP COLUMN lyrID")); m_pDB->Execute(_T("ALTER TABLE tracks DROP COLUMN perID")); m_pDB->Execute(_T("ALTER TABLE tracks DROP COLUMN SyncState")); m_pDB->Execute(_T("ALTER TABLE tracks DROP COLUMN WriteAbleState")); m_pDB->Execute(_T("DROP TABLE Info")); m_pDB->Execute(_T("ALTER TABLE collections DROP COLUMN status")); currentDBVersion = 4; } if (currentDBVersion == 4)//Upgrade from 4 (0.95 beta) ->5 (0.95 internal - 1) { //======Cached Failed Info Requests====== TRACE(_T("@3 SQLManager::Init. Creating InfoRecordRequest Table\r\n")); m_pDB->Execute( _T("CREATE TABLE InfoRecordRequest ( ") _T("parID int NOT NULL,") _T("infoType smallint NOT NULL,") _T("result smallint NOT NULL,") _T("requestTimeStamp int NOT NULL)")); m_pDB->Execute( _T("CREATE UNIQUE INDEX InfoRecordRequestID ON InfoRecordRequest (parID,infoType)")); //======LocalPic====== TRACE(_T("@3 SQLManager::Init. Creating LocalPic Table\r\n")); m_pDB->Execute( _T("CREATE TABLE LocalPic ( ") _T("parID int NOT NULL,") _T("infoType smallint NOT NULL,") _T("Path varchar(255) NOT NULL,") _T("Type smallint NOT NULL)")); m_pDB->Execute( _T("CREATE UNIQUE INDEX LocalPicID ON LocalPic (parID, infoType)")); currentDBVersion = 5; } if (currentDBVersion == 5)//Upgrade from 5 (0.95d) ->5 (0.95e) { //======Cached Failed Info Requests====== TRACE(_T("@3 SQLManager::Init. Creating InfoRequests Table\r\n")); m_pDB->Execute( _T("CREATE TABLE InfoRequests ( ") _T("requestTimeStamp int NOT NULL,") _T("hash int NOT NULL)")); m_pDB->Execute( _T("CREATE UNIQUE INDEX hashInfoRequests ON InfoRequests (hash)")); m_pDB->Execute(_T("DROP TABLE InfoRecordRequest")); currentDBVersion = 6; } //--- INSERT NEW PATCHES HERE //--- SET THE latestDBVersion if (bDBNeedsUpgrade) { CreateFile(_T("cdb.ins"), GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); TRACE(_T("@1 SQLManager::Init. Update DB Version\r\n")); TCHAR bf[500]; _sntprintf(bf, 500, _T("UPDATE DBInfo SET version = %d"), latestDBVersion); m_pDB->Execute(bf); TRACE(_T("@1 SQLManager::Init. Upgrade Finished\r\n")); } return TRUE; } //============================================= //====================Public Utilities //============================================= INT SQLManager::AddNewTrackFromTagInfo(UINT collectionID, LPCTSTR location, TagInfo& info) { TRACEST(_T("SQLManager::AddNewTrackFromTagInfo")); //ASSERT(info.validFields != TagInfo_None); ASSERT(collectionID != 0 && location != NULL); if (collectionID == 0) { TRACE(_T("@1 SQLManager::AddNewTrackFromTagInfo collectionID: 0\r\n")); return 0; } if (location == 0) { TRACE(_T("@1 SQLManager::AddNewTrackFromTagInfo location: 0\r\n")); return 0; } TrackRecord track; track.colID = collectionID; track.location = location; track.trackType = GetTrackType(location); ::GetLocalTime(&track.dateAdded); if (info.IsValid(TagInfo_Bitrate)) track.bitrate = info.Bitrate; if (info.IsValid(TagInfo_Length)) track.duration = info.Length; if (info.IsValid(TagInfo_Title)) track.name = info.Title; if (info.IsValid(TagInfo_Rating)) track.rating = info.Rating; if (info.IsValid(TagInfo_Size)) track.size = info.Size; if (info.IsValid(TagInfo_TrackNo)) track.trackNo = info.TrackNo; if (info.IsValid(TagInfo_Year)) track.year = info.Year; if (track.year < 1000) track.year = 0; //======Genres trim(info.Genre); LPCTSTR genreName = _T(""); if (info.IsValid(TagInfo_Genre)) genreName = info.Genre.c_str(); GenreRecord genre; if (!GetGenreRecordUnique(genreName, genre))//This Genre Exists in Database { genre.name = genreName; if (!AddNewGenreRecord(genre)) return 0; } track.genID = genre.ID; //=======Artists trim(info.Artist); LPCTSTR artistName = _T(""); if (info.IsValid(TagInfo_Artist)) artistName = info.Artist.c_str(); ArtistRecord artist; if (!GetArtistRecordUnique(artistName, artist))//This Artist Exists in Database { artist.name = artistName; artist.genID = track.genID; if (!AddNewArtistRecord(artist)) return 0; } track.artID = artist.ID; //=======Albums trim(info.Album); LPCTSTR albumName = _T(""); if (info.IsValid(TagInfo_Album)) albumName = info.Album.c_str(); AlbumRecord album; if (!GetAlbumRecordUnique(track.artID, albumName, album))//This album Exists in Database { album.artID = track.artID; album.year = track.year; album.name = albumName; if (!AddNewAlbumRecord(album)) return 0; } track.albID = album.ID; if (!AddNewTrackRecord(track)) return 0; //=======Comment if (info.IsValid(TagInfo_Comment)) { trim(info.Comment); if (!info.Comment.empty()) { if (!AddNewTrackInfo(track.ID, IIT_TrackComment, info.Comment.c_str())) TRACE(_T("@1 SQLManager::AddNewTrackFromTagInfo Add Comments failed\r\n")); } } //=======Lyrics if (info.IsValid(TagInfo_Lyrics)) { trim(info.Lyrics); if (!info.Lyrics.empty()) { if (!AddNewTrackInfo(track.ID, IIT_TrackLyrics, info.Lyrics.c_str())) TRACE(_T("@1 SQLManager::AddNewTrackFromTagInfo Add Lyrics failed\r\n")); } } return track.ID; } BOOL SQLManager::UpdateTrackFromTagInfo(UINT ID, UINT collectionID, LPCTSTR location, TagInfo& info) { ASSERT(ID != 0); ASSERT(collectionID != 0); ASSERT(location != NULL); TrackRecord track; if (!GetTrackRecord(ID, track)) return FALSE; track.colID = collectionID; track.location = location; track.trackType = GetTrackType(location); //dateAdded stays the same if (info.IsValid(TagInfo_Bitrate)) track.bitrate = info.Bitrate; if (info.IsValid(TagInfo_Length)) track.duration = info.Length; if (info.IsValid(TagInfo_Title)) track.name = info.Title; if (info.IsValid(TagInfo_Rating)) track.rating = info.Rating; if (info.IsValid(TagInfo_Size)) track.size = info.Size; if (info.IsValid(TagInfo_TrackNo)) track.trackNo = info.TrackNo; if (info.IsValid(TagInfo_Year)) track.year = info.Year; //======Genres if (info.IsValid(TagInfo_Genre)) { trim(info.Genre); GenreRecord genre; if (!GetGenreRecordUnique(info.Genre.c_str(), genre))//This Genre Exists in Database { genre.name = info.Genre; if (!AddNewGenreRecord(genre)) return FALSE; } track.genID = genre.ID; } //=======Artists if (info.IsValid(TagInfo_Artist)) { trim(info.Artist); ArtistRecord artist; if (!GetArtistRecordUnique(info.Artist.c_str(), artist))//This Artist Exists in Database { artist.name = info.Artist; artist.genID = track.genID; if (!AddNewArtistRecord(artist)) return FALSE; } track.artID = artist.ID; //=== Test the case that. We are changing the artist name "Doors"->"Nirvana" // but not the Album Name. if (!info.IsValid(TagInfo_Album)) { AlbumRecord existing; if (!GetAlbumRecord(track.albID, existing)) { TRACE(_T("@1 SQLManager::UpdateTrackFromTagInfo. DB Inconsistent albID not found\r\n")); return 0; } if (existing.artID != artist.ID) { //=== We have changed Artist but not Album Name AlbumRecord album; if (GetAlbumRecordUnique(track.artID, existing.name.c_str(), album)) { //=== An album name with the same name exists under the new artist //=== We just assign the album.ID to the track.albID } else { //=== There is no Album with such name in this new artist //=== We are creating a new one and assigning the new albID album.artID = track.artID; album.year = existing.year; album.name = existing.name.c_str(); if (!AddNewAlbumRecord(album)) return FALSE; } track.albID = album.ID; } else { //=== We haven' t change artist } } } //=======Albums if (info.IsValid(TagInfo_Album)) { trim(info.Album); AlbumRecord album; if (!GetAlbumRecordUnique(track.artID, info.Album.c_str(), album))//This album Exists in Database { album.artID = track.artID; album.year = info.Year; album.name = info.Album; if (!AddNewAlbumRecord(album)) return FALSE; } track.albID = album.ID; } //=======Comment if (info.IsValid(TagInfo_Comment)) { trim(info.Comment); AdjustTrackInfo(track.ID, IIT_TrackComment, info.Comment.c_str()); } //=======Lyrics if (info.IsValid(TagInfo_Lyrics)) { trim(info.Lyrics); AdjustTrackInfo(track.ID, IIT_TrackLyrics, info.Lyrics.c_str()); } return UpdateTrackRecord(track); } //============================================== //=================== SQL Strings / GetField functions //============================================== const TCHAR* const TrackSQL = _T("SELECT Tracks.ID,[Tracks.Name],[Tracks.Type],Tracks.DateAdded,") _T("Tracks.albID,Tracks.artID,Tracks.CollectionID,Tracks.GenreID,Tracks.Path,") _T("Tracks.Bitrate,Tracks.Duration,[Tracks.Size],Tracks.TrackNo,") _T("Tracks.Year,Tracks.Rating ") _T("FROM Tracks "); void SQLManager::GetTrackRecordFields(TrackRecord& rec, ADORecordset& rs, short& fieldID) { rec.ID = rs.GetUINTFieldValue(fieldID++); rs.GetStringFieldValue(fieldID++, rec.name); rec.trackType = (TrackTypesEnum)rs.GetINTFieldValue(fieldID++); rec.dateAdded = rs.GetSYSTEMTIMEFieldValue(fieldID++); rec.albID = rs.GetINTFieldValue(fieldID++); rec.artID = rs.GetINTFieldValue(fieldID++); rec.colID = rs.GetINTFieldValue(fieldID++); rec.genID = rs.GetINTFieldValue(fieldID++); rs.GetStringFieldValue(fieldID++, rec.location); rec.bitrate = rs.GetINTFieldValue(fieldID++); rec.duration = rs.GetINTFieldValue(fieldID++); rec.size = rs.GetINTFieldValue(fieldID++); rec.trackNo = rs.GetINTFieldValue(fieldID++); rec.year = rs.GetINTFieldValue(fieldID++); rec.rating = rs.GetINTFieldValue(fieldID++); ASSERT(rec.IsValid()); } const TCHAR* const AlbumSQL = _T("SELECT ") _T("ID, Name, artID, Year, Rating ") _T("FROM Albums "); void SQLManager::GetAlbumRecordFields(AlbumRecord& album, ADORecordset& rs, short& startIdx) { album.ID = rs.GetUINTFieldValue(startIdx++); rs.GetStringFieldValue(startIdx++, album.name); album.artID = rs.GetUINTFieldValue(startIdx++); album.year = rs.GetINTFieldValue(startIdx++); album.rating = rs.GetSHORTFieldValue(startIdx++); ASSERT(album.IsValid()); } const TCHAR* const ArtistSQL = _T("SELECT ") _T("ID, Name, GenreID, Rating ") _T("FROM Artists "); void SQLManager::GetArtistRecordFields(ArtistRecord& artist, ADORecordset& rs, short& startIdx) { artist.ID = rs.GetUINTFieldValue(startIdx++); rs.GetStringFieldValue(startIdx++, artist.name); artist.genID = rs.GetUINTFieldValue(startIdx++); artist.rating = rs.GetSHORTFieldValue(startIdx++); ASSERT(artist.IsValid()); } const TCHAR* const GenreSQL = _T("SELECT ") _T("Genres.ID, Genres.Name ") _T(", -1 ") _T("FROM Genres "); const TCHAR* const CountGenreSQL = _T("SELECT ") _T("first(Genres.ID), first(Genres.Name)") _T(", count(*) ") _T("FROM Tracks INNER JOIN Genres ON Tracks.genreID = Genres.ID "); void SQLManager::GetGenreRecordFields(GenreRecord& genre, ADORecordset& rs, short& startIdx) { genre.ID = rs.GetUINTFieldValue(startIdx++); rs.GetStringFieldValue(startIdx++, genre.name); ASSERT(genre.IsValid()); } const TCHAR* const CollectionSQL = _T("SELECT ") _T("Collections.ID, Collections.Name, Collections.PathName ") _T(", Collections.Serial, Collections.Type ") _T(", Collections.DateAdded, Collections.DateUpdated ") _T(", 0, 0, 0 ") _T("FROM Collections "); const TCHAR* const CountCollectionSQL = _T("SELECT ") _T("first(Collections.ID), first(Collections.Name), first(Collections.PathName) ") _T(", first(Collections.Serial), first(Collections.Type) ") _T(", first(Collections.DateAdded), first(Collections.DateUpdated) ") _T(", count(Tracks.ID), Sum([Tracks.Size]), Sum(Tracks.Duration) ") _T("FROM Collections LEFT JOIN Tracks ON Collections.ID = Tracks.CollectionID "); void SQLManager::GetCollectionRecordFields(CollectionRecord& rec, ADORecordset& rs, short& startIdx) { rec.ID = rs.GetINTFieldValue(startIdx++); rs.GetStringFieldValue(startIdx++, rec.name); rs.GetStringFieldValue(startIdx++, rec.location); rec.serial = rs.GetINTFieldValue(startIdx++); rec.type = (CollectionTypesEnum) rs.GetINTFieldValue(startIdx++); //rec.status = (CollectionStatusEnum)rs.GetINTFieldValue(startIdx++); rec.dateAdded = rs.GetSYSTEMTIMEFieldValue(startIdx++); rec.dateUpdated = rs.GetSYSTEMTIMEFieldValue(startIdx++); ASSERT(rec.IsValid()); } BOOL SQLManager::SetCollectionRecordFields(CollectionRecord& collection, ADORecordset& rs) { INT ret = rs.SetVariantFieldValue(_T("name"), collection.name.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("pathname"), collection.location.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("serial"), collection.serial) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("type"), collection.type) ? 1 : 0; //ret += rs.SetVariantFieldValue(_T("status"), collection.status) ? 1 : 0; ret += rs.SetSystemTimeFieldValue(_T("dateAdded"), collection.dateAdded) ? 1 : 0; ret += rs.SetSystemTimeFieldValue(_T("dateUpdated"), collection.dateUpdated) ? 1 : 0; ASSERT(ret == 6); return ret == 6; } //const TCHAR* const InfoSQL = _T("SELECT ") //_T("ID, Name, DateAdded ") //_T("FROM Info "); //void SQLManager::GetInfoRecordFields(InfoRecord& rec, ADORecordset& rs, short& fieldID) //{ // rec.ID = rs.GetUINTFieldValue(fieldID++); // rs.GetStringFieldValue(fieldID++, rec.name); // rec.dateAdded = rs.GetSYSTEMTIMEFieldValue(fieldID++); // ASSERT(rec.IsValid()); //} //BOOL SQLManager::SetInfoRecordFields(InfoRecord& rec, ADORecordset& rs) //{ // INT ret = rs.SetVariantFieldValue(_T("name"), rec.name.c_str()) ? 1 : 0; // ret += rs.SetSystemTimeFieldValue(_T("dateAdded"), rec.dateAdded) ? 1 : 0; // ASSERT(ret == 2); // return ret == 2; //} const TCHAR* const HistArtistSQL = _T("SELECT ") _T("ID, Name ") _T("FROM HistArtists "); void SQLManager::GetHistArtistRecordFields(HistArtistRecord& rec, ADORecordset& rs, short& startIdx) { rec.ID = rs.GetUINTFieldValue(startIdx++); rs.GetStringFieldValue(startIdx++, rec.name); ASSERT(rec.IsValid()); } const TCHAR* const HistLogSQL = _T("SELECT ") _T("ID, actID, DateAdded, trackID ") _T("FROM HistLog"); void SQLManager::GetHistLogRecordFields(HistLogRecord& rec, ADORecordset& rs, short& startIdx) { rec.ID = rs.GetUINTFieldValue(startIdx++); rec.actID = (HistoryLogActionsEnum) rs.GetINTFieldValue(startIdx++); rec.dateAdded = rs.GetSYSTEMTIMEFieldValue(startIdx++); rec.trackID = rs.GetUINTFieldValue(startIdx++); ASSERT(rec.IsValid()); } const TCHAR* const HistTrackSQL = _T("SELECT ") _T("ID, Name, artID ") _T("FROM HistTracks "); void SQLManager::GetHistTrackRecordFields(HistTrackRecord& rec, ADORecordset& rs, short& fieldID) { rec.ID = rs.GetUINTFieldValue(fieldID++); rs.GetStringFieldValue(fieldID++, rec.name); rec.artID = rs.GetUINTFieldValue(fieldID++); ASSERT(rec.IsValid()); } //============================================= //====================Retrieve Collections By SQL //============================================= BOOL SQLManager::GetTrackRecordCollectionBySQL(TrackRecordCollection& col, LPCTSTR sql, INT limitResults) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { TrackRecord* pRec = new TrackRecord; short startIdx = 0; GetTrackRecordFields(*pRec, rs, startIdx); col.push_back(TrackRecordSP(pRec)); countResults++; if (countResults == limitResults) return TRUE; rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetGenreRecordCollectionBySQL(GenreRecordCollection& col, LPCTSTR sql) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; while (!rs.IsEOF()) { GenreRecord* pRec = new GenreRecord; short startIdx = 0; GetGenreRecordFields(*pRec, rs, startIdx); pRec->trackCount = rs.GetINTFieldValue(startIdx++); col.push_back(GenreRecordSP(pRec)); rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetCollectionRecordCollectionBySQL(CollectionRecordCollection& col, LPCTSTR sql) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; while (!rs.IsEOF()) { CollectionRecord* pRec = new CollectionRecord; short startIdx = 0; GetCollectionRecordFields(*pRec, rs, startIdx); pRec->trackCount = rs.GetUINTFieldValue(startIdx++); pRec->sumSize = (UINT)rs.GetDOUBLEFieldValue(startIdx++); pRec->sumDuration = (UINT)rs.GetDOUBLEFieldValue(startIdx++); col.push_back(CollectionRecordSP(pRec)); rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetYearRecordCollectionBySQL(YearRecordCollection& col, LPCTSTR sql) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; while (!rs.IsEOF()) { YearRecord* rec = new YearRecord; short startIdx = 0; rec->year = rs.GetINTFieldValue(startIdx++); rec->trackCount = rs.GetINTFieldValue(startIdx++); col.push_back(YearRecordSP(rec)); rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetMonthAddedRecordCollectionBySQL(MonthAddedRecordCollection& col, LPCTSTR sql) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; while (!rs.IsEOF()) { MonthAddedRecord* rec = new MonthAddedRecord; short startIdx = 0; rec->month = rs.GetINTFieldValue(startIdx++); rec->trackCount = rs.GetINTFieldValue(startIdx++); col.push_back(MonthAddedRecordSP(rec)); rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetFullTrackRecordCollectionBySQL(FullTrackRecordCollection& col, LPCTSTR sql, INT limitResults) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { FullTrackRecordSP rec(new FullTrackRecord); short fieldID = 0; GetTrackRecordFields(rec->track, rs, fieldID); GetAlbumRecordFields(rec->album, rs, fieldID); GetArtistRecordFields(rec->artist, rs, fieldID); GetGenreRecordFields(rec->genre, rs, fieldID); GetCollectionRecordFields(rec->collection, rs, fieldID); ASSERT(rec->IsValid()); col.push_back(rec); countResults++; if (countResults == limitResults) return TRUE; rs.MoveNext(); } if (col.size() == 0) TRACE(_T("@1 SQLManager::GetFullTrackRecordCollectionBySQL. returning empty collection\r\n")); return TRUE; } BOOL SQLManager::GetFullAlbumRecordCollectionBySQL(FullAlbumRecordCollection& col, LPCTSTR sql) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; while (!rs.IsEOF()) { FullAlbumRecord* rec = new FullAlbumRecord; short fieldID = 0; GetAlbumRecordFields(rec->album, rs, fieldID); GetArtistRecordFields(rec->artist, rs, fieldID); rec->album.trackCount = rs.GetINTFieldValue(fieldID++); col.push_back(FullAlbumRecordSP(rec)); rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetFullArtistRecordCollectionBySQL(FullArtistRecordCollection& col, LPCTSTR sql) { ASSERT(sql != NULL); ASSERT(sql[0] != 0); ADORecordset rs(m_pDB); if (!rs.Open(sql)) return FALSE; while (!rs.IsEOF()) { //TCHAR bf[cMaxStringLen];//MAX_STRING_LEN FullArtistRecord* rec = new FullArtistRecord; short fieldID = 0; GetArtistRecordFields(rec->artist, rs, fieldID); GetGenreRecordFields(rec->genre, rs, fieldID); rec->artist.trackCount = rs.GetINTFieldValue(fieldID++); col.push_back(FullArtistRecordSP(rec)); rs.MoveNext(); } return TRUE; } //============================================= //====================Retrieve Records By ID //============================================= //===============Get-Xxx-Record: Gets a record from ID //REQUIRE: ID!=0 //RETURN: FALSE if xxx does not exists || failure // TRUE on success. BOOL SQLManager::GetPicRecord(PicRecord& rec) { ASSERT(rec.parID > 0); if (rec.parID == 0) return FALSE; TCHAR sql[1000]; _sntprintf(sql, 1000, _T("SELECT path,type FROM localpic WHERE parID=%d AND infoType=%d"), rec.parID, rec.infoType); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short fieldID = 0; rs.GetStringFieldValue(fieldID++, rec.path); rec.pictureType = (PictureTypeEnum)rs.GetINTFieldValue(fieldID++); ASSERT(rec.IsValid()); return TRUE; } return FALSE; } BOOL SQLManager::AddOrUpdatePicRecord(PicRecord& rec) { ASSERT(rec.parID != NULL); if (rec.parID == 0) return FALSE; TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM LocalPic WHERE parID=%d AND infoType=%d"), rec.parID, rec.infoType); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); } else { if (rs.Open(_T("LocalPic"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); rs.SetVariantFieldValue(_T("parID"), rec.parID); rs.SetVariantFieldValue(_T("infoType"), rec.infoType); } else return FALSE; } rs.SetVariantFieldValue(_T("path"), rec.path.c_str()); rs.SetVariantFieldValue(_T("type"), rec.pictureType); return rs.Update(); } BOOL SQLManager::DeletePicRecord(InfoItemTypeEnum iit, UINT parID) { ASSERT(iit >= IIT_Unknown && iit < IIT_Last); ASSERT(parID >= 0); ASSERT(m_pDB != NULL); TCHAR sql[200]; _sntprintf(sql, 200, _T("DELETE FROM LocalPic WHERE parID=%d AND infoType=%d"), parID, iit); return m_pDB->Execute(sql) != -1; } //BOOL SQLManager::GetInfoRecordRequestRecord(InfoRecordRequest& rec) //{ // ASSERT(rec.parID > 0); // if (rec.parID == 0) // return FALSE; // TCHAR sql[1000]; // _sntprintf(sql, 1000, _T("SELECT result, requestTimeStamp FROM InfoRecordRequest WHERE parID=%d AND infoType=%d"), // rec.parID, // rec.infoType); // ADORecordset rs(m_pDB); // if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) // { // short fieldID = 0; // rec.result = (InfoRecordRequestResultEnum)rs.GetINTFieldValue(fieldID++); // rec.requestTimeStamp = rs.GetUINTFieldValue(fieldID++); // ASSERT(rec.IsValid()); // return TRUE; // } // return FALSE; //} BOOL SQLManager::AddInfoRequest(UINT timeStamp, UINT hash) { TCHAR sql[1000]; _sntprintf(sql, 1000, _T("INSERT INTO InfoRequests (requestTimeStamp,hash) VALUES (%u,%u)"), timeStamp, hash ); return m_pDB->Execute(sql) == -1; } BOOL SQLManager::DeleteInfoRequestsOlderThan(UINT timeStampLimit) { TCHAR sql[1000]; _sntprintf(sql, 1000, _T("DELETE FROM InfoRequests WHERE requestTimeStamp<%u"), timeStampLimit); return m_pDB->Execute(sql) != - 1; } BOOL SQLManager::GetInfoRequests(std::set<UINT>& requestSet) { ADORecordset rs(m_pDB); if (rs.Open(_T("SELECT hash FROM InfoRequests"), adOpenForwardOnly, adLockReadOnly, adCmdText)) { while (!rs.IsEOF()) { requestSet.insert(rs.GetUINTFieldValue(0)); rs.MoveNext(); } } return TRUE; } BOOL SQLManager::GetTrackRecord(UINT ID, TrackRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), TrackSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetTrackRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetAlbumRecord(UINT ID, AlbumRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), AlbumSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetAlbumRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetArtistRecord(UINT ID, ArtistRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), ArtistSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetArtistRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetGenreRecord(UINT ID, GenreRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), GenreSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetGenreRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } //BOOL SQLManager::GetInfoRecord(UINT ID, InfoRecord& rec) //{ // ASSERT(ID > 0); // TCHAR sql[1000]; // _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), InfoSQL, ID); // ADORecordset rs(m_pDB); // if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) // { // short startIdx = 0; // GetInfoRecordFields(rec, rs, startIdx); // return TRUE; // } // return FALSE; //} BOOL SQLManager::GetCollectionRecord(UINT ID, CollectionRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), CollectionSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetCollectionRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetHistTrackRecord(UINT ID, HistTrackRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), HistTrackSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetHistTrackRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetHistArtistRecord(UINT ID, HistArtistRecord& rec) { ASSERT(ID > 0); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), HistArtistSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetHistArtistRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetHistLogRecord(UINT ID, HistLogRecord& rec) { TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE ID=%d"), HistLogSQL, ID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetHistLogRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } //============================================= //====================Retrieve Records By Unique Key //============================================= //===============Get-Xxx-RecordUnique: Gets a record from ID //REQUIRE: ID!=0 //RETURN: FALSE if xxx does not exists || failure // TRUE on success. BOOL SQLManager::GetTrackRecordUnique(UINT colID, LPCTSTR location, TrackRecord& rec) { ASSERT(colID > 0); ASSERT(location != NULL); if (location == NULL) return FALSE; std::tstring fname(location); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE collectionID=%d AND path='%s' "), TrackSQL, colID, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetTrackRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetAlbumRecordUnique(UINT artID, LPCTSTR name, AlbumRecord& album) { ASSERT(name != NULL); #ifdef USE_CACHED_QUERIES if (sAlbumCache.ID != 0 && sAlbumCache.artID == artID && sAlbumCache.name == name) { album = sAlbumCache; return TRUE; } #endif // USE_CACHED_QUERIES ADORecordset rs(m_pDB); std::tstring fname(name); if (fname.empty()) fname = TS_UnknownString; else replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE name='%s' AND artID=%d"), AlbumSQL, fname.c_str(), artID); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetAlbumRecordFields(album, rs, startIdx); #ifdef USE_CACHED_QUERIES sAlbumCache = album; #endif // USE_CACHED_QUERIES return TRUE; } return FALSE; } BOOL SQLManager::GetArtistRecordUnique(LPCTSTR name, ArtistRecord& artist) { ASSERT(name != NULL); if (name[0] == 0) { artist.ID = 1; artist.name = name; return TRUE; } #ifdef USE_CACHED_QUERIES if (sArtistCache.ID != 0 && sArtistCache.name == name) { artist = sArtistCache; return TRUE; } #endif // USE_CACHED_QUERIES std::tstring fname(name); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE name='%s' "), ArtistSQL, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetArtistRecordFields(artist, rs, startIdx); #ifdef USE_CACHED_QUERIES sArtistCache = artist; #endif // USE_CACHED_QUERIES return TRUE; } return FALSE; } BOOL SQLManager::GetGenreRecordUnique(LPCTSTR name, GenreRecord& genre) { ASSERT(name != NULL); if (name[0] == 0) { genre.ID = 1; genre.name = TS_UnknownString; return TRUE; } #ifdef USE_CACHED_QUERIES if (sGenreCache.ID != 0 && sGenreCache.name == name) { genre = sGenreCache; return TRUE; } #endif // USE_CACHED_QUERIES std::tstring fname(name); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE name='%s'"), GenreSQL, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetGenreRecordFields(genre, rs, startIdx); #ifdef USE_CACHED_QUERIES sGenreCache = genre; #endif // USE_CACHED_QUERIES return TRUE; } return FALSE; } BOOL SQLManager::GetCollectionRecordUnique(UINT serial, LPCTSTR location, CollectionRecord& rec) { ASSERT(location != NULL); std::tstring fname(location); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE serial=%d AND pathName='%s'"), CollectionSQL, serial, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { short startIdx = 0; GetCollectionRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetHistTrackRecordUnique(UINT artID, LPCTSTR name, HistTrackRecord& rec) { ASSERT(artID != 0 && name != NULL); if (artID == 0 || name == NULL) return FALSE; std::tstring fname(name); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE artID=%d AND name='%s'"), HistTrackSQL, artID, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql) && !rs.IsEOF()) { short startIdx = 0; GetHistTrackRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } BOOL SQLManager::GetHistArtistRecordUnique(LPCTSTR name, HistArtistRecord& rec) { ASSERT(name != NULL); if (name == NULL) return FALSE; std::tstring fname(name); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE name='%s'"), HistArtistSQL, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql) && !rs.IsEOF()) { short startIdx = 0; GetHistArtistRecordFields(rec, rs, startIdx); return TRUE; } return FALSE; } //===============Get-Xxx-UD: Gets the ID //REQUIRE: ... //RETURN: 0 if xxx does not exists || failure // Database ID on success. UINT SQLManager::GetTrackID(UINT colID, LPCTSTR location) { ASSERT(colID > 0); ASSERT(location != NULL); std::tstring fname(location); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE collectionID=%d AND path='%s'"), TrackSQL, colID, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) return rs.GetUINTFieldValue(_T("ID")); return 0; } UINT SQLManager::GetAlbumID(UINT artID, LPCTSTR name) { ASSERT(name != NULL); std::tstring fname(name); if (fname.empty()) fname = TS_UnknownString; else replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("SELECT * FROM albums WHERE name='%s' AND artID=%d"), fname.c_str(), artID); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) return rs.GetUINTFieldValue(_T("ID")); return 0; } UINT SQLManager::GetArtistID(LPCTSTR name) { ASSERT(name != NULL); if (name[0] == 0) return 1; std::tstring fname(name); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE name='%s' "), ArtistSQL, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) return rs.GetUINTFieldValue(_T("ID")); return 0; } UINT SQLManager::GetGenreID(LPCTSTR name) { ASSERT(name != NULL); if (name[0] == 0) return 1; std::tstring fname(name); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE name='%s'"), GenreSQL, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) return rs.GetUINTFieldValue(_T("ID")); return 0; } UINT SQLManager::GetCollectionID(UINT serial, LPCTSTR location) { ASSERT(location != NULL); std::tstring fname(location); replace(fname, _T("'"), _T("''")); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("%s WHERE serial=%d AND pathName='%s'"), CollectionSQL, serial, fname.c_str()); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) return rs.GetUINTFieldValue(_T("ID")); return 0; } //UINT SQLManager::GetHistTrackID(UINT artID, LPCTSTR name) //{ // //} //UINT SQLManager::GetHistArtistID(LPCTSTR name) //{ // //} //============================================= //====================AddNew Records //============================================= //===============AddNew-Xxx-Record: Adds a new Xxx record //REQUIRE: xxx with ID==0 && name != "" && foreign keys valid //RETURN: FALSE if xxx exists || failure // TRUE on success. Modifies ID with the new ID BOOL SQLManager::AddNewTrackRecord(TrackRecord& rec) { ASSERT(rec.ID == 0); ASSERT(!rec.location.empty()); ASSERT(rec.artID != 0); ASSERT(rec.albID != 0); ASSERT(rec.genID != 0); ASSERT(rec.colID != 0); ASSERT(rec.trackType != TTYPE_Unsupported); if (rec.ID != 0 || rec.location.empty() || rec.artID == 0 || rec.albID == 0 || rec.genID == 0 || rec.colID == 0 || rec.trackType == TTYPE_Unsupported) return FALSE; if (rec.name.empty()) rec.name = TS_UnknownString; #ifdef USE_INTEGRITY_CHECKS TrackRecord existing; if (GetTrackRecordUnique(rec.colID, rec.location.c_str(), existing)) return FALSE; if (!ArtistRecordExists(rec.artID)) return FALSE; if (!AlbumRecordExists(rec.albID)) return FALSE; if (!GenreRecordExists(rec.genID)) return FALSE; if (!CollectionRecordExists(rec.colID)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("tracks"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); SetTrackRecordFields(rec, rs); if (rs.Update()) { m_changes.tracks.additions++; rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } BOOL SQLManager::AddNewAlbumRecord(AlbumRecord& rec) { ASSERT(rec.ID == 0); ASSERT(rec.artID != 0); if (rec.name.empty()) rec.name = TS_UnknownString; #ifdef USE_CACHED_QUERIES sAlbumCache.ID = 0; #endif // USE_CACHED_QUERIES if (rec.ID != 0 || rec.artID == 0) return FALSE; #ifdef USE_INTEGRITY_CHECKS AlbumRecord existing; if (GetAlbumRecordUnique(rec.artID, rec.name.c_str(), existing)) return FALSE; if (!ArtistRecordExists(rec.artID)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("albums"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); SetAlbumRecordFields(rec, rs); if (rs.Update()) { m_changes.albums.additions++; rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } BOOL SQLManager::AddNewArtistRecord(ArtistRecord& rec) { ASSERT(rec.ID == 0); ASSERT(!rec.name.empty()); ASSERT(rec.genID != 0); if (rec.ID != 0 || rec.genID == 0 || rec.name.empty()) return FALSE; #ifdef USE_CACHED_QUERIES sArtistCache.ID = 0; #endif // USE_CACHED_QUERIES #ifdef USE_INTEGRITY_CHECKS ArtistRecord existing; if (GetArtistRecordUnique(rec.name.c_str(), existing)) return FALSE; if (!GenreRecordExists(rec.genID)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("artists"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); SetArtistRecordFields(rec, rs); if (rs.Update()) { m_changes.artists.additions++; rec.ID = rs.GetUINTFieldValue(_T("ID")); return TRUE; } } return FALSE; } BOOL SQLManager::AddNewGenreRecord(GenreRecord& rec) { ASSERT(rec.ID == 0); ASSERT(!rec.name.empty()); if (rec.ID != 0 || rec.name.empty()) return FALSE; #ifdef USE_CACHED_QUERIES sGenreCache.ID = 0; #endif // USE_CACHED_QUERIES #ifdef USE_INTEGRITY_CHECKS GenreRecord existing; if (GetGenreRecordUnique(rec.name.c_str(), existing)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("genres"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); SetGenreRecordFields(rec, rs); if (rs.Update()) { m_changes.genres.additions++; rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } //BOOL SQLManager::AddNewInfoRecord(InfoRecord& rec) //{ // ASSERT(rec.ID == 0); // ASSERT(!rec.name.empty()); // if (rec.ID != 0 || rec.name.empty()) // return FALSE; // ADORecordset rs(m_pDB); // if (rs.Open(_T("info"), adOpenKeyset, adLockOptimistic, adCmdTable)) // { // rs.AddNew(); // SetInfoRecordFields(rec, rs); // if (rs.Update()) // { // m_changes.info.additions++; // rec.ID = rs.GetUINTFieldValue("ID"); // return TRUE; // } // } // return FALSE; //} BOOL SQLManager::AddNewCollectionRecord(CollectionRecord& rec) { ASSERT(rec.ID == 0); ASSERT(!rec.location.empty()); ASSERT(rec.type > CTYPE_Unknown && rec.type < CTYPE_Last); //ASSERT(rec.status >= CSTAT_Unknown && rec.status < CSTAT_Last); if(rec.ID) return FALSE; if(rec.location.empty()) return FALSE; if(!(rec.type > CTYPE_Unknown && rec.type < CTYPE_Last)) return FALSE; //if (rec.status == CSTAT_Unknown) rec.status = CSTAT_Ready; //if(!(rec.status > CSTAT_Unknown && rec.status < CSTAT_Last)) return FALSE; if (rec.name.empty()) rec.name = rec.location; #ifdef USE_INTEGRITY_CHECKS CollectionRecord existing; if (GetCollectionRecordUnique(rec.serial, rec.location.c_str(), existing)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("collections"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); if (rec.name.empty()) rec.name = rec.location; ::GetLocalTime(&rec.dateAdded); ::GetLocalTime(&rec.dateUpdated); SetCollectionRecordFields(rec, rs); if (rs.Update()) { m_changes.collections.additions++; rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } BOOL SQLManager::AddNewHistArtistRecord(HistArtistRecord& rec) { ASSERT(rec.ID == 0 && !rec.name.empty()); if(rec.ID != 0 || rec.name.empty()) return FALSE; #ifdef USE_INTEGRITY_CHECKS HistArtistRecord existing; if (GetHistArtistRecordUnique(rec.name.c_str(), existing)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("histartists"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); INT ret = rs.SetVariantFieldValue(_T("name"), rec.name.c_str()) ? 1 : 0; ASSERT(ret == 1); if (rs.Update()) { rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } BOOL SQLManager::AddNewHistTrackRecord(HistTrackRecord& rec) { ASSERT(rec.ID == 0 && !rec.name.empty() && rec.artID != 0); if(rec.ID != 0 || rec.name.empty() || rec.artID == 0) return FALSE; #ifdef USE_INTEGRITY_CHECKS HistTrackRecord existing; if (GetHistTrackRecordUnique(rec.artID, rec.name.c_str(), existing)) return FALSE; #endif // USE_INTEGRITY_CHECKS ADORecordset rs(m_pDB); if (rs.Open(_T("histtracks"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); INT ret = rs.SetVariantFieldValue(_T("name"), rec.name.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("artID"), rec.artID) ? 1 : 0; ASSERT(ret == 2); if (rs.Update()) { rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } BOOL SQLManager::AddNewHistLogRecord(HistLogRecord& rec) { ASSERT(rec.ID == 0 && rec.actID > HLA_Unknown && rec.actID < HLA_Last && rec.trackID); if(!(rec.ID == 0 && rec.actID > HLA_Unknown && rec.actID < HLA_Last && rec.trackID)) return FALSE; ADORecordset rs(m_pDB); if (rs.Open(_T("histlog"), adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); INT ret = rs.SetVariantFieldValue(_T("actID"), rec.actID) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("trackID"), rec.trackID) ? 1 : 0; ret += rs.SetSystemTimeFieldValue(_T("dateAdded"), rec.dateAdded) ? 1 : 0; ASSERT(ret == 3); if (rs.Update()) { rec.ID = rs.GetUINTFieldValue("ID"); return TRUE; } } return FALSE; } //===============Update-Xxx-Record: Updates a Xxx record //REQUIRE: xxx with ID!=0 && name != "" && foreign keys valid //RETURN: FALSE on failure // TRUE on success. BOOL SQLManager::UpdateTrackRecord(TrackRecord& rec) { ASSERT(rec.ID > 0);//0:Invalid ASSERT(!rec.location.empty()); ASSERT(rec.artID != 0); ASSERT(rec.albID != 0); ASSERT(rec.genID != 0); ASSERT(rec.colID != 0); ASSERT(rec.trackType > TTYPE_Unsupported && rec.trackType < TTYPE_Last); if (rec.ID == 0 || rec.location.empty() || rec.artID == 0 || rec.albID == 0 || rec.genID == 0 || rec.colID == 0 || rec.trackType == TTYPE_Unsupported) return FALSE; if (rec.name.empty()) rec.name = TS_UnknownString; #ifdef USE_INTEGRITY_CHECKS TrackRecord existingINT; if (GetTrackRecordUnique(rec.colID, rec.location.c_str(), existingINT)) { if (existingINT.ID != rec.ID) return FALSE; } if (!ArtistRecordExists(rec.artID)) return FALSE; if (!AlbumRecordExists(rec.albID)) return FALSE; if (!GenreRecordExists(rec.genID)) return FALSE; if (!CollectionRecordExists(rec.colID)) return FALSE; #endif // USE_INTEGRITY_CHECKS TrackRecord existing; GetTrackRecordUnique(rec.colID, rec.location.c_str(), existing); if (existing.ID == 0 || existing.ID == rec.ID) { ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM tracks WHERE ID=%d"), rec.ID); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); SetTrackRecordFields(rec, rs); m_changes.tracks.updates++; return rs.Update(); } } return FALSE; } BOOL SQLManager::UpdateAlbumRecord(AlbumRecord& rec, BOOL bForce) { ASSERT(rec.ID != 0); ASSERT(rec.artID != 0); ASSERT(rec.IsValid()); if (!(rec.artID != 0)) return FALSE; sAlbumCache.ID = 0; if (rec.name.empty()) rec.name = TS_UnknownString; //We must check for name duplication AlbumRecord existing; GetAlbumRecordUnique(rec.artID, rec.name.c_str(), existing); if (existing.ID == 0 || existing.ID == rec.ID) { TRACE(_T("@4 SQLManager::UpdateAlbumRecord. Updating. Existing: %d\r\n"), existing.ID); ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM albums WHERE ID=%d"), rec.ID); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); SetAlbumRecordFields(rec, rs); m_changes.albums.updates++; return rs.Update(); } } else if (bForce) { TRACE(_T("@4 SQLManager::UpdateAlbumRecord. There is already a record that has the same name\r\n")); //There is already a record that has the same name as this one. //FORCE WILL Keep the integrity of the database by // 1. Update all Track Records to the existing ID TCHAR sql[500]; _sntprintf(sql, 500, _T("UPDATE tracks SET albID=%d WHERE albID=%d"), existing.ID, rec.ID); m_pDB->Execute(sql); // 2. Delete all the info related to this record DeleteAllAlbumInfo(rec.ID); // 3. Delete This record m_changes.albums.removals++; _sntprintf(sql, 500, _T("DELETE FROM albums WHERE ID=%d"), rec.ID); m_pDB->Execute(sql); rec = existing; return TRUE; } TRACE(_T("@1 SQLManager::UpdateAlbumRecord. Not forced. Do nothing\r\n")); return FALSE; } BOOL SQLManager::UpdateArtistRecord(ArtistRecord& rec, BOOL bForce) { ASSERT(rec.ID > 2); ASSERT(rec.genID != 0); ASSERT(rec.IsValid()); //We must check for name duplication if (!(rec.ID > 2 && rec.genID != 0 && rec.IsValid())) return FALSE; sArtistCache.ID = 0; ArtistRecord existing; GetArtistRecordUnique(rec.name.c_str(), existing); if (existing.ID == 0 || existing.ID == rec.ID) { TRACE(_T("@4 SQLManager::UpdateArtistRecord. Updating. Existing: %d\r\n"), existing.ID); ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM artists WHERE ID=%d"), rec.ID); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); SetArtistRecordFields(rec, rs); m_changes.artists.updates++; return rs.Update(); } } else if (bForce) { TRACE(_T("@4 SQLManager::UpdateArtistRecord. There is already a record that has the same name\r\n")); //There is already a record that has the same name as this one. //FORCE WILL Keep the integrity of the database by // 1. Update all Track Records to the existing ID TCHAR sql[500]; _sntprintf(sql, 500, _T("UPDATE tracks SET artID=%d WHERE artID=%d"), existing.ID, rec.ID); m_changes.tracks.updates += m_pDB->Execute(sql); // 2. Update all Album Records the same way //There may be ALBUM DUPLICATION ********** BUGGGGGGGGGGGG ADORecordset rs(m_pDB); _sntprintf(sql, 500, _T("SELECT * FROM albums WHERE artID=%d"), rec.ID); if (rs.Open(sql)) { AlbumRecord al; while (!rs.IsEOF()) { short idx = 0; GetAlbumRecordFields(al, rs, idx); al.artID = existing.ID; UpdateAlbumRecord(al, TRUE); rs.MoveNext(); } } //_sntprintf(sql, 500, _T("UPDATE albums SET artID=%d WHERE artID=%d"), existing.ID, rec.ID); //m_changes.albums.updates += m_pDB->Execute(sql); // 3. Delete all the info related to this record DeleteAllArtistInfo(rec.ID); // 4. Delete This record _sntprintf(sql, 500, _T("DELETE FROM artists WHERE ID=%d"), rec.ID); m_changes.artists.removals += m_pDB->Execute(sql); rec = existing; return TRUE; } TRACE(_T("@1 SQLManager::UpdateArtistRecord. Not forced. Do nothing\r\n")); return FALSE; } BOOL SQLManager::UpdateGenreRecord(GenreRecord& rec, BOOL bForce) { ASSERT(rec.ID != 0); ASSERT(rec.name.empty() == FALSE); sGenreCache.ID = 0; //We must check for name duplication GenreRecord existing; GetGenreRecordUnique(rec.name.c_str(), existing); if (existing.ID == 0 || existing.ID == rec.ID) { ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM genres WHERE ID=%d"), rec.ID); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); SetGenreRecordFields(rec, rs); m_changes.genres.updates++; return rs.Update(); } } else if (bForce) { //There is already a record that has the same name as this one. //FORCE WILL Keep the integrity of the database by // 1. Update all Track Records to the existing ID TCHAR sql[500]; _sntprintf(sql, 500, _T("UPDATE tracks SET genID=%d WHERE genID=%d"), existing.ID, rec.ID); m_pDB->Execute(sql); // 2. Update all Artists Records the same way _sntprintf(sql, 500, _T("UPDATE artists SET genID=%d WHERE genID=%d"), existing.ID, rec.ID); m_pDB->Execute(sql); // 3. Delete This record _sntprintf(sql, 500, _T("DELETE FROM genres WHERE ID=%d"), rec.ID); m_changes.genres.removals++; m_pDB->Execute(sql); rec = existing; return TRUE; } return FALSE; } //BOOL SQLManager::UpdateInfoRecord(InfoRecord& rec) //{ // ASSERT(rec.ID != 0); // ASSERT(rec.name.empty() == FALSE); // ADORecordset rs(m_pDB); // TCHAR sql[200]; // _sntprintf(sql, 200, _T("SELECT * FROM info WHERE ID=%d"), rec.ID); // if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) // { // rs.Edit(); // SetInfoRecordFields(rec, rs); // m_changes.info.updates++; // return rs.Update(); // } // return FALSE; //} //BOOL SQLManager::AdjustInfoRecord(InfoRecord& rec) //{ // if (rec.ID == 0) // { // if (rec.name.empty()) // return TRUE; // else // return AddNewInfoRecord(rec); // } // else // { // if (rec.name.empty()) // { // UINT ID = rec.ID; // rec.ID = 0; // return DeleteInfoRecord(ID); // } // else // return UpdateInfoRecord(rec); // } // // return FALSE; //} BOOL SQLManager::UpdateCollectionRecord(CollectionRecord& rec) { ASSERT(rec.ID != 0); ASSERT(rec.location.empty() == FALSE); if (rec.name.empty()) rec.name = rec.location; //ASSERT(rec.status > CSTAT_Unknown && rec.status < CSTAT_Last); ASSERT(rec.type > CTYPE_Unknown && rec.type < CTYPE_Last); //We must check for name duplication CollectionRecord existing; GetCollectionRecordUnique(rec.serial, rec.location.c_str(), existing); if (existing.ID == 0 || existing.ID == rec.ID) { ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM collections WHERE ID=%d"), rec.ID); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { m_changes.collections.updates++; rs.Edit(); SetCollectionRecordFields(rec, rs); return rs.Update(); } } return FALSE; } BOOL SQLManager::UpdateHistTrackRecord(HistTrackRecord& rec) { ASSERT(0); return FALSE; } BOOL SQLManager::UpdateHistLogRecord(HistLogRecord& rec) { ASSERT(0); return FALSE; } BOOL SQLManager::UpdateHistArtistRecord(HistArtistRecord& rec) { ASSERT(0); return FALSE; } //===============Xxx-RecordExists: Test if a record exist //REQUIRE: ID!=0 //RETURN: FALSE if xxx does not exists || failure // TRUE on success. BOOL SQLManager::RecordExists(LPCTSTR sql, UINT ID) { ASSERT(ID > 0); TCHAR q[1000]; _sntprintf(q, 1000, _T("%s WHERE ID=%d"), sql, ID); ADORecordset rs(m_pDB); if (rs.Open(q, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) return TRUE; TRACE(_T("@1 SQLManager::RecordExists. Not existent '%s'\r\n"), q); return FALSE; } BOOL SQLManager::TrackRecordExists(UINT ID) { return RecordExists(TrackSQL, ID); } BOOL SQLManager::AlbumRecordExists(UINT ID) { return RecordExists(AlbumSQL, ID); } BOOL SQLManager::ArtistRecordExists(UINT ID) { return RecordExists(ArtistSQL, ID); } BOOL SQLManager::GenreRecordExists(UINT ID) { return RecordExists(GenreSQL, ID); } //BOOL SQLManager::InfoRecordExists(UINT ID) //{ // return RecordExists(InfoSQL, ID); //} BOOL SQLManager::CollectionRecordExists(UINT ID) { return RecordExists(CollectionSQL, ID); } BOOL SQLManager::HistTrackRecordExists(UINT ID) { return RecordExists(HistTrackSQL, ID); } BOOL SQLManager::HistArtistRecordExists(UINT ID) { return RecordExists(HistArtistSQL, ID); } BOOL SQLManager::HistLogRecordExists(UINT ID) { return RecordExists(HistLogSQL, ID); } BOOL SQLManager::UpdateFullArtistRecord(FullArtistRecord& artist, BOOL bForce) { //======Genres GenreRecord genre; if (!GetGenreRecordUnique(artist.genre.name.c_str(), genre))//This Genre Exists in Database { genre.name = artist.genre.name.c_str(); if (!AddNewGenreRecord(genre)) return FALSE; } artist.artist.genID = artist.genre.ID = genre.ID; //=======Artists return UpdateArtistRecord(artist.artist, bForce); } BOOL SQLManager::UpdateFullAlbumRecord(FullAlbumRecord& album, BOOL bForce) { //======Artist ArtistRecord artist; if (!GetArtistRecordUnique(album.artist.name.c_str(), artist))//This Genre Exists in Database { artist.name = album.artist.name.c_str(); if (!AddNewArtistRecord(artist)) return FALSE; } album.album.artID = album.artist.ID = artist.ID; //=======Album return UpdateAlbumRecord(album.album, bForce); } BOOL SQLManager::UpdateFullTrackRecord(FullTrackRecord& track) { ASSERT(track.track.ID != 0); ASSERT(track.track.colID == track.collection.ID); ASSERT(track.track.colID != 0); ASSERT(!track.track.location.empty()); //======Genres GenreRecord genre; if (!GetGenreRecordUnique(track.genre.name.c_str(), genre))//This Genre Exists in Database { genre.name = track.genre.name.c_str(); if (!AddNewGenreRecord(genre)) return FALSE; } track.track.genID = track.genre.ID = genre.ID; //======Artist ArtistRecord artist; if (!GetArtistRecordUnique(track.artist.name.c_str(), artist))//This Genre Exists in Database { artist.name = track.artist.name.c_str(); artist.genID = genre.ID; if (!AddNewArtistRecord(artist)) return FALSE; } track.track.artID = track.artist.ID = artist.ID; //======Album AlbumRecord album; if (!GetAlbumRecordUnique(artist.ID, track.album.name.c_str(), album))//This Genre Exists in Database { album.name = track.album.name.c_str(); album.artID = artist.ID; if (!AddNewAlbumRecord(album)) return FALSE; } track.track.albID = track.album.ID = album.ID; return UpdateTrackRecord(track.track); } //BOOL SQLManager::GetInfo(LPCTSTR fldName, LPCTSTR tblName, // InfoItemTypeEnum iit, UINT ID, InfoRecord& rec) //{ // ASSERT(ID != 0); // ASSERT(fldName != NULL && tblName != NULL); // TCHAR sql[1000]; // _sntprintf(sql, 1000, _T("SELECT %s FROM %s WHERE ID=%d"), fldName, tblName, ID); // ADORecordset rs(m_pDB); // if (rs.Open(sql) && !rs.IsEOF()) // { // UINT comID = rs.GetUINTFieldValue(0); // if (comID > 0) // return GetInfoRecord(comID, rec); // } // return FALSE; // //} // //BOOL SQLManager::SetInfo(LPCTSTR fldName, LPCTSTR tblName, // InfoItemTypeEnum iit, UINT ID, LPCTSTR info) //{ // ASSERT(ID != 0); // ASSERT(fldName != NULL && tblName != NULL); // TCHAR sql[1000]; // _sntprintf(sql, 1000, _T("SELECT %s FROM %s WHERE ID=%d"), fldName, tblName, ID); // ADORecordset rs(m_pDB); // if (rs.Open(sql) && !rs.IsEOF()) // { // UINT infoID = rs.GetUINTFieldValue(0); // if (infoID > 0) // { // if (info[0] != 0) // { // InfoRecord ir; // ir.ID = infoID; // ir.name = info; // GetLocalTime(&ir.dateAdded); // return UpdateInfoRecord(ir); // } // else // DeleteInfoRecord(infoID); // return TRUE; // } // else // { // if (info[0] != 0) // { // InfoRecord ir; // ir.name = info; // GetLocalTime(&ir.dateAdded); // if (AddNewInfoRecord(ir)) // { // TCHAR sql[1000]; // _sntprintf(sql, 1000, _T("UPDATE %s SET %s=%d WHERE ID=%d"), // tblName, fldName, ir.ID, ID); // return m_pDB->Execute(sql); // } // } // } // } // return FALSE; //} //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== //============================================================== // TRACKS TABLE //============================================================== //BOOL SQLManager::TrackRecordCollectionByCollectionID(TrackRecordCollection& col, UINT collectionID) //{ // ASSERT(collectionID > 0); // if (collectionID == 0) // return FALSE; // std::tstring sql(TrackSQL); // TCHAR bf[200]; // _sntprintf(bf, 200, _T(" WHERE Tracks.CollectionID=%d"), collectionID); // sql += bf; // return TrackRecordCollectionBySQL(col, sql.c_str()); //} BOOL SQLManager::GetTrackRecordCollectionByTracksFilter(TrackRecordCollection& col, TracksFilter& Filter) { CString Where(GetWhereSQL(Filter)); CString SQL; if (!Where.IsEmpty()) SQL.Format(_T("%s WHERE %s"), TrackSQL, &((LPCTSTR)Where)[4]); else SQL = TrackSQL; return GetTrackRecordCollectionBySQL(col, SQL); } const TCHAR* const FullTrackSQL = _T("SELECT ") _T("Tracks.ID,[Tracks.Name],[Tracks.Type],Tracks.DateAdded,") _T("Tracks.albID,Tracks.artID,Tracks.CollectionID,Tracks.GenreID,Tracks.Path,") _T("Tracks.Bitrate,Tracks.Duration,[Tracks.Size],Tracks.TrackNo,") _T("Tracks.Year,Tracks.Rating,") _T("Albums.ID,Albums.Name,Albums.artID,Albums.Year,Albums.Rating,") _T("Artists.ID,Artists.Name,Artists.GenreID,Artists.Rating,") _T("Genres.ID,Genres.Name,") _T("Collections.ID,Collections.Name,Collections.PathName,Collections.Serial,") _T("Collections.Type,Collections.DateAdded,Collections.DateUpdated ") _T("FROM ((((Tracks INNER JOIN Albums ON Tracks.albID=Albums.ID) ") _T("INNER JOIN Genres ON Tracks.GenreID=Genres.ID) ") _T("INNER JOIN Artists ON Tracks.artID=Artists.ID) ") _T("INNER JOIN Collections ON Tracks.collectionID=Collections.ID) "); BOOL SQLManager::GetFullTrackRecordByID(FullTrackRecordSP& rec, UINT id) { //TRACEST(_T("SQLManager::GetFullTrackRecordByID")); TracksFilter tf; tf.TrackID.match = NUMM_Exact; tf.TrackID.val = id; FullTrackRecordCollection col; if (GetFullTrackRecordCollectionByTracksFilter(col, tf)) { if (col.size() == 1) { rec = col[0]; return TRUE; } } return FALSE; } BOOL SQLManager::GetFullTrackRecordByLocation(FullTrackRecordSP& rec, LPCTSTR Location, UINT CollectionID) { //TRACEST(_T("SQLManager::GetFullTrackRecordByLocation")); ASSERT(Location != NULL); if (Location != NULL) { TracksFilter tf; tf.Location.match = TXTM_Exact; tf.Location.val = Location; if (CollectionID != 0) { tf.CollectionID.match = NUMM_Exact; tf.CollectionID.val = CollectionID; } FullTrackRecordCollection col; if (GetFullTrackRecordCollectionByTracksFilter(col, tf)) { if (col.size() > 0) { rec = col[0]; return TRUE; } } } return FALSE; } BOOL SQLManager::GetFullTrackRecordCollectionByLocation(FullTrackRecordCollection& col, LPCTSTR Location) { TRACEST(_T("SQLManager::GetFullTrackRecordCollectionByLocation")); ASSERT(Location != NULL); if (Location != NULL) { TracksFilter tf; tf.Location.match = TXTM_Exact; tf.Location.val = Location; if (GetFullTrackRecordCollectionByTracksFilter(col, tf)) return TRUE; } return FALSE; } BOOL SQLManager::GetFullTrackRecordCollectionByTracksFilter(FullTrackRecordCollection& col, TracksFilter& Filter, INT limitResults) { //TRACEST(_T("SQLManager::GetFullTrackRecordCollectionByTracksFilter")); CString Where(GetWhereSQL(Filter)); if (Filter.MinNumTracks.match == NUMM_Disabled) { if (Filter.ArtistID.match == NUMM_Disabled) AddSQLCountParameter(Where, Filter.ArtistTrackCount, _T("Tracks.artID")); if (Filter.AlbumID.match == NUMM_Disabled) AddSQLCountParameter(Where, Filter.AlbumTrackCount, _T("Tracks.albID")); if (Filter.GenreID.match == NUMM_Disabled) AddSQLCountParameter(Where, Filter.GenreTrackCount, _T("Tracks.genreID")); if (Filter.CollectionID.match == NUMM_Disabled) AddSQLCountParameter(Where, Filter.CollectionTrackCount, _T("Tracks.collectionID")); if (Filter.Year.match == NUMM_Disabled) AddSQLCountParameter(Where, Filter.YearTrackCount, _T("Tracks.Year")); if (Filter.MonthAdded.match == NUMM_Disabled) AddSQLCountParameter(Where, Filter.MonthAddedTrackCount, _T("(Month(Tracks.DateAdded) + Year(Tracks.DateAdded) * 12 - 1)")); } CString SQL; if (!Where.IsEmpty()) SQL.Format(_T("%s WHERE %s"), FullTrackSQL, &((LPCTSTR)Where)[4]); else SQL = FullTrackSQL; return GetFullTrackRecordCollectionBySQL(col, SQL, limitResults); } BOOL SQLManager::GetFullTrackRecordCollectionBySimpleSearch(FullTrackRecordCollection& col, LPCTSTR searchStr, INT limitResults) { TRACEST(_T("SQLManager::GetFullTrackRecordCollectionBySimpleSearch"), searchStr); ASSERT(searchStr != NULL); if (searchStr[0] == 0) return TRUE;//Does not touch the collection (Leave it empty usually - except if the user wanted to append) std::tstring searchF(searchStr); replace(searchF, _T("'"), _T("''")); std::tstring SQL(FullTrackSQL); SQL.reserve(1000 + 4 * searchF.size()); SQL += _T(" WHERE (Tracks.Name LIKE '%"); SQL += searchF; SQL += _T("%') OR (Artists.Name LIKE '%"); SQL += searchF; SQL += _T("%') OR (Albums.Name LIKE '%"); SQL += searchF; SQL += _T("%') OR (Tracks.Path LIKE '%"); SQL += searchF; SQL += _T("%')"); //TCHAR SQL[2000]; //_sntprintf(SQL, 2000, // _T("%s WHERE (Tracks.Name LIKE '%%%s%%' OR Artists.Name LIKE '%%%s%%' OR Albums.Name LIKE '%%%s%%' OR Tracks.Path LIKE '%%%s%%')"), // FullTrackSQL, searchF.c_str(), searchF.c_str(), searchF.c_str(), searchF.c_str()); return GetFullTrackRecordCollectionBySQL(col, SQL.c_str(), limitResults); } void SQLManager::AddSmartSearchCondition(std::tstring& SQL, LPCTSTR condition) { SQL += _T(" (Tracks.Name + Artists.Name + Albums.Name + Tracks.Path) LIKE '%"); SQL += condition; SQL += _T("%' "); } BOOL SQLManager::GetFullTrackRecordCollectionBySmartSearch(FullTrackRecordCollection& col, LPCTSTR searchStr, INT limitResults) { TRACEST(_T("SQLManager::GetFullTrackRecordCollectionBySmartSearch"), searchStr); ASSERT(searchStr != NULL); if (searchStr[0] == 0) return TRUE;//Does not touch the collection (Leave it empty usually - except if the user wanted to append) std::tstring searchF(searchStr); replace(searchF, _T("'"), _T("''")); trim(searchF); std::tstring SQL(FullTrackSQL); SQL += _T(" WHERE "); LPCTSTR posStart = searchF.c_str(); LPCTSTR posEnd = _tcschr(posStart, _T(' ')); while (TRUE) { if (posEnd == NULL) { AddSmartSearchCondition(SQL, posStart); break; } const INT cbfLen = 100; TCHAR bf[cbfLen]; _tcsncpy(bf, posStart, posEnd - posStart); bf[posEnd - posStart] = 0; AddSmartSearchCondition(SQL, bf); //=== Find the next while (*posEnd == _T(' ')) posEnd++; posStart = posEnd; posEnd = _tcschr(posStart, _T(' ')); SQL += _T(" AND "); } //TCHAR SQL[2000]; //_sntprintf(SQL, 2000, // _T("%s WHERE (Tracks.Name LIKE '%%%s%%' OR Artists.Name LIKE '%%%s%%' OR Albums.Name LIKE '%%%s%%' OR Tracks.Path LIKE '%%%s%%')"), // FullTrackSQL, searchF.c_str(), searchF.c_str(), searchF.c_str(), searchF.c_str()); return GetFullTrackRecordCollectionBySQL(col, SQL.c_str(), limitResults); } BOOL SQLManager::GetFullTrackRecordCollectionByInfoLikeness(FullTrackRecordCollection& col, InfoItemTypeEnum iit, LPCTSTR searchString) { ASSERT(searchString != NULL); if (searchString[0] == 0) return FALSE; TCHAR FixedString[500]; FixStringField(searchString, FixedString, 500); CString SQL; SQL.Format(_T("%s INNER JOIN tracksinfo ON TracksInfo.trackid=Tracks.ID ") _T("WHERE tracksinfo.Name LIKE '%%%s%%' AND tracksinfo.type=%d"), FullTrackSQL, FixedString, iit); return GetFullTrackRecordCollectionBySQL(col, SQL); } //============================================================== // ARTISTS TABLE //============================================================== const TCHAR* const FullArtistSQL = _T("SELECT ") _T("Artists.ID, Artists.Name, Artists.GenreID, Artists.Rating ") _T(",Genres.ID,Genres.Name ") _T(", -1 ") _T("FROM Artists INNER JOIN Genres ON Artists.GenreID=Genres.ID "); const TCHAR* const CountFullArtistSQL = _T("SELECT ") _T("first(Artists.ID), first(Artists.Name), first(Artists.GenreID), first(Artists.Rating) ") _T(",first(Genres.ID),first(Genres.Name),") _T("count(*) ") _T("FROM Tracks INNER JOIN (Artists INNER JOIN Genres ") _T("ON Artists.genreID = Genres.ID) ON Tracks.artID = Artists.ID "); BOOL SQLManager::GetFullArtistRecordByID(FullArtistRecordSP& rec, UINT id) { ASSERT(id > 0); FullArtistRecordCollection col; std::tstring SQL = FullArtistSQL; TCHAR bf[100]; _sntprintf(bf, 100, _T(" WHERE Artists.ID=%d"), id); SQL += bf; if (GetFullArtistRecordCollectionBySQL(col, SQL.c_str())) { ASSERT(col.size() == 1); if (col.size() == 1) { rec = col[0]; return TRUE; } } return FALSE; } BOOL SQLManager::GetFullArtistRecordCollectionByTracksFilter(FullArtistRecordCollection& col, TracksFilter& Filter) { std::tstring SQL; SQL = CountFullArtistSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } SQL += _T(" GROUP BY Tracks.artID "); SQL += GetHavingSQL(Filter.MinNumTracks); return GetFullArtistRecordCollectionBySQL(col, SQL.c_str()); } //============================================================== // ALBUMS TABLE //============================================================== const TCHAR* const FullAlbumSQL = _T("SELECT ") _T("Albums.ID, Albums.Name, Albums.artID, Albums.Year, Albums.Rating ") _T(", Artists.ID, Artists.Name, Artists.GenreID, Artists.Rating ") _T(", -1 ") _T("FROM Albums INNER JOIN Artists ON Albums.artID=Artists.ID "); const TCHAR* const CountFullAlbumSQL = _T("SELECT ") _T("first(Albums.ID), first(Albums.Name), first(Albums.artID), first(Albums.Year), first(Albums.Rating) ") _T(", first(Artists.ID), first(Artists.Name), first(Artists.GenreID), first(Artists.Rating)") _T(", count(*) ") _T("FROM Tracks INNER JOIN (Albums INNER JOIN Artists ") _T("ON Albums.artID = Artists.ID) ON Tracks.albID = Albums.ID "); const TCHAR* const AlternativeFullAlbumSQL = _T("SELECT ") _T("first(Albums.ID), first(Albums.Name), first(Albums.artID), first(Albums.Year), first(Albums.Rating) ") _T(", count(distinct(Tracks.artID), '', 1, 0, 0") _T(", count(*) ") _T("FROM Tracks INNER JOIN Albums ") _T("ON Tracks.albID = Albums.ID "); BOOL SQLManager::GetFullAlbumRecordByID(FullAlbumRecordSP& rec, UINT id) { ASSERT(id > 0); if (id == 0) return FALSE; FullAlbumRecordCollection col; std::tstring SQL = FullAlbumSQL; TCHAR bf[100]; _sntprintf(bf, 100, _T(" WHERE Albums.ID=%d"), id); SQL += bf; if (GetFullAlbumRecordCollectionBySQL(col, SQL.c_str())) { ASSERT(col.size() == 1); if (col.size() == 1) { rec = col[0]; return TRUE; } } return FALSE; } BOOL SQLManager::GetFullAlbumRecordCollectionByTracksFilter(FullAlbumRecordCollection& col, TracksFilter& Filter) { std::tstring SQL = CountFullAlbumSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } SQL += _T(" GROUP BY Tracks.albID "); SQL += GetHavingSQL(Filter.MinNumTracks); return GetFullAlbumRecordCollectionBySQL(col, SQL.c_str()); } BOOL SQLManager::GetFullAlbumGPNRecordCollectionByTracksFilter(FullAlbumRecordCollection& col, TracksFilter& Filter) { std::tstring SQL = CountFullAlbumSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } SQL += _T(" GROUP BY Albums.name "); SQL += GetHavingSQL(Filter.MinNumTracks); return GetFullAlbumRecordCollectionBySQL(col, SQL.c_str()); } BOOL SQLManager::GetFullAlbumRecordCollectionByTracksFilterForCollections(FullAlbumRecordCollection& col, TracksFilter& Filter) { std::tstring SQL = _T("SELECT ") _T("first(Albums.ID), first(Albums.Name), first(Albums.artID), first(Albums.Year), first(Albums.Rating), 0, '', 0, 0, 0, count(*) ") _T("FROM Tracks INNER JOIN Albums ") _T("ON Tracks.albID = Albums.ID ") _T("WHERE Left(Albums.name,1)<>'[' "); CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) SQL += Where; SQL += _T("GROUP BY (Albums.name) HAVING MAX(Tracks.artID) <> MIN(Tracks.artID) "); return GetFullAlbumRecordCollectionBySQL(col, SQL.c_str()); } //SELECT //first(Albums.ID), first(Albums.Name), first(Albums.artID), first(Albums.Year), first(Albums.InfoID), first(Albums.Rating), count(Tracks.artID), 'aaaa', 1, 0, 0, count(*) //FROM Tracks INNER JOIN Albums //ON Tracks.albID = Albums.ID //WHERE Left(Albums.name,1)<>'[' //GROUP BY (Albums.name) //HAVING MAX(Tracks.artID) <> MIN(Tracks.artID) //============================================================== // GENRES TABLE //============================================================== BOOL SQLManager::GetGenreRecordCollectionByTracksFilter(GenreRecordCollection& col, TracksFilter& Filter, BOOL bCountTracks) { std::tstring SQL; if (bCountTracks) SQL = CountGenreSQL; else SQL = GenreSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } if (bCountTracks) { SQL += _T(" GROUP BY Tracks.genreID "); SQL += GetHavingSQL(Filter.MinNumTracks); } return GetGenreRecordCollectionBySQL(col, SQL.c_str()); } //============================================================== // COLLECTIONS TABLE //============================================================== BOOL SQLManager::GetCollectionRecordCollectionByTracksFilter(CollectionRecordCollection& col, TracksFilter& Filter, BOOL bCountTracks) { std::tstring SQL; if (bCountTracks) SQL = CountCollectionSQL; else SQL = CollectionSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } if (bCountTracks) { SQL += _T(" GROUP BY Collections.ID "); SQL += GetHavingSQL(Filter.MinNumTracks); } return GetCollectionRecordCollectionBySQL(col, SQL.c_str()); } BOOL SQLManager::GetCollectionRecordCollectionByTypeID(CollectionRecordCollection& col, CollectionTypesEnum type) { std::tstring SQL; SQL = CollectionSQL; TCHAR bf[200]; _sntprintf(bf, 200, _T(" WHERE type=%d"), type); SQL += bf; return GetCollectionRecordCollectionBySQL(col, SQL.c_str()); } //============================================================== // YEARS //============================================================== const TCHAR* const CountYearSQL = _T("SELECT ") _T("first(Tracks.Year) ") _T(", count(*) ") _T("FROM Tracks "); BOOL SQLManager::GetYearRecordCollectionByTracksFilter(YearRecordCollection& col, TracksFilter& Filter, BOOL bCountTracks) { std::tstring SQL; ASSERT(bCountTracks); SQL = CountYearSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } if (bCountTracks) { SQL += _T(" GROUP BY Tracks.year "); SQL += GetHavingSQL(Filter.MinNumTracks); } return GetYearRecordCollectionBySQL(col, SQL.c_str()); } //============================================================== // MONTH ADDED //============================================================== const TCHAR* const CountMonthAddedSQL = _T("SELECT ") _T("Month(Tracks.DateAdded) + Year(Tracks.DateAdded) * 12 - 1 ") _T(", count(*) ") _T("FROM Tracks "); BOOL SQLManager::GetMonthAddedRecordCollectionByTracksFilter(MonthAddedRecordCollection& col, TracksFilter& Filter, BOOL bCountTracks) { std::tstring SQL; ASSERT(bCountTracks); SQL = CountMonthAddedSQL; CString Where(GetWhereSQL(Filter)); if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } if (bCountTracks) { SQL += _T(" GROUP BY Month(Tracks.DateAdded),Year(Tracks.DateAdded) "); SQL += GetHavingSQL(Filter.MinNumTracks); } return GetMonthAddedRecordCollectionBySQL(col, SQL.c_str()); } //BOOL SQLManager::GetDirectoryRecordCollectionByTracksFilter(DirectoryRecordCollection& col, TracksFilter& Filter, BOOL bCountTracks) //{ // std::tstring SQL; // ASSERT(bCountTracks); // SQL = CountMonthAddedSQL; // // CString Where(GetWhereSQL(Filter)); // if (!Where.IsEmpty()) // { // SQL += _T(" WHERE "); // SQL += &((LPCTSTR)Where)[4]; // } // if (bCountTracks) // { // SQL += _T(" GROUP BY Month(Tracks.DateAdded),Year(Tracks.DateAdded) "); // SQL += GetHavingSQL(Filter.MinNumTracks); // } // // // return GetMonthAddedRecordCollectionBySQL(col, SQL.c_str()); //} //============================================================== // PRIVATE UTILITIES //============================================================== CString SQLManager::GetWhereSQL(TracksFilter& Filter) { CString ret; AddSQLNumParameter(ret, Filter.TrackID, _T("Tracks.ID")); AddSQLNumParameter(ret, Filter.ArtistID, _T("Tracks.artID")); AddSQLNumParameter(ret, Filter.AlbumID, _T("Tracks.albID")); AddSQLNumParameter(ret, Filter.GenreID, _T("Tracks.GenreID")); AddSQLNumParameter(ret, Filter.CollectionID, _T("Tracks.CollectionID")); AddSQLStrParameter(ret, Filter.Title, _T("Tracks.Name")); AddSQLStrParameter(ret, Filter.Album, _T("Albums.Name")); AddSQLStrParameter(ret, Filter.Artist, _T("Artists.Name")); AddSQLStrParameter(ret, Filter.Location, _T("Tracks.Path")); AddSQLStrParameter(ret, Filter.Genre, _T("Genres.Name")); AddSQLNumParameter(ret, Filter.Year, _T("Tracks.year")); if (Filter.Rating.match != NUMM_Disabled) { AddSQLNumParameter(ret, Filter.Rating, _T("Tracks.Rating")); NumericMatch rat2; rat2.match = NUMM_Over; rat2.val = 1; AddSQLNumParameter(ret, rat2,_T("Tracks.Rating")); } AddSQLNumParameter(ret, Filter.TrackNo, _T("Tracks.TrackNo")); AddSQLNumParameter(ret, Filter.Size, _T("Tracks.Size")); AddSQLNumParameter(ret, Filter.Duration, _T("Tracks.duration")); AddSQLNumParameter(ret, Filter.Bitrate, _T("Tracks.bitrate")); AddSQLNumParameter(ret, Filter.TrackType, _T("Tracks.type")); AddSQLNumParameter(ret, Filter.MonthAdded, _T("(Month(Tracks.DateAdded) + 12 * Year(Tracks.DateAdded) - 1)")); AddSQLDateParameter(ret, Filter.DateAdded, _T("Tracks.DateAdded")); return ret; } CString SQLManager::GetHavingSQL(NumericMatch nm) { if (nm.match != NUMM_Disabled) { ASSERT(nm.val > 0); TCHAR bf[400]; _sntprintf(bf, 400, _T(" HAVING count(*) %s %d"), nm.match == NUMM_Over ? _T(">") : (nm.match == NUMM_Under ? _T("<=") : _T("=")), nm.val); return CString(bf); } return CString(); } void SQLManager::AddSQLCountParameter(CString& ret, NumericMatch nm, LPCTSTR fieldName) { if (nm.match == NUMM_Disabled || nm.val == 0) return; LPCTSTR oper = _T("="); if (nm.match == NUMM_Over) oper = _T(">"); else oper = _T("<="); TCHAR bf[400]; _sntprintf(bf, 400, _T(" AND %s IN ") _T("(Select %s from Tracks group by %s having count(%s) %s %d)"), fieldName, fieldName, fieldName, fieldName, oper, nm.val); ret += bf; } void SQLManager::AddSQLNumParameter(CString& ret, NumericMatch nm, LPCTSTR str) { if (nm.match == NUMM_Disabled) return; TCHAR* op; switch (nm.match) { case NUMM_Exact: op = _T("="); break; case NUMM_Over: op = _T(">="); break; case NUMM_Under: op = _T("<"); break; case NUMM_Diff: op = _T("<>"); break; default: TRACE(_T("@1 SQLManager::AddSQLNumParameter Unknown operator\r\n")); ASSERT(FALSE); return; } //if (!ret.IsEmpty()) ret += _T(" AND "); ret += str; ret += op; TCHAR bf[20]; _itot(nm.val, bf, 10); ret += bf; //curLen += _sntprintf(&bf[curLen], TotalLen - curLen, _T(" AND %s %s %d"), str, op, nm.val); } void SQLManager::AddSQLStrParameter(CString& ret, TextMatch tm, LPCTSTR str) { if (tm.match == TXTM_Disabled) return; ASSERT(!tm.val.empty()); if (!tm.val.empty()) { TCHAR FixedField[500]; //DbManager::FixStringField(tm.val, FixedField, 300); FixStringField(tm.val.c_str(), FixedField, 500); TCHAR bf[1000]; switch (tm.match) { case TXTM_Exact: _sntprintf(bf, 1000, _T(" AND %s = '%s'"), str, FixedField); break; case TXTM_Like: _sntprintf(bf, 1000, _T(" AND %s Like '%%%s%%'"), str, FixedField); break; default: ASSERT(FALSE); return; } ret += bf; //curLen += _sntprintf(&bf[curLen], TotalLen - curLen, _T(" AND %s %s '%s'"), str, op, FixedField); } } void SQLManager::AddSQLDateParameter(CString& ret, DateMatch dm, LPCTSTR str) { if (dm.match == DATM_Disabled) return; TCHAR bf[100]; GetDateFormat(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), DATE_SHORTDATE, &dm.val, NULL, bf, 100); //if (!ret.IsEmpty()) ret += _T(" AND "); ret += str; ret += dm.match == DATM_After ? _T(">") : _T("<"); ret += _T("#"); ret += bf; ret += _T("#"); } UINT SQLManager::FixStringField(LPCTSTR source, LPTSTR dest, UINT destLen) { ASSERT(source != NULL); ASSERT(dest!=NULL); ASSERT(destLen > _tcslen(source)); UINT i = 0; UINT additions = 0; while (source[i] != 0) { if (source[i] == 39)//Duplicate 39 "'" { dest[additions + i] = 39; additions++; } if (additions + i >= destLen - 1)//Do not overwrite break; dest[additions + i] = source[i]; i++; } ASSERT(destLen > additions + i + 10);//Test for error boundaries dest[min(additions + i, destLen - 1)] = 0; return additions; } //======================================================================== //======================================================================== //======================================================================== //======================================================================== //======================================================================== //======================================================================== //===================================COLLECTIONS //BOOL SQLManager::GetCollectionRecordUnique(UINT serial, LPCTSTR location, CollectionRecord& collection) //{ // ASSERT(location != NULL); // if (location[0] == 0) // { // collection.ID = 1; // collection.name = location; // } // ADORecordset rs(m_pDB); // std::tstring fname(location); // replace2(fname, _T("'"), _T("''")); // TCHAR sql[500]; // _sntprintf(sql, 500, _T("SELECT * FROM collections WHERE pathName='%s' AND serial=%d"), fname.c_str(), serial); // if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) // { // GetCollectionRecordFields(collection, rs, 0); // return TRUE; // } // return FALSE; //} //===================================GENRES BOOL SQLManager::SetGenreRecordFields(GenreRecord& genre, ADORecordset& rs) { //[DO NOT EDIT] rs.SetVariantFieldValue(_T("ID"), genre.ID); INT ret = rs.SetVariantFieldValue(_T("name"), genre.name.c_str()) ? 1 : 0; ASSERT(ret == 1); return ret == 1; } //===================================GENRES END //===================================ARTISTS BOOL SQLManager::SetArtistRecordFields(ArtistRecord& artist, ADORecordset& rs) { INT ret = rs.SetVariantFieldValue(_T("name"), artist.name.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("genreID"), artist.genID) ? 1 : 0;//Foreign Key ret += rs.SetVariantFieldValue(_T("rating"), artist.rating) ? 1 : 0; ASSERT(ret == 3); return ret == 3; } //===================================ARTISTS END //===================================ALBUMS BOOL SQLManager::SetAlbumRecordFields(AlbumRecord& album, ADORecordset& rs) { INT ret = 0; ret += rs.SetVariantFieldValue(_T("name"), album.name.empty() ? TS_UnknownString : album.name.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("artID"), album.artID) ? 1 : 0;//Foreign Key ret += rs.SetVariantFieldValue(_T("Year"), album.year) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("rating"), album.rating) ? 1 : 0; ASSERT(ret == 4); return ret == 4; } //===================================ALBUMS END //Needs album.ID to be != 0 //Needs artID-infoID to be Valid!!!! //UNIQUE KEY = ID, Name //==============SetFields BOOL SQLManager::SetTrackRecordFields(TrackRecord& track, ADORecordset& rs) { //[DO NOT EDIT] rs.SetVariantFieldValue(_T("ID"), track.ID); INT ret = rs.SetVariantFieldValue(_T("name"), track.name.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("type"), track.trackType) ? 1 : 0; ret += rs.SetSystemTimeFieldValue(_T("dateAdded"), track.dateAdded) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("albID"), track.albID) ? 1 : 0;//Foreign Key ret += rs.SetVariantFieldValue(_T("artID"), track.artID) ? 1 : 0;//Foreign Key ret += rs.SetVariantFieldValue(_T("CollectionID"), track.colID) ? 1 : 0;//Foreign Key ret += rs.SetVariantFieldValue(_T("genreID"), track.genID) ? 1 : 0;//Foreign Key ret += rs.SetVariantFieldValue(_T("path"), track.location.c_str()) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("bitrate"), track.bitrate) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("duration"), track.duration) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("size"), track.size) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("trackno"), track.trackNo) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("year"), track.year) ? 1 : 0; ret += rs.SetVariantFieldValue(_T("rating"), track.rating) ? 1 : 0; ASSERT(ret == 14); return ret == 14; } BOOL SQLManager::DeleteTrackRecord(UINT ID) { ASSERT(ID > 0); DeleteAllTrackInfo(ID); TCHAR sql[100]; _sntprintf(sql, 100, _T("DELETE FROM Tracks WHERE id=%d"), ID); m_changes.tracks.removals++; return m_pDB->Execute(sql) != -1; } BOOL SQLManager::GetVirtualTrackCollectionRecord(CollectionRecord& cr) { ASSERT(0);return FALSE;//TODO } BOOL SQLManager::GetFirstVal(LPCTSTR sql, INT& val) { ADORecordset rs(m_pDB); if (rs.Open(sql) && !rs.IsEOF()) { val = rs.GetINTFieldValue(0); return TRUE; } return FALSE; } BOOL SQLManager::DeleteAlbumRecord(UINT ID) { ASSERT(ID > 0); #ifdef USE_INTEGRITY_CHECKS TRACE(_T("@4 SQLManager::DeleteAlbumRecord. Integrity Test\r\n")); INT count = 0; if (!GetFirstVal(_T("Select count(*) FROM Tracks WHERE albID=%d"), count) || count == 0) return FALSE; TRACE(_T("@4 SQLManager::DeleteAlbumRecord. Integrity Test = OK\r\n")); #endif // USE_INTEGRITY_CHECKS DeleteAllAlbumInfo(ID); TCHAR sql[100]; _sntprintf(sql, 100, _T("DELETE FROM Albums WHERE id=%d"), ID); m_changes.albums.removals++; return m_pDB->Execute(sql) != -1; } BOOL SQLManager::DeleteArtistRecord(UINT ID) { ASSERT(ID > 0); #ifdef USE_INTEGRITY_CHECKS TRACE(_T("@4 SQLManager::DeleteArtistRecord. Integrity Test\r\n")); INT count = 0; if (!GetFirstVal(_T("Select count(*) FROM Tracks WHERE artID=%d"), count) || count != 0) return FALSE; if (!GetFirstVal(_T("Select count(*) FROM Albums WHERE artID=%d"), count) || count != 0) return FALSE; TRACE(_T("@4 SQLManager::DeleteArtistRecord. Integrity Test = OK\r\n")); #endif // USE_INTEGRITY_CHECKS DeleteAllArtistInfo(ID); TCHAR sql[100]; _sntprintf(sql, 100, _T("DELETE FROM Artists WHERE id=%d"), ID); m_changes.artists.removals++; return m_pDB->Execute(sql) != -1; } BOOL SQLManager::DeleteGenreRecord(UINT ID) { ASSERT(ID > 0); #ifdef USE_INTEGRITY_CHECKS TRACE(_T("@4 SQLManager::DeleteGenreRecord. Integrity Test\r\n")); INT count = 0; if (!GetFirstVal(_T("Select count(*) FROM Tracks WHERE genID=%d"), count) || count != 0) return FALSE; if (!GetFirstVal(_T("Select count(*) FROM Artists WHERE genID=%d"), count) || count != 0) return FALSE; TRACE(_T("@4 SQLManager::DeleteGenreRecord. Integrity Test = OK\r\n")); #endif // USE_INTEGRITY_CHECKS TCHAR sql[100]; _sntprintf(sql, 100, _T("DELETE FROM Genres WHERE id=%d"), ID); m_changes.genres.removals++; return m_pDB->Execute(sql) != -1; } BOOL SQLManager::DeleteCollectionRecord(UINT ID, BOOL bForce) { ASSERT(ID > 0); TCHAR sql[100]; if (bForce) { _sntprintf(sql, 100, _T("DELETE FROM Tracks WHERE collectionid=%d"), ID); if (m_pDB->Execute(sql) == -1) return FALSE; } #ifdef USE_INTEGRITY_CHECKS else { return FALSE; } #endif // USE_INTEGRITY_CHECKS _sntprintf(sql, 100, _T("DELETE FROM Collections WHERE ID=%d"), ID); if (m_pDB->Execute(sql) == -1) return FALSE; m_changes.collections.removals++; return TRUE; } //BOOL SQLManager::DeleteInfoRecord(UINT ID) //{ // ASSERT(ID > 0); // TCHAR sql[100]; // _sntprintf(sql, 100, _T("DELETE FROM Info WHERE id=%d"), ID); // if (m_pDB->Execute(sql)) // { // m_changes.info.removals++; // return TRUE; // } // return FALSE; //} BOOL SQLManager::DeleteHistLogRecord(UINT ID) { //CAUTION The track Record must be handled properly ASSERT(ID > 0); TCHAR sql[100]; _sntprintf(sql, 100, _T("DELETE FROM HistLog WHERE id=%d"), ID); return m_pDB->Execute(sql) != -1; } UINT SQLManager::GetTrackCount(TracksFilter& tf) { CString Where = GetWhereSQL(tf); CString SQL = _T("SELECT count(*) FROM tracks"); if (!Where.IsEmpty()) { SQL += _T(" WHERE"); SQL += &((LPCTSTR)Where)[4]; } ADORecordset rs(m_pDB); if (rs.Open(SQL) && !rs.IsEOF()) return rs.GetUINTFieldValue((short)0); return 0; } BOOL SQLManager::GetTrackIDList(TracksFilter& tf, std::vector<UINT>& idList) { CString Where = GetWhereSQL(tf); CString SQL; if (tf.Album.match == TXTM_Disabled) SQL = _T("SELECT ID FROM tracks"); else { //This have been Changed because of AlbumByName case... SQL = _T("SELECT tracks.ID FROM tracks INNER JOIN albums ON tracks.albID = albums.ID"); } if (!Where.IsEmpty()) { SQL += _T(" WHERE"); SQL += &((LPCTSTR)Where)[4]; } ADORecordset rs(m_pDB); if (rs.Open(SQL)) { short idx = 0; while (!rs.IsEOF()) { idList.push_back(rs.GetUINTFieldValue(idx)); rs.MoveNext(); } return TRUE; } return FALSE; } void SQLManager::GetSQLDateForQueries(SYSTEMTIME& input, LPTSTR bf, UINT bfLen) { ASSERT(bf != NULL && bfLen > 10); TCHAR dateStr[100]; GetDateFormat(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), DATE_SHORTDATE, &input, NULL, dateStr, 100); _sntprintf(bf, bfLen, _T("#%s#"), dateStr); bf[bfLen - 1] = 0; } BOOL SQLManager::LogTrackInHistory(LPCTSTR artist, LPCTSTR track, HistoryLogActionsEnum actID, SYSTEMTIME& localTime) { ASSERT(actID > HLA_Unknown && actID < HLA_Last); ASSERT(artist!= NULL && track != NULL); if (!(artist!= NULL && track != NULL && actID > HLA_Unknown && actID < HLA_Last)) return FALSE; if (artist == _T("")) artist = TS_UnknownString; if (track == _T("")) track = TS_UnknownString; HistArtistRecord art; if (!GetHistArtistRecordUnique(artist, art)) { art.name = artist; AddNewHistArtistRecord(art); } ASSERT(art.IsValid()); HistTrackRecord tra; if (!GetHistTrackRecordUnique(art.ID, track, tra)) { tra.artID = art.ID; tra.name = track; AddNewHistTrackRecord(tra); } ASSERT(tra.IsValid()); HistLogRecord log; log.actID = actID; log.dateAdded = localTime; log.trackID = tra.ID; return AddNewHistLogRecord(log); } BOOL SQLManager::GetHistoryLogStats(SQLManager::HistoryLogStats& stats) { ADORecordset rs(m_pDB); if (rs.Open(_T("SELECT count(*),actID,MIN(DateAdded),MAX(DateADDED) FROM HistLog GROUP BY actID"))) { while (!rs.IsEOF()) { HistoryLogActionsEnum actID = (HistoryLogActionsEnum) rs.GetUINTFieldValue(1); if (actID == HLA_Played) { stats.plays = rs.GetUINTFieldValue(0); stats.firstTime = rs.GetSYSTEMTIMEFieldValue(2); stats.lastTime = rs.GetSYSTEMTIMEFieldValue(3); } else if (actID == HLA_Clicked) stats.actions = rs.GetUINTFieldValue(0); else ASSERT(0); rs.MoveNext(); } return TRUE; } return FALSE; } BOOL SQLManager::GetHistoryTrackStats(LPCTSTR Artist, LPCTSTR Track, SYSTEMTIME* startDate, SYSTEMTIME* endDate,//IN SQLManager::HistoryTrackStats& stats)//OUT { ASSERT(Artist!=NULL); ASSERT(Track!=NULL); if (Artist == NULL || Track == NULL) return FALSE; #ifdef _DEBUG if (startDate && endDate) { FILETIME ftStart; FILETIME ftEnd; SystemTimeToFileTime(startDate, &ftStart); SystemTimeToFileTime(endDate, &ftEnd); ASSERT(CompareFileTime(&ftStart, &ftEnd) == -1); } #endif std::tstring fartist(Artist); replace(fartist, _T("'"), _T("''")); std::tstring ftrack(Track); replace(ftrack, _T("'"), _T("''")); CString SQL; SQL.Format(_T("SELECT count(*), MIN(histLog.DateAdded), MAX(histLog.DateAdded) ") _T("FROM (histLog INNER JOIN HistTracks ON histlog.trackID = HistTracks.ID) ") _T("INNER JOIN HistArtists ON HistTracks.artID = HistArtists.ID ") _T("WHERE HistArtists.Name = '%s' AND HistTracks.Name = '%s' AND histLog.actID = 1"), fartist.c_str(), ftrack.c_str()); if (startDate != NULL) { SQL += _T(" AND HistLog.DateAdded >= "); TCHAR dateStr[100]; GetSQLDateForQueries(*startDate, dateStr, 100); SQL += dateStr; } if (endDate != NULL) { SQL += _T(" AND HistLog.DateAdded < "); TCHAR dateStr[100]; GetSQLDateForQueries(*endDate, dateStr, 100); SQL += dateStr; } ADORecordset rs(m_pDB); if (rs.Open(SQL) && !rs.IsEOF()) { stats.hits = rs.GetUINTFieldValue(0); if (stats.hits > 0) { stats.firstTime = rs.GetSYSTEMTIMEFieldValue(1); stats.lastTime = rs.GetSYSTEMTIMEFieldValue(2); SQL = _T("SELECT count(*) as Hits FROM HistLog WHERE actid=1 "); if (startDate) { SQL += _T(" AND HistLog.DateAdded >= "); TCHAR dateStr[100]; GetSQLDateForQueries(*startDate, dateStr, 100); SQL += dateStr; } if (endDate) { SQL += _T(" AND HistLog.DateAdded < "); TCHAR dateStr[100]; GetSQLDateForQueries(*endDate, dateStr, 100); SQL += dateStr; } SQL += _T(" GROUP BY trackID ORDER BY count(*) DESC"); ADORecordset rsRank(m_pDB); if (rsRank.Open(SQL)) { UINT rank = 0; while (!rsRank.IsEOF()) { stats.rank++; if (stats.hits == rsRank.GetUINTFieldValue(0)) break; rsRank.MoveNext(); } } } } return TRUE; } BOOL SQLManager::GetFullLogRecordCollection(FullHistLogRecordCollection& col, SYSTEMTIME* startDate/* = NULL*/, SYSTEMTIME* endDate /*= NULL*/, TCHAR* ArtistFilter /*= NULL*/, TCHAR* TrackFilter /*= NULL*/, HistoryLogActionsEnum actID /*= -1*/, UINT limitResults /*= 0*/) { std::tstring SQL(_T("SELECT ") _T("HistLog.ID, HistLog.actID, HistLog.DateAdded, HistLog.trackID, ") _T("HistTracks.ID, HistTracks.Name, HistTracks.artID, ") _T("HistArtists.ID, HistArtists.Name ") _T("FROM (HistArtists INNER JOIN HistTracks ON HistTracks.artID = HistArtists.ID) ") _T("INNER JOIN HistLog ON HistLog.trackID = Histtracks.ID ")); CString Where; DateMatch dm; if (startDate != NULL) { dm.match = DATM_After; dm.val = *startDate; AddSQLDateParameter(Where, dm, _T("HistLog.DateAdded")); } if (endDate != NULL) { dm.match = DATM_Before; dm.val = *endDate; AddSQLDateParameter(Where, dm, _T("HistLog.DateAdded")); } TextMatch tm; if (ArtistFilter != NULL) { tm.match = TXTM_Like; tm.val = ArtistFilter; AddSQLStrParameter(Where, tm, _T("HistArtists.Name")); } if (TrackFilter != NULL) { tm.match = TXTM_Like; tm.val = TrackFilter; AddSQLStrParameter(Where, tm, _T("HistTracks.Name")); } if (actID > HLA_Unknown && actID < HLA_Last) { NumericMatch nm; nm.match = NUMM_Exact; nm.val = actID; AddSQLNumParameter(Where, nm, _T("HistLog.actID")); } if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } ADORecordset rs(m_pDB); if (!rs.Open(SQL.c_str())) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { FullHistLogRecord* pRec = new FullHistLogRecord; short startIdx = 0; GetHistLogRecordFields(pRec->log, rs, startIdx); GetHistTrackRecordFields(pRec->track, rs, startIdx); GetHistArtistRecordFields(pRec->artist, rs, startIdx); col.push_back(FullHistLogRecordSP(pRec)); countResults++; if (countResults == limitResults) return TRUE; rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetFullHistTrackRecordCollection(FullHistTrackRecordCollection& col, SYSTEMTIME* startDate/* = NULL*/, SYSTEMTIME* endDate /*= NULL*/, TCHAR* ArtistFilter /*= NULL*/, TCHAR* TrackFilter /*= NULL*/, HistoryLogActionsEnum actID /*= -1*/, UINT limitResults /*= 0*/) { std::tstring SQL(_T("SELECT ") _T("max(HistTracks.ID), max(HistTracks.Name), max(HistTracks.artID), ") _T("max(HistArtists.ID), max(HistArtists.Name), ") _T("count(*) as Hits, min(HistLog.DateAdded) as FirstTime, max(HistLog.DateAdded) as LastTime ") _T("FROM (HistArtists INNER JOIN HistTracks ON HistTracks.artID = HistArtists.ID) ") _T("INNER JOIN HistLog ON HistLog.trackID = Histtracks.ID ")); CString Where; DateMatch dm; if (startDate != NULL) { dm.match = DATM_After; dm.val = *startDate; AddSQLDateParameter(Where, dm, _T("HistLog.DateAdded")); } if (endDate != NULL) { dm.match = DATM_Before; dm.val = *endDate; AddSQLDateParameter(Where, dm, _T("HistLog.DateAdded")); } TextMatch tm; if (ArtistFilter != NULL) { tm.match = TXTM_Like; tm.val = ArtistFilter; AddSQLStrParameter(Where, tm, _T("HistArtists.Name")); } if (TrackFilter != NULL) { tm.match = TXTM_Like; tm.val = TrackFilter; AddSQLStrParameter(Where, tm, _T("HistTracks.Name")); } if (actID > HLA_Unknown && actID < HLA_Last) { NumericMatch nm; nm.match = NUMM_Exact; nm.val = actID; AddSQLNumParameter(Where, nm, _T("HistLog.actID")); } if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } SQL += _T(" GROUP BY HistLog.TrackID"); ADORecordset rs(m_pDB); if (!rs.Open(SQL.c_str())) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { FullHistTrackRecord* pRec = new FullHistTrackRecord; short startIdx = 0; GetHistTrackRecordFields(pRec->track, rs, startIdx); GetHistArtistRecordFields(pRec->artist, rs, startIdx); pRec->hits = rs.GetUINTFieldValue(startIdx++); pRec->firstTime = rs.GetSYSTEMTIMEFieldValue(startIdx++); pRec->lastTime = rs.GetSYSTEMTIMEFieldValue(startIdx++); col.push_back(FullHistTrackRecordSP(pRec)); countResults++; if (countResults == limitResults) return TRUE; rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetFullHistArtistRecordCollection(FullHistArtistRecordCollection& col, SYSTEMTIME* startDate/* = NULL*/, SYSTEMTIME* endDate /*= NULL*/, TCHAR* ArtistFilter /*= NULL*/, TCHAR* TrackFilter /*= NULL*/, HistoryLogActionsEnum actID /*= 0*/, UINT limitResults /*= 0*/) { std::tstring SQL(_T("SELECT ") _T("max(HistArtists.ID), max(HistArtists.Name), ") _T("count(*) as Hits, min(HistLog.DateAdded) as FirstTime, max(HistLog.DateAdded) as LastTime ") _T("FROM (HistArtists INNER JOIN HistTracks ON HistTracks.artID = HistArtists.ID) ") _T("INNER JOIN HistLog ON HistLog.trackID = Histtracks.ID ")); CString Where; DateMatch dm; if (startDate != NULL) { dm.match = DATM_After; dm.val = *startDate; AddSQLDateParameter(Where, dm, _T("HistLog.DateAdded")); } if (endDate != NULL) { dm.match = DATM_Before; dm.val = *endDate; AddSQLDateParameter(Where, dm, _T("HistLog.DateAdded")); } TextMatch tm; if (ArtistFilter != NULL) { tm.match = TXTM_Like; tm.val = ArtistFilter; AddSQLStrParameter(Where, tm, _T("HistArtists.Name")); } if (TrackFilter != NULL) { tm.match = TXTM_Like; tm.val = TrackFilter; AddSQLStrParameter(Where, tm, _T("HistTracks.Name")); } if (actID > HLA_Unknown && actID < HLA_Last) { NumericMatch nm; nm.match = NUMM_Exact; nm.val = actID; AddSQLNumParameter(Where, nm, _T("HistLog.actID")); } if (!Where.IsEmpty()) { SQL += _T(" WHERE "); SQL += &((LPCTSTR)Where)[4]; } SQL += _T(" GROUP BY HistTracks.artID"); ADORecordset rs(m_pDB); if (!rs.Open(SQL.c_str())) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { FullHistArtistRecord* pRec = new FullHistArtistRecord; short startIdx = 0; GetHistArtistRecordFields(pRec->artist, rs, startIdx); pRec->hits = rs.GetUINTFieldValue(startIdx++); pRec->firstTime = rs.GetSYSTEMTIMEFieldValue(startIdx++); pRec->lastTime = rs.GetSYSTEMTIMEFieldValue(startIdx++); col.push_back(FullHistArtistRecordSP(pRec)); countResults++; if (countResults == limitResults) return TRUE; rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetHistTrackRankCollection(std::vector<Rank>& col) { std::tstring SQL(_T("SELECT hits, count(hits) ") _T("FROM (SELECT count(*) as Hits FROM HistLog WHERE actID = 1 GROUP BY TrackID) ") _T("GROUP BY hits ORDER by hits DESC")); ADORecordset rs(m_pDB); if (!rs.Open(SQL.c_str())) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { short startIdx = 0; Rank r; r.Hits = rs.GetUINTFieldValue(startIdx++); r.HitsCount = rs.GetUINTFieldValue(startIdx++); col.push_back(r); rs.MoveNext(); } return TRUE; } BOOL SQLManager::GetHistArtistRankCollection(std::vector<Rank>& col) { std::tstring SQL(_T("SELECT hits, count(hits) ") _T("FROM (SELECT count(*) as Hits FROM HistLog INNER JOIN HistTracks ON histLog.trackID=HistTracks.ID WHERE HistLog.actID = 1 GROUP BY HistTracks.artID) ") _T("GROUP BY hits ORDER by hits DESC")); ADORecordset rs(m_pDB); if (!rs.Open(SQL.c_str())) return FALSE; INT countResults = 0; while (!rs.IsEOF()) { short startIdx = 0; Rank r; r.Hits = rs.GetUINTFieldValue(startIdx++); r.HitsCount = rs.GetUINTFieldValue(startIdx++); col.push_back(r); rs.MoveNext(); } return TRUE; } //BOOL SQLManager::GetRandomTrackIDList(std::vector<UINT>& idList, // UINT numItems, RandomTrackModeEnum rtm, UINT rtmHelperID, UINT avoidID, UINT minRating) //{ // ASSERT(rtm >= RTM_All && rtm < RTM_Last); // ASSERT((rtm==RTM_All && rtmHelperID==0) || (rtm!=RTM_All && rtmHelperID!=0)); // TCHAR sql[1000]; // if (rtm != RTM_Newest) // { // LPCTSTR fieldName = _T("0"); // switch (rtm) // { // case RTM_Artist: // fieldName = _T("artID"); // break; // case RTM_Album: // fieldName = _T("albID"); // break; // case RTM_Genre: // fieldName = _T("genreID"); // break; // case RTM_Year: // fieldName = _T("year"); // break; // case RTM_Collection: // fieldName = _T("collectionID"); // break; // case RTM_All: // break; // default: // ASSERT(0); // } // _sntprintf(sql, 1000, _T("SELECT Tracks.ID From Tracks INNER JOIN Collections ON Tracks.collectionID = Collections.ID ") // _T("WHERE Tracks.ID<>%d AND Tracks.Rating >= %d AND (Collections.type=1 OR Collections.type=3) AND %s=%d"), avoidID, minRating, fieldName, rtmHelperID); // } // else // { // _sntprintf(sql, 1000, _T("SELECT TOP %d Tracks.ID From Tracks INNER JOIN Collections ON Tracks.collectionID = Collections.ID ") // _T("WHERE Tracks.ID<>%d AND Tracks.Rating >= %d AND (Collections.type=1 OR Collections.type=3) ORDER BY Tracks.DateAdded DESC"), rtmHelperID, avoidID, minRating); // } // // // ADORecordset rs(m_pDB); // if (rs.Open(sql) && !rs.IsEOF()) // { // UINT numTracks = 0; // ULONG ID = 0; // UINT count = rs.GetRecordCount(); // BOOL bAlreadyInResults = FALSE; // ULONG pos = 0; // ULONG startPos = 0; // while(numTracks < numItems) // { // if (!bAlreadyInResults) // { // pos = (rand() * count) / RAND_MAX + 1; // } // else // { // if (pos == startPos) // break;//There are no more results (we ve done the circle) // if (startPos == 0) // startPos = pos; // pos++; // if (pos == count + 1) // pos = 1; // } // //rs.SetAbsolutePosition(pos); // //rs->GetFieldValue(0, ID); // //std::vector<ULONG>::const_iterator it = IDs.begin(); // //bAlreadyInResults = FALSE; // //for (; it!= IDs.end(); it++) // //{ // // if (*it == ID) // // { // // bAlreadyInResults = TRUE; // // break; // // } // //} // //if (!bAlreadyInResults) // //{ // // startPos = 0;//Reset the flag // // IDs.push_back(ID); // // numTracks++; // //} // } // return count; // } // return 0; // //} // // BOOL SQLManager::EvaluateTrackInfo(InfoItemTypeEnum iit) { switch (iit) { case IIT_TrackLyrics: case IIT_TrackComment: case IIT_TrackPersonal: case IIT_TrackTablatures: return TRUE; } ASSERT(0); return FALSE; } BOOL SQLManager::EvaluateAlbumInfo(InfoItemTypeEnum iit) { switch (iit) { case IIT_AlbumReview: return TRUE; } ASSERT(0); return FALSE; } BOOL SQLManager::EvaluateArtistInfo(InfoItemTypeEnum iit) { switch (iit) { case IIT_ArtistBio: return TRUE; } ASSERT(0); return FALSE; } //----------------------------------------- //-----------GetInfoID //----------------------------------------- //UINT SQLManager::GetInfoID(LPCTSTR tblName, LPCTSTR fldName, UINT ID, InfoItemTypeEnum iit) //{ // ASSERT(tblName != NULL && ID != NULL); // TCHAR bf[1000]; // _sntprintf(bf, 1000, // _T("SELECT infoID FROM %s WHERE %s=%d AND type=%d"), tblName, fldName, ID, iit); // ADORecordset rs(m_pDB); // if (!rs.Open(bf)) // return 0; // INT countResults = 0; // if (!rs.IsEOF()) // return rs.GetUINTFieldValue(0); // return 0; //} // //UINT SQLManager::GetTrackInfoID(UINT trackID, InfoItemTypeEnum iit) //{ // ASSERT(trackID != 0); // if (!EvaluateTrackInfo(iit)) // return 0; // return GetInfoID(_T("tracksinfo"), _T("trackID"), trackID, iit); //} // //UINT SQLManager::GetAlbumInfoID(UINT albID, InfoItemTypeEnum iit) //{ // ASSERT(albID != 0); // if (!EvaluateAlbumInfo(iit)) // return 0; // return GetInfoID(_T("albumsinfo"), _T("albID"), albID, iit); //} // //UINT SQLManager::GetArtistInfoID(UINT artID, InfoItemTypeEnum iit) //{ // ASSERT(artID != 0); // if (!EvaluateArtistInfo(iit)) // return 0; // return GetInfoID(_T("artistsinfo"), _T("artID"), artID, iit); //} //----------------------------------------- //-----------AddNewInfo //----------------------------------------- BOOL SQLManager::AddNewInfo(LPCTSTR tblName, LPCTSTR fldName, UINT ID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(tblName != NULL && fldName != NULL && ID > 0 && info != NULL); if (info[0] == 0) return FALSE; ADORecordset rs(m_pDB); if (rs.Open(tblName, adOpenKeyset, adLockOptimistic, adCmdTable)) { rs.AddNew(); rs.SetVariantFieldValue(fldName, ID); rs.SetVariantFieldValue(_T("type"), iit); rs.SetVariantFieldValue(_T("name"), info); SYSTEMTIME st; GetLocalTime(&st); rs.SetSystemTimeFieldValue(_T("dateAdded"), st); return rs.Update(); } return FALSE; } BOOL SQLManager::AddNewTrackInfo(UINT trackID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(trackID != 0); ASSERT(info != NULL); if (!EvaluateTrackInfo(iit)) return FALSE; return AddNewInfo(_T("tracksinfo"), _T("trackid"), trackID, iit, info); } BOOL SQLManager::AddNewAlbumInfo(UINT albID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(albID != 0); ASSERT(info != NULL); if (!EvaluateAlbumInfo(iit)) return FALSE; return AddNewInfo(_T("albumsinfo"), _T("albid"), albID, iit, info); } BOOL SQLManager::AddNewArtistInfo(UINT artID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(artID != 0); ASSERT(info != NULL); if (!EvaluateArtistInfo(iit)) return FALSE; return AddNewInfo(_T("artistsinfo"), _T("artid"), artID, iit, info); } //----------------------------------------- //-----------UpdateInfo //----------------------------------------- BOOL SQLManager::UpdateTrackInfo(UINT trackID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(trackID != 0); ASSERT(info != NULL); if (!EvaluateTrackInfo(iit)) return FALSE; ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM tracksinfo WHERE trackID=%d AND type=%d"), trackID, iit); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); INT ret = rs.SetVariantFieldValue(_T("name"), info) ? 1 : 0; ASSERT(ret == 1); m_changes.info.updates++; return rs.Update(); } return FALSE; } BOOL SQLManager::UpdateAlbumInfo(UINT albID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(albID != 0); ASSERT(info != NULL); if (!EvaluateAlbumInfo(iit)) return FALSE; ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM albumsinfo WHERE albID=%d AND type=%d"), albID, iit); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); INT ret = rs.SetVariantFieldValue(_T("name"), info) ? 1 : 0; ASSERT(ret == 1); m_changes.info.updates++; return rs.Update(); } return FALSE; } BOOL SQLManager::UpdateArtistInfo(UINT artID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(artID != 0); ASSERT(info != NULL); if (!EvaluateArtistInfo(iit)) return FALSE; ADORecordset rs(m_pDB); TCHAR sql[200]; _sntprintf(sql, 200, _T("SELECT * FROM artistsinfo WHERE artID=%d AND type=%d"), artID, iit); if (rs.Open(sql, adOpenDynamic, adLockPessimistic, adCmdText) && !rs.IsEOF()) { rs.Edit(); INT ret = rs.SetVariantFieldValue(_T("name"), info) ? 1 : 0; ASSERT(ret == 1); m_changes.info.updates++; return rs.Update(); } return FALSE; } //----------------------------------------- //-----------DeleteInfo //----------------------------------------- BOOL SQLManager::DeleteTrackInfo(UINT trackID, InfoItemTypeEnum iit) { ASSERT(trackID != 0); if (!EvaluateTrackInfo(iit)) return FALSE; TCHAR sql[500]; _sntprintf(sql, 500, _T("DELETE FROM tracksinfo WHERE trackID=%d AND type=%d"), trackID, iit); return m_pDB->Execute(sql) != -1; } BOOL SQLManager::DeleteAlbumInfo(UINT albID, InfoItemTypeEnum iit) { ASSERT(albID != 0); if (!EvaluateAlbumInfo(iit)) return FALSE; TCHAR sql[500]; _sntprintf(sql, 500, _T("DELETE FROM albumsinfo WHERE albID=%d AND type=%d"), albID, iit); return m_pDB->Execute(sql) != -1; } BOOL SQLManager::DeleteArtistInfo(UINT artID, InfoItemTypeEnum iit) { ASSERT(artID != 0); if (!EvaluateArtistInfo(iit)) return FALSE; TCHAR sql[500]; _sntprintf(sql, 500, _T("DELETE FROM artistsinfo WHERE artID=%d AND type=%d"), artID, iit); return m_pDB->Execute(sql) != -1; } BOOL SQLManager::DeleteAllTrackInfo(UINT trackID) { return DeleteTrackInfo(trackID, IIT_TrackComment) && DeleteTrackInfo(trackID, IIT_TrackLyrics) && DeleteTrackInfo(trackID, IIT_TrackPersonal) && DeleteTrackInfo(trackID, IIT_TrackTablatures); } BOOL SQLManager::DeleteAllAlbumInfo(UINT albID) { return DeleteAlbumInfo(albID, IIT_AlbumReview); } BOOL SQLManager::DeleteAllArtistInfo(UINT artID) { return DeleteArtistInfo(artID, IIT_ArtistBio); } BOOL SQLManager::AdjustTrackInfo(UINT trackID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(trackID != 0); ASSERT(info != NULL); if (!EvaluateTrackInfo(iit)) return FALSE; InfoRecord ir; if (GetTrackInfoRecord(trackID, iit, ir)) { if (info[0] == NULL) return DeleteTrackInfo(trackID, iit); return UpdateTrackInfo(trackID, iit, info); } return AddNewTrackInfo(trackID, iit, info); } BOOL SQLManager::AdjustAlbumInfo(UINT albID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(albID != 0); if (!EvaluateAlbumInfo(iit)) return FALSE; InfoRecord ir; if (GetAlbumInfoRecord(albID, iit, ir)) { if (info[0] == NULL) return DeleteAlbumInfo(albID, iit); return UpdateAlbumInfo(albID, iit, info); } return AddNewAlbumInfo(albID, iit, info); } BOOL SQLManager::AdjustArtistInfo(UINT artID, InfoItemTypeEnum iit, LPCTSTR info) { ASSERT(artID != 0); if (!EvaluateArtistInfo(iit)) return FALSE; InfoRecord ir; if (GetArtistInfoRecord(artID, iit, ir)) { if (info[0] == NULL) return DeleteArtistInfo(artID, iit); return UpdateArtistInfo(artID, iit, info); } return AddNewArtistInfo(artID, iit, info); } BOOL SQLManager::GetTrackInfoRecord(UINT trackID, InfoItemTypeEnum iit, InfoRecord& ir) { ASSERT(trackID != 0); if (!EvaluateTrackInfo(iit)) return FALSE; TCHAR sql[1000]; _sntprintf(sql, 1000, _T("SELECT ID, name, dateadded FROM TracksInfo WHERE trackID=%d AND Type=%d"), trackID, iit); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { ir.ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, ir.name); ir.dateAdded = rs.GetSYSTEMTIMEFieldValue(2); return TRUE; } return FALSE; } BOOL SQLManager::GetAlbumInfoRecord(UINT albID, InfoItemTypeEnum iit, InfoRecord& ir) { ASSERT(albID != 0); if (!EvaluateAlbumInfo(iit)) return FALSE; TCHAR sql[1000]; _sntprintf(sql, 1000, _T("SELECT ID, name, dateadded FROM AlbumsInfo WHERE albID=%d AND Type=%d"), albID, iit); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { ir.ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, ir.name); ir.dateAdded = rs.GetSYSTEMTIMEFieldValue(2); return TRUE; } return FALSE; } BOOL SQLManager::GetArtistInfoRecord(UINT artID, InfoItemTypeEnum iit, InfoRecord& ir) { ASSERT(artID != 0); if (!EvaluateArtistInfo(iit)) return FALSE; TCHAR sql[1000]; _sntprintf(sql, 1000, _T("SELECT ID, name, dateadded FROM artistsInfo WHERE artID=%d AND Type=%d"), artID, iit); ADORecordset rs(m_pDB); if (rs.Open(sql, adOpenForwardOnly, adLockReadOnly, adCmdText) && !rs.IsEOF()) { ir.ID = rs.GetUINTFieldValue(0); rs.GetStringFieldValue(1, ir.name); ir.dateAdded = rs.GetSYSTEMTIMEFieldValue(2); return TRUE; } return FALSE; } UINT SQLManager::GetTrackInfoFlags(UINT trackID) { TCHAR bf[1000]; _sntprintf(bf, 200, _T("SELECT type FROM tracksinfo WHERE trackID=%d"), trackID); UINT flags = TRF_NoFlags; ADORecordset rs(m_pDB); if (!rs.Open(bf)) return flags; while (!rs.IsEOF()) { switch (rs.GetUINTFieldValue(0)) { case IIT_TrackComment: flags |= TRF_HasComments; break; case IIT_TrackLyrics: flags |= TRF_HasLyrics; break; case IIT_TrackPersonal: flags |= TRF_HasPersonal; break; case IIT_TrackTablatures: flags |= TRF_HasTablatures; break; } rs.MoveNext(); } return flags; } bool UDgreater(SQLManager::ValuedID& elem1, SQLManager::ValuedID& elem2) { return elem1.value > elem2.value; } BOOL SQLManager::GetSimilarArtists(std::vector<ValuedID>& col, UINT artistID, INT maxTagsToExamine, INT maxArtistsPerGenreToExamine) { ASSERT(artistID != 0); ADORecordset rs(m_pDB); TCHAR sql[1000]; _sntprintf(sql, 1000, _T("SELECT genreID,count(*) ") _T("FROM tracks ") _T("WHERE tracks.artID=%d AND tracks.genreID>1 ") _T("GROUP BY tracks.genreID ") _T("ORDER BY count(*) DESC"), artistID ); if (!rs.Open(sql)) return FALSE; INT tagSearch = 0; ADORecordset rsArt(m_pDB); ADORecordset rsArtTrackCount(m_pDB); while (!rs.IsEOF()) { tagSearch++; if (tagSearch > maxTagsToExamine)//===LIMIT THE TAG SEARCHING break; UINT genID = rs.GetUINTFieldValue(0); UINT traCount = rs.GetUINTFieldValue(1); _sntprintf(sql, 1000, _T("SELECT artID,count(*) ") _T("FROM tracks ") _T("WHERE genreID=%d AND artID<>%d ") _T("GROUP BY artID ") _T("ORDER BY count(*) DESC"), genID, artistID ); if (rsArt.Open(sql)) { INT artSearch = 0; const INT maxArtSearch = 5; while (!rsArt.IsEOF()) { artSearch++; if (artSearch > maxArtistsPerGenreToExamine)//===LIMIT THE TAG SEARCHING break; UINT artID = rsArt.GetUINTFieldValue(0); UINT count = rsArt.GetUINTFieldValue(1); std::vector<ValuedID>::iterator it = col.begin(); BOOL bFound = FALSE; _sntprintf(sql, 1000, _T("SELECT count(*) FROM tracks WHERE artID=%d"), artID ); INT artistTrackCount = count; if (rsArtTrackCount.Open(sql) && !rsArtTrackCount.IsEOF()) artistTrackCount = rsArtTrackCount.GetUINTFieldValue(0); DOUBLE value = (traCount * count) / (DOUBLE)artistTrackCount; for (; it != col.end(); it++) { if (it->ID == artID) { it->value += value; bFound = TRUE; it->appearanceCount++; break; } } if (bFound == FALSE) col.push_back(ValuedID(artID, value)); rsArt.MoveNext(); } } rs.MoveNext(); } std::sort(col.begin(), col.end(), UDgreater); return TRUE; }
[ "outcast1000@dc1b949e-fa36-4f9e-8e5c-de004ec35678" ]
[ [ [ 1, 4770 ] ] ]
5b27093bd04d26c65d429c9854127e6ef9f2e266
c86338cfb9a65230aa7773639eb8f0a3ce9d34fd
/Geometry/MNVector3.h
5e436f63d3a9165abca20e9f17fe94e56bc52faf
[]
no_license
jonike/mnrt
2319fb48d544d58984d40d63dc0b349ffcbfd1dd
99b41c3deb75aad52afd0c315635f1ca9b9923ec
refs/heads/master
2021-08-24T05:52:41.056070
2010-12-03T18:31:24
2010-12-03T18:31:24
113,554,148
0
0
null
null
null
null
UTF-8
C++
false
false
10,840
h
//////////////////////////////////////////////////////////////////////////////////////////////////// // MNRT License //////////////////////////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2010 Mathias Neumann, www.maneumann.com. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation and/or // other materials provided with the distribution. // // 3. Neither the name Mathias Neumann, nor the names of contributors may be // used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// /// \file Geometry\MNVector3.h /// /// \brief Declares the MNVector3 class and global utility functions for vectors. /// \author Mathias Neumann /// \date 06.02.2010 /// \ingroup Geometry //////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef __MN_VECTOR3_H__ #define __MN_VECTOR3_H__ #pragma once #include <math.h> #include "../MNUtilities.h" class MNNormal3; //////////////////////////////////////////////////////////////////////////////////////////////////// /// \class MNVector3 /// /// \brief Three-dimensional floating point vector class. /// /// Modelled after \ref lit_pharr "[Pharr and Humphreys 2004]". /// /// \warning Do not add members or change member order as the current order ensures /// casting to CUDA compatible structs works. /// /// \author Mathias Neumann /// \date 06.02.2010 //////////////////////////////////////////////////////////////////////////////////////////////////// class MNVector3 { public: /// Default constructor. MNVector3(float _x=0, float _y=0, float _z=0) : x(_x), y(_y), z(_z) { } /// Explicit conversion from a normal. explicit MNVector3(const MNNormal3& n); ~MNVector3(void) {} // Data members public: /// x-coordinate of vector. float x; /// y-coordinate of vector. float y; /// z-coordinate of vector. float z; // Operators public: /// Vector addition operator. MNVector3 operator+(const MNVector3& v) const { return MNVector3(x + v.x, y + v.y, z + v.z); } /// Vector addition assignment operator. MNVector3& operator+=(const MNVector3& v) { x += v.x; y += v.y; z += v.z; return *this; } /// Vector subtraction operator. MNVector3 operator-(const MNVector3& v) const { return MNVector3(x - v.x, y - v.y, z - v.z); } /// Vector subtraction assignment operator. MNVector3& operator-=(const MNVector3& v) { x -= v.x; y -= v.y; z -= v.z; return *this; } /// Vector negation operator. MNVector3 operator-() const { return MNVector3(-x, -y, -z); } /// Vector scaling (by scalar) operator. MNVector3 operator*(float f) const { return MNVector3(f*x, f*y, f*z); } /// Vector scaling (by scalar) assignment operator. MNVector3& operator*=(float f) { x *= f; y *= f; z *= f; return *this; } /// Vector division (by scalar) operator. MNVector3 operator/(float f) const { MNAssert(f != 0); float inv = 1.f / f; return MNVector3(x*inv, y*inv, z*inv); } /// Vector division (by scalar) assignment operator. MNVector3& operator/=(float f) { MNAssert(f != 0); float inv = 1.f / f; x *= inv; y *= inv; z *= inv; return *this; } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn float operator[](int i) const /// /// \brief Component-wise access operator. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param i Component index. Has to be 0, 1 or 2. /// /// \return The component (as constant value). //////////////////////////////////////////////////////////////////////////////////////////////////// float operator[](int i) const { MNAssert(i >= 0 && i < 3); return (&x)[i]; } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn float& operator[](int i) /// /// \brief Component-wise access operator. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param i Component index. Has to be 0, 1 or 2. /// /// \return The component (as reference). //////////////////////////////////////////////////////////////////////////////////////////////////// float& operator[](int i) { MNAssert(i >= 0 && i < 3); return (&x)[i]; } public: /// Computes the squared length of the vector. Might be used to avoid the square root operation. float LengthSquared() const { return x*x + y*y + z*z; } /// Computes the length of this vector. Includes square root operation. float Length() const { return sqrtf(LengthSquared()); } }; //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn inline MNVector3 operator*(float f, const MNVector3& v) /// /// \brief Scaling of a vector \a v by a scalar \a f from the left side. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param f The scalar. /// \param v The vector. /// /// \return The scaled vector. //////////////////////////////////////////////////////////////////////////////////////////////////// inline MNVector3 operator*(float f, const MNVector3& v) { return v * f; } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn inline MNVector3 Normalize(const MNVector3& v) /// /// \brief Normalizes the given vector \a v and returns the result. /// /// \warning This is no inplace operation! /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param v The vector. /// /// \return Normalized vector. //////////////////////////////////////////////////////////////////////////////////////////////////// inline MNVector3 Normalize(const MNVector3& v) { return v / v.Length(); } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn inline float Dot(const MNVector3& v1, const MNVector3& v2) /// /// \brief Calculates the dot product (inner product, scalar product) between two vectors \a v1 /// and \a v2. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param v1 The first vector. /// \param v2 The second vector. /// /// \return Dot product between the two vectors. //////////////////////////////////////////////////////////////////////////////////////////////////// inline float Dot(const MNVector3& v1, const MNVector3& v2) { return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn inline float AbsDot(const MNVector3& v1, const MNVector3& v2) /// /// \brief Computes the dot product of \a v1 and \a v2 and takes the absolute value of the /// result. It is therefore a composition of \a fabsf() and ::Dot. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param v1 The first vector. /// \param v2 The second vector. /// /// \return Absolute dot produkt of the two vectors. //////////////////////////////////////////////////////////////////////////////////////////////////// inline float AbsDot(const MNVector3& v1, const MNVector3& v2) { return fabsf(Dot(v1, v2)); } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn inline MNVector3 Cross(const MNVector3& v1, const MNVector3& v2) /// /// \brief Determines the cross product of two vectors /a v1 and /a v2. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param v1 The first vector. /// \param v2 The second vector. /// /// \return The cross product. //////////////////////////////////////////////////////////////////////////////////////////////////// inline MNVector3 Cross(const MNVector3& v1, const MNVector3& v2) { return MNVector3((v1.y * v2.z) - (v1.z * v2.y), (v1.z * v2.x) - (v1.x * v2.z), (v1.x * v2.y) - (v1.y * v2.x)); } //////////////////////////////////////////////////////////////////////////////////////////////////// /// \fn inline void CoordinateSystem(const MNVector3& v1, MNVector3* pV2, MNVector3* pV3) /// /// \brief Coordinate system construction from a single vector. Two additional vectors are /// generated to create a valid orthogonal coordinate system with \a v1 and the two /// generated vectors \a pV2 and \a pV3 as coordinate axes. /// /// \author Mathias Neumann /// \date 06.02.2010 /// /// \param v1 Input vector. /// \param [out] pV2 Second generated vector of the coordinate system. /// \param [out] pV3 Third generated vector of the coordinate system. //////////////////////////////////////////////////////////////////////////////////////////////////// inline void CoordinateSystem(const MNVector3& v1, MNVector3* pV2, MNVector3* pV3) { // Compute second vector by zeroing one component and swapping the others. if(fabsf(v1.x) > fabsf(v1.y)) { float invLength = 1.f / sqrtf(v1.x * v1.x + v1.z * v1.z); *pV2 = MNVector3(-v1.z * invLength, 0.f, v1.x * invLength); } else { float invLength = 1.f / sqrtf(v1.y * v1.y + v1.z * v1.z); *pV2 = MNVector3(0.f, v1.z * invLength, -v1.y * invLength); } *pV3 = Cross(v1, *pV2); } #endif // __MN_VECTOR3_H__
[ [ [ 1, 316 ] ] ]
839af618e500d8ebbaa5732c5c61562964602d02
6581dacb25182f7f5d7afb39975dc622914defc7
/WinsockLab/Hostentgethostbyname/hostentgethostbynamesrc.cpp
5f9b26b973be3a4a9c7bd87d00912931ce6fe30f
[]
no_license
dice2019/alexlabonline
caeccad28bf803afb9f30b9e3cc663bb2909cc4f
4c433839965ed0cff99dad82f0ba1757366be671
refs/heads/master
2021-01-16T19:37:24.002905
2011-09-21T15:20:16
2011-09-21T15:20:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,183
cpp
// Link to ws2_32.lib #include <winsock2.h> #include <ws2tcpip.h> #include <stdio.h> int main(int argc, char **argv) { // Declare and initialize variables WSADATA wsaData; DWORD dwError; int i = 0; struct hostent *remoteHost; char *host_name; struct in_addr addr; char **pAlias; // Validate the parameters if (argc != 2) { printf("Usage: %s ipv4address\n", argv[0]); printf(" or\n"); printf(" %s hostname\n", argv[0]); printf(" to return the host\n"); printf(" %s 127.0.0.1\n", argv[0]); printf(" to return the IP addresses for a host\n"); printf(" %s www.google.com\n", argv[0]); return 1; } // Initialize Winsock if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { printf("WSAStartup() failed with error code %d\n", WSAGetLastError()); return 1; } else printf("WSAStartup() should be fine!\n"); host_name = argv[1]; // If the user input is an alpha name for the host, use gethostbyname() // If not, get host by addr (assume IPv4) if (isalpha(host_name[0])) { // host address is a name printf("Calling gethostbyname() with %s\n", host_name); remoteHost = gethostbyname(host_name); } else { printf("Calling gethostbyaddr() with %s\n", host_name); addr.s_addr = inet_addr(host_name); if (addr.s_addr == INADDR_NONE) { printf("The IPv4 address entered must be a legal address!\n"); return 1; } else remoteHost = gethostbyaddr((char *) &addr, 4, AF_INET); } if (remoteHost == NULL) { dwError = WSAGetLastError(); if (dwError != 0) { if (dwError == WSAHOST_NOT_FOUND) { printf("Host not found!\n"); return 1; } else if (dwError == WSANO_DATA) { printf("No data record found!\n"); return 1; } else { printf("Function failed with error code %ld\n", dwError); return 1; } } } else { printf("Function returned:\n"); printf("\tOfficial name: %s\n", remoteHost->h_name); for (pAlias = remoteHost->h_aliases; *pAlias != 0; pAlias++) { printf("\tAlternate name #%d: %s\n", ++i, *pAlias); } printf("\tAddress type: "); switch (remoteHost->h_addrtype) { case AF_INET: printf("AF_INET\n"); break; case AF_INET6: printf("AF_INET6\n"); break; case AF_NETBIOS: printf("AF_NETBIOS\n"); break; default: printf(" %d\n", remoteHost->h_addrtype); break; } printf("\tAddress length: %d\n", remoteHost->h_length); i = 0; while (remoteHost->h_addr_list[i] != 0) { addr.s_addr = *(u_long *) remoteHost->h_addr_list[i++]; printf("\tIP Address #%d: %s\n", i, inet_ntoa(addr)); } } return 0; }
[ "damoguyan8844@3a4e9f68-f5c2-36dc-e45a-441593085838" ]
[ [ [ 1, 120 ] ] ]
19cd137a047554b78a8b7827d7c1236c19aa8ac2
c5534a6df16a89e0ae8f53bcd49a6417e8d44409
/trunk/Dependencies/Xerces/include/xercesc/internal/XMLInternalErrorHandler.hpp
e144c5fb10bf4f279bae6450ade2d98392a6a16a
[]
no_license
svn2github/ngene
b2cddacf7ec035aa681d5b8989feab3383dac012
61850134a354816161859fe86c2907c8e73dc113
refs/heads/master
2023-09-03T12:34:18.944872
2011-07-27T19:26:04
2011-07-27T19:26:04
78,163,390
2
0
null
null
null
null
UTF-8
C++
false
false
4,237
hpp
/* * Copyright 2001,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. */ /* * $Id: XMLInternalErrorHandler.hpp 191054 2005-06-17 02:56:35Z jberry $ */ #if !defined(XMLINTERNALERRORHANDLER_HPP) #define XMLINTERNALERRORHANDLER_HPP #include <xercesc/util/XercesDefs.hpp> #include <xercesc/sax/ErrorHandler.hpp> XERCES_CPP_NAMESPACE_BEGIN class XMLInternalErrorHandler : public ErrorHandler { public: // ----------------------------------------------------------------------- // Constructors and Destructor // ----------------------------------------------------------------------- XMLInternalErrorHandler(ErrorHandler* userHandler = 0) : fSawWarning(false), fSawError(false), fSawFatal(false), fUserErrorHandler(userHandler) { } ~XMLInternalErrorHandler() { } // ----------------------------------------------------------------------- // Implementation of the error handler interface // ----------------------------------------------------------------------- void warning(const SAXParseException& toCatch); void error(const SAXParseException& toCatch); void fatalError(const SAXParseException& toCatch); void resetErrors(); // ----------------------------------------------------------------------- // Getter methods // ----------------------------------------------------------------------- bool getSawWarning() const; bool getSawError() const; bool getSawFatal() const; // ----------------------------------------------------------------------- // Private data members // // fSawWarning // This is set if we get any warning, and is queryable via a getter // method. // // fSawError // This is set if we get any errors, and is queryable via a getter // method. // // fSawFatal // This is set if we get any fatal, and is queryable via a getter // method. // // fUserErrorHandler // This is the error handler from user // ----------------------------------------------------------------------- bool fSawWarning; bool fSawError; bool fSawFatal; ErrorHandler* fUserErrorHandler; private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLInternalErrorHandler(const XMLInternalErrorHandler&); XMLInternalErrorHandler& operator=(const XMLInternalErrorHandler&); }; inline bool XMLInternalErrorHandler::getSawWarning() const { return fSawWarning; } inline bool XMLInternalErrorHandler::getSawError() const { return fSawError; } inline bool XMLInternalErrorHandler::getSawFatal() const { return fSawFatal; } inline void XMLInternalErrorHandler::warning(const SAXParseException& toCatch) { fSawWarning = true; if (fUserErrorHandler) fUserErrorHandler->warning(toCatch); } inline void XMLInternalErrorHandler::error(const SAXParseException& toCatch) { fSawError = true; if (fUserErrorHandler) fUserErrorHandler->error(toCatch); } inline void XMLInternalErrorHandler::fatalError(const SAXParseException& toCatch) { fSawFatal = true; if (fUserErrorHandler) fUserErrorHandler->fatalError(toCatch); } inline void XMLInternalErrorHandler::resetErrors() { fSawWarning = false; fSawError = false; fSawFatal = false; } XERCES_CPP_NAMESPACE_END #endif
[ "Riddlemaster@fdc6060e-f348-4335-9a41-9933a8eecd57" ]
[ [ [ 1, 138 ] ] ]
38d399d5dd6e0b96930403ee1c8c16e6f20e49ee
1c9f99b2b2e3835038aba7ec0abc3a228e24a558
/Projects/elastix/elastix_sources_v4/src/Components/ImageSamplers/RandomCoordinate/elxRandomCoordinateSampler.h
865f0fe3dda0898a2551d79af2edee850c903633
[]
no_license
mijc/Diploma
95fa1b04801ba9afb6493b24b53383d0fbd00b33
bae131ed74f1b344b219c0ffe0fffcd90306aeb8
refs/heads/master
2021-01-18T13:57:42.223466
2011-02-15T14:19:49
2011-02-15T14:19:49
1,369,569
0
0
null
null
null
null
UTF-8
C++
false
false
8,631
h
/*====================================================================== This file is part of the elastix software. Copyright (c) University Medical Center Utrecht. All rights reserved. See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. ======================================================================*/ #ifndef __elxRandomCoordinateSampler_h #define __elxRandomCoordinateSampler_h #include "itkImageRandomCoordinateSampler.h" #include "elxIncludes.h" namespace elastix { using namespace itk; /** * \class RandomCoordinateSampler * \brief An interpolator based on the itk::ImageRandomCoordinateSampler. * * This image sampler randomly samples 'NumberOfSamples' coordinates in * the InputImageRegion. If a mask is given, the sampler tries to find * samples within the mask. If the mask is very sparse, this may take some time. * The RandomCoordinate sampler samples not only positions that correspond * to voxels, but also positions between voxels. An interpolator for the fixed image is thus * required. A B-spline interpolator is used, the order of which can be specified * by the user. Typically, the RandomCoordinate gives a smoother cost function, * because the so-called 'grid-effect' is avoided. * * This sampler is suitable to used in combination with the * NewSamplesEveryIteration parameter (defined in the elx::OptimizerBase). * * The parameters used in this class are: * \parameter ImageSampler: Select this image sampler as follows:\n * <tt>(ImageSampler "RandomCoordinate")</tt> * \parameter NumberOfSpatialSamples: The number of image voxels used for computing the * metric value and its derivative in each iteration. Must be given for each resolution.\n * example: <tt>(NumberOfSpatialSamples 2048 2048 4000)</tt> \n * The default is 5000. * \parameter UseRandomSampleRegion: Defines whether to randomly select a subregion of the image * in each iteration. When set to "true", also specify the SampleRegionSize. * By setting this option to "true", in combination with the NewSamplesEveryIteration parameter, * a "localised" similarity measure is obtained. This can give better performance in case * of the presence of large inhomogeneities in the image, for example.\n * example: <tt>(UseRandomSampleRegion "true")</tt>\n * Default: false. * \parameter SampleRegionSize: the size of the subregions that are selected when using * the UseRandomSampleRegion option. The size should be specified in mm, for each dimension. * As a rule of thumb, you may try a value ~1/3 of the image size.\n * example: <tt>(SampleRegionSize 50.0 50.0 50.0)</tt>\n * You can also specify one number, which will be used for all dimensions. Also, you * can specify different values for each resolution:\n * example: <tt>(SampleRegionSize 50.0 50.0 50.0 30.0 30.0 30.0)</tt>\n * In this example, in the first resolution 50mm is used for each of the 3 dimensions, * and in the second resolution 30mm.\n * Default: sampleRegionSize[i] = min ( fixedImageSize[i], max_i ( fixedImageSize[i]/3 ) ), * with fixedImageSize in mm. So, approximately 1/3 of the fixed image size. * \parameter FixedImageBSplineInterpolationOrder: When using a RandomCoordinate sampler, * the fixed image needs to be interpolated. This is done using a B-spline interpolator. * With this option you can specify the order of interpolation.\n * example: <tt>(FixedImageBSplineInterpolationOrder 0 0 1)</tt>\n * Default value: 1. The parameter can be specified for each resolution. * * \ingroup ImageSamplers */ template < class TElastix > class RandomCoordinateSampler : public ImageRandomCoordinateSampler< ITK_TYPENAME elx::ImageSamplerBase<TElastix>::InputImageType >, public elx::ImageSamplerBase<TElastix> { public: /** Standard ITK-stuff. */ typedef RandomCoordinateSampler Self; typedef ImageRandomCoordinateSampler< typename elx::ImageSamplerBase<TElastix>::InputImageType > Superclass1; typedef elx::ImageSamplerBase<TElastix> Superclass2; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro( RandomCoordinateSampler, ImageRandomCoordinateSampler ); /** Name of this class. * Use this name in the parameter file to select this specific interpolator. \n * example: <tt>(ImageSampler "RandomCoordinate")</tt>\n */ elxClassNameMacro( "RandomCoordinate" ); /** Typedefs inherited from the superclass. */ typedef typename Superclass1::DataObjectPointer DataObjectPointer; typedef typename Superclass1::OutputVectorContainerType OutputVectorContainerType; typedef typename Superclass1::OutputVectorContainerPointer OutputVectorContainerPointer; typedef typename Superclass1::InputImageType InputImageType; typedef typename Superclass1::InputImagePointer InputImagePointer; typedef typename Superclass1::InputImageConstPointer InputImageConstPointer; typedef typename Superclass1::InputImageRegionType InputImageRegionType; typedef typename Superclass1::InputImagePixelType InputImagePixelType; typedef typename Superclass1::ImageSampleType ImageSampleType; typedef typename Superclass1::ImageSampleContainerType ImageSampleContainerType; typedef typename Superclass1::MaskType MaskType; typedef typename Superclass1::InputImageIndexType InputImageIndexType; typedef typename Superclass1::InputImagePointType InputImagePointType; typedef typename Superclass1::InputImageSizeType InputImageSizeType; typedef typename Superclass1::InputImageSpacingType InputImageSpacingType; typedef typename Superclass1::InputImagePointValueType InputImagePointValueType; typedef typename Superclass1::ImageSampleValueType ImageSampleValueType; /** This image sampler samples the image on physical coordinates and thus * needs an interpolator. */ typedef typename Superclass1::CoordRepType CoordRepType; typedef typename Superclass1::InterpolatorType InterpolatorType; typedef typename Superclass1::DefaultInterpolatorType DefaultInterpolatorType; /** The input image dimension. */ itkStaticConstMacro( InputImageDimension, unsigned int, Superclass1::InputImageDimension ); /** Typedefs inherited from Elastix. */ typedef typename Superclass2::ElastixType ElastixType; typedef typename Superclass2::ElastixPointer ElastixPointer; typedef typename Superclass2::ConfigurationType ConfigurationType; typedef typename Superclass2::ConfigurationPointer ConfigurationPointer; typedef typename Superclass2::RegistrationType RegistrationType; typedef typename Superclass2::RegistrationPointer RegistrationPointer; typedef typename Superclass2::ITKBaseType ITKBaseType; /** Execute stuff before each resolution: * \li Set the number of samples. * \li Set the fixed image interpolation order * \li Set the UseRandomSampleRegion flag and the SampleRegionSize */ virtual void BeforeEachResolution(void); protected: /** The constructor. */ RandomCoordinateSampler() {} /** The destructor. */ virtual ~RandomCoordinateSampler() {} private: /** The private constructor. */ RandomCoordinateSampler( const Self& ); // purposely not implemented /** The private copy constructor. */ void operator=( const Self& ); // purposely not implemented }; // end class RandomCoordinateSampler } // end namespace elastix #ifndef ITK_MANUAL_INSTANTIATION #include "elxRandomCoordinateSampler.hxx" #endif #endif // end #ifndef __elxRandomCoordinateSampler_h
[ [ [ 1, 174 ] ] ]
41c5663b728d45e57228f329051259dd2b3a09f4
59ce53af7ad5a1f9b12a69aadbfc7abc4c4bfc02
/src/SkinResEditor/SkinResDialogView.h
366ddce9a0149584544bf61974233e1b34cf2101
[]
no_license
fingomajom/skinengine
444a89955046a6f2c7be49012ff501dc465f019e
6bb26a46a7edac88b613ea9a124abeb8a1694868
refs/heads/master
2021-01-10T11:30:51.541442
2008-07-30T07:13:11
2008-07-30T07:13:11
47,892,418
0
0
null
null
null
null
GB18030
C++
false
false
29,588
h
/******************************************************************** * CreatedOn: 2008-2-17 12:25 * FileName: SkinResDialogView.h * CreatedBy: lidengwang <[email protected]> * $LastChangedDate$ * $LastChangedRevision$ * $LastChangedBy$ * $HeadURL: $ * Purpose: *********************************************************************/ #include "SkinControlsMgt.h" #include "SkinResWndDefProperty.h" #include "SkinDialgPreviewWindow.h" #include "SkinUpDownDlg.h" #include "SkinItemIdMgt.h" class SkinResDialogView : public CDialogImpl<SkinResDialogView>, public SkinTreeItemControl, public SkinPropertyView::PropertyEditNotify { public: enum { em_itemid_begin = 1000 }; int m_ndialogindex; int m_nNewItemId; HTREEITEM m_hTreeItem; CTreeViewCtrl m_wndTree; CComboBox m_wndComboBox; CButton m_wndAddBtn; CButton m_wndDelBtn; SkinUpDownDlg m_wndUpdown; SkinDialgPreviewWindow m_wndPreView; HTREEITEM m_hLastSelItem; CImageList m_imagelist; SkinDialogRes& GetResDialog() { SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); static SkinDialogRes null; if (m_ndialogindex < 0 || m_ndialogindex >= (int)ControlsMgt.m_resDocument.m_resDialogDoc.m_vtDialogList.size()) return null; return ControlsMgt.m_resDocument.m_resDialogDoc.m_vtDialogList[m_ndialogindex]; } SkinResDialogView(int ndialogindex) : m_ndialogindex(ndialogindex), m_hTreeItem(NULL) { m_nNewItemId = em_itemid_begin; } ~SkinResDialogView() { if (m_wndPreView.IsWindow()) m_wndPreView.DestroyWindow(); if (m_wndUpdown.IsWindow()) m_wndUpdown.DestroyWindow(); } public: virtual void InitResult(HTREEITEM hTreeItem) { m_hTreeItem = hTreeItem; SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); if (m_hWnd == NULL) { Create(ControlsMgt.m_piSkinFrame->GetResultParentWnd()); } m_wndTree.DeleteAllItems(); SkinDialogRes& dialogRes = GetResDialog(); if (dialogRes.m_dlgWndProperty.m_vtPropertyList.size() == 0) { SkinResWndDefProperty::GetResClassWndDefProperty( KSGUI::CString(), dialogRes.m_dlgWndProperty); dialogRes.m_dlgWndProperty.SetProperty(_T("IdName"), dialogRes.m_dlgWndProperty.GetIdName()); dialogRes.m_dlgWndProperty.SetProperty(_T("Width") , _T("200")); dialogRes.m_dlgWndProperty.SetProperty(_T("Height"), _T("150")); dialogRes.m_dlgWndProperty.SetProperty(_T("Style") , _T("0x5c0a0000")); dialogRes.m_dlgWndProperty.SetProperty(_T("Font"), _T("宋体,GB2312_CHARSET,9,1,400,0")); } m_wndTree.InsertItem( dialogRes.m_dlgWndProperty.GetIdName(), 2, 2, TVI_ROOT, TVI_LAST); for (size_t i = 0; i < dialogRes.m_vtChildWndList.size(); i++) { HTREEITEM hInsertItem = m_wndTree.InsertItem( dialogRes.m_vtChildWndList[i].GetIdName(), 3, 3, m_wndTree.GetRootItem(), TVI_LAST); m_wndTree.SetItemData(hInsertItem, i); ////////////////////////////////////////////////////////////////////////// KSGUI::CString strItemId; if (!dialogRes.m_vtChildWndList[i].GetProperty(_T("ItemId"), strItemId)) continue; SkinItemIdMgt::instance().UsedItemId( dialogRes.m_vtChildWndList[i].GetIdName(), strItemId); //std::map<KSGUI::CString, KSGUI::CString>::const_iterator iter = // m_mapUsedIdName.find(dialogRes.m_vtChildWndList[i].GetIdName()); //if (iter == m_mapUsedIdName.end()) //{ // m_mapUsedIdName[dialogRes.m_vtChildWndList[i].GetIdName()] = strItemId; //} //else if (strItemId != iter->second) //{ // // error //} ////////////////////////////////////////////////////////////////////////// } std::vector<KSGUI::CString> vtClassName; SkinResWndDefProperty::GetDefClassNameList(vtClassName); for (size_t i = 0; i < vtClassName.size(); i++) { m_wndComboBox.AddString(vtClassName[i]); } m_wndTree.Expand(m_wndTree.GetRootItem()); } virtual void ShowResult(HTREEITEM hTreeItem, LPARAM lParam) { SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); m_wndTree.SetItemText(m_wndTree.GetRootItem(), GetResDialog().m_dlgWndProperty.GetIdName()); CreatePreviewWindow(); SkinHookMouse::instance().m_hHookWindow = m_wndPreView; //m_wndUpdown.ShowWindow(SW_SHOW); m_wndTree.SelectItem(m_wndTree.GetRootItem()); ShowWindow(SW_SHOW); m_wndPreView.ShowWindow(SW_SHOWDEFAULT); ControlsMgt.m_piSkinFrame->SetActiveResultWindow(m_hWnd); } virtual void HideResult(HTREEITEM hTreeItem, LPARAM lParam) { SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); ControlsMgt.m_skinResPropertyView.Clear(); SkinHookMouse::instance().m_hHookWindow = NULL; SkinHookMouse::instance().m_bHookKey = FALSE; m_wndTree.SelectItem(NULL); m_wndPreView.m_wndSelectFlag.ShowWindow(SW_HIDE); m_wndUpdown.ShowWindow(SW_HIDE); m_wndPreView.ShowWindow(SW_HIDE); ShowWindow(SW_HIDE); } enum { IDD = IDD_EDITDLG_DIALOG }; void CreatePreviewWindow() { SkinXmlElement xmlElement; m_wndPreView.ReCreatePreviewWindow(GetDlgItem(IDC_REVIEW_STATIC), GetResDialog()); SkinHookMouse::instance().m_hHookWindow = m_wndPreView; } BEGIN_MSG_MAP(SkinResDialogListView) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) MESSAGE_HANDLER(WM_SIZE , OnSize) MESSAGE_HANDLER(WM_USER_KEYDOWN , OnUserKeyDown) MESSAGE_HANDLER(WM_SELECTCHILDWINDOW, OnSelectWindow) COMMAND_HANDLER(IDC_ADD , BN_CLICKED, OnAdd) COMMAND_HANDLER(IDC_DELETE, BN_CLICKED, OnDel) COMMAND_HANDLER(IDC_UP_BUTTON , BN_CLICKED, OnUp) COMMAND_HANDLER(IDC_DOWN_BUTTON, BN_CLICKED, OnDown) NOTIFY_CODE_HANDLER( TVN_SELCHANGED, OnSelChanged) END_MSG_MAP() int GetNextItemId() { int nResult = 0; SkinDialogRes& dialogRes = GetResDialog(); std::vector<SkinWndPropertyList>& vtChildWndList = dialogRes.m_vtChildWndList; KSGUI::CString strItemIdNew; KSGUI::CString strItemId; KSGUI::CString strIDName; for ( ; true; m_nNewItemId++ ) { strItemIdNew.Format(_T("%d") , m_nNewItemId); strIDName.Format(_T("IDN_%d"), m_nNewItemId); BOOL bUsed = FALSE; for ( size_t i = 0; i < vtChildWndList.size(); i++ ) { if (!strIDName.CompareNoCase(vtChildWndList[i].GetIdName())) { bUsed = TRUE; break; } if (!vtChildWndList[i].GetProperty(_T("ItemId"), strItemId) ) continue; if (!strItemIdNew.CompareNoCase(strItemId)) { bUsed = TRUE; break; } } if (!bUsed) { nResult = m_nNewItemId; break; } } return nResult; } int GetItemIndex(HTREEITEM hTreeItem) { int nResult = -1; while (hTreeItem != NULL) { hTreeItem = m_wndTree.GetPrevSiblingItem(hTreeItem); nResult++; } return nResult; } LRESULT OnAdd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { TCHAR szBuffer[MAX_PATH] = { 0 }; m_wndComboBox.GetWindowText(szBuffer, MAX_PATH); if ( ( szBuffer[0] >= '0' && szBuffer[0] <= '9' ) || _tcslen(szBuffer) <= 0) // 不合法的项名 { return TRUE; } SkinDialogRes& dialogRes = GetResDialog(); SkinWndPropertyList WndProperty; SkinResWndDefProperty::GetResClassWndDefProperty( szBuffer, WndProperty); int nNewItemId = GetNextItemId(); KSGUI::CString strItemId; strItemId.Format(_T("%d"), nNewItemId); WndProperty.GetIdName().Format(_T("IDN_%d"), nNewItemId); ////////////////////////////////////////////////////////////////////////// SkinItemIdMgt::instance().UsedItemId( WndProperty.GetIdName(), strItemId); //std::map<KSGUI::CString, KSGUI::CString>::const_iterator iter = // m_mapUsedIdName.find(WndProperty.GetIdName()); //if (iter != m_mapUsedIdName.end()) //{ // strItemId = iter->second; //} //else //{ // m_mapUsedIdName[WndProperty.GetIdName()] = strItemId; //} ////////////////////////////////////////////////////////////////////////// WndProperty.SetProperty(_T("IdName"), WndProperty.GetIdName()); WndProperty.SetProperty(_T("SkinClassName"), szBuffer); WndProperty.SetProperty(_T("ItemId"), strItemId); KSGUI::CString strStyle; KSGUI::CString strExStyle; SkinResWndDefProperty::GetWndStyle(szBuffer, strStyle); SkinResWndDefProperty::GetWndExStyle(szBuffer, strExStyle); WndProperty.SetProperty(_T("Style"), strStyle); WndProperty.SetProperty(_T("ExStyle"), strExStyle); dialogRes.m_vtChildWndList.push_back(WndProperty); HTREEITEM hInsertItem = m_wndTree.InsertItem( WndProperty.GetIdName(), 3, 3, m_wndTree.GetRootItem(), TVI_LAST); m_wndTree.SetItemData(hInsertItem, dialogRes.m_vtChildWndList.size() - 1); TVITEM tvItem; tvItem.mask = TVIF_CHILDREN ; tvItem.hItem = m_wndTree.GetRootItem(); m_wndTree.GetItem(&tvItem); tvItem.cChildren = TRUE; m_wndTree.SetItem(&tvItem); SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); ControlsMgt.m_resDocument.Modify(TRUE); m_wndPreView.AddSkinWindow(WndProperty); m_wndTree.SelectItem(hInsertItem); return TRUE; } LRESULT OnDel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); HTREEITEM hTreeItem = m_wndTree.GetSelectedItem(); if (hTreeItem == m_wndTree.GetRootItem()) return TRUE; int nindex = GetItemIndex(hTreeItem); if (nindex >= 0) { SkinDialogRes& dialogRes = GetResDialog(); ATLASSERT((size_t)nindex < dialogRes.m_vtChildWndList.size()); m_wndPreView.DelSkinWindow(dialogRes.m_vtChildWndList[nindex]) ; KSGUI::CString strIdName = dialogRes.m_vtChildWndList[nindex].GetIdName(); dialogRes.m_vtChildWndList.erase( dialogRes.m_vtChildWndList.begin() + nindex); SkinItemIdMgt::instance().DelItemId( strIdName ); //if (!ControlsMgt.m_resDocument.m_resDialogDoc.IsChildIdNameExists(strIdName)) // m_mapUsedIdName.erase(strIdName); m_wndTree.DeleteItem(hTreeItem); SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); ControlsMgt.m_resDocument.Modify(TRUE); //CreatePreviewWindow(); return TRUE; } return TRUE; } LRESULT OnSelChanged(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/) { LPNMTREEVIEW pNMTV = reinterpret_cast<LPNMTREEVIEW>(pNMHDR); LRESULT lResult = DefWindowProc(); SkinDialogRes& dialogRes = GetResDialog(); m_hLastSelItem = pNMTV->itemNew.hItem; SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); ControlsMgt.m_skinResPropertyView.Clear(); ControlsMgt.m_skinResPropertyView.SetPropertyEditNotify(this); if (m_hLastSelItem != NULL) { std::vector<SkinWndPropertyList::WndPropertyItem>* pPropertyList = NULL; if (m_hLastSelItem == m_wndTree.GetRootItem()) { pPropertyList = &dialogRes.m_dlgWndProperty.m_vtPropertyList; m_wndPreView.ClearSelectWindow(); MoveUpdownWindow(-1); } else { int nindex = (int)GetItemIndex(m_hLastSelItem); ATLASSERT(nindex >= 0 && nindex < (int)dialogRes.m_vtChildWndList.size()); pPropertyList = &dialogRes.m_vtChildWndList[nindex].m_vtPropertyList; KSGUI::CString strClassName; dialogRes.m_vtChildWndList[nindex].GetProperty(_T("SkinClassName") , strClassName); m_wndComboBox.SetWindowText(strClassName); m_wndPreView.SelectWindow(dialogRes.m_vtChildWndList[nindex]); MoveUpdownWindow(nindex); } ATLASSERT(pPropertyList != NULL); for (size_t i = 0; i < pPropertyList->size(); i++) { int ntype = SkinResWndDefProperty::GetResWndPropertyEditType((*pPropertyList)[i].strProperty); if (m_hLastSelItem == m_wndTree.GetRootItem()) { if (!_tcscmp((*pPropertyList)[i].strProperty, _T("IdName"))) { ntype = SkinPropertyView::it_readonly; } else if (!_tcscmp((*pPropertyList)[i].strProperty, _T("Font"))) { ntype = SkinPropertyView::it_button; } } ControlsMgt.m_skinResPropertyView.AppendProperty( (*pPropertyList)[i].strProperty, (*pPropertyList)[i].strValue, ntype); } } return lResult; } void MoveUpdownWindow(int index) { if (index < 0) { m_wndUpdown.ShowWindow(SW_HIDE); return; } int nheight = m_wndTree.GetItemHeight(); RECT rcClient = { 0 }; m_wndTree.GetClientRect(&rcClient); ClientToScreen(&rcClient); rcClient.top += ( (index + 1) * nheight); rcClient.bottom = rcClient.top + 20; rcClient.left = rcClient.right - 20; m_wndUpdown.MoveWindow(&rcClient); m_wndUpdown.ShowWindow(SW_SHOW); } LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { if (m_wndTree.m_hWnd != NULL) { RECT rcClient = { 0 }; RECT rcTree = { 0 }; RECT rcComboBox = { 0 }; RECT rcAddBtn = { 0 }; RECT rcDelBtn = { 0 }; RECT rcStatic = { 0 }; GetClientRect(&rcClient); m_wndTree.GetClientRect(&rcTree); rcTree.bottom = rcClient.bottom - 50; rcTree.right = 160; rcComboBox = rcTree; rcComboBox.top = rcComboBox.bottom + 2; rcComboBox.bottom = rcComboBox.top + 22; rcAddBtn = rcComboBox; rcAddBtn.top = rcAddBtn.bottom + 2; rcAddBtn.bottom = rcAddBtn.top + 22; rcAddBtn.left += 2; rcAddBtn.right = (rcAddBtn.left + rcAddBtn.right) / 2 + 1; rcDelBtn = rcAddBtn; rcDelBtn.left = rcAddBtn.right + 2; rcDelBtn.right = rcTree.right - 2; rcStatic = rcClient; rcStatic.left = rcTree.right + 2; m_wndTree.MoveWindow(&rcTree); m_wndComboBox.MoveWindow(&rcComboBox); m_wndAddBtn.MoveWindow(&rcAddBtn); m_wndDelBtn.MoveWindow(&rcDelBtn); GetDlgItem(IDC_REVIEW_STATIC).MoveWindow(&rcStatic); } m_wndPreView.UpdateSelectFlag(); return DefWindowProc(); } LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { m_wndTree = GetDlgItem(IDC_WND_TREE); m_wndComboBox = GetDlgItem(IDC_COMBO); m_wndAddBtn = GetDlgItem(IDC_ADD); m_wndDelBtn = GetDlgItem(IDC_DELETE); CBitmap bmp; bmp.LoadBitmap(IDB_RESTYPE_BITMAP); m_imagelist.Create(16, 16, ILC_COLOR24 | ILC_MASK, 3, 1); m_imagelist.Add(bmp, RGB(255, 0, 255)); m_wndTree.SetImageList(m_imagelist); if (!m_wndUpdown.IsWindow()) { m_wndUpdown.Create(m_hWnd); m_wndUpdown.m_hWndParent = m_hWnd; } return TRUE; } LRESULT OnSelectWindow(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) { LPCTSTR lpIdName = (LPCTSTR)wParam; if (lpIdName == NULL) m_wndTree.SelectItem(m_wndTree.GetRootItem()); else { HTREEITEM hTreeItem = m_wndTree.GetChildItem(m_wndTree.GetRootItem()); size_t index = 0; SkinDialogRes& dialogRes = GetResDialog(); while (hTreeItem != NULL) { if (index >= dialogRes.m_vtChildWndList.size()) break; if (!dialogRes.m_vtChildWndList[index].GetIdName().CollateNoCase(lpIdName)) { m_wndTree.SelectItem(hTreeItem); break; } index++; hTreeItem = m_wndTree.GetNextSiblingItem(hTreeItem); } } return TRUE; } void OnValueChange ( LPCTSTR pszPropertyName, LPCTSTR pszOldValue, LPCTSTR pszNewValue) { SkinDialogRes& dialogRes = GetResDialog(); HTREEITEM hTreeItem = m_wndTree.GetSelectedItem(); if (hTreeItem == m_wndTree.GetRootItem()) { UpdateWndProperty(dialogRes.m_dlgWndProperty, pszPropertyName, pszOldValue, pszNewValue); CreatePreviewWindow(); } else { int nindex = GetItemIndex(hTreeItem); UpdateWndProperty(dialogRes.m_vtChildWndList[nindex], pszPropertyName, pszOldValue, pszNewValue); } } void UpdateWndProperty( SkinWndPropertyList& WndPropertyList, LPCTSTR pszPropertyName, LPCTSTR pszOldValue, LPCTSTR pszNewValue) { SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); SkinDialogRes& dialogRes = GetResDialog(); if ( !_tcscmp(pszPropertyName, _T("IdName") ) ) { if ( _tcslen(pszNewValue) <= _tcslen(_T("IDN_")) || _tcsncmp(pszNewValue, _T("IDN_"), _tcslen(_T("IDN_")) ) ) // 不合法的项名 { ControlsMgt.m_skinResPropertyView.SetProperty(_T("IdName"), pszOldValue); KSGUI::CString strMsg; strMsg.Format( _T("[%s]不是合法的项名\n必顺以 IDN_ 开头的字符串。"), pszNewValue); MessageBox(strMsg, _T("错误")); return; } if (&WndPropertyList != &dialogRes.m_dlgWndProperty) { for ( size_t i = 0; i < dialogRes.m_vtChildWndList.size(); i++ ) { if ( !dialogRes.m_vtChildWndList[i].GetIdName().CollateNoCase(pszNewValue) ) // 不合法的项名 { ControlsMgt.m_skinResPropertyView.SetProperty(_T("IdName"), pszOldValue); KSGUI::CString strMsg; strMsg.Format( _T("[%s]项名已存在。请输入其它的名称。"), pszNewValue); MessageBox(strMsg, _T("错误")); return; } } m_wndPreView.DelSkinWindow( WndPropertyList ); } m_wndTree.SetItemText( m_wndTree.GetSelectedItem(), pszNewValue); WndPropertyList.GetIdName() = pszNewValue; WndPropertyList.SetProperty( pszPropertyName, pszNewValue ); if (&WndPropertyList != &dialogRes.m_dlgWndProperty) { m_wndPreView.AddSkinWindow(WndPropertyList); ////////////////////////////////////////////////////////////////////////// KSGUI::CString strItemId; WndPropertyList.GetProperty(_T("ItemId"), strItemId); KSGUI::CString strUsedItemId = strItemId; SkinItemIdMgt::instance().UsedItemId( WndPropertyList.GetIdName(), strUsedItemId); if (strUsedItemId != strItemId) { WndPropertyList.SetProperty( _T("ItemId"), strUsedItemId ); ControlsMgt.m_skinResPropertyView.SetProperty(_T("ItemId"), strUsedItemId); } SkinItemIdMgt::instance().DelItemId( pszOldValue ); //std::map<KSGUI::CString, KSGUI::CString>::const_iterator iter = // m_mapUsedIdName.find(WndPropertyList.GetIdName()); //if (iter != m_mapUsedIdName.end()) //{ // WndPropertyList.SetProperty( _T("ItemId"), iter->second ); // ControlsMgt.m_skinResPropertyView.SetProperty(_T("ItemId"), // iter->second); //} //else //{ // KSGUI::CString strItemId; // WndPropertyList.GetProperty(_T("ItemId"), strItemId); // // m_mapUsedIdName[WndPropertyList.GetIdName()] = strItemId; //} //if (!ControlsMgt.m_resDocument.m_resDialogDoc.IsChildIdNameExists(pszOldValue)) // m_mapUsedIdName.erase(pszOldValue); ////////////////////////////////////////////////////////////////////////// } return; } else if ( !_tcscmp(pszPropertyName, _T("ItemId") ) ) { SkinItemIdMgt::instance().ChangeItemId( WndPropertyList.GetIdName(), pszNewValue); } WndPropertyList.SetProperty( pszPropertyName, pszNewValue ); m_wndPreView.UpdateSkinWindow(WndPropertyList); } void OnButtonClieck(LPCTSTR pszPropertyName) { SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); HTREEITEM hTreeItem = m_wndTree.GetSelectedItem(); if (hTreeItem != m_wndTree.GetRootItem()) return; if ( !_tcscmp(pszPropertyName, _T("Font")) ) { KSGUI::CString strOldFont; TCHAR szNewBuffer[1024] = { 0 }; GetResDialog().m_dlgWndProperty.GetProperty(_T("Font"), strOldFont); LOGFONT logFont = { 0 }; KSGUI::skinxmlfont xmlfont; (KSGUI::CString&)xmlfont = (strOldFont); xmlfont >> logFont; CFontDialog fontdlg(&logFont); if (fontdlg.DoModal() != IDOK) return ; logFont.lfHeight = fontdlg.GetSize() / 10; xmlfont << logFont; if (!_tcscmp(strOldFont, xmlfont)) return ; ControlsMgt.m_skinResPropertyView.SetProperty(_T("Font"), xmlfont); OnValueChange(pszPropertyName, strOldFont, xmlfont); return ; } } LRESULT OnUp(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { return 0L; } LRESULT OnDown(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { return 0L; } LRESULT OnUserKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/) { if ( wParam == VK_LEFT || wParam == VK_RIGHT || wParam == VK_UP || wParam == VK_DOWN ) { HTREEITEM hTreeItem = m_wndTree.GetSelectedItem(); if (hTreeItem == NULL || hTreeItem == m_wndTree.GetRootItem()) return 1L; SkinDialogRes& dialogRes = GetResDialog(); SkinControlsMgt& ControlsMgt = SkinControlsMgt::Instance(); int nindex = GetItemIndex(hTreeItem); SkinWndPropertyList& WndProperty = dialogRes.m_vtChildWndList[nindex]; KSGUI::CString strLeft; KSGUI::CString strTop; KSGUI::CString strWidth; KSGUI::CString strHeight; WndProperty.GetProperty(_T("Left"), strLeft); WndProperty.GetProperty(_T("Top") , strTop); WndProperty.GetProperty(_T("Width"), strWidth); WndProperty.GetProperty(_T("Height"), strHeight); int nleft = _ttoi(strLeft); int ntop = _ttoi(strTop); int nwidth = _ttoi(strWidth); int nheight = _ttoi(strHeight); char bShiftState = ( GetKeyState(VK_SHIFT) >> 8 ) & 0x01; char bControlState = ( GetKeyState(VK_CONTROL) >> 8) & 0x01; int nstep = bControlState ? 1 : 5; switch(wParam) { case VK_LEFT: if (!bShiftState) { nleft -= nstep; nleft = nleft > 0 ? nleft : 0; nleft = nleft / nstep * nstep; } else { nwidth -= nstep; nwidth = nwidth > 0 ? nwidth : 0; nwidth = nwidth / nstep * nstep; } break; case VK_UP: if (!bShiftState) { ntop -= nstep; ntop = ntop > 0 ? ntop : 0; ntop = ntop / nstep * nstep; } else { nheight -= nstep; nheight = nheight > 0 ? nheight : 0; nheight = nheight / nstep * nstep; } break; case VK_RIGHT: if (!bShiftState) { nleft += nstep; nleft = nleft > 0 ? nleft : 0; nleft = nleft / nstep * nstep; } else { nwidth += nstep; nwidth = nwidth > 0 ? nwidth : 0; nwidth = nwidth / nstep * nstep; } break; case VK_DOWN: if (!bShiftState) { ntop += nstep; ntop = ntop > 0 ? ntop : 0; ntop = ntop / nstep * nstep; } else { nheight += nstep; nheight = nheight > 0 ? nheight : 0; nheight = nheight / nstep * nstep; } break; } strLeft.Format(_T("%d"), nleft); strTop.Format(_T("%d"), ntop); strWidth.Format(_T("%d"), nwidth); strHeight.Format(_T("%d"), nheight); WndProperty.SetProperty(_T("Left"), strLeft); WndProperty.SetProperty(_T("Top") , strTop); WndProperty.SetProperty(_T("Width"), strWidth); WndProperty.SetProperty(_T("Height"), strHeight); ControlsMgt.m_skinResPropertyView.SetProperty(_T("Left"), strLeft); ControlsMgt.m_skinResPropertyView.SetProperty(_T("Top"), strTop); ControlsMgt.m_skinResPropertyView.SetProperty(_T("Width"), strWidth); ControlsMgt.m_skinResPropertyView.SetProperty(_T("Height"), strHeight); m_wndPreView.UpdateSkinWindow(WndProperty); } return 1L; } };
[ [ [ 1, 974 ] ] ]
eb11c67c9a9ab5de2f40ef6e2f120c3410683887
e3a67b819e6c8072ea587f070214c2c075b2dee3
/IntegratedImpedanceSensingSystem/abstractexperimentdlg.h
b0bac7ff079358c1b6d42cacad7041c5142a73cb
[]
no_license
pmanandhar1452/ImpedanceSensingSystem
46f32a57d3c19ebc011c539746fab5facf5e0c71
0c4a0472c75f280857d549630fabb881c452e791
refs/heads/master
2021-01-17T16:43:17.019071
2011-11-15T01:40:45
2011-11-15T01:40:45
62,420,080
0
0
null
null
null
null
UTF-8
C++
false
false
456
h
#ifndef ABSTRACTEXPERIMENTDLG_H #define ABSTRACTEXPERIMENTDLG_H #include <QDialog> #include <QList> #include "Measurement.h" class AbstractExperimentDlg : public QDialog { Q_OBJECT public: explicit AbstractExperimentDlg(QWidget *parent = 0); virtual QList<ImpedanceMeasurement> * getImpMeasurement(); protected: QList<ImpedanceMeasurement> impMsmt; signals: public slots: }; #endif // ABSTRACTEXPERIMENTDLG_H
[ "jaa_saaymi@d83832b1-3638-4858-8a38-9f153b6b3474" ]
[ [ [ 1, 24 ] ] ]
a3081abf2efccddcd7832dac1949c26a8aea993e
7eee2f0c30e5efc9216c1d3f3b97fa61fc2f3095
/VirtualAlvinn/Alvinn.h
1647f049d2798a159d8bd1ad7c2aa74bbe4448d2
[ "MIT" ]
permissive
jsj2008/VirtualAlvinn
5d01658d1c3d9692067380408c317ee84d316f84
1300c2940366247b5f656c68ac4dc4193870a3fd
refs/heads/master
2021-01-20T23:52:07.560481
2011-11-19T19:23:57
2011-11-19T19:23:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,763
h
#ifndef ALVINN_H #define ALVINN_H #define GL_SGIX_fragment_lighting #include <SDL.h> #include <SDL_opengl.h> #include "World.h" #include <fann.h> #include <fann_cpp.h> class Alvinn { private: World world; World::CameraType camType; int screenWidth, screenHeight; int camTextureWidth, camTextureHeight; GLuint camTexture; GLuint depthRenderBuffer; GLuint fbo; FANN::neural_net ann; FANN::training_data td; enum DRIVER { D_HUMAN, D_ANN } driver; btClock clock;//clock to control samples per second int maxSamples;//maximum number of samples to capture (the size of the input and output arrays) int numSamples;//current number of samples captured int numInputs;//number of elements in each entry in the input array (camTextureWidth*camTextureHeight) int numOutputs;//number of elements in each entry in the output array (steering, throttle, brake) int samplingRate;//number of samples to capture per second bool sample;//whether to capture samples(true) or not(false) fann_type** input; fann_type** output; SDL_Joystick* joystick; void InitializeJoystick();//sets joystick to the first joystick found if any, NULL otherwise void CheckErrors();//verifies whether any sdl/opengl error ocurred during the main loop and output them int HandleEvent(const SDL_Event& event); void ANNDrive(fann_type* input); void RenderFBO(); void RenderScreen(); void RenderRobotCamera(); void ToggleCapture(); void TrainANN(); void ToggleDriver(); public: Alvinn();//sets up basic config ~Alvinn(); int Initialize();//initialize stuff including SDL and OpenGL. Retuns 0 on error, other values otherwise void Run(); }; float Luminance(unsigned int abgr); #endif
[ [ [ 1, 66 ] ] ]
979fdb030a920c78df383df4bb02fa61d5dc4886
08f7bb3d26daa5a62b6f994138601182de953550
/ancient-slave-ship/Light.h
db08947830109217afecbb4f98aff9d0afdffbc7
[]
no_license
geordieboy83/ancient-slave-ship
da8d7a6cf3b8650d7cb89de296c119c5be7eee98
1eb684e40fdeb4f1295b55572b7d17ebb98ca7f1
refs/heads/master
2020-05-04T04:23:15.386391
2011-05-23T16:19:53
2011-05-23T16:19:53
39,701,081
0
0
null
null
null
null
UTF-8
C++
false
false
179
h
using namespace std; #pragma once #include <GL\glew.h> #include <GL\glfw.h> #include <vector> #include "DoubletsAndTriplets.h" class Light { public: protected: };
[ [ [ 1, 13 ] ] ]
dd71fc42b29888d0da04bf0aa2ac058a6aee6ec0
221e3e713891c951e674605eddd656f3a4ce34df
/core/OUE/Event.cpp
8217d495e68b9bea1ed80fbd35f2592b3422ec0e
[ "MIT" ]
permissive
zacx-z/oneu-engine
da083f817e625c9e84691df38349eab41d356b76
d47a5522c55089a1e6d7109cebf1c9dbb6860b7d
refs/heads/master
2021-05-28T12:39:03.782147
2011-10-18T12:33:45
2011-10-18T12:33:45
null
0
0
null
null
null
null
GB18030
C++
false
false
2,470
cpp
/* This source file is part of OneU Engine. Copyright (c) 2011 Ladace Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "Event.h" namespace OneU { namespace event { //无参数事件 //广播事件 //广播对象接收到的事件 /* ----------------------------------------------------------------------------*/ /** * @brief 进入一帧的时候被广播 * * 在场景更新之前。 */ /* ----------------------------------------------------------------------------*/ const wchar* ENTER_FRAME = L"enter frame"; /* ----------------------------------------------------------------------------*/ /** * @brief 窗口被激活时被广播 */ /* ----------------------------------------------------------------------------*/ const wchar* WINDOW_ACTIVE = L"wnd active"; /* ----------------------------------------------------------------------------*/ /** * @brief 窗口失去焦点时被广播 */ /* ----------------------------------------------------------------------------*/ const wchar* WINDOW_DEACTIVE = L"wnd deactive"; /* ----------------------------------------------------------------------------*/ /** * @brief 游戏对象被销毁时被广播 * * 在场景销毁之后,各种系统销毁之前。 * @sa section_run */ /* ----------------------------------------------------------------------------*/ const wchar* DESTROY = L"destroy"; } }
[ "[email protected]@d30a3831-f586-b1a3-add9-2db6dc386f9c" ]
[ [ [ 1, 61 ] ] ]
6e9c8eba2346a06232c5b03a1990c4d772f39090
b8fbe9079ce8996e739b476d226e73d4ec8e255c
/src/engine/rb_render8/dxutils.cpp
6d0922c31b5d140451667ad187222c2dac212b65
[]
no_license
dtbinh/rush
4294f84de1b6e6cc286aaa1dd48cf12b12a467d0
ad75072777438c564ccaa29af43e2a9fd2c51266
refs/heads/master
2021-01-15T17:14:48.417847
2011-06-16T17:41:20
2011-06-16T17:41:20
41,476,633
1
0
null
2015-08-27T09:03:44
2015-08-27T09:03:44
null
UTF-8
C++
false
false
5,381
cpp
//****************************************************************************/ // File: DXUtils.cpp // Desc: //****************************************************************************/ #include "stdafx.h" #include "DXUtils.h" D3DCOLORVALUE ConvertColor( DWORD col ) { D3DCOLORVALUE res; res.a = float( (col & 0xFF000000)>>24 ) / 255.0f; res.r = float( (col & 0x00FF0000)>>16 ) / 255.0f; res.g = float( (col & 0x0000FF00)>>8 ) / 255.0f; res.b = float( (col & 0x000000FF) ) / 255.0f; return res; } // ConvertColor const char* GetDXError( HRESULT hresult ) { switch (hresult) { case D3DERR_CONFLICTINGRENDERSTATE: return "The currently set render states cannot be used together."; case D3DERR_CONFLICTINGTEXTUREFILTER: return "The current texture filters cannot be used together."; case D3DERR_CONFLICTINGTEXTUREPALETTE: return "The current textures cannot be used simultaneously."; case D3DERR_DEVICELOST: return "The device is lost and cannot be restored at the current time." "Rendering is not possible."; case D3DERR_DEVICENOTRESET: return "The device cannot be reset."; case D3DERR_DRIVERINTERNALERROR: return "Internal driver error."; case D3DERR_INVALIDCALL: return "The method call is invalid. " "Method's parameter may have an invalid value."; case D3DERR_INVALIDDEVICE: return "The requested device type is not valid."; case D3DERR_MOREDATA: return "There is more data available than the specified buffer size can hold."; case D3DERR_NOTAVAILABLE: return "This device does not support the queried technique."; case D3DERR_NOTFOUND: return "The requested item was not found."; case D3DERR_OUTOFVIDEOMEMORY: return "Direct3D does not have enough display memory to perform the operation."; case D3DERR_TOOMANYOPERATIONS: return "The application is requesting more texture-filtering operations " "than the device supports."; case D3DERR_UNSUPPORTEDALPHAARG: return "The device does not support a specified texture-blending argument " "for the alpha channel."; case D3DERR_UNSUPPORTEDALPHAOPERATION: return "The device does not support a specified texture-blending operation " "for the alpha channel."; case D3DERR_UNSUPPORTEDCOLORARG: return "The device does not support a specified texture-blending argument " "for color values."; case D3DERR_UNSUPPORTEDCOLOROPERATION: return "The device does not support a specified texture-blending operation " "for color values."; case D3DERR_UNSUPPORTEDFACTORVALUE: return "The device does not support the specified texture factor value."; case D3DERR_UNSUPPORTEDTEXTUREFILTER: return "The device does not support the specified texture filter."; case D3DERR_WRONGTEXTUREFORMAT: return "The pixel format of the texture surface is not valid."; case E_FAIL: return "An undetermined error occurred inside the Direct3D subsystem."; case E_INVALIDARG: return "An invalid parameter was passed to the returning function."; case E_OUTOFMEMORY: return "Direct3D could not allocate sufficient memory to complete the call."; default: return ""; } return ""; } // GetDXError DWORD CreateFVF( const VertexDeclaration& vdecl ) { DWORD fvf = 0; for (int i = 0; i < vdecl.m_NElements; i++) { switch (vdecl.m_Element[i].m_Usage) { case VertexComponent_Position : fvf |= D3DFVF_XYZ; break; case VertexComponent_PositionRHW : fvf |= D3DFVF_XYZRHW; break; case VertexComponent_Blend0 : fvf |= D3DFVF_XYZB1; break; case VertexComponent_Blend1 : fvf |= D3DFVF_XYZB2; fvf &= ~D3DFVF_XYZB1; break; case VertexComponent_Blend2 : fvf |= D3DFVF_XYZB3; fvf &= ~D3DFVF_XYZB2; break; case VertexComponent_Blend3 : fvf |= D3DFVF_XYZB4; fvf &= ~D3DFVF_XYZB3; break; case VertexComponent_BlendIdx : fvf |= D3DFVF_LASTBETA_UBYTE4; break; case VertexComponent_Normal : fvf |= D3DFVF_NORMAL; break; case VertexComponent_Diffuse : fvf |= D3DFVF_DIFFUSE; break; case VertexComponent_Specular : fvf |= D3DFVF_SPECULAR; break; case VertexComponent_TexCoor0 : fvf |= D3DFVF_TEX1; break; case VertexComponent_TexCoor1 : fvf |= D3DFVF_TEX2; fvf &= ~D3DFVF_TEX1; break; case VertexComponent_TexCoor2 : fvf |= D3DFVF_TEX3; fvf &= ~D3DFVF_TEX2; break; case VertexComponent_TexCoor3 : fvf |= D3DFVF_TEX4; fvf &= ~D3DFVF_TEX3; break; case VertexComponent_TexCoor4 : fvf |= D3DFVF_TEX5; fvf &= ~D3DFVF_TEX4; break; case VertexComponent_TexCoor5 : fvf |= D3DFVF_TEX6; fvf &= ~D3DFVF_TEX5; break; case VertexComponent_TexCoor6 : fvf |= D3DFVF_TEX7; fvf &= ~D3DFVF_TEX6; break; case VertexComponent_TexCoor7 : fvf |= D3DFVF_TEX8; fvf &= ~D3DFVF_TEX7; break; } } return fvf; } // CreateVDecl
[ [ [ 1, 111 ] ] ]
56744b5381fb9d5424f45dbef76c464e71ce2be4
2ff4099407bd04ffc49489f22bd62996ad0d0edd
/Project/Code/inc/BlurTexture.h
66b576556a11091409e1b2dc5b497c88349df1ec
[]
no_license
willemfrishert/imagebasedrendering
13687840a8e5b37a38cc91c3c5b8135f9c1881f2
1cb9ed13b820b791a0aa2c80564dc33fefdc47a2
refs/heads/master
2016-09-10T15:23:42.506289
2007-06-04T11:52:13
2007-06-04T11:52:13
32,184,690
0
1
null
null
null
null
UTF-8
C++
false
false
2,265
h
#pragma once #include "Basic.h" #include "FrameBufferObject.h" #include "ShaderProgram.h" #include "ShaderObject.h" #include "ShaderUniformValue.h" const int KNumberOfBlurLevels = 4; const int KNumberOfBlurShaders = 1; class BlurTexture { public: BlurTexture(); ~BlurTexture(); void processData(GLuint aProcessTex, GLuint* aBlurredTextures); private: enum TTextureSize { ETextureSize512 = 512, ETextureSize256 = 256, ETextureSize128 = 128, ETextureSize64 = 64, ETextureSize32 = 32, ETextureSize16 = 16, ETextureSize8 = 8, ETextureSize4 = 4, ETextureSize2 = 2, ETextureSize1 = 1 }; void Init(); void InitTextures(); void InitFramebufferObject(); void InitShaders(); void InitCodecShaderObject(); void InitBlurShaders(); void BlurMipmap( GLuint aTextureID, GLuint aCounter, GLuint aMipmapSize, GLuint aBlurPasses ); void RenderSceneOnQuad( GLuint aTextureID, GLuint aTextureSize ); GLint iOldViewPort[4]; GLuint iOriginalImageSize; FrameBufferObject* iOriginalFBO; FrameBufferObject* iIntermediateFBO[KNumberOfBlurLevels]; FrameBufferObject* iBlendedFBO; FBOTextureAttachment iOriginalTexAttachment; FBOTextureAttachment iHorizBlurredTexAttachment[KNumberOfBlurLevels]; FBOTextureAttachment iVertBlurredTexAttachment[KNumberOfBlurLevels]; // final blurred texture id is the same as vertical texture id GLuint iFinalBlurredTexture[KNumberOfBlurLevels]; GLuint iBlurPasses[KNumberOfBlurLevels]; GLuint iMipmapSize[KNumberOfBlurLevels]; // ########### SHADERS DECLARATIONS ############ ShaderProgram* iHorizontalShaderProgram; ShaderProgram* iVerticalShaderProgram; ShaderObject* iHorizontalBlurFragmentShader; ShaderObject* iVerticalBlurFragmentShader; ShaderObject* iCodecRGBEFragmentShader; ShaderUniformValue<int> iMipmapSizeUniform; ShaderUniformValue<int> iVerticalTextureSizeUniform; ShaderUniformValue<float> iHorizBlurWeight1Uniform; ShaderUniformValue<float> iHorizBlurWeight2Uniform; ShaderUniformValue<float> iHorizBlurWeight3Uniform; ShaderUniformValue<float> iVertBlurWeight1Uniform; ShaderUniformValue<float> iVertBlurWeight2Uniform; ShaderUniformValue<float> iVertBlurWeight3Uniform; };
[ "wfrishert@15324175-3028-0410-9899-2d1205849c9d" ]
[ [ [ 1, 80 ] ] ]
23182c1b2396a0bf1763a98628a33b344d12a39c
b5ad65ebe6a1148716115e1faab31b5f0de1b493
/maxsdk2008/include/itreevw.h
a9a11b9b92be4517b5acaf0a72345fc10fc1a573
[]
no_license
gasbank/aran
4360e3536185dcc0b364d8de84b34ae3a5f0855c
01908cd36612379ade220cc09783bc7366c80961
refs/heads/master
2021-05-01T01:16:19.815088
2011-03-01T05:21:38
2011-03-01T05:21:38
1,051,010
1
0
null
null
null
null
UTF-8
C++
false
false
52,500
h
/********************************************************************** *< FILE: itreevw.h DESCRIPTION: Tree View Interface CREATED BY: Rolf Berteig HISTORY: Created 17 April 1995 Moved into public SDK, JBW 5.25.00 Extended by Adam Felt for R5 *> Copyright (c) 1994-2002, All Rights Reserved. **********************************************************************/ #ifndef __ITREEVW__ #define __ITREEVW__ #include "iFnPub.h" #define WM_TV_SELCHANGED WM_USER + 0x03001 #define WM_TV_MEDIT_TV_DESTROYED WM_USER + 0x03b49 // Sent to a track view window to force it to do a horizontal zoom extents #define WM_TV_DOHZOOMEXTENTS WM_USER + 0xb9a1 // Style flag options for Interface::CreateTreeViewChild #define TVSTYLE_MAXIMIZEBUT (1<<0) // Has a maximize button for TV in a viewport. #define TVSTYLE_INVIEWPORT (1<<1) //Setting the TVSTYLE_NAMEABLE flag will give the user maxscript access to your treeview through the trackviews.current interface. //Set this flag if you want the user to be able to modify your trackview settings. #define TVSTYLE_NAMEABLE (1<<2) #define TVSTYLE_INMOTIONPAN (1<<3) #define TVSTYLE_SHOW_NONANIMATABLE (1<<4) // this flag specifies the treeview child window contains a menu bar and toolbars. (R5 and later only) // if this style has been set you can use ITreeViewUI::GetHWnd() to get the handle to the window housing the CUI elements. // this automatically sets the TVSTYLE_NAMEABLE flag since UI macroScripts may depend in the window being scriptable #define TVSTYLE_SHOW_CUI (1<<5) // Docking options for ITrackViewArray::OpenTrackViewWindow #define TV_FLOAT 0 // float window. can't dock on top (the default) #define TV_DOCK_TOP 1 // dock on top #define TV_DOCK_BOTTOM 2 // dock on bottom. can't dock on top #define TV_CAN_DOCK_TOP 3 // floating but able to dock on top // Major modes #define MODE_EDITKEYS 0 #define MODE_EDITTIME 1 #define MODE_EDITRANGES 2 #define MODE_POSRANGES 3 #define MODE_EDITFCURVE 4 // Operations on keys can be performed on one of the following set types #define EFFECT_ALL_SEL_KEYS 0 #define EFFECT_SEL_KEYS_IN_SEL_TRACKS 1 #define EFFECT_ALL_KEYS_IN_SEL_TRACKS 2 #define EFFECT_ALL_KEYS 3 class TrackViewFilter; class TrackViewPick; typedef Animatable* AnimatablePtr; //This is an interface into many of the UI layout functions of trackview. //You can get an instance of this class by calling ITreeView::GetInterface(TREEVIEW_UI_INTERFACE) //*********************************************************************************************** #define TREEVIEW_UI_INTERFACE Interface_ID(0x1bcd78ef, 0x21990819) class ITreeViewUI : public FPMixinInterface { public: virtual HWND GetHWnd()=0; virtual MSTR GetMenuBar()=0; virtual void SetMenuBar(MSTR name)=0; virtual MSTR GetControllerQuadMenu()=0; virtual void SetControllerQuadMenu(MSTR name)=0; virtual MSTR GetKeyQuadMenu()=0; virtual void SetKeyQuadMenu(MSTR name)=0; virtual int ToolbarCount()=0; virtual void AddToolbar()=0; virtual void DeleteToolbar()=0; virtual bool AddToolbar(MCHAR *name)=0; virtual bool DeleteToolbar(int index)=0; virtual bool DeleteToolbar(MCHAR *name)=0; virtual MCHAR* GetToolbarName(int index)=0; virtual void ShowToolbar(MCHAR *name)=0; virtual void HideToolbar(MCHAR *name)=0; virtual bool IsToolbarVisible(MCHAR *name)=0; virtual void ShowAllToolbars()=0; virtual void HideAllToolbars()=0; virtual void ShowMenuBar(bool visible)=0; virtual bool IsMenuBarVisible()=0; virtual void ShowScrollBars(bool visible)=0; virtual bool IsScrollBarsVisible()=0; virtual void ShowTrackWindow(bool visible)=0; virtual bool IsTrackWindowVisible()=0; virtual void ShowKeyWindow(bool visible)=0; virtual bool IsKeyWindowVisible()=0; virtual void ShowTimeRuler(bool visible)=0; virtual bool IsTimeRulerVisible()=0; virtual void ShowKeyPropertyIcon(bool visible)=0; virtual bool IsKeyPropertyIconVisible()=0; virtual void ShowIconsByClass(bool byClass)=0; virtual bool ShowIconsByClass()=0; virtual void SaveUILayout()=0; virtual void SaveUILayout(MCHAR* name)=0; virtual void LoadUILayout(MCHAR* name)=0; virtual int LayoutCount()=0; virtual MSTR GetLayoutName(int index)=0; virtual MSTR GetLayoutName()=0; //the current layout enum { tv_getHWnd, tv_getMenuBar, tv_setMenuBar, tv_getControllerQuadMenu, tv_setControllerQuadMenu, tv_getKeyQuadMenu, tv_setKeyQuadMenu, tv_getMenuBarVisible, tv_setMenuBarVisible, tv_getScrollBarsVisible, tv_setScrollBarsVisible, tv_getTrackWindowVisible, tv_setTrackWindowVisible, tv_getKeyWindowVisible, tv_setKeyWindowVisible, tv_getTimeRulerVisible, tv_setTimeRulerVisible, tv_showAllToolbars, tv_hideAllToolbars, tv_showToolbar, tv_hideToolbar, tv_getToolbarName, tv_deleteToolbar, tv_addToolbar, tv_toolbarCount, tv_saveUILayout, tv_saveCurrentUILayout, tv_loadUILayout, tv_layoutCount, tv_getLayoutName, tv_layoutName, tv_isToolbarVisible, tv_getKeyPropertyVisible, tv_setKeyPropertyVisible, tv_getIconsByClass, tv_setIconsByClass, }; BEGIN_FUNCTION_MAP RO_PROP_FN(tv_getHWnd, GetHWnd, TYPE_HWND); RO_PROP_FN(tv_layoutName, GetLayoutName, TYPE_TSTR_BV); PROP_FNS(tv_getMenuBar, GetMenuBar, tv_setMenuBar, SetMenuBar, TYPE_TSTR_BV); PROP_FNS(tv_getControllerQuadMenu, GetControllerQuadMenu, tv_setControllerQuadMenu, SetControllerQuadMenu, TYPE_TSTR_BV); PROP_FNS(tv_getKeyQuadMenu, GetKeyQuadMenu, tv_setKeyQuadMenu, SetKeyQuadMenu, TYPE_TSTR_BV); PROP_FNS(tv_getMenuBarVisible, IsMenuBarVisible, tv_setMenuBarVisible, ShowMenuBar, TYPE_bool); PROP_FNS(tv_getScrollBarsVisible, IsScrollBarsVisible, tv_setScrollBarsVisible, ShowScrollBars, TYPE_bool); PROP_FNS(tv_getTrackWindowVisible, IsTrackWindowVisible, tv_setTrackWindowVisible, ShowTrackWindow, TYPE_bool); PROP_FNS(tv_getKeyWindowVisible, IsKeyWindowVisible, tv_setKeyWindowVisible, ShowKeyWindow, TYPE_bool); PROP_FNS(tv_getTimeRulerVisible, IsTimeRulerVisible, tv_setTimeRulerVisible, ShowTimeRuler, TYPE_bool); PROP_FNS(tv_getKeyPropertyVisible, IsKeyPropertyIconVisible, tv_setKeyPropertyVisible, ShowKeyPropertyIcon, TYPE_bool); PROP_FNS(tv_getIconsByClass, ShowIconsByClass, tv_setIconsByClass, ShowIconsByClass, TYPE_bool); VFN_0(tv_showAllToolbars, ShowAllToolbars); VFN_0(tv_hideAllToolbars, HideAllToolbars); VFN_1(tv_showToolbar, ShowToolbar, TYPE_STRING); VFN_1(tv_hideToolbar, HideToolbar, TYPE_STRING); FN_1(tv_getToolbarName, TYPE_STRING, GetToolbarName, TYPE_INDEX); FN_1(tv_deleteToolbar, TYPE_bool, fp_DeleteToolbar, TYPE_FPVALUE); FN_1(tv_addToolbar, TYPE_bool, AddToolbar, TYPE_STRING); FN_0(tv_toolbarCount, TYPE_INT, ToolbarCount); FN_1(tv_isToolbarVisible, TYPE_bool, IsToolbarVisible, TYPE_STRING); VFN_0(tv_saveCurrentUILayout, SaveUILayout); VFN_1(tv_saveUILayout, SaveUILayout, TYPE_STRING); VFN_1(tv_loadUILayout, LoadUILayout, TYPE_STRING); FN_0(tv_layoutCount, TYPE_INT, LayoutCount); FN_1(tv_getLayoutName, TYPE_TSTR_BV, GetLayoutName, TYPE_INDEX); END_FUNCTION_MAP FPInterfaceDesc* GetDesc() { return GetDescByID(TREEVIEW_UI_INTERFACE); } Interface_ID GetID() { return TREEVIEW_UI_INTERFACE; } private: virtual bool fp_DeleteToolbar(FPValue* val)=0; }; #define TREEVIEW_OPS_INTERFACE Interface_ID(0x60fb7eef, 0x1f6d6dd3) //These are the operations you can do on any open trackview //Added by AF (09/12/00) //********************************************************* /*! \sa Class FPMixinInterface, Class Animatable, Class ReferenceTarget\n\n \par Description: This class is available in release 4.0 and later only.\n\n This class contains the operations you can do on any open trackview. */ class ITreeViewOps : public FPMixinInterface { public: /*! \remarks Constructor. */ virtual ~ITreeViewOps() {} /*! \remarks This method returns the number of tracks in the TreeView. */ virtual int GetNumTracks()=0; /*! \remarks This method returns the number of currently selected tracks in the TreeView. */ virtual int NumSelTracks()=0; /*! \remarks This method retrieves a track by its specified index. \par Parameters: <b>int i</b>\n\n The index of the track you wish you retrieve.\n\n <b>AnimatablePtr \&anim</b>\n\n A reference to the Animatable object of the track that was specified.\n\n <b>AnimatablePtr \&client</b>\n\n A reference to the client object of the track that was specified. This is the 'parent' or 'owner' of the specified item.\n\n <b>int \&subNum</b>\n\n The index of the sub-anim of the track that was specified. */ virtual void GetSelTrack(int i,AnimatablePtr &anim,AnimatablePtr &client,int &subNum)=0; /*! \remarks This method returns a pointer to the reference target associated with a TrackView entry. \par Parameters: <b>int index</b>\n\n The index of the TrackView entry for which to retrieve the reference target. */ virtual ReferenceTarget* GetAnim(int index)=0; /*! \remarks This method returns a pointer to the client of the specified track. This is the 'parent' or 'owner' of the specified item. \par Parameters: <b>int index</b>\n\n The index of the TrackView entry for which to retrieve the client. */ virtual ReferenceTarget* GetClient(int index)=0; /*! \remarks This method returns TRUE if a controller can be assigned and FALSE if no controller can be assigned. */ virtual BOOL CanAssignController()=0; /*! \remarks This method will invoke the assign controller dialog. \par Parameters: <b>BOOL clearMot</b>\n\n TRUE to clear the current settings, FALSE to leave the current settings. */ virtual void DoAssignController(BOOL clearMot=TRUE)=0; /*! \remarks This method allows you to set the show controller type flag, on or off. \par Parameters: <b>BOOL show</b>\n\n Set the parameter to TRUE if the controller type should be shown. FALSE if the controller type should not be shown. */ virtual void ShowControllerType(BOOL show)=0; /*! \remarks This method returns the name of the TreeView name. */ virtual MCHAR *GetTVName()=0; // added for scripter access, JBW - 11/11/98 /*! \remarks This method allows you to set the TreeView name. \par Parameters: <b>MCHAR* s</b>\n\n The name of the TreeView you wish to set. */ virtual void SetTVName(MCHAR *)=0; /*! \remarks This method will close the TreeView window. */ virtual void CloseTreeView()=0; /*! \remarks This method allows you to set set a TreeView selection filter by adding to the selection mask. \par Parameters: <b>DWORD mask</b>\n\n The filter selection mask. See the List of TrackView Filter Mask Types for details.\n\n <b>int which</b>\n\n The filter you wish to set, 0 for filter 1, and 1 for filter 2.\n\n <b>BOOL redraw</b>\n\n Signal that a redraw should be issued. */ virtual void SetFilter(DWORD mask,int which, BOOL redraw=TRUE)=0; /*! \remarks This method allows you to set set a TreeView selection filter by subtracting from the selection mask. \par Parameters: <b>DWORD mask</b>\n\n The filter selection mask. See the List of TrackView Filter Mask Types for details.\n\n <b>int which</b>\n\n The filter you wish to clear, 0 for filter 1, and 1 for filter 2.\n\n <b>BOOL redraw</b>\n\n Signal that a redraw should be issued. */ virtual void ClearFilter(DWORD mask,int which, BOOL redraw=TRUE)=0; /*! \remarks This method allows you to test if a filter has been set. \par Parameters: <b>DWORD mask</b>\n\n The filter selection mask. See the List of TrackView Filter Mask Types for details.\n\n <b>int which</b>\n\n The filter you wish to test, 0 for filter 1, and 1 for filter 2. */ virtual DWORD TestFilter(DWORD mask,int which)=0; // added for param wiring, JBW - 5.26.00 /*! \remarks This method allows you to zoom/focus on a specified entry. \par Parameters: <b>Animatable* owner</b>\n\n A pointer to the Animatable you wish to zoom/focus on.\n\n <b>int subnum</b>\n\n The sub-anim you wish to zoom/focus on. */ virtual void ZoomOn(Animatable* owner, int subnum)=0; /*! \remarks This method will zoom/focus on the selected entry. */ virtual void ZoomSelected()=0; /*! \remarks This method will expand the tracks in the TreeView. */ virtual void ExpandTracks()=0; //added for completeness by AF (09/12/00) /*! \remarks This method returns the index of the specified Animatable. \par Parameters: <b>Animatable *anim</b>\n\n A pointer to the Animatable you wish to get the index of. */ virtual int GetIndex(Animatable *anim)=0; /*! \remarks This method allows you to select a specific track by providing its index. \par Parameters: <b>int index</b>\n\n The index of the track you wish to select.\n\n <b>BOOL clearSelection</b>\n\n Set this parameter to TRUE to signal the TreeView to clear the current selection, otherwise FALSE. */ virtual void SelectTrackByIndex(int index, BOOL clearSelection=TRUE)=0; /*! \remarks This method allows you to select the track in trackview corresponding to the Animatable* passed as the argument. \par Parameters: <b>Animatable* anim</b>\n\n A pointer to the Animatable you wish to select.\n\n <b>BOOL clearSelection</b>\n\n Set this parameter to TRUE to signal the TreeView to clear the current selection, otherwise FALSE. */ virtual void SelectTrack(Animatable* anim, BOOL clearSelection=TRUE)=0; /*! \remarks This method allows you to assign a controller to the selected entry. The function checks to make sure a controller can be assigned to the selected tracks, and that the controller passed in is of the appropriate SuperClass_ID. Returns FALSE if the tracks don't all have the same SuperClassID, or if the controller argument is of the wrong type. \par Parameters: <b>Animatable* ctrl</b>\n\n A pointer to the Animatable controller you wish to assign. \return TRUE if the assignment was successful, otherwise FALSE. */ virtual BOOL AssignControllerToSelected(Animatable* ctrl)=0; //added by AF (09/25/00) for MAXScript exposure /*! \remarks This method allows you to set the edit mode that the trackview displays. \par Parameters: <b>int mode</b>\n\n The edit mode, which is one of the following;\n\n <b>MODE_EDITKEYS</b>\n\n Edit keys mode.\n\n <b>MODE_EDITTIME</b>\n\n Edit time mode.\n\n <b>MODE_EDITRANGES</b>\n\n Edit ranges mode.\n\n <b>MODE_POSRANGES</b>\n\n Edit pos ranges model\n\n <b>MODE_EDITFCURVE</b>\n\n Edit function curves mode. */ virtual void SetEditMode(int mode)=0; /*! \remarks This method returns the current edit mode. \return The edit mode, which is one of the following;\n\n <b>MODE_EDITKEYS</b>\n\n Edit keys mode.\n\n <b>MODE_EDITTIME</b>\n\n Edit time mode.\n\n <b>MODE_EDITRANGES</b>\n\n Edit ranges mode.\n\n <b>MODE_POSRANGES</b>\n\n Edit pos ranges model\n\n <b>MODE_EDITFCURVE</b>\n\n Edit function curves mode. */ virtual int GetEditMode()=0; //added by AF (09/25/00) for more MAXScript exposure //These differ from "active" because the trackview //doesn't have to be selected for it to be the currently used trackview /*! \remarks This method returns TRUE if this trackview is the last trackview used by the user, otherwise FALSE. */ virtual BOOL IsCurrent()=0; /*! \remarks This method allows you to set this trackview to be the current trackview. */ virtual void SetCurrent()=0; enum { tv_getName, tv_setName, tv_close, tv_numSelTracks, tv_getNumTracks, tv_getSelTrack, tv_canAssignController, tv_doAssignController, tv_assignController, tv_showControllerTypes, tv_expandTracks, tv_zoomSelected, tv_zoomOnTrack, tv_getAnim, tv_getClient, tv_getSelAnim, tv_getSelClient, tv_getSelAnimSubNum, tv_getIndex, tv_selectTrackByIndex, tv_selectTrack, tv_setFilter, tv_clearFilter, tv_setEditMode, tv_getEditMode, tv_setEditModeProp, tv_getEditModeProp, tv_setCurrent, tv_getCurrent, tv_getUIInterface, tv_getModifySubTree, tv_setModifySubTree, tv_getModifyChildren, tv_setModifyChildren, tv_launchUtilityDialog, tv_launchUtility, tv_getUtilityCount, tv_getUtilityName, tv_closeUtility, tv_getInteractiveUpdate, tv_setInteractiveUpdate, tv_getSyncTime, tv_setSyncTime, tv_setTangentType, tv_setInTangentType, tv_setOutTangentType, tv_getFreezeSelKeys, tv_setFreezeSelKeys, tv_getFreezeNonSelCurves, tv_setFreezeNonSelCurves, tv_getShowNonSelCurves, tv_setShowNonSelCurves, tv_getShowTangents, tv_setShowTangents, tv_getShowFrozenKeys, tv_setShowFrozenKeys, tv_getEffectSelectedObjectsOnly, tv_setEffectSelectedObjectsOnly, tv_getAutoExpandChildren, tv_setAutoExpandChildren, tv_getAutoExpandTransforms, tv_setAutoExpandTransforms, tv_getAutoExpandObjects, tv_setAutoExpandObjects, tv_getAutoExpandModifiers, tv_setAutoExpandModifiers, tv_getAutoExpandMaterials, tv_setAutoExpandMaterials, tv_getAutoExpandXYZ, tv_setAutoExpandXYZ, tv_getAutoSelectAnimated, tv_setAutoSelectAnimated, tv_getAutoSelectPosition, tv_setAutoSelectPosition, tv_getAutoSelectRotation, tv_setAutoSelectRotation, tv_getAutoSelectScale, tv_setAutoSelectScale, tv_getAutoSelectXYZ, tv_setAutoSelectXYZ, tv_getManualNavigation, tv_setManualNavigation, tv_getAutoZoomToRoot, tv_setAutoZoomToRoot, tv_getAutoZoomToSelected, tv_setAutoZoomToSelected, tv_getAutoZoomToEdited, tv_setAutoZoomToEdited, tv_getUseSoftSelect, tv_setUseSoftSelect, tv_getSoftSelectRange, tv_setSoftSelectRange, tv_getSoftSelectFalloff, tv_setSoftSelectFalloff, tv_getRootTrack, tv_setRootTrack, tv_restoreRootTrack, tv_getScaleValuesOrigin, tv_setScaleValuesOrigin, tv_updateList, //symbolic enums tv_enumEffectTracks, tv_enumKeyTangentType, tv_editModeTypes, tv_enumTangentDisplay, }; BEGIN_FUNCTION_MAP FN_0(tv_getName, TYPE_STRING, GetTVName); VFN_1(tv_setName, SetTVName, TYPE_STRING); VFN_0(tv_close, CloseTreeView); FN_0(tv_getNumTracks, TYPE_INT, GetNumTracks); FN_0(tv_numSelTracks, TYPE_INT, NumSelTracks); FN_0(tv_canAssignController, TYPE_BOOL, CanAssignController); VFN_0(tv_doAssignController, DoAssignController); FN_1(tv_assignController, TYPE_BOOL, AssignControllerToSelected, TYPE_REFTARG); VFN_1(tv_showControllerTypes, ShowControllerType, TYPE_BOOL); VFN_0(tv_expandTracks, ExpandTracks); VFN_0(tv_zoomSelected, ZoomSelected); VFN_2(tv_zoomOnTrack, ZoomOn, TYPE_REFTARG, TYPE_INT); FN_1(tv_getAnim, TYPE_REFTARG, GetAnim, TYPE_INDEX); FN_1(tv_getClient, TYPE_REFTARG, GetClient, TYPE_INDEX); FN_1(tv_getSelAnim, TYPE_REFTARG, fpGetSelectedAnimatable, TYPE_INDEX); FN_1(tv_getSelClient, TYPE_REFTARG, fpGetSelectedClient, TYPE_INDEX); FN_1(tv_getSelAnimSubNum, TYPE_INDEX, fpGetSelectedAnimSubNum, TYPE_INDEX); FN_1(tv_getIndex, TYPE_INDEX, GetIndex, TYPE_REFTARG); VFN_2(tv_selectTrackByIndex, SelectTrackByIndex, TYPE_INDEX, TYPE_BOOL); VFN_2(tv_selectTrack, SelectTrack, TYPE_REFTARG, TYPE_BOOL); FN_VA(tv_setFilter, TYPE_BOOL, fpSetFilter); FN_VA(tv_clearFilter, TYPE_BOOL, fpClearFilter); VFN_1(tv_setEditMode, SetEditMode, TYPE_ENUM); FN_0(tv_getEditMode, TYPE_ENUM, GetEditMode); PROP_FNS(tv_getEditModeProp, GetEditMode, tv_setEditModeProp, SetEditMode, TYPE_ENUM); FN_0(tv_getCurrent, TYPE_BOOL, IsCurrent); VFN_0(tv_setCurrent, SetCurrent); // UI interface property RO_PROP_FN(tv_getUIInterface, fpGetUIInterface, TYPE_INTERFACE); // dope sheet mode property PROP_FNS(tv_getModifySubTree, ModifySubTree, tv_setModifySubTree, ModifySubTree, TYPE_BOOL); PROP_FNS(tv_getModifyChildren, ModifyChildren, tv_setModifyChildren, ModifyChildren, TYPE_BOOL); //trackview utility methods VFN_0(tv_launchUtilityDialog, LaunchUtilityDialog); VFN_1(tv_launchUtility, LaunchUtility, TYPE_TSTR_BV); VFN_1(tv_closeUtility, CloseUtility, TYPE_TSTR_BV); FN_0(tv_getUtilityCount, TYPE_INT, GetUtilityCount); FN_1(tv_getUtilityName, TYPE_TSTR_BV, GetUtilityName, TYPE_INDEX); // key tangent type methods VFN_2(tv_setTangentType, SetTangentType, TYPE_ENUM, TYPE_ENUM); VFN_2(tv_setInTangentType, SetInTangentType, TYPE_ENUM, TYPE_ENUM); VFN_2(tv_setOutTangentType, SetOutTangentType, TYPE_ENUM, TYPE_ENUM); // button state properties PROP_FNS(tv_getInteractiveUpdate, InteractiveUpdate, tv_setInteractiveUpdate, InteractiveUpdate, TYPE_BOOL); PROP_FNS(tv_getSyncTime, SyncTime, tv_setSyncTime, SyncTime, TYPE_BOOL); PROP_FNS(tv_getFreezeSelKeys, FreezeSelKeys, tv_setFreezeSelKeys, FreezeSelKeys, TYPE_BOOL); PROP_FNS(tv_getFreezeNonSelCurves, FreezeNonSelCurves, tv_setFreezeNonSelCurves, FreezeNonSelCurves, TYPE_BOOL); PROP_FNS(tv_getShowNonSelCurves, ShowNonSelCurves, tv_setShowNonSelCurves, ShowNonSelCurves, TYPE_BOOL); PROP_FNS(tv_getShowTangents, ShowTangents, tv_setShowTangents, ShowTangents, TYPE_ENUM); PROP_FNS(tv_getShowFrozenKeys, ShowFrozenKeys, tv_setShowFrozenKeys, ShowFrozenKeys, TYPE_BOOL); // soft selection properties PROP_FNS(tv_getUseSoftSelect, UseSoftSelect, tv_setUseSoftSelect, UseSoftSelect, TYPE_BOOL); PROP_FNS(tv_getSoftSelectRange, SoftSelectRange, tv_setSoftSelectRange, SoftSelectRange, TYPE_TIMEVALUE); PROP_FNS(tv_getSoftSelectFalloff, SoftSelectFalloff, tv_setSoftSelectFalloff, SoftSelectFalloff, TYPE_FLOAT); // workflow properties PROP_FNS(tv_getEffectSelectedObjectsOnly, EffectSelectedObjectsOnly, tv_setEffectSelectedObjectsOnly, EffectSelectedObjectsOnly, TYPE_BOOL); PROP_FNS(tv_getManualNavigation, ManualNavigation, tv_setManualNavigation, ManualNavigation, TYPE_BOOL); PROP_FNS(tv_getAutoExpandChildren, AutoExpandChildren, tv_setAutoExpandChildren, AutoExpandChildren, TYPE_BOOL); PROP_FNS(tv_getAutoExpandTransforms, AutoExpandTransforms, tv_setAutoExpandTransforms, AutoExpandTransforms, TYPE_BOOL); PROP_FNS(tv_getAutoExpandObjects, AutoExpandObjects, tv_setAutoExpandObjects, AutoExpandObjects, TYPE_BOOL); PROP_FNS(tv_getAutoExpandModifiers, AutoExpandModifiers, tv_setAutoExpandModifiers, AutoExpandModifiers, TYPE_BOOL); PROP_FNS(tv_getAutoExpandMaterials, AutoExpandMaterials, tv_setAutoExpandMaterials, AutoExpandMaterials, TYPE_BOOL); PROP_FNS(tv_getAutoExpandXYZ, AutoExpandXYZ, tv_setAutoExpandXYZ, AutoExpandXYZ, TYPE_BOOL); PROP_FNS(tv_getAutoSelectAnimated, AutoSelectAnimated, tv_setAutoSelectAnimated, AutoSelectAnimated, TYPE_BOOL); PROP_FNS(tv_getAutoSelectPosition, AutoSelectPosition, tv_setAutoSelectPosition, AutoSelectPosition, TYPE_BOOL); PROP_FNS(tv_getAutoSelectRotation, AutoSelectRotation, tv_setAutoSelectRotation, AutoSelectRotation, TYPE_BOOL); PROP_FNS(tv_getAutoSelectScale, AutoSelectScale, tv_setAutoSelectScale, AutoSelectScale, TYPE_BOOL); PROP_FNS(tv_getAutoSelectXYZ, AutoSelectXYZ, tv_setAutoSelectXYZ, AutoSelectXYZ, TYPE_BOOL); PROP_FNS(tv_getAutoZoomToRoot, AutoZoomToRoot, tv_setAutoZoomToRoot, AutoZoomToRoot, TYPE_BOOL); PROP_FNS(tv_getAutoZoomToSelected, AutoZoomToSelected, tv_setAutoZoomToSelected, AutoZoomToSelected, TYPE_BOOL); PROP_FNS(tv_getAutoZoomToEdited, AutoZoomToEdited, tv_setAutoZoomToEdited, AutoZoomToEdited, TYPE_BOOL); //root node methods PROP_FNS(tv_getRootTrack, GetRootTrack, tv_setRootTrack, SetRootTrack, TYPE_REFTARG); VFN_0(tv_restoreRootTrack, RestoreDefaultRootTrack); // scale values mode -- scale origin PROP_FNS(tv_getScaleValuesOrigin, ScaleValuesOrigin, tv_setScaleValuesOrigin, ScaleValuesOrigin, TYPE_FLOAT); VFN_0(tv_updateList, UpdateList); END_FUNCTION_MAP /*! \remarks This method returns a pointer to the Function Publishing Interface Description. */ FPInterfaceDesc* GetDesc() { return GetDescByID(TREEVIEW_OPS_INTERFACE); } Interface_ID GetID() { return TREEVIEW_OPS_INTERFACE; } // private: //these methods are created to massage data into a format the function publishing system can interpret //these functions just call other public functions above //Added by AF (09/12/00) // LAM - 4/1/04 - made public. No access to SetTVDisplayFlag/GetTVDisplayFlag, which is needed for the // AutoXXXX methods below. virtual Animatable* fpGetSelectedAnimatable(int index)=0; virtual Animatable* fpGetSelectedClient(int index)=0; virtual int fpGetSelectedAnimSubNum(int index)=0; virtual BOOL fpSetFilter(FPParams* val)=0; virtual BOOL fpClearFilter(FPParams* val)=0; // these are here so we don't break plugin compatibility // these can be called using FPInterface::Invoke() // Dope Sheet Mode effect children virtual BOOL ModifySubTree()=0; virtual void ModifySubTree(BOOL onOff)=0; virtual BOOL ModifyChildren()=0; virtual void ModifyChildren(BOOL onOff)=0; // Track View Utilities virtual void LaunchUtility(MSTR name)=0; virtual void LaunchUtilityDialog()=0; virtual void CloseUtility(MSTR name)=0; virtual int GetUtilityCount()=0; virtual MSTR GetUtilityName(int index)=0; // Update the viewport interactively, or on mouse up virtual BOOL InteractiveUpdate()=0; virtual void InteractiveUpdate(BOOL update)=0; // Sync Time with the mouse while clicking and dragging selections, keys, etc. virtual BOOL SyncTime()=0; virtual void SyncTime(BOOL sync)=0; // Button States virtual BOOL FreezeSelKeys()=0; virtual void FreezeSelKeys(BOOL onOff)=0; virtual BOOL FreezeNonSelCurves()=0; virtual void FreezeNonSelCurves(BOOL onOff)=0; virtual BOOL ShowNonSelCurves()=0; virtual void ShowNonSelCurves(BOOL onOff)=0; virtual int ShowTangents()=0; virtual void ShowTangents(int type)=0; virtual BOOL ShowFrozenKeys()=0; virtual void ShowFrozenKeys(BOOL onOff)=0; // Soft selection virtual void UseSoftSelect(BOOL use)=0; virtual BOOL UseSoftSelect()=0; virtual void SoftSelectRange(TimeValue range)=0; virtual TimeValue SoftSelectRange()=0; virtual void SoftSelectFalloff(float falloff)=0; virtual float SoftSelectFalloff()=0; // Adjust the key tangent types virtual void SetTangentType(int type, int effect = EFFECT_ALL_SEL_KEYS)=0; virtual void SetInTangentType(int type, int effect = EFFECT_ALL_SEL_KEYS)=0; virtual void SetOutTangentType(int type, int effect = EFFECT_ALL_SEL_KEYS)=0; ITreeViewUI* fpGetUIInterface() { return (ITreeViewUI*)GetInterface(TREEVIEW_UI_INTERFACE); } // Workflow settings virtual BOOL EffectSelectedObjectsOnly()=0; virtual void EffectSelectedObjectsOnly(BOOL effect)=0; virtual BOOL ManualNavigation()=0; virtual void ManualNavigation(BOOL manual)=0; virtual BOOL AutoExpandChildren()=0; virtual void AutoExpandChildren(BOOL expand)=0; virtual BOOL AutoExpandTransforms()=0; virtual void AutoExpandTransforms(BOOL expand)=0; virtual BOOL AutoExpandObjects()=0; virtual void AutoExpandObjects(BOOL expand)=0; virtual BOOL AutoExpandModifiers()=0; virtual void AutoExpandModifiers(BOOL expand)=0; virtual BOOL AutoExpandMaterials()=0; virtual void AutoExpandMaterials(BOOL expand)=0; virtual BOOL AutoExpandXYZ()=0; virtual void AutoExpandXYZ(BOOL expand)=0; virtual BOOL AutoSelectAnimated()=0; virtual void AutoSelectAnimated(BOOL select)=0; virtual BOOL AutoSelectPosition()=0; virtual void AutoSelectPosition(BOOL select)=0; virtual BOOL AutoSelectRotation()=0; virtual void AutoSelectRotation(BOOL select)=0; virtual BOOL AutoSelectScale()=0; virtual void AutoSelectScale(BOOL select)=0; virtual BOOL AutoSelectXYZ()=0; virtual void AutoSelectXYZ(BOOL select)=0; virtual BOOL AutoZoomToRoot()=0; virtual void AutoZoomToRoot(BOOL zoom)=0; virtual BOOL AutoZoomToSelected()=0; virtual void AutoZoomToSelected(BOOL zoom)=0; virtual BOOL AutoZoomToEdited()=0; virtual void AutoZoomToEdited(BOOL zoom)=0; virtual ReferenceTarget* GetRootTrack()=0; virtual void SetRootTrack(ReferenceTarget* root)=0; virtual void RestoreDefaultRootTrack()=0; virtual float ScaleValuesOrigin()=0; virtual void ScaleValuesOrigin(float origin)=0; // force an update of the list virtual void UpdateList()=0; }; /*! \sa Class ITreeViewOps, Class IObject, Class ITrackViewArray, Class TrackViewActionCallback, Class TrackViewFilter, Class ReferenceTarget, Class Animatable\n\n \par Description: This class is available in release 4.0 and later only.\n\n While this is the main TreeView class used for trackview operations, most of the operations for TreeView's are inherited through the <b>ITreeViewOps</b> class.\n\n */ class ITreeView : public IObject, public ITreeViewOps{ public: /*! \remarks Constructor */ virtual ~ITreeView() {} /*! \remarks This method will position the TreeView window at the specified position using the specified size. \par Parameters: <b>int x, int y</b>\n\n The x and y position of the TreeView window, in screen pixels.\n\n <b>int w, int h</b>\n\n The width and height of the TreeView window, in screen pixels. */ virtual void SetPos(int x, int y, int w, int h)=0; /*! \remarks This method shows the TreeView window. */ virtual void Show()=0; /*! \remarks This method hides the TreeView window. */ virtual void Hide()=0; /*! \remarks This method allows you to enquire if the TreeView window is currently visible. \return TRUE if the TreeView window is visible, otherwise FALSE. */ virtual BOOL IsVisible()=0; /*! \remarks This method allows you to enquire whether the TreeView is being displayed in a viewport. \return TRUE if the TreeView is displayed in a viewport, otherwise FALSE. */ virtual BOOL InViewPort()=0; /*! \remarks This method allows you to set the TreeView root which represents the initial tree branch. \par Parameters: <b>ReferenceTarget *root</b>\n\n A pointer to a reference target to use as the root in the TreeView.\n\n <b>ReferenceTarget *client</b>\n\n A pointer to the reference target which is the root's client.\n\n <b>int subNum</b>\n\n The sub-animatable number of the root you wish to set. */ virtual void SetTreeRoot(ReferenceTarget *root,ReferenceTarget *client=NULL,int subNum=0)=0; /*! \remarks This method will instruct the TreeView to show the labels only. \par Parameters: <b>BOOL only</b>\n\n The only parameter specifies if the label only flag should be set (TRUE) or not (FALSE). */ virtual void SetLabelOnly(BOOL only)=0; /*! \remarks This method controls the state of the TreeView's multi-select capability and allows you to enable or disable the selection of multiple selections. \par Parameters: <b>BOOL on</b>\n\n Set this parameter to TRUE to enable multi-select. FALSE to disable multi-select. */ virtual void SetMultiSel(BOOL on)=0; /*! \remarks This method allows you to set set a TreeView selection filter which controls the amount of information displayed in the TreeView. \par Parameters: <b>TrackViewFilter *f</b>\n\n A pointer to a trackview filter which defines the displayable sub-set. */ virtual void SetSelFilter(TrackViewFilter *f=NULL)=0; /*! \remarks This method allows you to activate or inactivate the treeview. \par Parameters: <b>BOOL active</b>\n\n TRUE to activate, FALSE to deactivate. */ virtual void SetActive(BOOL active)=0; /*! \remarks This method returns whether the TreeView is active (TRUE) or inactive (FALSE). */ virtual BOOL IsActive()=0; /*! \remarks This method returns the handle to the TreeView window. */ virtual HWND GetHWnd()=0; /*! \remarks This method\n\n This method returns the parent index of a specific TrackView entry. If no parent is found, -1 will be returned. \par Parameters: <b>int index</b>\n\n The index of the TrackView entry for which to return the parent index. */ virtual int GetTrackViewParent(int index)=0; // returns -1 if no parent is found /*! \remarks This method will flush the TreeView and resets its size to 0. */ virtual void Flush()=0; /*! \remarks This method will recalculate the sub-tree and signal the list has changed. */ virtual void UnFlush()=0; /*! \remarks This method will set the material browser flag. */ virtual void SetMatBrowse()=0; /*! \remarks This method returns the TrackView ID. */ virtual DWORD GetTVID()=0; //from IObject virtual MCHAR* GetIObjectName(){return _M("ITrackView");} virtual int NumInterfaces() { return IObject::NumInterfaces() + 1; } virtual BaseInterface* GetInterfaceAt(int index) { if (index == 0) return (ITreeViewOps*)this; return IObject::GetInterfaceAt(index-1); } virtual BaseInterface* GetInterface(Interface_ID id) { if (id == TREEVIEW_OPS_INTERFACE) return (BaseInterface*)this; else { return IObject::GetInterface(id); } return NULL; } }; //Added by AF (09/07/00) //A CORE interface to get the trackview windows //Use GetCOREInterface(ITRACKVIEWS) to get a pointer to this interface //************************************************** #define ITRACKVIEWS Interface_ID(0x531c5f2c, 0x6fdf29cf) /*! \sa Class FPStaticInterface, Class ITreeViewOps, Class Animatable\n\n \par Description: This class is available in release 4.0 and later only.\n\n This class represents the interface to the track views array. An <b>ITrackViewArray</b> pointer can be obtained by calling: <b>GetCOREInterface(ITRACKVIEWS)</b>. */ class ITrackViewArray : public FPStaticInterface { public: /*! \remarks This method returns the number of currently available TrackViews. */ int GetNumAvailableTrackViews(); /*! \remarks This method returns a pointer to the ITreeViewOps of a specific TrackView. \par Parameters: <b>int index</b>\n\n The index of the TrackView you wish to obtain. */ ITreeViewOps* GetTrackView(int index); /*! \remarks This method returns a pointer to the ITreeViewOps of a specific TrackView. \par Parameters: <b>MSTR name</b>\n\n The name of the TrackView you wish to obtain. */ ITreeViewOps* GetTrackView(MSTR name); /*! \remarks This method returns a table of ITreeViewOps pointers representing the list of TrackViews that are currently available. */ Tab<ITreeViewOps*> GetAvaliableTrackViews(); /*! \remarks This method returns an interface to the last trackview used by the user. */ ITreeViewOps* GetLastActiveTrackView(); /*! \remarks This method returns TRUE if the specified trackview is open, otherwise FALSE. \par Parameters: <b>MSTR name</b>\n\n The name of the trackview. */ BOOL IsTrackViewOpen(MSTR name); /*! \remarks This method returns TRUE if the specified trackview is open, otherwise FALSE. \par Parameters: <b>int index</b>\n\n The index of the trackview. */ BOOL IsTrackViewOpen(int index); /*! \remarks This method will open a specific TrackView window. \par Parameters: <b>MSTR name</b>\n\n The name of the TrackView window you wish to open. \return TRUE if the window was opened, otherwise FALSE. */ BOOL OpenTrackViewWindow(MSTR name, MSTR layoutName = _M(""), Point2 pos = Point2(-1.0f,-1.0f), int width = -1, int height = -1, int dock = TV_FLOAT); /*! \remarks This method will open a trackview by its specified index. \par Parameters: <b>int index</b>\n\n The index of the trackview. \return TRUE if the trackview could be opened, otherwise FALSE. */ BOOL OpenTrackViewWindow(int index); /*! \remarks This method will open the last edited trackview if it was closed by the user. \return TRUE if the last active trackview could be opened, otherwise FALSE. */ BOOL OpenLastActiveTrackViewWindow(); /*! \remarks This method will close a specific TrackView window. \par Parameters: <b>MSTR name</b>\n\n The name of the TrackView window you wish to close. \return TRUE if the window was closed, otherwise FALSE. */ BOOL CloseTrackView(MSTR name); /*! \remarks This method will close a specific TrackView window. \par Parameters: <b>int index</b>\n\n The index of the trackview you wish to close. \return TRUE if the window was closed, otherwise FALSE. */ BOOL CloseTrackView(int index); /*! \remarks This method deletes the specified trackview from the list of saved trackviews. \par Parameters: <b>MSTR name</b>\n\n The name of the trackview you wish to delete. */ void DeleteTrackView(MSTR name); /*! \remarks This method deletes the specified trackview from the list of saved trackviews. \par Parameters: <b>int index</b>\n\n The index of the trackview you wish to delete. */ void DeleteTrackView(int index); /*! \remarks This method will return the name of a TrackView, specified by it's index. \par Parameters: <b>int index</b>\n\n The index of the TrackView for which you wish to obtain the name. */ MCHAR* GetTrackViewName(int index); /*! \remarks This method will get the name of the last used trackview. */ MCHAR* GetLastUsedTrackViewName(); /*! \remarks This method returns TRUE if the specified trackview is the current trackview, otherwise FALSE. \par Parameters: <b>int index</b>\n\n The index of the trackview. */ BOOL IsTrackViewCurrent(int index); /*! \remarks This method returns TRUE if the specified trackview is the current trackview, otherwise FALSE. \par Parameters: <b>MSTR name</b>\n\n The name of the trackview. */ BOOL IsTrackViewCurrent(MSTR name); /*! \remarks This method allows you to set the specified trackview to be the current trackview \par Parameters: <b>int index</b>\n\n The index of the trackview. */ BOOL SetTrackViewCurrent(int index); /*! \remarks This method allows you to set the specified trackview to be the current trackview \par Parameters: <b>MSTR name</b>\n\n The name of the trackview. */ BOOL SetTrackViewCurrent(MSTR name); /*! \remarks This method will zoom on the selected entries in a specific TrackView \par Parameters: <b>MSTR tvName</b>\n\n The name of the TrackView window you wish to have execute the zoom selected function. \return TRUE if zooming was successful, FALSE if it failed. */ BOOL TrackViewZoomSelected(MSTR tvName); /*! \remarks This method will zoom on a specific TrackView entry. \par Parameters: <b>MSTR tvName</b>\n\n The name of the TrackView you wish to execute the zoom function for.\n\n <b>Animatable* anim</b>\n\n A pointer to the Animatable object you wish to zoom on.\n\n <b>int subNum</b>\n\n The sub-anim index. \return TRUE if zooming was successful, FALSE if it failed. */ BOOL TrackViewZoomOn(MSTR tvName, Animatable* anim, int subNum); enum{ getTrackView, getAvaliableTrackViews, getNumAvailableTrackViews, openTrackView, closeTrackView, getTrackViewName, trackViewZoomSelected, trackViewZoomOn, setFilter, clearFilter, pickTrackDlg, isOpen, openLastTrackView, currentTrackViewProp, lastUsedTrackViewNameProp, deleteTrackView, isTrackViewCurrent, setTrackViewCurrent, doesTrackViewExist, dockTypeEnum, }; DECLARE_DESCRIPTOR(ITrackViewArray); BEGIN_FUNCTION_MAP FN_1(getTrackView, TYPE_INTERFACE, fpGetTrackView, TYPE_FPVALUE); FN_0(getAvaliableTrackViews, TYPE_INTERFACE_TAB_BV, GetAvaliableTrackViews); FN_0(getNumAvailableTrackViews, TYPE_INT, GetNumAvailableTrackViews); FN_6(openTrackView, TYPE_BOOL, fpOpenTrackViewWindow, TYPE_FPVALUE, TYPE_TSTR_BV, TYPE_POINT2_BV, TYPE_INT, TYPE_INT, TYPE_ENUM); FN_1(closeTrackView, TYPE_BOOL, fpCloseTrackView, TYPE_FPVALUE); VFN_1(deleteTrackView, fpDeleteTrackView, TYPE_FPVALUE); FN_1(getTrackViewName, TYPE_STRING, GetTrackViewName, TYPE_INDEX); FN_1(trackViewZoomSelected, TYPE_BOOL, TrackViewZoomSelected, TYPE_TSTR); FN_3(trackViewZoomOn, TYPE_BOOL, TrackViewZoomOn, TYPE_TSTR, TYPE_REFTARG, TYPE_INDEX); FN_VA(setFilter, TYPE_BOOL, fpSetTrackViewFilter); FN_VA(clearFilter, TYPE_BOOL, fpClearTrackViewFilter); FN_VA(pickTrackDlg, TYPE_FPVALUE_BV, fpDoPickTrackDlg); FN_1(isOpen, TYPE_BOOL, fpIsTrackViewOpen, TYPE_FPVALUE); FN_0(openLastTrackView, TYPE_BOOL, OpenLastActiveTrackViewWindow); RO_PROP_FN(currentTrackViewProp, GetLastActiveTrackView, TYPE_INTERFACE); RO_PROP_FN(lastUsedTrackViewNameProp, GetLastUsedTrackViewName, TYPE_STRING); FN_1(isTrackViewCurrent, TYPE_BOOL, fpIsTrackViewCurrent, TYPE_FPVALUE); FN_1(setTrackViewCurrent, TYPE_BOOL, fpSetTrackViewCurrent, TYPE_FPVALUE); FN_1(doesTrackViewExist, TYPE_BOOL, fpDoesTrackViewExist, TYPE_FPVALUE); END_FUNCTION_MAP private: // these functions are wrapper functions to massage maxscript specific values into standard values // These methods just call one of the corresponding public methods BOOL fpSetTrackViewFilter(FPParams* val); BOOL fpClearTrackViewFilter(FPParams* val); FPValue fpDoPickTrackDlg(FPParams* val); BOOL fpIsTrackViewOpen(FPValue* val); BOOL fpCloseTrackView(FPValue* val); void fpDeleteTrackView(FPValue* val); BOOL fpIsTrackViewCurrent(FPValue* val); BOOL fpSetTrackViewCurrent(FPValue* val); ITreeViewOps* fpGetTrackView(FPValue* val); BOOL fpOpenTrackViewWindow(FPValue* val,MSTR layoutName, Point2 pos, int width, int height, int dock); BOOL fpDoesTrackViewExist(FPValue* val); }; #define TRACK_SELSET_MGR_INTERFACE Interface_ID(0x18f36a84, 0x1f572eb7) class TrackSelectionSetMgr : public FPStaticInterface { public: virtual BOOL Create(MSTR name, Tab<ReferenceTarget*> tracks, Tab<MCHAR*> trackNames)=0; virtual BOOL Delete(MSTR name)=0; virtual int Count()=0; virtual MSTR GetName(int index)=0; virtual void SetName(int index, MSTR name)=0; virtual MSTR GetCurrent(ITreeView* tv)=0; virtual void GetTracks(MSTR name, Tab<ReferenceTarget*> &tracks, Tab<MCHAR*> &trackNames)=0; virtual BOOL Add(MSTR name, Tab<ReferenceTarget*> tracks, Tab<MCHAR*> trackNames)=0; virtual BOOL Remove(MSTR name, Tab<ReferenceTarget*> tracks)=0; enum { kCreate, kDelete, kCount, kGetName, kSetName, kGetCurrent, kGetTracks, kAdd, kRemove, }; }; TrackSelectionSetMgr* GetTrackSelectionSetMgr(); // Defines for the "open" argument to Interface::CreateTreeViewChild // ***************************************************************** // "Special" windows are TreeViews whose data can not customized and is not saved. #define OPENTV_SPECIAL -2 // "Custom" windows are TreeViews whose data can be customized but is not saved. // R5.1 and later only. A TreeView will not be created if using this flag in a previous release. #define OPENTV_CUSTOM -3 // These arguments should not be used by third party developers. // They are used to create the saved trackviews that appear in the Graph Editors Menu. #define OPENTV_LAST -1 #define OPENTV_NEW 0 // ***************************************************************** // Sent by a tree view window to its parent when the user right clicks // on dead area of the toolbar. // Mouse points are relative to the client area of the tree view window // // LOWORD(wParam) = mouse x // HIWORD(wParam) = mouse y // lparam = tree view window handle #define WM_TV_TOOLBAR_RIGHTCLICK WM_USER + 0x8ac1 // Sent by a tree view window when the user double // clicks on a track label. // wParam = 0 // lParam = HWND of track view window #define WM_TV_LABEL_DOUBLE_CLICK WM_USER + 0x8ac2 /*! \sa Class ActionCallback\n\n class TrackViewActionCallback : public ActionCallback\n\n \par Description: This class is available in release 4.0 and later only.\n\n This is the callback object for handling TrackView actions.\n\n \par Data Members: <b>HWND mhWnd;</b>\n\n The handle to the.window. */ class TrackViewActionCallback: public ActionCallback { public: /*! \remarks This method specifies which action to execute. This returns a BOOL that indicates if the action was actually executed. If the item is disabled, or if the table that owns it is not activated, then it won't execute, and returns FALSE. If it does execute then TRUE is returned. \par Parameters: <b>int id</b>\n\n The action ID. */ BOOL ExecuteAction(int id); /*! \remarks This method sets the window handle. \par Parameters: <b>HWND hWnd</b>\n\n The handle to the window you wish to set. \par Default Implementation: <b>{ mhWnd = hWnd; }</b> */ void SetHWnd(HWND hWnd) { mhWnd = hWnd; } HWND mhWnd; }; //----------------------------------------------------------------- // // Button IDs for the track view #define ID_TV_TOOLBAR 200 // the toolbar itself (not valid in R5 and later) //#define ID_TV_DELETE 210 #define ID_TV_DELETETIME 215 #define ID_TV_MOVE 220 #define ID_TV_SCALE 230 #define ID_TV_SCALETIME 250 //#define ID_TV_FUNCTION_CURVE 240 #define ID_TV_SNAPKEYS 260 #define ID_TV_ALIGNKEYS 270 #define ID_TV_ADD 280 //#define ID_TV_EDITKEYS 290 //#define ID_TV_EDITTIME 300 //#define ID_TV_EDITRANGE 310 //#define ID_TV_POSITIONRANGE 320 #define ID_TV_FILTERS 330 #define ID_TV_INSERT 340 #define ID_TV_CUT 350 #define ID_TV_COPY 360 #define ID_TV_PASTE 370 #define ID_TV_SLIDE 380 #define ID_TV_SELECT 390 #define ID_TV_REVERSE 400 #define ID_TV_LEFTEND 410 #define ID_TV_RIGHTEND 420 #define ID_TV_SUBTREE 430 #define ID_TV_ASSIGNCONTROL 440 #define ID_TV_MAKEUNIQUE 450 #define ID_TV_CHOOSEORT 460 #define ID_TV_SHOWTANGENTS 470 #define ID_TV_SHOWALLTANGENTS 475 #define ID_TV_SCALEVALUES 480 #define ID_TV_FREEZESEL 490 #define ID_TV_SHOWKEYSONFROZEN 495 #define ID_TV_TEMPLATE 500 //Same as ID_TV_FREEZENONSELCURVES #define ID_TV_FREEZENONSELCURVES 500 #define ID_TV_HIDENONSELCURVES 505 #define ID_TV_LOCKTAN 510 #define ID_TV_PROPERTIES 520 #define ID_TV_NEWEASE 530 #define ID_TV_DELEASE 540 #define ID_TV_TOGGLEEASE 550 #define ID_TV_CHOOSE_EASE_ORT 560 #define ID_TV_CHOOSE_MULT_ORT 570 #define ID_TV_ADDNOTE 580 #define ID_TV_DELETENOTE 590 #define ID_TV_RECOUPLERANGE 600 #define ID_TV_COPYTRACK 610 #define ID_TV_PASTETRACK 620 #define ID_TV_REDUCEKEYS 630 #define ID_TV_ADDVIS 640 #define ID_TV_DELVIS 650 #define ID_TV_TVNAME 660 #define ID_TV_TVUTIL 670 //watje #define ID_TV_GETSELECTED 680 #define ID_TV_DELETECONTROL 690 #define ID_TV_SETUPPERLIMIT 700 #define ID_TV_SETLOWERLIMIT 701 #define ID_TV_TOGGLELIMIT 702 #define ID_TV_REMOVELIMIT 703 #define ID_TV_COPYLIMITONLY 704 #define ID_TV_PASTELIMITONLY 705 #define ID_TV_EXPANDNODES 710 #define ID_TV_EXPANDTRACKS 711 #define ID_TV_EXPANDALL 712 #define ID_TV_COLLAPSENODES 713 #define ID_TV_COLLAPSETRACKS 714 #define ID_TV_COLLAPSEALL 715 #define ID_TV_SELECTALL 720 #define ID_TV_SELECTINVERT 721 #define ID_TV_SELECTNONE 722 #define ID_TV_SELECTCHILDREN 723 #define ID_TV_EDITTRACKSET 730 #define ID_TV_TRACKSETLIST 731 #define ID_TV_AUTOEXPAND_KEYABLE 750 #define ID_TV_AUTOEXPAND_ANIMATED 751 #define ID_TV_AUTOEXPAND_LIMITS 752 #define ID_TV_IGNORE_ANIM_RANGE 760 #define ID_TV_RESPECT_ANIM_RANGE 761 #define ID_TV_FILTER_SELECTEDTRACKS 770 #define ID_TV_EDIT_TRACKSETS 800 // Status tool button IDs #define ID_TV_STATUS 1000 #define ID_TV_ZOOMREGION 1020 #define ID_TV_PAN 1030 #define ID_TV_VFITTOWINDOW 1040 #define ID_TV_HFITTOWINDOW 1050 #define ID_TV_SHOWSTATS 1060 #define ID_TV_TIMETYPEIN 1070 #define ID_TV_VALUETYPEIN 1080 #define ID_TV_ZOOM 1090 #define ID_TV_MAXIMIZE 1100 #define ID_TV_SELWILDCARD 1110 #define ID_TV_ZOOMSEL 1120 // From accelerators #define ID_TV_K_SNAP 2000 //#define ID_TV_K_LOCKKEYS 2010 #define ID_TV_K_MOVEKEYS 2020 #define ID_TV_K_MOVEVERT 2030 #define ID_TV_K_MOVEHORZ 2040 #define ID_TV_K_SELTIME 2050 #define ID_TV_K_SUBTREE 2060 #define ID_TV_K_LEFTEND 2070 #define ID_TV_K_RIGHTEND 2080 #define ID_TV_K_TEMPLATE 2090 #define ID_TV_K_SHOWTAN 2100 #define ID_TV_K_LOCKTAN 2110 #define ID_TV_K_APPLYEASE 2120 #define ID_TV_K_APPLYMULT 2130 #define ID_TV_K_ACCESSTNAME 2140 #define ID_TV_K_ACCESSSELNAME 2150 #define ID_TV_K_ACCESSTIME 2160 #define ID_TV_K_ACCESSVAL 2170 #define ID_TV_K_ZOOMHORZ 2180 #define ID_TV_K_ZOOMHORZKEYS 2190 #define ID_TV_K_ZOOM 2200 #define ID_TV_K_ZOOMTIME 2210 #define ID_TV_K_ZOOMVALUE 2220 //#define ID_TV_K_NUDGELEFT 2230 //#define ID_TV_K_NUDGERIGHT 2240 //#define ID_TV_K_MOVEUP 2250 //#define ID_TV_K_MOVEDOWN 2260 //#define ID_TV_K_TOGGLENODE 2270 //#define ID_TV_K_TOGGLEANIM 2280 #define ID_TV_K_SHOWSTAT 2290 #define ID_TV_K_MOVECHILDUP 2300 #define ID_TV_K_MOVECHILDDOWN 2310 // Button IDs for the tangent type buttons #define ID_TV_TANGENT_FLAT 2320 #define ID_TV_TANGENT_CUSTOM 2330 #define ID_TV_TANGENT_FAST 2340 #define ID_TV_TANGENT_SLOW 2350 #define ID_TV_TANGENT_STEP 2360 #define ID_TV_TANGENT_LINEAR 2370 #define ID_TV_TANGENT_SMOOTH 2380 //Button ID for the DrawCurves Mode button #define ID_TV_DRAWCURVES 2390 // ID for the keyable property toggle action item (R5.1 and later only) #define ID_TV_TOGGLE_KEYABLE 2400 // trackview filter name to mask map #define FILTER_SELOBJECTS (1<<0) #define FILTER_SELCHANNELS (1<<1) #define FILTER_ANIMCHANNELS (1<<2) #define FILTER_WORLDMODS (1<<3) #define FILTER_OBJECTMODS (1<<4) #define FILTER_TRANSFORM (1<<5) #define FILTER_BASEPARAMS (1<<6) #define FILTER_POSX (1<<7) #define FILTER_POSY (1<<8) #define FILTER_POSZ (1<<9) #define FILTER_POSW (1<<10) #define FILTER_ROTX (1<<11) #define FILTER_ROTY (1<<12) #define FILTER_ROTZ (1<<13) #define FILTER_SCALEX (1<<14) #define FILTER_SCALEY (1<<15) #define FILTER_SCALEZ (1<<16) #define FILTER_RED (1<<17) #define FILTER_GREEN (1<<18) #define FILTER_BLUE (1<<19) #define FILTER_ALPHA (1<<20) #define FILTER_CONTTYPES (1<<21) #define FILTER_NOTETRACKS (1<<22) #define FILTER_SOUND (1<<23) #define FILTER_MATMAPS (1<<24) #define FILTER_MATPARAMS (1<<25) #define FILTER_VISTRACKS (1<<26) #define FILTER_GLOBALTRACKS (1<<27) // More filter bits. These are stored in the 2nd DWORD. #define FILTER_GEOM (1<<0) #define FILTER_SHAPES (1<<1) #define FILTER_LIGHTS (1<<2) #define FILTER_CAMERAS (1<<3) #define FILTER_HELPERS (1<<4) #define FILTER_WARPS (1<<5) #define FILTER_VISIBLE_OBJS (1<<6) #define FILTER_POSITION (1<<7) #define FILTER_ROTATION (1<<8) #define FILTER_SCALE (1<<9) #define FILTER_CONTX (1<<10) #define FILTER_CONTY (1<<11) #define FILTER_CONTZ (1<<12) #define FILTER_CONTW (1<<13) #define FILTER_STATICVALS (1<<14) #define FILTER_HIERARCHY (1<<15) #define FILTER_NODES (1<<16) #define FILTER_BONES (1<<17) #define FILTER_KEYABLE (1<<18) //! Whether or not we show only active layer controls or all controls. #define FILTER_ACTIVELAYER (1<<19) #define DEFAULT_TREEVIEW_FILTER0 (FILTER_WORLDMODS|FILTER_OBJECTMODS|FILTER_TRANSFORM| \ FILTER_BASEPARAMS|FILTER_POSX|FILTER_POSY|FILTER_POSZ|FILTER_POSW|FILTER_ROTX|FILTER_ROTY|FILTER_ROTZ| \ FILTER_SCALEX|FILTER_SCALEY|FILTER_SCALEZ|FILTER_RED|FILTER_GREEN|FILTER_BLUE|FILTER_ALPHA| \ FILTER_NOTETRACKS|FILTER_MATMAPS|FILTER_MATPARAMS|FILTER_VISTRACKS|FILTER_SOUND|FILTER_GLOBALTRACKS) #define DEFAULT_TREEVIEW_FILTER1 (FILTER_POSITION|FILTER_ROTATION|FILTER_SCALE| \ FILTER_CONTX|FILTER_CONTY|FILTER_CONTZ|FILTER_CONTW|FILTER_VISIBLE_OBJS|FILTER_STATICVALS| \ FILTER_HIERARCHY|FILTER_NODES) // key tangent display setting #define DISPLAY_TANGENTS_NONE 1 #define DISPLAY_TANGENTS_SELECTED 2 #define DISPLAY_TANGENTS_ALL 3 #endif
[ [ [ 1, 1237 ] ] ]
c41719909949835a42651743f5edb429c44bef71
99527557aee4f1db979a7627e77bd7d644098411
/rainbow/interface.cpp
b17d0491f3004f951b5fb2056698d76a924203a2
[]
no_license
GunioRobot/2deffects
7aeb02400090bb7118d23f1fc435ffbdd4417c59
39d8e335102d6a51cab0d47a3a2dc7686d7a7c67
refs/heads/master
2021-01-18T14:10:32.049756
2008-09-15T15:56:50
2008-09-15T15:56:50
null
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
4,944
cpp
#include "utils/winutils/dibsection.h" #include "utils/color.h" #include "interface.h" #include <iostream> #include <iomanip> #include <fstream> #include <ctime> #include <cmath> #if 0//defined(__SWIG__) #define STDCALL_ #else #define STDCALL_ __stdcall #endif #define for if(false);else for using namespace geo; namespace { raytrace::ProjectionSystem proj_; raytrace::PhotoEnvironment phenv_; syd::Rect proj_area_; bool check() { // 正確なチェックじゃあない。 using namespace std; if( proj_.camera_dist() > 0.0 && norm(proj_.u_dir()) > 0.0 && norm(proj_.v_dir()) > 0.0) { if( phenv_.ambient() >= 0.0 ) { if( proj_area_.size() !=0.0 ) { cout<< proj_area_.topLeft().x() << "," << proj_area_.topLeft().y() << "," << proj_area_.bottomRight().x() << "," << proj_area_.bottomRight().y() << endl; return true; } } else { cout << phenv_.ambient() << "," << phenv_.get_skycolor(vector3d(1,0,0)).r() << "," << phenv_.get_skycolor(vector3d(1,0,0)).g() << "," << phenv_.get_skycolor(vector3d(1,0,0)).b() << "," << phenv_.light().intensity_at(vector3d(0,0,0)) << endl; } } return false; } } // noname namespace; inline double rand500() { using namespace std; return 500.0-1000.0*rand()/RAND_MAX; } inline double rand1() { using namespace std; return (double)rand()/RAND_MAX*0.6+0.4; } raytrace::World* new_random_world() { using namespace raytrace; using namespace geo; typedef vector3d v3d; typedef GeneralPlane gp; //3Dワールド系 World* pworld=new World; World& world=*pworld; PlaneTraits traits( 0.3, 0.9, 0.55, color_t(0,0,0) ); for(int i=0; i<2; i++) { v3d p0 = v3d(rand500()*2.4,rand500()*1.2,-rand500()/2-1500); Triangle tri(p0, add(p0,v3d(rand500()*1.6,rand500()*2,rand500()*0.7)), add(p0,v3d(rand500()*1.6,rand500()*2,rand500()*0.7)) ); v3d normal = tri.normal(); world.set_plane( gp( tri, traits.color( color_t(rand1(),rand1(),rand1()) ) ) ); } traits.specular_refrectance(0.55); for(int i=5; i<10; i++) { int r=(rand500()+500)/4; int z=-r-(rand500()/2+800)/2; world.set_plane( gp( Sphere( v3d(rand500(),rand500(),z), r ), traits.color( color_t(rand1(),rand1(),rand1()) ) ) ); } int x=-1000,z=-4000,y=-900; int ww=2000,hh=3000,dd=3990; v3d v1(x,y,z+dd/3),v2(x+ww,y,z+dd/3),v3(x+ww,y+hh,z+dd/3),v4(x,y+hh,z+dd/3); traits.diffuse_refrectance(0.1); traits.specular_refrectance(0.9); world.set_plane( gp( Triangle( v1,v3,v2 ), // 立ってる方 traits.color(color_t(0.2,0.2,0.2)) ) ); world.set_plane( gp( Triangle( v1,v4,v3 ), traits) ); ww+=3000;x-=1500; z-=2000;dd+=2000; v3d v5(x,y,z),v6(x+ww,y,z),v7(x+ww,y,z+dd),v8(x,y,z+dd); traits.diffuse_refrectance(0.7); traits.specular_refrectance(0.45); world.set_plane( gp( Triangle( v5,v6,v7 ), traits.color(color_t(0.2,0.2,0.8)) ) ); world.set_plane( gp( Triangle( v5,v7,v8 ), traits ) ); return pworld; } void STDCALL_ proj_system( const vector3d* plane_pos, const vector3d* u_dir, const vector3d* v_dir, double camera_dist ) { proj_.plane_pos( *plane_pos ) .u_dir( normalize( *u_dir )) .v_dir( normalize( *v_dir )) .camera_dist( camera_dist ); } void STDCALL_ proj_area( const syd::Rect* rect ) { proj_area_=*rect; } void STDCALL_ photo_env( const vector3d* light_dir, double light_intensity, double ambient, const raytrace::color_t* skycol, int rainbow, double rainbow_intensity ) { using namespace raytrace; ParallelLight paralell_light( *light_dir, light_intensity); Angle2RefractionTable* a2r = new Angle2RefractionTable; Refraction2LambdaTable* r2l = new Refraction2LambdaTable( std::fstream( "refraction2lambda.txt" ) ); Lambda2RgbTable* l2rgb = new Lambda2RgbTable( std:: fstream( "lambda2rgb.txt" ) ); phenv_.light( new ParallelLight(paralell_light) ) .ambient( ambient ) .skycolor( *skycol ) .rainbow( (bool)rainbow ) .rainbow_factor( a2r, r2l, l2rgb, rainbow_intensity ); } void draw( syd::Bitmap& buf, unsigned depth ) { using namespace geo; using namespace raytrace; typedef vector3d v3d; // 3Dオブジェクト World* pworld = new World;//new_random_world(); // 描画!!! { syd::bmp_lock_key key(buf); raytrace::raytrace( proj_, proj_area_, RaytraceCore(*pworld,phenv_), depth, buf); } delete pworld; } void STDCALL_ raytrace_draw(HDC hdc, unsigned w, unsigned h, unsigned depth) { using namespace syd; srand(time(0)); if( check() ){ syd::DibSection dib(w,h,4); draw( dib, depth ); BitBlt(hdc, 0,0,w,h, dib.getDC(), 0,0, SRCCOPY); } else { std::cout << "bad param" << std::endl; } }
[ [ [ 1, 212 ] ] ]
99d29fb2f2cf7bc902e7f98141ca99c15667b2c0
cf579692f2e289563160b6a218fa5f1b6335d813
/XBtool/StringEdit.h
81af204134708c9569681ee9fdfb2f4b4aa24051
[]
no_license
opcow/XBtool
a7451971de3296e1ce5632b0c9d95430f6d3b223
718a7fbf87e08c12c0c829dd2e2c0d6cee967cbe
refs/heads/master
2021-01-16T21:02:17.759102
2011-03-09T23:36:54
2011-03-09T23:36:54
1,461,420
8
2
null
null
null
null
UTF-8
C++
false
false
4,109
h
//***************************************************************************** // header file //***************************************************************************** // // FILE NAME: StringEdit.h // #if !defined(AFX_STRINGEDIT_H__A8199B9F_CB7C_12E1_ADB8_000000000000__INCLUDED_) #define AFX_STRINGEDIT_H__A8199B9F_CB7C_12E1_ADB8_000000000000__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 class CStringEdit : public CEdit { public: // Construction CStringEdit(); // Destructor virtual ~CStringEdit(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CStringEdit) //}}AFX_VIRTUAL // Implementation void SetFixedLen(BOOL bFixedLen); // set fixed length flag BOOL GetFixedLen(void) { return(m_bFixedLen); } // read back the fixed length flag void SetMode(BOOL bMode); // sets edit/status mode BOOL GetMode(void) { return(m_bMode); } // reads back the mode flag void SetAlertActive(UINT nSeconds); // start active alert mode void SetAlertInactive(void); // End the alert mode void SetMaxLength(int nMax); // method to set the maximum string length int GetMaxLength(void) { return(m_nMax); } // method to read back the maximum string length void SetLegal(LPCSTR lpszLegal); // sets the string of legal characters void GetLegal(CString& strLegal) { strLegal = m_strLegal; } // gets back the legal string void SetIllegal(LPCSTR lpszIllegal); // sets the string of illegal characters void GetIllegal(CString& strIllegal) { strIllegal = m_strIllegal; } // gets back the illlegal string void SetStatus(LPCSTR lpszStatus); // set status string void GetStatus(CString& strStatus) { strStatus = m_strStatus; } // gets back the status string void SetAlert(LPCSTR lpszAlert); // set alert string void GetAlert(CString& strAlert) { strAlert = m_strAlert; } // gets back the alert string void SetText(LPCSTR lpszText); // plug text into control void GetText(CString& strText); // take text out of control protected: // Generated message map functions //{{AFX_MSG(CStringEdit) afx_msg BOOL OnUpdate(); afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnDestroy(); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: // Implementation BOOL ValidateText(CString& strText); // returns TRUE if text validates OK // Attributes BOOL m_bFixedLen; // Flag to control the return of a string padded with // spaces to m_nMax length. This is ignored if the // maximum length is set to <=0. int m_nMax; // Maximum number characters in the edit string BOOL m_bMode; // Flag to control the display mode to show status // if true and the edit text if in the false state BOOL m_bAlert; // Flag to control overide Alert Mode if true CString m_strLegal; // string of legal input characters CString m_strIllegal; // string of illegal characters. CString m_strLastValid; // buffer of last valid string entry CString m_strStatus; // buffer to hold Status text CString m_strAlert; // buffer to hold Alert text COLORREF m_clrText; // holds color of edit text COLORREF m_clrEdBkgnd; // Color of the Edit Mode background COLORREF m_clrStBkgnd; // Color of the Status Mode background COLORREF m_clrAlBkgnd; // Color of the Alert Mode background CBrush m_brEdBkgnd; // Brush for the Edit Mode background CBrush m_brStBkgnd; // Brush for the Status Mode background CBrush m_brAlBkgnd; // Brush for the Alert Mode background UINT m_nTimerID; // Timer number for the alert timer UINT m_nTimerCntr; // Timer count down register. UINT m_nTimerEvent; // Event ID for the timer. }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STRINGEDIT_H__A8199B9F_CB7C_12E1_ADB8_000000000000__INCLUDED_)
[ [ [ 1, 93 ] ] ]
7822ce9edf7883979c6d1478ae2c0a117b25176c
136e81907731410b95458d5401d4ecf4e092ba39
/src/wrapper/Standalone/juce_StandaloneFilterWindow.cpp
4347d1446e332cbdf6a5c3ccaba30afec9784826
[]
no_license
ZECTBynmo/MyAwesomeSynth
11c4b317a9cb8f254f3093638f085f2c4dfca241
121abf608f330bc493ed7b3bdce4127e18078491
refs/heads/master
2020-05-29T12:23:04.677418
2010-02-21T02:49:28
2010-02-21T02:49:28
16,752,671
1
0
null
null
null
null
UTF-8
C++
false
false
9,777
cpp
/* ============================================================================== This file is part of the JUCE library - "Jules' Utility Class Extensions" Copyright 2004-9 by Raw Material Software Ltd. ------------------------------------------------------------------------------ JUCE can be redistributed and/or modified under the terms of the GNU General Public License (Version 2), as published by the Free Software Foundation. A copy of the license is included in the JUCE distribution, or can be found online at www.gnu.org/licenses. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ------------------------------------------------------------------------------ To release a closed-source product which uses JUCE, commercial licenses are available: visit www.rawmaterialsoftware.com/juce for more information. ============================================================================== */ #include "juce_StandaloneFilterWindow.h" #include "../juce_PluginHeaders.h" //============================================================================== /** Somewhere in the codebase of your plugin, you need to implement this function and make it create an instance of the filter subclass that you're building. */ extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); //============================================================================== StandaloneFilterWindow::StandaloneFilterWindow (const String& title, const Colour& backgroundColour) : DocumentWindow (title, backgroundColour, DocumentWindow::minimiseButton | DocumentWindow::closeButton), filter (0), deviceManager (0), optionsButton (0) { setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false); PropertySet* const globalSettings = getGlobalSettings(); optionsButton = new TextButton (T("options")); Component::addAndMakeVisible (optionsButton); optionsButton->addButtonListener (this); optionsButton->setTriggeredOnMouseDown (true); JUCE_TRY { filter = createPluginFilter(); if (filter != 0) { deviceManager = new AudioFilterStreamingDeviceManager(); deviceManager->setFilter (filter); XmlElement* savedState = 0; if (globalSettings != 0) savedState = globalSettings->getXmlValue (T("audioSetup")); deviceManager->initialise (filter->getNumInputChannels(), filter->getNumOutputChannels(), savedState, true); delete savedState; if (globalSettings != 0) { MemoryBlock data; if (data.fromBase64Encoding (globalSettings->getValue (T("filterState"))) && data.getSize() > 0) { filter->setStateInformation (data.getData(), data.getSize()); } } setContentComponent (filter->createEditorIfNeeded(), true, true); const int x = globalSettings->getIntValue (T("windowX"), -100); const int y = globalSettings->getIntValue (T("windowY"), -100); if (x != -100 && y != -100) setBoundsConstrained (x, y, getWidth(), getHeight()); else centreWithSize (getWidth(), getHeight()); } } JUCE_CATCH_ALL if (deviceManager == 0) { jassertfalse // Your filter didn't create correctly! In a standalone app that's not too great. JUCEApplication::quit(); } } StandaloneFilterWindow::~StandaloneFilterWindow() { PropertySet* const globalSettings = getGlobalSettings(); globalSettings->setValue (T("windowX"), getX()); globalSettings->setValue (T("windowY"), getY()); deleteAndZero (optionsButton); if (globalSettings != 0 && deviceManager != 0) { XmlElement* const xml = deviceManager->createStateXml(); globalSettings->setValue (T("audioSetup"), xml); delete xml; } deleteAndZero (deviceManager); if (globalSettings != 0 && filter != 0) { MemoryBlock data; filter->getStateInformation (data); globalSettings->setValue (T("filterState"), data.toBase64Encoding()); } deleteFilter(); } //============================================================================== void StandaloneFilterWindow::deleteFilter() { if (deviceManager != 0) deviceManager->setFilter (0); if (filter != 0 && getContentComponent() != 0) { filter->editorBeingDeleted (dynamic_cast <AudioProcessorEditor*> (getContentComponent())); setContentComponent (0, true); } deleteAndZero (filter); } void StandaloneFilterWindow::resetFilter() { deleteFilter(); filter = createPluginFilter(); if (filter != 0) { if (deviceManager != 0) deviceManager->setFilter (filter); setContentComponent (filter->createEditorIfNeeded(), true, true); } PropertySet* const globalSettings = getGlobalSettings(); if (globalSettings != 0) globalSettings->removeValue (T("filterState")); } //============================================================================== void StandaloneFilterWindow::saveState() { PropertySet* const globalSettings = getGlobalSettings(); FileChooser fc (TRANS("Save current state"), globalSettings != 0 ? File (globalSettings->getValue (T("lastStateFile"))) : File::nonexistent); if (fc.browseForFileToSave (true)) { MemoryBlock data; filter->getStateInformation (data); if (! fc.getResult().replaceWithData (data.getData(), data.getSize())) { AlertWindow::showMessageBox (AlertWindow::WarningIcon, TRANS("Error whilst saving"), TRANS("Couldn't write to the specified file!")); } } } void StandaloneFilterWindow::loadState() { PropertySet* const globalSettings = getGlobalSettings(); FileChooser fc (TRANS("Load a saved state"), globalSettings != 0 ? File (globalSettings->getValue (T("lastStateFile"))) : File::nonexistent); if (fc.browseForFileToOpen()) { MemoryBlock data; if (fc.getResult().loadFileAsData (data)) { filter->setStateInformation (data.getData(), data.getSize()); } else { AlertWindow::showMessageBox (AlertWindow::WarningIcon, TRANS("Error whilst loading"), TRANS("Couldn't read from the specified file!")); } } } //============================================================================== PropertySet* StandaloneFilterWindow::getGlobalSettings() { /* If you want this class to store the plugin's settings, you can set up an ApplicationProperties object and use this method as it is, or override this method to return your own custom PropertySet. If using this method without changing it, you'll probably need to call ApplicationProperties::setStorageParameters() in your plugin's constructor to tell it where to save the file. */ return ApplicationProperties::getInstance()->getUserSettings(); } void StandaloneFilterWindow::showAudioSettingsDialog() { AudioDeviceSelectorComponent selectorComp (*deviceManager, filter->getNumInputChannels(), filter->getNumInputChannels(), filter->getNumOutputChannels(), filter->getNumOutputChannels(), true, false, true, false); selectorComp.setSize (500, 450); DialogWindow::showModalDialog (TRANS("Audio Settings"), &selectorComp, this, Colours::lightgrey, true, false, false); } //============================================================================== void StandaloneFilterWindow::closeButtonPressed() { JUCEApplication::quit(); } void StandaloneFilterWindow::resized() { DocumentWindow::resized(); if (optionsButton != 0) optionsButton->setBounds (8, 6, 60, getTitleBarHeight() - 8); } void StandaloneFilterWindow::buttonClicked (Button*) { if (filter == 0) return; PopupMenu m; m.addItem (1, TRANS("Audio Settings...")); m.addSeparator(); m.addItem (2, TRANS("Save current state...")); m.addItem (3, TRANS("Load a saved state...")); m.addSeparator(); m.addItem (4, TRANS("Reset to default state")); switch (m.showAt (optionsButton)) { case 1: showAudioSettingsDialog(); break; case 2: saveState(); break; case 3: loadState(); break; case 4: resetFilter(); break; default: break; } }
[ [ [ 1, 295 ] ] ]
884adb2487da8b8eacd19002c6bdb794ccefef3f
1d6dcdeddc2066f451338361dc25196157b8b45c
/tp2/Geometria/Coordenadas.cpp
990cb9802a28bd476ef5790b5a1b46318656b1d8
[]
no_license
nicohen/ssgg2009
1c105811837f82aaa3dd1f55987acaf8f62f16bb
467e4f475ef04d59740fa162ac10ee51f1f95f83
refs/heads/master
2020-12-24T08:16:36.476182
2009-08-15T00:43:57
2009-08-15T00:43:57
34,405,608
0
0
null
null
null
null
UTF-8
C++
false
false
2,089
cpp
#include "Coordenadas.h" #include "Circunferencia.h" Coordenadas::Coordenadas() { this->x = 0; this->y = 0; this->z = 0; } Coordenadas::Coordenadas(int x, int y) { this->x = x; this->y = y; this->z = 0; } Coordenadas::Coordenadas(int x, int y, int z) { this->x = x; this->y = y; this->z = z; } Coordenadas::Coordenadas(float x, float y) { this->x = x; this->y = y; this->z = 0; } Coordenadas::Coordenadas(float x, float y, float z) { this->x = x; this->y = y; this->z = z; } Coordenadas::Coordenadas(double x, double y) { this->x = x; this->y = y; this->z = 0; } Coordenadas::Coordenadas(double x, double y, double z) { this->x = x; this->y = y; this->z = z; } Coordenadas::~Coordenadas() { //dtor } bool Coordenadas::tieneMayorX(Coordenadas* c){ bool mayor; (this->x >= c->getX())? mayor = true : mayor = false; return mayor; } Coordenadas* Coordenadas::mayorX(Coordenadas* c){ Coordenadas* coordenadas; (this->x > c->getX()) ? coordenadas = this : coordenadas = c; return coordenadas; } Coordenadas* Coordenadas::menorX(Coordenadas* c){ Coordenadas* coordenadas; (this->x < c->getX()) ? coordenadas = this : coordenadas = c; return coordenadas; } Coordenadas* Coordenadas::mayorY(Coordenadas* c){ Coordenadas* coordenadas; (this->y > c->getY()) ? coordenadas = this : coordenadas = c; return coordenadas; } Coordenadas* Coordenadas::menorY(Coordenadas* c){ Coordenadas* coordenadas; (this->y < c->getY()) ? coordenadas = this : coordenadas = c; return coordenadas; } double Coordenadas::distancia (Coordenadas hasta){ float deltaX = hasta.getX() - this->x; float deltaY = hasta.getY() - this->y; return sqrt(deltaX*deltaX + deltaY*deltaY); } bool Coordenadas::operator == (Coordenadas coordenadas){ return ((this->x == coordenadas.getX()) && (this->y == coordenadas.getY())); } void Coordenadas::dibujar(){ Circunferencia* c = new Circunferencia(0.01,this->copia()); c->setColorBorde(this->borde); c->setColorRelleno(this->borde); c->dibujar(); delete c; }
[ "rodvar@6da81292-15a5-11de-a4db-e31d5fa7c4f0", "nicohen@6da81292-15a5-11de-a4db-e31d5fa7c4f0" ]
[ [ [ 1, 3 ], [ 5, 5 ], [ 14, 51 ], [ 54, 67 ] ], [ [ 4, 4 ], [ 6, 13 ], [ 52, 53 ] ] ]
9df412a9b3d39205e9c4383d452068bde42964cd
36d0ddb69764f39c440089ecebd10d7df14f75f3
/プログラム/Ngllib/src/Mesh.cpp
629273e4e89f8a604f4e9e716409e6285cbf0eac
[]
no_license
weimingtom/tanuki-mo-issyo
3f57518b4e59f684db642bf064a30fc5cc4715b3
ab57362f3228354179927f58b14fa76b3d334472
refs/heads/master
2021-01-10T01:36:32.162752
2009-04-19T10:37:37
2009-04-19T10:37:37
48,733,344
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
22,590
cpp
/*******************************************************************************/ /** * @file Mesh.cpp. * * @brief メッシュクラスソースファイル. * * @date 2008/10/09. * * @version 1.00. * * @author Kentarou Nishimura. */ /******************************************************************************/ #include "Ngl/Mesh.h" #include "Ngl/FileInputC.h" #include "Ngl/Manipulator.h" #include "Ngl/Utility.h" #include "Ngl/Vector4.h" #include <cassert> using namespace Ngl; /*=========================================================================*/ /** * @brief コンストラクタ * * @param[in] renderer レンダラー. */ Mesh::Mesh( IRenderer* renderer ): renderer_( renderer ), meshInfo_( 0 ), indexBuffer_( 0 ), vertexDeclaration_( 0 ) { // 初期値を作成 bufferList_[ STREAM_TYPE_VERTEX ] = 0; bufferList_[ STREAM_TYPE_NORMAL ] = 0; bufferList_[ STREAM_TYPE_DIFFUSE ] = 0; bufferList_[ STREAM_TYPE_SPECULAR ] = 0; bufferList_[ STREAM_TYPE_TEXCOORD ] = 0; bufferList_[ STREAM_TYPE_BLENDWEIGHT ] = 0; bufferList_[ STREAM_TYPE_MATRIXINDEX ] = 0; bufferList_[ STREAM_TYPE_TANGENT ] = 0; bufferList_[ STREAM_TYPE_BINORMAL ] = 0; } /*=========================================================================*/ /** * @brief デストラクタ * * @param[in] なし. */ Mesh::~Mesh() { release(); } /*=========================================================================*/ /** * @brief 頂点フォーマットを設定 * * @param[in] format 頂点フォーマット構造体. * @return なし. */ void Mesh::setVertexFormat( const VertexFormat& format ) { info_.numVertices = format.numVertices; info_.numIndices = format.numIndices; info_.numWeights = format.numWeights; info_.hasTextureSpace = format.hasTextureSpace; info_.hasMatrixIndices = format.hasMatrixIndices; } /*=========================================================================*/ /** * @brief バッファデータを設定 * * @warning 設定したバッファはMeshクラスで削除されます。 * * @param[in] buf 設定するバッファのポインタ. * @param[in] type 設定するバッファのストリームタイプ. * @return なし. */ void Mesh::setBuffer( IBuffer* buf, StreamType type ) { assert( buf != 0 ); if( bufferList_[ type ] != 0 ){ delete bufferList_[ type ]; } bufferList_[ type ] = buf; } /*=========================================================================*/ /** * @brief インデックスバッファデータを設定 * * @warning 設定したバッファはMeshクラスで削除されます。 * * @param[in] buf 設定するバッファのポインタ. * @return なし. */ void Mesh::setIndexBuffer( IBuffer* buf ) { assert( buf != 0 ); if( indexBuffer_ != 0 ){ delete indexBuffer_; } indexBuffer_ = buf; } /*=========================================================================*/ /** * @brief マテリアルデータを設定 * * Meshクラスに設定した順番で、マテリアル番号が自動的に設定されます。 * * @warning 設定したマテリアルはMeshクラスで削除されます。 * @warning テクスチャが設定されていた場合は、ともに削除されます。 * * @param[in] material 設定するマテリアルのポインタ. * @return なし. */ void Mesh::setMaterial( MeshMaterial* material ) { materialArray_.push_back( material ); // テクスチャを持っているか if( material->hasTexture == true ){ info_.hasTexture = true; } // マテリアル数をカウント ++info_.numMaterials; } /*=========================================================================*/ /** * @brief 面データグループを設定 * * Meshクラスに設定した順番で、面データグループ番号が自動的に設定されます。 * * @warning 設定した面データグループはMeshクラスで削除されます。 * * @param[in] face 設定する面データグループのポインタ. * @return なし. */ void Mesh::setFaceGroup( FaceGroup* face ) { faceGroupArray_.push_back( face ); // 面データグループ数をカウント ++info_.numSubsets; } /*=========================================================================*/ /** * @brief 衝突判定データを作成する * * 設定されている頂点バッファとインデックスバッファから衝突判定データを作成します。 * どちらかのバッファが設定されていない場合は、作成されません。 * * @param[in] なし. * @return なし. */ void Mesh::createCollisionData() { assert( bufferList_[ STREAM_TYPE_VERTEX ] != 0 && indexBuffer_ != 0 ); // メッシュ衝突判定データを作成 collision_.create( info_, bufferList_[ STREAM_TYPE_VERTEX ], indexBuffer_ ); } /*=========================================================================*/ /** * @brief 解放処理 * * @param[in] なし. * @return なし. */ void Mesh::release() { // 頂点宣言データを削除 delete vertexDeclaration_; // 面データを配列を削除 FaceGroupArray::iterator itor = faceGroupArray_.begin(); while( itor != faceGroupArray_.end() ){ delete *itor; itor = faceGroupArray_.erase( itor ); } // マテリアルデータを配列を削除 MaterialArray::iterator matItor = materialArray_.begin(); while( matItor != materialArray_.end() ){ // テクスチャが張られているか if( (*matItor)->hasTexture == true ){ // テクスチャを削除 delete (*matItor)->texture; } delete *matItor; matItor = materialArray_.erase( matItor ); } // バッファリストを削除 BufferList::iterator bufItor = bufferList_.begin(); while( bufItor != bufferList_.end() ) { delete bufItor->second; bufItor = bufferList_.erase( bufItor ); } // インデックスバッファを削除 delete indexBuffer_; } /*=========================================================================*/ /** * @brief 描画処理 * * @param[in] effect エフェクトのポインタ. * @return なし. */ void Mesh::draw( IEffect* effect ) { // 面データを描画する for( unsigned int face=0; face<info_.numSubsets; ++face ){ // サブセットを描画する drawSubset( face, effect ); } } /*=========================================================================*/ /** * @brief サブセットを描画 * * @param[in] faceNo 面データ番号. * @param[in] effect エフェクト. * @return なし. */ void Mesh::drawSubset( unsigned int faceNo, IEffect* effect ) { assert( effect != 0 ); // 頂点ストリームを設定 renderer_->setVertexBuffer( &streamDescArray_[ 0 ], (unsigned int)streamDescArray_.size() ); // 頂点宣言データを設定 renderer_->setVertexDeclaration( vertexDeclaration_ ); // インデックスバッファの設定 renderer_->setIndexBuffer( indexBuffer_, INDEX_TYPE_USHORT ); // マテリアル番号を取得 int matNo = faceGroupArray_[ faceNo ]->materialNo; // マテリアルデータをエフェクトに出力する if( effectOutputDesc().isOutMaterial == true ){ effect->setVector( effectOutputDesc_.matAmbientName.c_str(), materialArray_[ matNo ]->material.ambient.r, materialArray_[ matNo ]->material.ambient.g, materialArray_[ matNo ]->material.ambient.b, materialArray_[ matNo ]->material.ambient.a ); effect->setVector( effectOutputDesc_.matDiffuseName.c_str(), materialArray_[ matNo ]->material.diffuse.r, materialArray_[ matNo ]->material.diffuse.g, materialArray_[ matNo ]->material.diffuse.b, materialArray_[ matNo ]->material.diffuse.a ); effect->setVector( effectOutputDesc_.matSpecularName.c_str(), materialArray_[ matNo ]->material.specular.r, materialArray_[ matNo ]->material.specular.g, materialArray_[ matNo ]->material.specular.b, materialArray_[ matNo ]->material.specular.a ); effect->setVector( effectOutputDesc_.matEmissiveName.c_str(), materialArray_[ matNo ]->material.emissive.r, materialArray_[ matNo ]->material.emissive.g, materialArray_[ matNo ]->material.emissive.b, materialArray_[ matNo ]->material.emissive.a ); effect->setScalar( effectOutputDesc_.matShininessName.c_str(), materialArray_[ matNo ]->material.power ); } // テクスチャをエフェクトに出力する if( materialArray_[ matNo ]->hasTexture == true && effectOutputDesc().isOutTexture == true ){ effect->setTexture( effectOutputDesc_.textureName.c_str(), materialArray_[ matNo ]->texture ); } // パスの回数分レンダリング for( int pass=0; pass<effect->getNumPass(); ++pass ){ // エフェクトを開始する effect->begin( pass ); // 頂点インデックスを利用して描画 renderer_->setPrimitive( PRIMITIVE_TYPE_TRIANGLE_LIST ); renderer_->drawIndexed( faceGroupArray_[ faceNo ]->numIndices, faceGroupArray_[ faceNo ]->startIndices ); // エフェクトの終了 effect->end(); } } /*=========================================================================*/ /** * @brief メッシュ情報を取得 * * @param[in] なし. * @return メッシュ情報構造体. */ const MeshInfo& Mesh::info() const { return info_; } /*=========================================================================*/ /** * @brief エフェクト出力記述子を取得 * * @param[in] なし. * @return エフェクト出力記述子. */ const EffectOutputDesc& Mesh::effectOutputDesc() const { return effectOutputDesc_; } /*=========================================================================*/ /** * @brief エフェクト出力記述子を設定 * * @param[in] desc エフェクト出力記述子. * @return なし. */ void Mesh::effectOutputDesc( const EffectOutputDesc& desc ) { effectOutputDesc_ = desc; } /*=========================================================================*/ /** * @brief 指定面データを取得する * * @param[in] faceNo 取得する面データ番号. * @return 面データ構造体. */ const FaceGroup& Mesh::getFaceGroups( unsigned int faceNo ) { return *faceGroupArray_[ faceNo ]; } /*=========================================================================*/ /** * @brief 指定メッシュマテリアルデータを取得する * * @param[in] matNo 取得するメッシュマテリアル番号. * @return メッシュマテリアル構造体. */ const MeshMaterial& Mesh::getMaterial( unsigned int matNo ) { return *materialArray_[ matNo ]; } /*=========================================================================*/ /** * @brief インデックスバッファを取得 * * @param[in] なし. * @return インデックスバッファポインタ. */ IBuffer* Mesh::getIndexBuffer() { return indexBuffer_; } /*=========================================================================*/ /** * @brief 頂点バッファを取得 * * @param[in] stream 取得するバッファの種類. * @return 頂点バッファポインタ. */ IBuffer* Mesh::getVertexBuffer( StreamType stream ) { return bufferList_[ stream ]; } /*=========================================================================*/ /** * @brief 頂点宣言データを作成 * * @param[in] inputSignature 入力シグネチャ記述子の参照. * @return なし. */ void Mesh::setVertexDeclaration( const InputSignatureDesc& inputSignature ) { // 頂点宣言データがすでに存在するか if( vertexDeclaration_ != 0 ){ delete vertexDeclaration_; } // ストリームタイプ配列を設定 setStreamType(); // レイアウトデータを作成する std::vector< VertexDeclarationDesc > layout; // 頂点レイアウト for( unsigned int streamNo=0; streamNo<streamTypeArray_.size(); ++streamNo ){ StreamType type = streamTypeArray_[ streamNo ]; VertexDeclarationDesc decl = { getSemantic( type ), 0, getType( type ), 0, streamNo }; // データを設定 layout.push_back( decl ); } // 頂点宣言データを作成する vertexDeclaration_ = renderer_->createVertexDeclaration( &layout[ 0 ], (unsigned int)layout.size(), inputSignature ); assert( vertexDeclaration_ != 0 ); // 頂点ストリームを設定 setVertexStream(); } /*===========================================================================*/ /** * @brief 線分との衝突判定 * * @param[in] line0 線分の始点. * @param[in] line1 線分の終点. * @return 衝突結果構造体の参照. */ const PlaneCollisionReport& Mesh::collisionLine( const float* line0, const float* line1 ) { return collision_.line( line0, line1 ); } /*===========================================================================*/ /** * @brief 指定の面データグループと線分との衝突判定 * * @param[in] faceNo 面データグループ番号. * @param[in] line0 線分の始点. * @param[in] line1 線分の終点. * @return 衝突結果構造体の参照. */ const PlaneCollisionReport& Mesh::collisionFaceAndLine( int faceNo, const float* line0, const float* line1 ) { // 開始ポリゴンデータ番号を求める int planeNo = faceGroupArray_[ faceNo ]->startIndices / 3; // ポリゴンと線分の衝突判定 for( unsigned int i=0; i<faceGroupArray_[ faceNo ]->numIndices/3; ++i ){ const PlaneCollisionReport& report = collision_.polygonAndLine( planeNo, line0, line1 ); if( report.isCollision == true ){ return report; } // ポリゴンデータ番号を更新 planeNo++; } return PLANECOLLISIONREPORT_NOT_COLLISION; } /*===========================================================================*/ /** * @brief 3D線との衝突判定 * * @param[in] rayPos 3D線の始点座標. * @param[in] rayDir 3D線の方向. * @return 面データ衝突パラメーター. */ const PlaneCollisionReport& Mesh::collisionRay( const float* rayPos, const float* rayDir ) { return collision_.ray( rayPos, rayDir ); } /*===========================================================================*/ /** * @brief 指定の面データグループと3D線との衝突判定 * * @param[in] faceNo 面データグループ番号. * @param[in] rayPos 3D線の始点座標. * @param[in] rayDir 3D線の方向. * @return 面データ衝突パラメーター. */ const PlaneCollisionReport& Mesh::collisionFaceAndRay( int faceNo, const float* rayPos, const float* rayDir ) { // 開始ポリゴンデータ番号を求める int planeNo = faceGroupArray_[ faceNo ]->startIndices / 3; // ポリゴンと線分の衝突判定 for( unsigned int i=0; i<faceGroupArray_[ faceNo ]->numIndices/3; ++i ){ const PlaneCollisionReport& report = collision_.polygonAndRay( planeNo, rayPos, rayDir ); if( report.isCollision == true ){ return report; } // ポリゴンデータ番号を更新 planeNo++; } return PLANECOLLISIONREPORT_NOT_COLLISION; } /*===========================================================================*/ /** * @brief 球体との衝突判定 * * @param[in] center 球体の中心位置. * @param[in] radius 球体の半径. * @return 面データ衝突パラメーター. */ const PlaneCollisionReport& Mesh::collisionSphere( const float* center, float radius ) { return collision_.sphere( center, radius ); } /*===========================================================================*/ /** * @brief 指定の面データグループと球体との衝突判定 * * @param[in] faceNo 面データグループ番号. * @param[in] center 球体の中心位置. * @param[in] radius 球体の半径. * @return 面データ衝突パラメーター. */ const PlaneCollisionReport& Mesh::collisionFaceAndSphere( int faceNo, const float* center, float radius ) { // 開始ポリゴンデータ番号を求める int planeNo = faceGroupArray_[ faceNo ]->startIndices / 3; // ポリゴンと線分の衝突判定 for( unsigned int i=0; i<faceGroupArray_[ faceNo ]->numIndices/3; ++i ){ const PlaneCollisionReport& report = collision_.polygonAndSphere( planeNo, center, radius ); if( report.isCollision == true ){ return report; } // ポリゴンデータ番号を更新 planeNo++; } return PLANECOLLISIONREPORT_NOT_COLLISION; } /*=========================================================================*/ /** * @brief 頂点ストリームデータを設定 * * @param[in] なし. * @return なし. */ void Mesh::setVertexStream() { // 以前のデータを削除 streamDescArray_.clear(); IBuffer* buffers[] = { // バッファのポインタ配列 bufferList_[ STREAM_TYPE_VERTEX ], // STREAM_TYPE_VERTEX = 0, bufferList_[ STREAM_TYPE_NORMAL ], // STREAM_TYPE_NORMAL = 1, bufferList_[ STREAM_TYPE_DIFFUSE ], // STREAM_TYPE_DIFFUSE = 2, bufferList_[ STREAM_TYPE_SPECULAR ], // STREAM_TYPE_SPECULAR = 3, bufferList_[ STREAM_TYPE_TEXCOORD ], // STREAM_TYPE_TEXCOORD = 4, bufferList_[ STREAM_TYPE_BLENDWEIGHT ], // STREAM_TYPE_BLENDWEIGHT = 5, bufferList_[ STREAM_TYPE_MATRIXINDEX ], // STREAM_TYPE_MATRIXINDEX = 6, bufferList_[ STREAM_TYPE_TANGENT ], // STREAM_TYPE_TANGENT = 7, bufferList_[ STREAM_TYPE_BINORMAL ] // STREAM_TYPE_BINORMAL = 8 }; // ストリームを設定 VertexStreamDesc streamDesc; for( unsigned int streamNo=0; streamNo<streamTypeArray_.size(); ++streamNo ){ streamDesc.buffer = buffers[ streamTypeArray_[ streamNo ] ]; streamDesc.offset = 0; streamDesc.stride = getStride( streamTypeArray_[ streamNo ] ); streamDescArray_.push_back( streamDesc ); } } /*=========================================================================*/ /** * @brief ストリームタイプを設定する * * @param[in] なし. * @return なし. */ void Mesh::setStreamType() { // 以前のデータをクリア streamTypeArray_.clear(); // 位置座標レイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_VERTEX ); // 法線ベクトルレイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_NORMAL ); // 拡散反射光カラー成分があるか if( bufferList_[ STREAM_TYPE_DIFFUSE ] != 0 ){ streamTypeArray_.push_back( STREAM_TYPE_DIFFUSE ); } // 鏡面反射光カラー成分があるか if( bufferList_[ STREAM_TYPE_SPECULAR ] != 0 ){ streamTypeArray_.push_back( STREAM_TYPE_SPECULAR ); } // テクスチャ座標が設定されているか if( bufferList_[ STREAM_TYPE_TEXCOORD ] != 0 ){ // テクスチャ座標レイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_TEXCOORD ); } // スキンデータがあるか if( info_.numWeights != 0 ){ // スキンウェイトレイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_BLENDWEIGHT ); } // 行列インデックスデータがあるか if( info_.hasMatrixIndices == true ){ // マトリクスインデックスレイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_MATRIXINDEX ); } // テクスチャ座標系データがあるか if( info_.hasTextureSpace == true ){ // 接ベクトルレイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_TANGENT ); // 従法線ベクトルレイアウトの設定 streamTypeArray_.push_back( STREAM_TYPE_BINORMAL ); } } /*=========================================================================*/ /** * @brief ストリームタイプからセマンティックを取得 * * @param[in] type ストリームタイプ. * @return なし. */ VertexSemantic Mesh::getSemantic( StreamType type ) { static const VertexSemantic semantics[] = { VERTEX_SEMANTIC_POSITION, // STREAM_TYPE_VERTEX = 0, VERTEX_SEMANTIC_NORMAL, // STREAM_TYPE_NORMAL = 1, VERTEX_SEMANTIC_DIFFUSE, // STREAM_TYPE_DIFFUSE = 2, VERTEX_SEMANTIC_SPECULAR, // STREAM_TYPE_SPECULAR = 3, VERTEX_SEMANTIC_TEXCOORD, // STREAM_TYPE_TEXCOORD = 4, VERTEX_SEMANTIC_BLENDWEIGHT, // STREAM_TYPE_BLENDWEIGHT = 5, VERTEX_SEMANTIC_BLENDINDICES, // STREAM_TYPE_MATRIXINDEX = 6, VERTEX_SEMANTIC_TANGENT, // STREAM_TYPE_TANGENT = 7, VERTEX_SEMANTIC_BINORMAL // STREAM_TYPE_BINORMAL = 8 }; return semantics[ type ]; } /*=========================================================================*/ /** * @brief ストリームタイプから頂点セマンティックを取得 * * @param[in] type ストリームタイプ. * @return なし. */ VertexType Mesh::getType( StreamType type ) { static const VertexType types[] = { VERTEX_TYPE_FLOAT3, // STREAM_TYPE_VERTEX = 0, VERTEX_TYPE_FLOAT3, // STREAM_TYPE_NORMAL = 1, VERTEX_TYPE_FLOAT4, // STREAM_TYPE_DIFFUSE = 2, VERTEX_TYPE_FLOAT4, // STREAM_TYPE_SPECULAR = 3, VERTEX_TYPE_FLOAT2, // STREAM_TYPE_TEXCOORD = 4, VERTEX_TYPE_FLOAT4, // STREAM_TYPE_BLENDWEIGHT = 5, VERTEX_TYPE_FLOAT4, // STREAM_TYPE_MATRIXINDEX = 6, VERTEX_TYPE_FLOAT3, // STREAM_TYPE_TANGENT = 7, VERTEX_TYPE_FLOAT3 // STREAM_TYPE_BINORMAL = 8 }; return types[ type ]; } /*=========================================================================*/ /** * @brief ストリームタイプから1要素の要素数を取得 * * @param[in] type ストリームタイプ. * @return なし. */ unsigned int Mesh::getStride( StreamType type ) { static const unsigned int strides[] = { sizeof( float ) * 3, // STREAM_TYPE_VERTEX = 0, sizeof( float ) * 3, // STREAM_TYPE_NORMAL = 1, sizeof( float ) * 4, // STREAM_TYPE_DIFFUSE = 2, sizeof( float ) * 4, // STREAM_TYPE_SPECULAR = 3, sizeof( float ) * 2, // STREAM_TYPE_TEXCOORD = 4, sizeof( float ) * 4, // STREAM_TYPE_BLENDWEIGHT = 5, sizeof( float ) * 4, // STREAM_TYPE_MATRIXINDEX = 6, sizeof( float ) * 3, // STREAM_TYPE_TANGENT = 7, sizeof( float ) * 3 // STREAM_TYPE_BINORMAL = 8 }; return strides[ type ]; } /*===== EOF ==================================================================*/
[ "rs.drip@aa49b5b2-a402-11dd-98aa-2b35b7097d33" ]
[ [ [ 1, 755 ] ] ]
dd862c3521c8bec253e0a848e790987c661bd323
11af1673bab82ca2329ef8b596d1f3d2f8b82481
/source/ui/ui_atoms.cpp
6d8090fb9805a62f5ed7c9ce5be0c5abb5056952
[]
no_license
legacyrp/legacyojp
8b33ecf24fd973bee5e7adbd369748cfdd891202
d918151e917ea06e8698f423bbe2cf6ab9d7f180
refs/heads/master
2021-01-10T20:09:55.748893
2011-04-18T21:07:13
2011-04-18T21:07:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
13,423
cpp
// Copyright (C) 1999-2000 Id Software, Inc. // /********************************************************************** UI_ATOMS.C User interface building blocks and support functions. **********************************************************************/ #include "ui_local.h" qboolean m_entersound; // after a frame, so caching won't disrupt the sound // these are here so the functions in q_shared.c can link #ifndef UI_HARD_LINKED void QDECL Com_Error( int level, const char *error, ... ) { va_list argptr; char text[1024]; va_start (argptr, error); vsprintf (text, error, argptr); va_end (argptr); trap_Error( va("%s", text) ); } void QDECL Com_Printf( const char *msg, ... ) { va_list argptr; char text[1024]; va_start (argptr, msg); vsprintf (text, msg, argptr); va_end (argptr); trap_Print( va("%s", text) ); } #endif qboolean newUI = qfalse; /* ================= UI_ClampCvar ================= */ float UI_ClampCvar( float min, float max, float value ) { if ( value < min ) return min; if ( value > max ) return max; return value; } /* ================= UI_StartDemoLoop ================= */ void UI_StartDemoLoop( void ) { trap_Cmd_ExecuteText( EXEC_APPEND, "d1\n" ); } char *UI_Argv( int arg ) { static char buffer[MAX_STRING_CHARS]; trap_Argv( arg, buffer, sizeof( buffer ) ); return buffer; } char *UI_Cvar_VariableString( const char *var_name ) { static char buffer[MAX_STRING_CHARS]; trap_Cvar_VariableStringBuffer( var_name, buffer, sizeof( buffer ) ); return buffer; } void UI_SetBestScores(postGameInfo_t *newInfo, qboolean postGame) { trap_Cvar_Set("ui_scoreAccuracy", va("%i%%", newInfo->accuracy)); trap_Cvar_Set("ui_scoreImpressives", va("%i", newInfo->impressives)); trap_Cvar_Set("ui_scoreExcellents", va("%i", newInfo->excellents)); trap_Cvar_Set("ui_scoreDefends", va("%i", newInfo->defends)); trap_Cvar_Set("ui_scoreAssists", va("%i", newInfo->assists)); trap_Cvar_Set("ui_scoreGauntlets", va("%i", newInfo->gauntlets)); trap_Cvar_Set("ui_scoreScore", va("%i", newInfo->score)); trap_Cvar_Set("ui_scorePerfect", va("%i", newInfo->perfects)); trap_Cvar_Set("ui_scoreTeam", va("%i to %i", newInfo->redScore, newInfo->blueScore)); trap_Cvar_Set("ui_scoreBase", va("%i", newInfo->baseScore)); trap_Cvar_Set("ui_scoreTimeBonus", va("%i", newInfo->timeBonus)); trap_Cvar_Set("ui_scoreSkillBonus", va("%i", newInfo->skillBonus)); trap_Cvar_Set("ui_scoreShutoutBonus", va("%i", newInfo->shutoutBonus)); trap_Cvar_Set("ui_scoreTime", va("%02i:%02i", newInfo->time / 60, newInfo->time % 60)); trap_Cvar_Set("ui_scoreCaptures", va("%i", newInfo->captures)); if (postGame) { trap_Cvar_Set("ui_scoreAccuracy2", va("%i%%", newInfo->accuracy)); trap_Cvar_Set("ui_scoreImpressives2", va("%i", newInfo->impressives)); trap_Cvar_Set("ui_scoreExcellents2", va("%i", newInfo->excellents)); trap_Cvar_Set("ui_scoreDefends2", va("%i", newInfo->defends)); trap_Cvar_Set("ui_scoreAssists2", va("%i", newInfo->assists)); trap_Cvar_Set("ui_scoreGauntlets2", va("%i", newInfo->gauntlets)); trap_Cvar_Set("ui_scoreScore2", va("%i", newInfo->score)); trap_Cvar_Set("ui_scorePerfect2", va("%i", newInfo->perfects)); trap_Cvar_Set("ui_scoreTeam2", va("%i to %i", newInfo->redScore, newInfo->blueScore)); trap_Cvar_Set("ui_scoreBase2", va("%i", newInfo->baseScore)); trap_Cvar_Set("ui_scoreTimeBonus2", va("%i", newInfo->timeBonus)); trap_Cvar_Set("ui_scoreSkillBonus2", va("%i", newInfo->skillBonus)); trap_Cvar_Set("ui_scoreShutoutBonus2", va("%i", newInfo->shutoutBonus)); trap_Cvar_Set("ui_scoreTime2", va("%02i:%02i", newInfo->time / 60, newInfo->time % 60)); trap_Cvar_Set("ui_scoreCaptures2", va("%i", newInfo->captures)); } } void UI_LoadBestScores(const char *map, int game) { char fileName[MAX_QPATH]; fileHandle_t f; postGameInfo_t newInfo; memset(&newInfo, 0, sizeof(postGameInfo_t)); Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game); if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { int size = 0; trap_FS_Read(&size, sizeof(int), f); if (size == sizeof(postGameInfo_t)) { trap_FS_Read(&newInfo, sizeof(postGameInfo_t), f); } trap_FS_FCloseFile(f); } UI_SetBestScores(&newInfo, qfalse); Com_sprintf(fileName, MAX_QPATH, "demos/%s_%d.dm_%d", map, game, (int)trap_Cvar_VariableValue("protocol")); uiInfo.demoAvailable = qfalse; if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { uiInfo.demoAvailable = qtrue; trap_FS_FCloseFile(f); } } /* =============== UI_ClearScores =============== */ void UI_ClearScores() { char gameList[4096]; char *gameFile; int i, len, count, size; fileHandle_t f; postGameInfo_t newInfo; count = trap_FS_GetFileList( "games", "game", gameList, sizeof(gameList) ); size = sizeof(postGameInfo_t); memset(&newInfo, 0, size); if (count > 0) { gameFile = gameList; for ( i = 0; i < count; i++ ) { len = strlen(gameFile); if (trap_FS_FOpenFile(va("games/%s",gameFile), &f, FS_WRITE) >= 0) { trap_FS_Write(&size, sizeof(int), f); trap_FS_Write(&newInfo, size, f); trap_FS_FCloseFile(f); } gameFile += len + 1; } } UI_SetBestScores(&newInfo, qfalse); } static void UI_Cache_f() { int i; Display_CacheAll(); if (trap_Argc() == 2) { for (i = 0; i < uiInfo.q3HeadCount; i++) { trap_Print( va("model %s\n", uiInfo.q3HeadNames[i]) ); } } } /* ======================= UI_CalcPostGameStats ======================= */ static void UI_CalcPostGameStats() { char map[MAX_QPATH]; char fileName[MAX_QPATH]; char info[MAX_INFO_STRING]; fileHandle_t f; int size, game, time, adjustedTime; postGameInfo_t oldInfo; postGameInfo_t newInfo; qboolean newHigh = qfalse; trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ); Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) ); game = atoi(Info_ValueForKey(info, "g_gametype")); // compose file name Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game); // see if we have one already memset(&oldInfo, 0, sizeof(postGameInfo_t)); if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { // if so load it size = 0; trap_FS_Read(&size, sizeof(int), f); if (size == sizeof(postGameInfo_t)) { trap_FS_Read(&oldInfo, sizeof(postGameInfo_t), f); } trap_FS_FCloseFile(f); } newInfo.accuracy = atoi(UI_Argv(3)); newInfo.impressives = atoi(UI_Argv(4)); newInfo.excellents = atoi(UI_Argv(5)); newInfo.defends = atoi(UI_Argv(6)); newInfo.assists = atoi(UI_Argv(7)); newInfo.gauntlets = atoi(UI_Argv(8)); newInfo.baseScore = atoi(UI_Argv(9)); newInfo.perfects = atoi(UI_Argv(10)); newInfo.redScore = atoi(UI_Argv(11)); newInfo.blueScore = atoi(UI_Argv(12)); time = atoi(UI_Argv(13)); newInfo.captures = atoi(UI_Argv(14)); newInfo.time = (time - trap_Cvar_VariableValue("ui_matchStartTime")) / 1000; adjustedTime = uiInfo.mapList[ui_currentMap.integer].timeToBeat[game]; if (newInfo.time < adjustedTime) { newInfo.timeBonus = (adjustedTime - newInfo.time) * 10; } else { newInfo.timeBonus = 0; } if (newInfo.redScore > newInfo.blueScore && newInfo.blueScore <= 0) { newInfo.shutoutBonus = 100; } else { newInfo.shutoutBonus = 0; } newInfo.skillBonus = trap_Cvar_VariableValue("g_spSkill"); if (newInfo.skillBonus <= 0) { newInfo.skillBonus = 1; } newInfo.score = newInfo.baseScore + newInfo.shutoutBonus + newInfo.timeBonus; newInfo.score *= newInfo.skillBonus; // see if the score is higher for this one newHigh = (qboolean)(newInfo.redScore > newInfo.blueScore && newInfo.score > oldInfo.score); if (newHigh) { // if so write out the new one uiInfo.newHighScoreTime = uiInfo.uiDC.realTime + 20000; if (trap_FS_FOpenFile(fileName, &f, FS_WRITE) >= 0) { size = sizeof(postGameInfo_t); trap_FS_Write(&size, sizeof(int), f); trap_FS_Write(&newInfo, sizeof(postGameInfo_t), f); trap_FS_FCloseFile(f); } } if (newInfo.time < oldInfo.time) { uiInfo.newBestTime = uiInfo.uiDC.realTime + 20000; } // put back all the ui overrides trap_Cvar_Set("capturelimit", UI_Cvar_VariableString("ui_saveCaptureLimit")); trap_Cvar_Set("fraglimit", UI_Cvar_VariableString("ui_saveFragLimit")); trap_Cvar_Set("duel_fraglimit", UI_Cvar_VariableString("ui_saveDuelLimit")); trap_Cvar_Set("cg_drawTimer", UI_Cvar_VariableString("ui_drawTimer")); trap_Cvar_Set("g_doWarmup", UI_Cvar_VariableString("ui_doWarmup")); trap_Cvar_Set("g_Warmup", UI_Cvar_VariableString("ui_Warmup")); trap_Cvar_Set("sv_pure", UI_Cvar_VariableString("ui_pure")); trap_Cvar_Set("g_friendlyFire", UI_Cvar_VariableString("ui_friendlyFire")); UI_SetBestScores(&newInfo, qtrue); UI_ShowPostGame(newHigh); } /* ================= UI_ConsoleCommand ================= */ qboolean UI_ConsoleCommand( int realTime ) { char *cmd; uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime; uiInfo.uiDC.realTime = realTime; cmd = UI_Argv( 0 ); // ensure minimum menu data is available //Menu_Cache(); if ( Q_stricmp (cmd, "ui_test") == 0 ) { UI_ShowPostGame(qtrue); } if ( Q_stricmp (cmd, "ui_report") == 0 ) { UI_Report(); return qtrue; } if ( Q_stricmp (cmd, "ui_load") == 0 ) { UI_Load(); return qtrue; } if ( Q_stricmp (cmd, "ui_opensiegemenu" ) == 0 ) { if ( trap_Cvar_VariableValue ( "g_gametype" ) == GT_SIEGE ) { Menus_CloseAll(); if (Menus_ActivateByName(UI_Argv(1))) { trap_Key_SetCatcher( KEYCATCH_UI ); } } return qtrue; } if ( Q_stricmp (cmd, "ui_openmenu" ) == 0 ) { //if ( trap_Cvar_VariableValue ( "developer" ) ) { Menus_CloseAll(); if (Menus_ActivateByName(UI_Argv(1))) { trap_Key_SetCatcher( KEYCATCH_UI ); } return qtrue; } } /* if ( Q_stricmp (cmd, "remapShader") == 0 ) { if (trap_Argc() == 4) { char shader1[MAX_QPATH]; char shader2[MAX_QPATH]; Q_strncpyz(shader1, UI_Argv(1), sizeof(shader1)); Q_strncpyz(shader2, UI_Argv(2), sizeof(shader2)); trap_R_RemapShader(shader1, shader2, UI_Argv(3)); return qtrue; } } */ if ( Q_stricmp (cmd, "postgame") == 0 ) { UI_CalcPostGameStats(); return qtrue; } if ( Q_stricmp (cmd, "ui_cache") == 0 ) { UI_Cache_f(); return qtrue; } if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) { //UI_TeamOrdersMenu_f(); return qtrue; } if ( Q_stricmp (cmd, "ui_cdkey") == 0 ) { //UI_CDKeyMenu_f(); return qtrue; } return qfalse; } /* ================= UI_Shutdown ================= */ void UI_Shutdown( void ) { } void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname ) { qhandle_t hShader; hShader = trap_R_RegisterShaderNoMip( picname ); trap_R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, hShader ); } void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ) { float s0; float s1; float t0; float t1; if( w < 0 ) { // flip about vertical w = -w; s0 = 1; s1 = 0; } else { s0 = 0; s1 = 1; } if( h < 0 ) { // flip about horizontal h = -h; t0 = 1; t1 = 0; } else { t0 = 0; t1 = 1; } trap_R_DrawStretchPic( x, y, w, h, s0, t0, s1, t1, hShader ); } /* ================ UI_FillRect Coordinates are 640*480 virtual values ================= */ void UI_FillRect( float x, float y, float width, float height, const float *color ) { trap_R_SetColor( color ); trap_R_DrawStretchPic( x, y, width, height, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); trap_R_SetColor( NULL ); } void UI_DrawSides(float x, float y, float w, float h) { trap_R_DrawStretchPic( x, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); trap_R_DrawStretchPic( x + w - 1, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); } void UI_DrawTopBottom(float x, float y, float w, float h) { trap_R_DrawStretchPic( x, y, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); trap_R_DrawStretchPic( x, y + h - 1, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader ); } /* ================ UI_DrawRect Coordinates are 640*480 virtual values ================= */ void UI_DrawRect( float x, float y, float width, float height, const float *color ) { trap_R_SetColor( color ); UI_DrawTopBottom(x, y, width, height); UI_DrawSides(x, y, width, height); trap_R_SetColor( NULL ); } void UI_SetColor( const float *rgba ) { trap_R_SetColor( rgba ); } void UI_UpdateScreen( void ) { trap_UpdateScreen(); } void UI_DrawTextBox (int x, int y, int width, int lines) { UI_FillRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorBlack ); UI_DrawRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorWhite ); } qboolean UI_CursorInRect (int x, int y, int width, int height) { if (uiInfo.uiDC.cursorx < x || uiInfo.uiDC.cursory < y || uiInfo.uiDC.cursorx > x+width || uiInfo.uiDC.cursory > y+height) return qfalse; return qtrue; }
[ "[email protected]@5776d9f2-9662-11de-ad41-3fcdc5e0e42d" ]
[ [ [ 1, 493 ] ] ]
d1462f11bfa180ccc2e435558cf29b97d69445dd
0fdaf407b337fd50efc83979788bae58eae78142
/engine/independent/kernel/debug/debug.h
4c86fa38f822b97de1c01bb283109604a51b0983
[ "MIT" ]
permissive
Flapstah/Workbench
2d034de200863b52a99be96670d912b9519c715d
6b7d2f2476c9a9a2f5106bcf7e73a1de657eefa5
refs/heads/master
2020-06-02T14:47:17.796279
2011-05-05T22:05:38
2011-05-05T22:05:38
735,737
0
0
null
null
null
null
UTF-8
C++
false
false
865
h
#if !defined(__DEBUG_H__) #define __DEBUG_H__ //============================================================================== namespace engine { //============================================================================ // CDebug //============================================================================ class CDebug { public: static void OutputToDebugger(const wchar_t* output); static void OutputToDebugger(const char* output); protected: CDebug() {} private: //============================================================================}; }; // End [class CDebug] //============================================================================ } // End [namespace engine] //============================================================================== #endif // End [!defined(__DEBUG_H__)] // [EOF]
[ [ [ 1, 13 ], [ 16, 26 ], [ 28, 29 ] ], [ [ 14, 15 ], [ 27, 27 ] ] ]
e5e51efedf86d81bcf9f8ecd0c9e087ec20891b0
6d340a0cdbabbcbdd10460852ed24770c2ec78e4
/source_codes/geometry/max_radius_inscribed_circle/max_circle.cpp
8161436ed8e1c3f53d93b9b804632ccbff0a47fb
[]
no_license
vsbus/vsb-reference
5bdb5eb8c212f1e8592a1b47044f5d531d741df4
2f4434e896bd03d33c14683b3702f09d51b5992e
refs/heads/master
2021-01-10T18:38:57.392158
2011-05-10T13:08:11
2011-05-10T13:08:11
32,411,348
0
0
null
null
null
null
UTF-8
C++
false
false
1,612
cpp
double getMaxRadius(Poly p) { int n = p.size(); vector<Line> lines(n); vector<int> next(n), prev(n); for (int j = n - 1, i = 0; i < n; j = i++) { lines[i] = Line(p[j], p[i]); next[j] = i; prev[i] = j; } vector<double> deathTime(n); set<pair<double, int> > s; for (int i = 0; i < n; ++i) { deathTime[i] = getDeathTime(i, lines, prev, next); s.insert(makePair(deathTime, i)); } while (s.size() > 3) { int cur = s.begin()->second; s.erase(makePair(deathTime, cur)); s.erase(makePair(deathTime, prev[cur])); s.erase(makePair(deathTime, next[cur])); next[prev[cur]] = next[cur]; prev[next[cur]] = prev[cur]; deathTime[prev[cur]] = getDeathTime(prev[cur], lines, prev, next); deathTime[next[cur]] = getDeathTime(next[cur], lines, prev, next); s.insert(makePair(deathTime, prev[cur])); s.insert(makePair(deathTime, next[cur])); } return deathTime[s.begin()->second]; } pair<double, int> makePair(vector<double> &d, int i) { return make_pair(d[i], i); } double getDeathTime(int i, vector<Line> &lines, vector<int> &prev, vector<int> &next) { double alp = getPositiveAng(lines[i].getDir(), -lines[prev[i]].getDir()) / 2; double beta = getPositiveAng(lines[next[i]].getDir(), -lines[i].getDir()) / 2; if (alp <= eps || beta <= eps) { return 1e100; } Point p1 = getIntPoint(lines[prev[i]].from, lines[prev[i]].to, lines[i].from, lines[i].to); Point p2 = getIntPoint(lines[next[i]].from, lines[next[i]].to, lines[i].from, lines[i].to); double A = (p1 - p2).length(); double H = A / (1 / tan(alp) + 1 / tan(beta)); return H; }
[ "victorbarinov@ad8ebaea-3bba-49b6-65e2-71ef8dee33c5" ]
[ [ [ 1, 44 ] ] ]
b65884fac45d6ea507a4ee8da48c47f459cf703d
5095bbe94f3af8dc3b14a331519cfee887f4c07e
/APSVis/source/chart_types.h
6b86c8b5c29b832b286c2ae4357a920adba76b42
[]
no_license
sativa/apsim_development
efc2b584459b43c89e841abf93830db8d523b07a
a90ffef3b4ed8a7d0cce1c169c65364be6e93797
refs/heads/master
2020-12-24T06:53:59.364336
2008-09-17T05:31:07
2008-09-17T05:31:07
64,154,433
0
0
null
null
null
null
UTF-8
C++
false
false
1,156
h
//--------------------------------------------------------------------------- #ifndef chart_typesH #define chart_typesH //--------------------------------------------------------------------------- #include <vcl\Classes.hpp> #include <vcl\Controls.hpp> #include <vcl\StdCtrls.hpp> #include <vcl\Forms.hpp> #include <vcl\ExtCtrls.hpp> #include <vcl\Buttons.hpp> #include <Graphics.hpp> //--------------------------------------------------------------------------- class TChart_types_form : public TForm { __published: // IDE-managed Components TLabel *Label1; TImage *Image1; TRadioButton *Scatter_radio; TImage *Image2; TRadioButton *Depth_radio; TBitBtn *BitBtn1; TBitBtn *BitBtn2; TImage *Image3; TRadioButton *Prob_radio; TRadioButton *Freq_radio; TImage *Image4; private: // User declarations public: // User declarations __fastcall TChart_types_form(TComponent* Owner); }; //--------------------------------------------------------------------------- extern TChart_types_form *Chart_types_form; //--------------------------------------------------------------------------- #endif
[ "devoilp@8bb03f63-af10-0410-889a-a89e84ef1bc8" ]
[ [ [ 1, 34 ] ] ]
1dda4ab19d130a145e7aecc5051aad8054d889e4
b22c254d7670522ec2caa61c998f8741b1da9388
/dependencies/OpenSceneGraph/include/osgIntrospection/PropertyInfo
4dc19bc95a6bfaf1aa68baf9fd9d58a186e87497
[]
no_license
ldaehler/lbanet
341ddc4b62ef2df0a167caff46c2075fdfc85f5c
ecb54fc6fd691f1be3bae03681e355a225f92418
refs/heads/master
2021-01-23T13:17:19.963262
2011-03-22T21:49:52
2011-03-22T21:49:52
39,529,945
0
1
null
null
null
null
UTF-8
C++
false
false
16,164
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ //osgIntrospection - Copyright (C) 2005 Marco Jez #ifndef OSGINTROSPECTION_PROPERTYINFO_ #define OSGINTROSPECTION_PROPERTYINFO_ #include <osgIntrospection/Export> #include <osgIntrospection/Type> #include <osgIntrospection/MethodInfo> #include <osgIntrospection/Attributes> #include <string> #include <typeinfo> #include <iosfwd> #include <vector> namespace osgIntrospection { /// This class keeps information about a class' property. A property is /// defined by a name and a set of methods that store and retrieve /// values. When the user wants to "get" the value of a property, the /// getter method will be invoked and its value returned. When the user /// wants to "set" the value of a property, the setter method will be /// called. There are three kinds of property: simple (get/set), indexed /// (get[i1, i2, ...]/set[i1, i2, ...]), and array (count/add/get[i]/ /// set[i]). /// Objects of class PropertyInfo can't be modified once they have been /// created, but they can be queried without restrictions. You can either /// retrieve the accessor methods and invoke them manually, or you can /// call getValue() / setValue() etc. methods to perform direct operations /// on the property, given an instance of the declaring type to work on. /// The latter technique is preferred because it checks for custom /// attributes associated to the PropertyInfo object and passes control /// to them when needed. /// class OSGINTROSPECTION_EXPORT PropertyInfo: public CustomAttributeProvider { public: /// Direct initialization constructor for simple properties. /// You must pass the Type object associated to the class that /// declares the property, the Type object that describes the /// type of the property's value, the property name and the /// getter/setter methods. Either the setter or the getter can /// be null, meaning a restricted access. If both are null, the /// user is expected to add a custom accessor attribute to this /// PropertyInfo object. PropertyInfo(const Type& declaratiionType, const Type& ptype, const std::string& name, const MethodInfo* getm, const MethodInfo* setm, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : CustomAttributeProvider(), _declarationType(declaratiionType), _ptype(ptype), _name(name), _getm(getm), _setm(setm), _numm(0), _addm(0), _insm(0), _remm(0), _is_array(false), _briefHelp(briefHelp), _detailedHelp(detailedHelp) { } /// Direct initialization constructor for "array" properties. /// You must pass the Type object associated to the type that /// declares the property, the Type object that describes the /// type of the property's value, the property name and the /// getter/setter/counter/adder/insert/remover methods. PropertyInfo(const Type& declaratiionType, const Type& ptype, const std::string& name, const MethodInfo* getm, const MethodInfo* setm, const MethodInfo* numm, const MethodInfo* addm, const MethodInfo* insm, const MethodInfo* remm, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : CustomAttributeProvider(), _declarationType(declaratiionType), _ptype(ptype), _name(name), _getm(getm), _setm(setm), _numm(numm), _addm(addm), _insm(insm), _remm(remm), _is_array(true), _briefHelp(briefHelp), _detailedHelp(detailedHelp) { } /// Direct initialization constructor for indexed properties. /// You must pass the Type object associated to the class that /// declares the property, the Type object that describes the /// type of the property's value, the property name and the /// getter/setter methods. Either the setter or the getter can /// be null, meaning a restricted access. If both are null, the /// user is expected to add a custom accessor attribute to this /// PropertyInfo object. /// If the getter method has parameters, the property is considered /// to be indexed. The same is true if the getter is null and the /// setter has more than one parameter. PropertyInfo(const Type& declaratiionType, const Type& ptype, const std::string& name, const MethodInfo* getm, const MethodInfo* setm, const MethodInfo* remm, std::string briefHelp = std::string(), std::string detailedHelp = std::string()) : CustomAttributeProvider(), _declarationType(declaratiionType), _ptype(ptype), _name(name), _getm(getm), _setm(setm), _numm(0), _addm(0), _insm(0), _remm(remm), _is_array(false), _briefHelp(briefHelp), _detailedHelp(detailedHelp) { if (_getm) { for (ParameterInfoList::size_type i=0; i<_getm->getParameters().size(); ++i) _indices.push_back(_getm->getParameters().at(i)); } else { if (_setm) { for (ParameterInfoList::size_type i=0; i<(_setm->getParameters().size()-1); ++i) _indices.push_back(_setm->getParameters().at(i)); } } } /// Returns the number of indices inline int getNumIndices() const { return static_cast<int>(getIndexParameters().size()); } /// Returns the name of the property being described. inline virtual const std::string& getName() const { return _name; } /// Returns the brief help of the property being described. inline virtual const std::string& getBriefHelp() const { return _briefHelp; } /// Returns the detailed help of the property being described. inline virtual const std::string& getDetailedHelp() const { return _detailedHelp; } /// Returns the type that declares the property. inline virtual const Type& getDeclaringType() const { return _declarationType; } /// Returns the type of the reflected property. inline const Type& getPropertyType() const { const PropertyTypeAttribute *pta = getAttribute<PropertyTypeAttribute>(false); if (pta) return pta->getPropertyType(); return _ptype; } /// Returns the getter method. inline const MethodInfo* getGetMethod() const { return _getm; } /// Returns the setter method. inline const MethodInfo* getSetMethod() const { return _setm; } /// Returns the counter method. inline const MethodInfo* getCountMethod() const { return _numm; } /// Returns the adder method. inline const MethodInfo* getAddMethod() const { return _addm; } /// Returns the insert method. inline const MethodInfo* getInsertMethod() const { return _insm; } /// Returns the remover method. inline const MethodInfo* getRemoveMethod() const { return _remm; } /// Returns whether the property's value can be retrieved. inline bool canGet() const { return (_getm != 0) || isDefined<CustomPropertyGetAttribute>(false); } /// Returns whether the property's value can be set. inline bool canSet() const { return _setm != 0 || isDefined<CustomPropertySetAttribute>(false); } /// Returns whether the property's array of values can be counted. inline bool canCount() const { return _numm != 0 || isDefined<CustomPropertyCountAttribute>(false); } /// Returns whether items can be added to the array property. inline bool canAdd() const { return _addm != 0 || isDefined<CustomPropertyAddAttribute>(false); } /// Returns whether items can be insert to the array property. inline bool canInsert() const { return _insm != 0 || isDefined<CustomPropertyInsertAttribute>(false); } /// Returns whether items can be removed from the array property. inline bool canRemove() const { return _remm != 0 || isDefined<CustomPropertyRemoveAttribute>(false); } /// Returns whether the property is simple. inline bool isSimple() const { return !isIndexed() && !isArray(); } /// Returns whether the property is indexed. inline bool isIndexed() const { return getNumIndices() > 0; } /// Returns whether the property is an array. inline bool isArray() const { return _is_array; } /// Returns the list of index parameters. /// If the property is not indexed, this list is empty. If neither /// the get method nor the set method are defined, this list is /// empty unless a custom indexing attribute is defined. const ParameterInfoList& getIndexParameters() const; /// Returns a list of valid values that can be used for the specified /// index. If a custom indexing attribute is defined for this property, /// then it will be queried for the index set, otherwise the index /// will be treated as an enumeration and the set of enumeration /// values will be returned. void getIndexValueSet(int whichindex, const Value& instance, ValueList& values) const; /// Invokes the getter method on the given const instance and /// returns the property's value. If a custom getter attribute /// is defined, it will be invoked instead. Value getValue(const Value& instance) const; /// Invokes the getter method on the given instance and /// returns the property's value. If a custom getter attribute /// is defined, it will be invoked instead. Value getValue(Value& instance) const; /// Invokes the setter method on the given instance and /// sets the property's value. If a custom setter attribute /// is defined, it will be invoked instead. void setValue(Value& instance, const Value& value) const; /// Invokes the getter method on the given const instance passing a /// list of indices and returns the indexed property's value. If a /// custom getter attribute is defined, it will be invoked instead. Value getIndexedValue(Value& instance, ValueList& indices) const; /// Invokes the getter method on the given instance passing a list /// of indices and returns the indexed property's value. If a custom /// getter attribute is defined, it will be invoked instead. Value getIndexedValue(const Value& instance, ValueList& indices) const; /// Invokes the setter method on the given instance passing a list /// of indices and sets the indexed property's value. If a custom /// setter attribute is defined, it will be invoked instead. void setIndexedValue(Value& instance, ValueList& indices, const Value& value) const; /// Invokes the remover method on the given instance and removes /// an item from the indexed property. If a custom remover attribute /// is defined, it will be invoked instead. void removeIndexedItem(Value& instance, ValueList& indices) const; /// Invokes the counter method on the given instance and returns /// the number of items of the array property. If a custom counter /// attribute is defined, it will be invoked instead. int getNumArrayItems(const Value& instance) const; /// Invokes the getter method on the given const instance and returns /// the i-th item of the array property. If a custom getter attribute /// us defined, it will be invoked instead. Value getArrayItem(const Value& instance, int i) const; /// Invokes the getter method on the given instance and returns /// the i-th item of the array property. If a custom getter attribute /// us defined, it will be invoked instead. Value getArrayItem(Value& instance, int i) const; /// Invokes the setter method on the given instance and sets /// the i-th item of the array property. If a custom setter attribute /// is defined, it will be invoked instead. void setArrayItem(Value& instance, int i, const Value& value) const; /// Invokes the adder method on the given instance and adds /// an item to the array property. If a custom adder attribute is /// defined, it will be invoked instead. void addArrayItem(Value& instance, const Value& value) const; /// Invokes the insert method on the given instance and inserts /// an item to the array property after the i-th item of the array /// property. If a custom adder attribute is defined, /// it will be invoked instead. void insertArrayItem(Value& instance, int i, const Value& value) const; /// Invokes the remover method on the given instance and removes /// an item from the array property. If a custom remover attribute /// is defined, it will be invoked instead. void removeArrayItem(Value& instance, int i) const; /// Returns the default value associated to the reflected property. /// If no default value has been specified, this method tries to /// create an instance of the property type and then returns its /// value. There are some attributes that change the behavior of /// this method, for example NoDefaultValueAttribute. Value getDefaultValue() const; virtual ~PropertyInfo() {}; protected: virtual void getInheritedProviders(CustomAttributeProviderList& providers) const; private: PropertyInfo& operator = (const PropertyInfo&) { return *this; } const Type& _declarationType; const Type& _ptype; std::string _name; const MethodInfo* _getm; const MethodInfo* _setm; const MethodInfo* _numm; const MethodInfo* _addm; const MethodInfo* _insm; const MethodInfo* _remm; ParameterInfoList _indices; bool _is_array; std::string _briefHelp; std::string _detailedHelp; }; } #endif
[ "vdelage@3806491c-8dad-11de-9a8c-6d5b7d1e4d13" ]
[ [ [ 1, 384 ] ] ]
93d53bdb0d3020044b7098979a75bb04fdfb5d62
b4d726a0321649f907923cc57323942a1e45915b
/Installer/Zipper.h
5004066767ea159d555dfd21c34014e0cdec0ecb
[]
no_license
chief1983/Imperial-Alliance
f1aa664d91f32c9e244867aaac43fffdf42199dc
6db0102a8897deac845a8bd2a7aa2e1b25086448
refs/heads/master
2016-09-06T02:40:39.069630
2010-10-06T22:06:24
2010-10-06T22:06:24
967,775
2
0
null
null
null
null
UTF-8
C++
false
false
1,528
h
// Zipper.h: interface for the CZipper class. // ////////////////////////////////////////////////////////////////////// /*#if !defined(AFX_ZIPPER_H__4249275D_B50B_4AAE_8715_B706D1CA0F2F__INCLUDED_) #define AFX_ZIPPER_H__4249275D_B50B_4AAE_8715_B706D1CA0F2F__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000*/ #include <windows.h> struct Z_FileInfo { int nFileCount; int nFolderCount; DWORD dwUncompressedSize; }; class CZipper { public: CZipper(LPCTSTR szFilePath = NULL, LPCTSTR szRootFolder = NULL, bool bAppend = FALSE); virtual ~CZipper(); // simple interface static bool ZipFile(LPCTSTR szFilePath); // saves as same name with .zip static bool ZipFolder(LPCTSTR szFilePath, bool bIgnoreFilePath); // saves as same name with .zip // works with prior opened zip bool AddFileToZip(LPCTSTR szFilePath, bool bIgnoreFilePath = FALSE); bool AddFileToZip(LPCTSTR szFilePath, LPCTSTR szRelFolderPath); // replaces path info from szFilePath with szFolder bool AddFolderToZip(LPCTSTR szFolderPath, bool bIgnoreFilePath = FALSE); // extended interface bool OpenZip(LPCTSTR szFilePath, LPCTSTR szRootFolder = NULL, bool bAppend = FALSE); bool CloseZip(); // for multiple reuse void GetFileInfo(Z_FileInfo& info); protected: void* m_uzFile; char m_szRootFolder[MAX_PATH + 1]; Z_FileInfo m_info; protected: void PrepareSourcePath(LPTSTR szPath); }; //#endif // !defined(AFX_ZIPPER_H__4249275D_B50B_4AAE_8715_B706D1CA0F2F__INCLUDED_)
[ [ [ 1, 50 ] ] ]
cfdacd249b4e8900b7e1cd33b4590d5313b8ce4f
8b3186e126ac2d19675dc19dd473785de97068d2
/bmt_prod/core/event.h
5420d36bf2a1e0279a2a005e5723deac74ba9378
[]
no_license
leavittx/revenge
e1fd7d6cd1f4a1fb1f7a98de5d16817a0c93da47
3389148f82e6434f0619df47c076c60c8647ed86
refs/heads/master
2021-01-01T17:28:26.539974
2011-08-25T20:25:14
2011-08-25T20:25:14
618,159
2
0
null
null
null
null
UTF-8
C++
false
false
233
h
#pragma once #include <string> #include <vector> #include <map> #include "../globals.h" class Event { public: Event() {}; ~Event() {}; float getValue(); bool hasPassed(); int m_time; int m_length; };
[ [ [ 1, 21 ] ] ]
b281e66541de70f8164de344cd22c1c8e4c015cc
b382e9343d44083f991298ae7585f75c45d45f13
/kinect_socket.cpp
18318bd82f456268009123a0986736b685b1cf1f
[]
no_license
sabo0202/udp_image_streaming_server
80d621c874acc951485a01e0b3acd385f8e72b95
c440e1a67d92cb25ac46b76a1e50c1d0ebbdc6bd
refs/heads/master
2021-01-19T08:40:26.052554
2000-01-01T00:25:48
2000-01-01T00:25:48
87,658,101
0
0
null
null
null
null
UTF-8
C++
false
false
21,725
cpp
#include <list> #include <stdexcept> #include <OpenNI.h> #include <opencv.hpp> #include <tracking.hpp> #include <imgcodecs.hpp> #include <stdio.h> #include <string.h> #include <math.h> #include <unistd.h> #include <fstream> #include <sstream> #include <string> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include "PracticalSocket.h" // For UDPSocket and SocketException #include <iostream> // For cout and cerr #include <cstdlib> // For atoi() #include <opencv2/rgbd.hpp> #include <opencv2/highgui.hpp> #include <opencv2/calib3d.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/core/utility.hpp> #include <opencv2/viz.hpp> #include "config.h" #include"matplotlibcpp.h" #define GAZEX_BIAS -50 #define GAZEY_BIAS -50 #define BILATERAL_FILTER 0// if 1 then bilateral filter will be used for the depth using namespace std; using namespace cv; using namespace cv::rgbd; namespace plt = matplotlibcpp; template<typename T_n> string NumToString(T_n number) { stringstream ss; ss << number; return ss.str(); } class MyTickMeter { public: MyTickMeter() { reset(); } void start() { startTime = getTickCount(); } void stop() { int64 time = getTickCount(); if ( startTime == 0 ) return; ++counter; sumTime += ( time - startTime ); startTime = 0; } int64 getTimeTicks() const { return sumTime; } double getTimeSec() const { return (double)getTimeTicks()/getTickFrequency(); } int64 getCounter() const { return counter; } void reset() { startTime = sumTime = 0; counter = 0; } private: int64 counter; int64 sumTime; int64 startTime; }; Point2d writeResults( const vector<Mat>& Rt ) { cout.precision(4); Point2d point; const Mat& Rt_curr = Rt[0]; CV_Assert( Rt_curr.type() == CV_64FC1 ); Mat R = Rt_curr(Rect(0,0,3,3)), rvec; Rodrigues(R, rvec); double alpha = norm( rvec ); if(alpha > DBL_MIN) rvec = rvec / alpha; double cos_alpha2 = std::cos(0.5 * alpha); double sin_alpha2 = std::sin(0.5 * alpha); rvec *= sin_alpha2; CV_Assert( rvec.type() == CV_64FC1 ); // timestamp tx ty tz qx qy qz qw //cout << fixed // << Rt_curr.at<double>(0,3) << " " << Rt_curr.at<double>(1,3) << " " << Rt_curr.at<double>(2,3) << " " // << rvec.at<double>(0) << " " << rvec.at<double>(1) << " " << rvec.at<double>(2) << " " << cos_alpha2 << endl; point.x = Rt_curr.at<double>(0,3); point.y = Rt_curr.at<double>(2,3); return point; } void setCameraMatrixFreiburg1(float& fx, float& fy, float& cx, float& cy) { fx = 517.3f; fy = 516.5f; cx = 318.6f; cy = 255.3f; } class GrabDetectorSample { public: /* Initialize */ void initialize() { initOpenNI(); } /* OpenNI's initialize */ void initOpenNI() { openni::OpenNI::getVersion(); openni::OpenNI::initialize(); device.open( openni::ANY_DEVICE ); /* Requires VGA depth & color input, with both depth-color registration and time sync enabled. See included sample for setting this up. */ /* Create color stream */ colorStream.create( device, openni::SENSOR_COLOR ); initStream( colorStream ); colorStream.start(); /* Create depth stream */ depthStream.create( device, openni::SENSOR_DEPTH ); initStream( depthStream ); depthStream.start(); /* Synchronism Depth & Color */ device.setDepthColorSyncEnabled( true ); /* Fit the Depth to Color */ device.setImageRegistrationMode( openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR ); /* Put together stream */ streams.push_back( &colorStream ); streams.push_back( &depthStream ); } /* Initialize the OpenNI stream */ void initStream( openni::VideoStream& stream ) { openni::VideoMode videoMode = stream.getVideoMode(); videoMode.setFps( 30 ); videoMode.setResolution( 640, 480 ); stream.setVideoMode( videoMode ); } /* Main loop */ void run() { /* Init visual odometry */ Point2d kinect_point, target_point; double sita; bool running = true; vector<Mat> Rts; MyTickMeter gtm; int count = 0; vector<double> x, y, X, Y; //plt::xlim(-80.0, 80.0); //plt::ylim(-80.0, 80.0); float fx = 525.0f, // default fy = 525.0f, cx = 319.5f, cy = 239.5f; setCameraMatrixFreiburg1(fx, fy, cx, cy); Mat cameraMatrix = Mat::eye(3,3,CV_32FC1); { cameraMatrix.at<float>(0,0) = fx; cameraMatrix.at<float>(1,1) = fy; cameraMatrix.at<float>(0,2) = cx; cameraMatrix.at<float>(1,2) = cy; } Ptr<OdometryFrame> frame_prev = Ptr<OdometryFrame>(new OdometryFrame()), frame_curr = Ptr<OdometryFrame>(new OdometryFrame()); Ptr<Odometry> odometry = Odometry::create("RgbdOdometry"); if(odometry.empty()) { cout << "Can not create Odometry algorithm. Check the passed odometry name." << endl; } odometry->setCameraMatrix(cameraMatrix); viz::Viz3d myWindow("Point Cloud"); cv::Affine3d cam_pose; /* Output txetfile */ //fstream outputfile; //outputfile.open("result.txt", ios::out | ios::out); //int file_count = 0; short targetGazeDepth; float xx, yy, zz; int iJpeg = 0; char capturename[20]; openni::VideoMode videoMode = depthStream.getVideoMode(); int gazeCount = 0; int currentGazePoint = 0; int targetGazePoint = 0; int beforeGazePoint = 0; int targetGazeX = 0; int targetGazeY = 0; int flag_goal = 0; int tracking_init = 0; /* Tracking */ Ptr<Tracker> trackerKCF; Rect2d KCFroi; KCFroi.x = 0; KCFroi.y = 0; Scalar colorkcf = Scalar(200, 0, 0); // Color initialize /* Save a movie */ double fps = 7; Size size = Size(640, 480); const int fourcc = VideoWriter::fourcc('X', 'V', 'I', 'D'); string filename = "output.avi"; VideoWriter writer(filename, fourcc, fps, size); /* UDP transfer Image */ string servAddress = "192.168.1.1"; // First arg: server address unsigned short servPort = Socket::resolveService("12345", "udp"); UDPSocket udp_sock; int jpegqual = ENCODE_QUALITY; // Compression Parameter vector < uchar > encoded; /* TCP reciever gaze_x */ int GazeX; struct sockaddr_in server_gazeX; int sock_gazeX; int buf_gazeX[1]; int n_gazeX; int max_gazeX = 640; int min_gazeX = 0; /* TCP reciever gaze_y */ int GazeY; struct sockaddr_in server_gazeY; int sock_gazeY; int buf_gazeY[1]; int n_gazeY; int max_gazeY = 480; int min_gazeY = 0; /* For Image processing */ Mat frame(320, 240, CV_8UC3); Mat send(320, 240, CV_8UC3); Mat depthImage(480, 640, CV_16UC1); Mat colorImage(480, 640, CV_8UC3); /* Get the frame of depth & color */ openni::VideoFrameRef depthFrame; depthStream.readFrame( &depthFrame ); openni::VideoFrameRef colorFrame; colorStream.readFrame( &colorFrame ); depthImage = showDepthStream( depthFrame ); colorImage = showColorStream( colorFrame ); // clock_t last_cycle = clock(); while ( running ) { try { /* Recieve gaze_x data */ sock_gazeX = socket(AF_INET, SOCK_STREAM, 0); server_gazeX.sin_family = AF_INET; server_gazeX.sin_port = htons(22333); server_gazeX.sin_addr.s_addr = inet_addr("192.168.1.1"); connect(sock_gazeX, (struct sockaddr *)&server_gazeX, sizeof(server_gazeX)); memset(buf_gazeX, 0, sizeof(buf_gazeX)); n_gazeX = read(sock_gazeX, buf_gazeX, sizeof(buf_gazeX)); if (n_gazeX < 1) { perror("read"); // break; } close(sock_gazeX); GazeX = *buf_gazeX; if (GazeX < 0) { GazeX = min_gazeX; } else if (GazeX >= 640) { GazeX = max_gazeX; } /* Recieve gaze_y data */ sock_gazeY = socket(AF_INET, SOCK_STREAM, 0); server_gazeY.sin_family = AF_INET; server_gazeY.sin_port = htons(33222); server_gazeY.sin_addr.s_addr = inet_addr("192.168.1.1"); connect(sock_gazeY, (struct sockaddr *)&server_gazeY, sizeof(server_gazeY)); memset(buf_gazeY, 0, sizeof(buf_gazeY)); n_gazeY = read(sock_gazeY, buf_gazeY, sizeof(buf_gazeY)); if (n_gazeY < 1) { perror("read"); // break; } close(sock_gazeY); GazeY = *buf_gazeY; if (GazeY < 0) { GazeY = min_gazeY; } else if (GazeY >= 480) { GazeY = max_gazeY; } } catch (SocketException & e) { cerr << e.what() << endl; GazeX = min_gazeX; GazeY = min_gazeY; // exit(1); } #if BILATERAL_FILTER MyTickMeter tm_bilateral_filter; #endif { int changedIndex; openni::OpenNI::waitForAnyStream( &streams[0], streams.size(), &changedIndex ); /* Get the frame of depth & color */ openni::VideoFrameRef depthFrame; depthStream.readFrame( &depthFrame ); openni::VideoFrameRef colorFrame; colorStream.readFrame( &colorFrame ); depthImage = showDepthStream( depthFrame ); colorImage = showColorStream( colorFrame ); CV_Assert(!colorImage.empty()); CV_Assert(!depthImage.empty()); CV_Assert(depthImage.type() == CV_16UC1); // scale depth Mat depth_flt; depthImage.convertTo(depth_flt, CV_32FC1, 1.f/8500.f); #if !BILATERAL_FILTER depth_flt.setTo(std::numeric_limits<float>::quiet_NaN(), depthImage == 0); depthImage = depth_flt; #else tm_bilateral_filter.start(); depthImage = Mat(depth_flt.size(), CV_32FC1, Scalar(0)); const double depth_sigma = 0.03; const double space_sigma = 4.5; // in pixels Mat invalidDepthMask = depth_flt == 0.f; depth_flt.setTo(-5*depth_sigma, invalidDepthMask); bilateralFilter(depth_flt, depth, -1, depth_sigma, space_sigma); depthImage.setTo(std::numeric_limits<float>::quiet_NaN(), invalidDepthMask); tm_bilateral_filter.stop(); cout << "Time filter " << tm_bilateral_filter.getTimeSec() << endl; #endif //timestamps.push_back( timestap ); } { Mat gray; cvtColor(colorImage, gray, COLOR_BGR2GRAY); frame_curr->image = gray; frame_curr->depth = depthImage; Mat Rt; if(!Rts.empty()) { MyTickMeter tm; tm.start(); gtm.start(); bool res = odometry->compute(frame_curr, frame_prev, Rt); gtm.stop(); tm.stop(); //count++; //cout << "Time " << tm.getTimeSec() << endl; #if BILATERAL_FILTER cout << "Time ratio " << tm_bilateral_filter.getTimeSec() / tm.getTimeSec() << endl; #endif if(!res) Rt = Mat::eye(4,4,CV_64FC1); } if( Rts.empty() ) Rts.push_back(Mat::eye(4,4,CV_64FC1)); else { Mat& prevRt = *Rts.rbegin(); //cout << "Rt " << Rt << endl; Rts[0] = ( prevRt * Rt ); } //10フレームごと変換して表示 /*Mat rot = Rts[count](Rect(0, 0, 3, 3)).t(); Mat tvec = Rts[count](Rect(3, 0, 1, 3)).t(); if (count % 10 == 0){ int downSamplingNum = 4; //e.g. 4 Mat image2(image.rows / downSamplingNum, image.cols / downSamplingNum, CV_8UC3); resize(image, image2, image2.size(), 0, 0, INTER_LINEAR); Mat pCloud(image.rows / downSamplingNum, image.cols / downSamplingNum, CV_64FC3); for (int y = 0; y < 480; y += downSamplingNum){ for (int x = 0; x < 640; x += downSamplingNum){ if (depth.at<float>(y, x) < 8.0 && depth.at<float>(y, x) > 0.4){ //RGB-D Dataset Mat pmat(1, 3, CV_64F); pmat.at<double>(0, 2) = (double)depth.at<float>(y, x); pmat.at<double>(0, 0) = (x - cx) * pmat.at<double>(0, 2) / fx; pmat.at<double>(0, 1) = (y - cy) * pmat.at<double>(0, 2) / fy; pmat = (pmat)*rot + tvec; Point3d p(pmat); pCloud.at<Point3d>(y / downSamplingNum, x / downSamplingNum) = p; pmat.release(); } else{ //RGB-D Dataset pCloud.at<Vec3d>(y / downSamplingNum, x / downSamplingNum) = Vec3d(0.f, 0.f, 0.f); } } } viz::WCloud wcloud(pCloud, image2); string myWCloudName = "CLOUD" + NumToString(count); myWindow.showWidget(myWCloudName, wcloud, cloud_pose_global); pCloud.release(); image2.release(); } cam_pose = cv::Affine3d(rot.t(), tvec); viz::WCameraPosition cpw(0.1); // Coordinate axes viz::WCameraPosition cpw_frustum(cv::Matx33d(cameraMatrix), 0.1, viz::Color::white()); // Camera frustum string widgetPoseName = "CPW" + NumToString(count); string widgetFrustumName = "CPW_FRUSTUM" + NumToString(count); myWindow.showWidget(widgetPoseName, cpw, cam_pose); //myWindow.showWidget(widgetFrustumName, cpw_frustum, cam_pose); myWindow.spinOnce(1, true); rot.release(); tvec.release(); */ if(!frame_prev.empty()) frame_prev->release(); std::swap(frame_prev, frame_curr); } kinect_point = writeResults(Rts); sita = getAngleofVec(kinect_point, target_point); /* Send to server */ resize(colorImage, frame, Size(320, 240)); if(frame.size().width==0) continue; // simple integrity check; skip erroneous data... resize(frame, send, Size(FRAME_WIDTH, FRAME_HEIGHT), 0, 0, INTER_LINEAR); vector < int > compression_params; compression_params.push_back(CV_IMWRITE_JPEG_QUALITY); compression_params.push_back(jpegqual); imencode(".jpg", send, encoded, compression_params); int total_pack = 1 + (encoded.size() - 1) / PACK_SIZE; int ibuf[1]; ibuf[0] = total_pack; udp_sock.sendTo(ibuf, sizeof(int), servAddress, servPort); for (int i = 0; i < total_pack; i++) { udp_sock.sendTo( & encoded[i * PACK_SIZE], PACK_SIZE, servAddress, servPort); } waitKey(FRAME_INTERVAL); /* Capture depth image */ /*if (iJpeg < 100000) { sprintf(capturename, "I1_%06d.png", iJpeg); imwrite(capturename, colorImage); iJpeg++; }*/ /* clock_t next_cycle = clock(); double duration = (next_cycle - last_cycle) / (double) CLOCKS_PER_SEC; cout << "\teffective FPS:" << (1 / duration) << " \tkbps:" << (PACK_SIZE * total_pack / duration / 1024 * 8) << endl; cout << next_cycle - last_cycle; last_cycle = next_cycle; */ //openni::VideoMode videoMode = depthStream.getVideoMode(); unsigned short* depth; depth = (unsigned short*)depthFrame.getData(); beforeGazePoint = currentGazePoint; currentGazePoint = GazeY * videoMode.getResolutionX() + GazeX; targetGazePoint = (KCFroi.y - GAZEY_BIAS) * videoMode.getResolutionX() + (KCFroi.x - GAZEX_BIAS); //currentGazeDepth = depth[currentGazePoint]; targetGazeDepth = depth[targetGazePoint]; openni::CoordinateConverter::convertDepthToWorld(depthStream, targetGazeX, targetGazeY, targetGazeDepth, &xx, &yy, &zz); target_point.x = xx * 0.01; target_point.y = zz * 0.01; //x.push_back(kinect_point.x * 1000); //y.push_back(kinect_point.y * 1000); //X.push_back(xx * 0.01); //Y.push_back(zz * 0.01); //x[0] = point.x; //y[0] = point.y; //plt::plot(x, y, "xr"); //plt::plot(X, Y, ".-b"); //plt::pause(0.1); //stringstream ss; //ss << " targetGazeDepth : " << currentGazeDepth << " CurrentPoint : ( " << currentGazeDepth << ", " << GazeY << " ) "; //ss << "TargetDepth : " << targetGazeDepth << " TargetPoint : ( " << xx << ", " << yy << ", " << zz << " ) " << " CurrentDepth : " << currentGazeDepth << " CurrentPoint : ( " << GazeX << ", " << GazeY << " ) "; //putText( colorImage, ss.str(), Point( 0, 50 ), FONT_HERSHEY_SIMPLEX, 1.0, Scalar( 255 ) ); /* Draw the circle */ if (gazeCount > 50) { circle(colorImage, Point(GazeX, GazeY), 10, Scalar(0, 0, 200), 3, 4); } if (flag_goal == 1 && gazeCount == 20) { circle(colorImage, Point(targetGazeX, targetGazeY), 30, Scalar(0, 200, 0), 3, 4); if (depth[targetGazePoint] < 510 && depth[targetGazePoint] != 0) { flag_goal = 0; gazeCount = 0; tracking_init = 0; } } if (currentGazePoint == beforeGazePoint && gazeCount < 50) { gazeCount++; if (gazeCount == 20) { flag_goal = 1; targetGazeX = GazeX; targetGazeY = GazeY; } } /* Tracker */ if (flag_goal == 1) { if (tracking_init == 0) { /* Tracking init */ trackerKCF = Tracker::create("KCF"); KCFroi.x = targetGazeX + GAZEX_BIAS; KCFroi.y = targetGazeY + GAZEY_BIAS; KCFroi.width = 100; KCFroi.height = 100; trackerKCF->init(colorImage, KCFroi); tracking_init++; } trackerKCF->update(colorImage, KCFroi); rectangle(colorImage, KCFroi, colorkcf, 1, 1); //putText(colorImage, "- KCF", Point(5, 20), FONT_HERSHEY_SIMPLEX, .5, colorkcf, 1, CV_AA); } /* Show the Image and save the video */ //showCenterDistance( depthImage, depthFrame ); imshow("Depth", depthImage); imshow("Color", colorImage); //writer << colorImage; /* if (flag_goal == 1) { outputfile << file_count << " " << targetGazeDepth << endl; file_count++; } */ int key = waitKey( 10 ); if ( key == 'q' ) { break; } /* For debug */ //cout << " x :" << GazeX << " y :" << GazeY << endl; cout << " point.x = " << kinect_point.x * 1000 << " point.y = " << kinect_point.y * 1000 << endl; cout << " gazeCount " << gazeCount << endl; cout << " target_x :" << targetGazeX << " target_y :" << targetGazeY << endl; cout << " target_depth :" << targetGazeDepth << endl; cout << " TargetPoint : ( " << xx * 0.01 << ", " << yy * 0.01 << ", " << zz * 0.01 << " ) " << endl; cout << " sita " << sita << endl; //cout << " flag_goal :" << flag_goal << endl; //cout << "x.size = " << x.size() << "y.size = " << y.size() << endl; } //std::cout << "Average time " << gtm.getTimeSec()/count << std::endl; //outputfile.close(); } /*void showCenterDistance( Mat& depthImage, const openni::VideoFrameRef& depthFrame) { openni::VideoMode videoMode = depthStream.getVideoMode(); int centerX = videoMode.getResolutionX() / 2; int centerY = videoMode.getResolutionY() / 2; int centerIndex = (centerY * videoMode.getResolutionX()) + centerX; unsigned short* depth = (unsigned short*)depthFrame.getData(); stringstream ss; ss << "Center Point :" << depth[centerIndex]; putText( depthImage, ss.str(), Point( 0, 50 ), FONT_HERSHEY_SIMPLEX, 1.0, Scalar( 255 ) ); }*/ /* Get the length of vector */ double getVeclength(Point2d v) { return pow((v.x * v.x) + (v.y * v.y), 0.5); } double getVecdotproduct(Point2d vl, Point2d vr) { return ((vl.x * vr.x) + (vl.y * vr.y)); } double getAngleofVec(Point2d kinect, Point2d target) { double length_kinect = getVeclength(kinect); double length_target = getVeclength(target); double cos_sita = getVecdotproduct(kinect, target) / (length_kinect * length_target); double sita = acos(cos_sita); sita = sita * 180.0 / 3.14159; return sita; } /* Convert depthstream to a form that can be displayed */ Mat showDepthStream( const openni::VideoFrameRef& depthFrame ) { /* Imaging a distance data(16bit) */ Mat depthImage = Mat( depthFrame.getHeight(), depthFrame.getWidth(), CV_16UC1, (unsigned short*)depthFrame.getData() ); /* Convert 0-10000mm to 0-255(8bit) */ //depthImage.convertTo( depthImage, CV_8UC1, 255.0 / 10000 ); //depthImage.convertTo( depthImage, CV_16UC1, 1.f / 8500.f ); /* Display distance of the center point */ //showCenterDistance( depthImage, depthFrame ); return depthImage; } /* Convert colorstream to a form that can be displayed */ Mat showColorStream( const openni::VideoFrameRef& colorFrame ) { /* Convert to form that is OpenCV */ Mat colorImage = Mat( colorFrame.getHeight(), colorFrame.getWidth(), CV_8UC3, (unsigned char*)colorFrame.getData() ); /* Convert BGR to RGB */ cvtColor( colorImage, colorImage, CV_RGB2BGR ); return colorImage; } private: openni::Device device; openni::VideoStream colorStream; openni::VideoStream depthStream; vector<openni::VideoStream*> streams; }; int main(void) { try { GrabDetectorSample app; app.initialize(); app.run(); } catch ( exception& ) { std::cout << openni::OpenNI::getExtendedError() << std::endl; } }
[ [ [ 1, 695 ] ] ]
f609811f99a9a712157858815ac35e49dec8ba61
6bdb3508ed5a220c0d11193df174d8c215eb1fce
/Codes/Halak/Mouse.Window.cpp
49248bce5d75efb689d338d8eb628c852722ec8b
[]
no_license
halak/halak-plusplus
d09ba78640c36c42c30343fb10572c37197cfa46
fea02a5ae52c09ff9da1a491059082a34191cd64
refs/heads/master
2020-07-14T09:57:49.519431
2011-07-09T14:48:07
2011-07-09T14:48:07
66,716,624
0
0
null
null
null
null
UTF-8
C++
false
false
1,227
cpp
#include <Halak/PCH.h> #include <Halak/Mouse.h> #include <Halak/MouseState.h> #include <Halak/Window.h> #if (defined(HALAK_PLATFORM_WINDOWS)) # define WIN32_LEAN_AND_MEAN # include <windows.h> namespace Halak { const MouseState& Mouse::GetState() { POINT windowsMousePosition = { 0, 0 }; ::GetCursorPos(&windowsMousePosition); ::ScreenToClient(static_cast<HWND>(window->GetHandle()), &windowsMousePosition); state->Position = Point(windowsMousePosition.x, windowsMousePosition.y); state->IsLeftButtonPressed = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0x0000; state->IsRightButtonPressed = (GetAsyncKeyState(VK_RBUTTON) & 0x8000) != 0x0000; state->IsMiddleButtonPressed = (GetAsyncKeyState(VK_MBUTTON) & 0x8000) != 0x0000; return *state; } void Mouse::SetPosition(Point value) { POINT windowsMousePosition = { value.X, value.Y }; ::ClientToScreen(static_cast<HWND>(window->GetHandle()), &windowsMousePosition); ::SetCursorPos(windowsMousePosition.x, windowsMousePosition.y); } } #endif
[ [ [ 1, 33 ] ] ]
2162d8def96d512299486e39325d138998609f1c
df5277b77ad258cc5d3da348b5986294b055a2be
/ChatServer/WindowsLibrary/Window.hpp
48a1fc96bdf4411d5f70d41e164cf68cf1b3b268
[]
no_license
beentaken/cs260-last2
147eaeb1ab15d03c57ad7fdc5db2d4e0824c0c22
61b2f84d565cc94a0283cc14c40fb52189ec1ba5
refs/heads/master
2021-03-20T16:27:10.552333
2010-04-26T00:47:13
2010-04-26T00:47:13
null
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
2,323
hpp
/**************************************************************************************************/ /*! @file Window.hpp @author Robert Onulak @author Justin Keane @par email: robert.onulak@@digipen.edu @par email: justin.keane@@digipen.edu @par Course: CS260 @par Assignment #3 ---------------------------------------------------------------------------------------------------- @attention © Copyright 2010: DigiPen Institute of Technology (USA). All Rights Reserved. */ /**************************************************************************************************/ #pragma once #include <windows.h> #include <string> // std::string #include <map> struct IWindowComponent { virtual ~IWindowComponent( void ) throw() {;} virtual HWND Create( HWND parent, HINSTANCE hInstance ) = 0; virtual void Init( void ) {;} }; // struct IWindowComponent const unsigned DEFAULT_WIDTH = 800; const unsigned DEFAULT_HEIGHT = 600; class Window { public: static Window* GetInstance( void ); bool Create( const std::string &name, WNDPROC proc, int show = SW_SHOWNORMAL, const std::string &title = "" /*name*/, unsigned width = DEFAULT_WIDTH, unsigned height = DEFAULT_HEIGHT ); HWND GetHwnd( void ) const { return handle_; } void AddComponent( IWindowComponent *component ); IWindowComponent* GetComponent( HWND component ); template < typename ComponentType > ComponentType HasComp( HWND component ) { return static_cast<ComponentType>( GetComponent( component ) ); } bool Run( void ); WPARAM ReturnCode( void ) const { return msg_.wParam; } private: Window( void ); ~Window( void ) throw(); // Not implemented Window( const Window &rhs ); Window& operator=( const Window &rhs ); private: unsigned width_; unsigned height_; std::string name_; std::string title_; WNDCLASSEX window_; DWORD style_; MSG msg_; HWND handle_; HINSTANCE hInst_; typedef std::map< HWND, IWindowComponent* > ComponentMap; ComponentMap map_; }; // class Window #define WinSys Window::GetInstance() // Include all the window component objects as well... #include "Components.hpp"
[ "rziugy@af704e40-745a-32bd-e5ce-d8b418a3b9ef" ]
[ [ [ 1, 86 ] ] ]
ecdc9429bc62db0cb0011b003ab022aca62b5fff
1197bf572cfd5f7c0ce359f1bf7893dc9f6faeff
/cppPrimerPlus/namesp.h
d42ceca198ff81e0bd4127faf5b220b34bc5fa9d
[]
no_license
badcodes/cpp
07054ba389814b1f5c6a7669151f7e6053b7a077
b91bc39c541d05c36bfb6210f9908a24867d5ca5
refs/heads/master
2020-06-05T04:39:00.359631
2010-11-24T20:26:46
2010-11-24T20:26:46
1,112,893
1
0
null
null
null
null
UTF-8
C++
false
false
372
h
namespace pers { const int LEN=40; struct Person { char fname[LEN]; char lname[LEN]; }; void getPerson(Person &); void showPerson(const Person &); } namespace debts { using namespace pers; struct Debt { Person name; double amount; }; void getDebt(Debt &); void showDebt(const Debt &); double sumDebt(const Debt ar[],int n); }
[ [ [ 1, 24 ] ] ]
2cdab6ae715f1d66546f1796f3238ae7ee6d6466
d425cf21f2066a0cce2d6e804bf3efbf6dd00c00
/Strategic/Creature Spreading.cpp
157a17724daaaadd29c2fcb9d852a8be2fee9f38
[]
no_license
infernuslord/ja2
d5ac783931044e9b9311fc61629eb671f376d064
91f88d470e48e60ebfdb584c23cc9814f620ccee
refs/heads/master
2021-01-02T23:07:58.941216
2011-10-18T09:22:53
2011-10-18T09:22:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
54,799
cpp
#ifdef PRECOMPILEDHEADERS #include "Strategic All.h" #include "GameSettings.h" #else #include "types.h" #include "fileman.h" #include "himage.h" #include "Creature Spreading.h" #include "Campaign Types.h" #include "Strategic Movement.h" #include "Game Event Hook.h" #include "GameSettings.h" #include "Random.h" #include "message.h" #include "Font Control.h" #include "Soldier Init List.h" #include "lighting.h" #include "strategicmap.h" #include "Game Clock.h" #include "Strategic Mines.h" #include "Music Control.h" #include "strategic.h" #include "jascreens.h" #include "Town Militia.h" #include "Strategic Town Loyalty.h" #include "PreBattle Interface.h" #include "Map Edgepoints.h" #include "Animation Data.h" #include "opplist.h" #include "meanwhile.h" #include "Strategic AI.h" #include "MessageBoxScreen.h" #include "Map Information.h" #endif #include "Strategic Mines.h" #include "connect.h" #ifdef JA2BETAVERSION BOOLEAN gfClearCreatureQuest = FALSE; extern UINT32 uiMeanWhileFlags; #endif //GAME BALANCING DEFINITIONS FOR CREATURE SPREADING //Hopefully, adjusting these following definitions will ease the balancing of the //creature spreading. //The one note here is that for any definitions that have a XXX_BONUS at the end of a definition, //it gets added on to it's counterpart via: // XXX_VALUE + Random( 1 + XXX_BONUS ) //The start day random bonus that the queen begins //#define EASY_QUEEN_START_DAY 10 //easy start day 10-13 //#define EASY_QUEEN_START_BONUS 3 //#define NORMAL_QUEEN_START_DAY 8 //normal start day 8-10 //#define NORMAL_QUEEN_START_BONUS 2 //#define HARD_QUEEN_START_DAY 7 //hard start day 7-8 //#define HARD_QUEEN_START_BONUS 1 //This is how often the creatures spread, once the quest begins. The smaller the gap, //the faster the creatures will advance. This is also directly related to the reproduction //rates which are applied each time the creatures spread. #define EASY_SPREAD_TIME_IN_MINUTES 510 //easy spreads every 8.5 hours #define NORMAL_SPREAD_TIME_IN_MINUTES 450 //normal spreads every 7.5 hours #define HARD_SPREAD_TIME_IN_MINUTES 390 //hard spreads every 6.5 hours #define INSANE_SPREAD_TIME_IN_MINUTES 150 //insane spreads every 2.5 hours //Once the queen is added to the game, we can instantly let her spread x number of times //to give her a head start. This can also be a useful tool for having slow reproduction rates //but quicker head start to compensate to make the creatures less aggressive overall. #define EASY_QUEEN_INIT_BONUS_SPREADS 1 #define NORMAL_QUEEN_INIT_BONUS_SPREADS 2 #define HARD_QUEEN_INIT_BONUS_SPREADS 3 #define INSANE_QUEEN_INIT_BONUS_SPREADS 5 //This value modifies the chance to populate a given sector. This is different from the previous definition. //This value gets applied to a potentially complicated formula, using the creature habitat to modify //chance to populate, along with factoring in the relative distance to the hive range (to promote deeper lair //population increases), etc. I would recommend not tweaking the value too much in either direction from //zero due to the fact that this can greatly effect spread times and maximum populations. Basically, if the //creatures are spreading too quickly, increase the value, otherwise decrease it to a negative value #define EASY_POPULATION_MODIFIER 0 #define NORMAL_POPULATION_MODIFIER 0 #define HARD_POPULATION_MODIFIER 0 #define INSANE_POPULATION_MODIFIER 0 //Augments the chance that the creatures will attack a town. The conditions for attacking a town //are based strictly on the occupation of the creatures in each of the four mine exits. For each creature //there is a base chance of 10% that the creatures will feed sometime during the night. #define EASY_CREATURE_TOWN_AGGRESSIVENESS -10 #define NORMAL_CREATURE_TOWN_AGGRESSIVENESS 0 #define HARD_CREATURE_TOWN_AGGRESSIVENESS 10 #define INSANE_CREATURE_TOWN_AGGRESSIVENESS 50 //This is how many creatures the queen produces for each cycle of spreading. The higher //the numbers the faster the creatures will advance. #define EASY_QUEEN_REPRODUCTION_BASE 6 //6-7 #define EASY_QUEEN_REPRODUCTION_BONUS 1 #define NORMAL_QUEEN_REPRODUCTION_BASE 7 //7-9 #define NORMAL_QUEEN_REPRODUCTION_BONUS 2 #define HARD_QUEEN_REPRODUCTION_BASE 9 //9-12 #define HARD_QUEEN_REPRODUCTION_BONUS 3 #define INSANE_QUEEN_REPRODUCTION_BASE 15 //15-20 #define INSANE_QUEEN_REPRODUCTION_BONUS 5 //When either in a cave level with blue lights or there is a creature presence, then //we override the normal music with the creature music. The conditions are maintained //inside the function PrepareCreaturesForBattle() in this module. //BOOLEAN gfUseCreatureMusic = FALSE; // moved to music control.cpp BOOLEAN gfCreatureMeanwhileScenePlayed = FALSE; enum { QUEEN_LAIR, //where the queen lives. Highly protected LAIR, //part of the queen's lair -- lots of babies and defending mothers LAIR_ENTRANCE, //where the creatures access the mine. INNER_MINE, //parts of the mines that aren't close to the outside world OUTER_MINE, //area's where miners work, close to towns, creatures love to eat :) FEEDING_GROUNDS, //creatures love to populate these sectors :) MINE_EXIT, //the area that creatures can initiate town attacks if lots of monsters. }; typedef struct CREATURE_DIRECTIVE { struct CREATURE_DIRECTIVE *next; UNDERGROUND_SECTORINFO *pLevel; }CREATURE_DIRECTIVE; CREATURE_DIRECTIVE *lair; INT32 giHabitatedDistance = 0; INT32 giPopulationModifier = 0; INT32 giLairID = 0; INT32 giDestroyedLairID = 0; //various information required for keeping track of the battle sector involved for //prebattle interface, autoresolve, etc. INT16 gsCreatureInsertionCode = 0; INT32 gsCreatureInsertionGridNo = 0; UINT8 gubNumCreaturesAttackingTown = 0; UINT8 gubYoungMalesAttackingTown = 0; UINT8 gubYoungFemalesAttackingTown = 0; UINT8 gubAdultMalesAttackingTown = 0; UINT8 gubAdultFemalesAttackingTown = 0; UINT8 gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE; UINT8 gubSectorIDOfCreatureAttack = 0; extern UNDERGROUND_SECTORINFO* FindUnderGroundSector( INT16 sMapX, INT16 sMapY, UINT8 bMapZ ); extern UNDERGROUND_SECTORINFO* NewUndergroundNode( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ ); extern void BuildUndergroundSectorInfoList(); void DeleteCreatureDirectives(); //extern MINE_STATUS_TYPE gMineStatus[ MAX_NUMBER_OF_MINES ]; CREATURE_DIRECTIVE* NewDirective( UINT8 ubSectorID, UINT8 ubSectorZ, UINT8 ubCreatureHabitat ) { CREATURE_DIRECTIVE *curr; UINT8 ubSectorX, ubSectorY; curr = (CREATURE_DIRECTIVE*)MemAlloc( sizeof( CREATURE_DIRECTIVE ) ); Assert( curr ); ubSectorX = (UINT8)((ubSectorID % 16) + 1); ubSectorY = (UINT8)((ubSectorID / 16) + 1); curr->pLevel = FindUnderGroundSector( ubSectorX, ubSectorY, ubSectorZ ); if( !curr->pLevel ) { AssertMsg( 0, String( "Could not find underground sector node (%c%db_%d) that should exist.", ubSectorY + 'A' - 1, ubSectorX, ubSectorZ ) ); return 0; } curr->pLevel->ubCreatureHabitat = ubCreatureHabitat; Assert( curr->pLevel ); curr->next = NULL; return curr; } void InitLairDrassen() { CREATURE_DIRECTIVE *curr; giLairID = 1; //initialize the linked list of lairs lair = NewDirective( SEC_F13, 3, QUEEN_LAIR ); curr = lair; if( !curr->pLevel->ubNumCreatures ) { curr->pLevel->ubNumCreatures = 1; //for the queen. } curr->next = NewDirective( SEC_G13, 3, LAIR ); curr = curr->next; curr->next = NewDirective( SEC_G13, 2, LAIR_ENTRANCE ); curr = curr->next; curr->next = NewDirective( SEC_F13, 2, INNER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_E13, 2, INNER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_E13, 1, OUTER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_D13, 1, MINE_EXIT ); } void InitLairCambria() { CREATURE_DIRECTIVE *curr; giLairID = 2; //initialize the linked list of lairs lair = NewDirective( SEC_J8, 3, QUEEN_LAIR ); curr = lair; if( !curr->pLevel->ubNumCreatures ) { curr->pLevel->ubNumCreatures = 1; //for the queen. } curr->next = NewDirective( SEC_I8, 3, LAIR ); curr = curr->next; curr->next = NewDirective( SEC_H8, 3, LAIR ); curr = curr->next; curr->next = NewDirective( SEC_H8, 2, LAIR_ENTRANCE ); curr = curr->next; curr->next = NewDirective( SEC_H9, 2, INNER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_H9, 1, OUTER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_H8, 1, MINE_EXIT ); } void InitLairAlma() { CREATURE_DIRECTIVE *curr; giLairID = 3; //initialize the linked list of lairs lair = NewDirective( SEC_K13, 3, QUEEN_LAIR ); curr = lair; if( !curr->pLevel->ubNumCreatures ) { curr->pLevel->ubNumCreatures = 1; //for the queen. } curr->next = NewDirective( SEC_J13, 3, LAIR ); curr = curr->next; curr->next = NewDirective( SEC_J13, 2, LAIR_ENTRANCE ); curr = curr->next; curr->next = NewDirective( SEC_J14, 2, INNER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_J14, 1, OUTER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_I14, 1, MINE_EXIT ); } void InitLairGrumm() { CREATURE_DIRECTIVE *curr; giLairID = 4; //initialize the linked list of lairs lair = NewDirective( SEC_G4, 3, QUEEN_LAIR ); curr = lair; if( !curr->pLevel->ubNumCreatures ) { curr->pLevel->ubNumCreatures = 1; //for the queen. } curr->next = NewDirective( SEC_H4, 3, LAIR ); curr = curr->next; curr->next = NewDirective( SEC_H4, 2, LAIR_ENTRANCE ); curr = curr->next; curr->next = NewDirective( SEC_H3, 2, INNER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_I3, 2, INNER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_I3, 1, OUTER_MINE ); curr = curr->next; curr->next = NewDirective( SEC_H3, 1, MINE_EXIT ); } #ifdef JA2BETAVERSION extern BOOLEAN gfExitViewer; #endif void InitCreatureQuest() { UNDERGROUND_SECTORINFO *curr; BOOLEAN fPlayMeanwhile = FALSE; INT32 i=-1; INT32 iChosenMine; INT32 iRandom; INT32 iNumMinesInfectible; #ifdef JA2BETAVERSION INT32 iOrigRandom; #endif BOOLEAN fMineInfectible[4]; if( giLairID ) { return; //already active! } #ifdef JA2BETAVERSION if( guiCurrentScreen != AIVIEWER_SCREEN ) { fPlayMeanwhile = TRUE; } #else fPlayMeanwhile = TRUE; #endif #ifdef JA2UB //Ja25 No meanwhiles && no creatures #else if( fPlayMeanwhile && !gfCreatureMeanwhileScenePlayed ) { //Start the meanwhile scene for the queen ordering the release of the creatures. HandleCreatureRelease(); gfCreatureMeanwhileScenePlayed = TRUE; } #endif giHabitatedDistance = 0; switch( gGameOptions.ubDifficultyLevel ) { case DIF_LEVEL_EASY: giPopulationModifier = EASY_POPULATION_MODIFIER; break; case DIF_LEVEL_MEDIUM: giPopulationModifier = NORMAL_POPULATION_MODIFIER; break; case DIF_LEVEL_HARD: giPopulationModifier = HARD_POPULATION_MODIFIER; break; case DIF_LEVEL_INSANE: giPopulationModifier = INSANE_POPULATION_MODIFIER; break; } //Determine which of the four maps are infectible by creatures. Infectible mines //are those that are player controlled and unlimited. We don't want the creatures to //infect the mine that runs out. //Default them all to infectible memset( fMineInfectible, 1, sizeof( BOOLEAN ) * 4 ); if( gMineStatus[ MINE_DRASSEN ].fAttackedHeadMiner || //gMineStatus[ MINE_DRASSEN ].uiOreRunningOutPoint || !gMineStatus[ MINE_DRASSEN ].fInfectible || //StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_D13 ) ].fEnemyControlled StrategicMap[ gMineStatus[MINE_DRASSEN].StrategicIndex() ].fEnemyControlled ) { //If head miner was attacked, ore will/has run out, or enemy controlled fMineInfectible[ 0 ] = FALSE; } if( gMineStatus[ MINE_CAMBRIA ].fAttackedHeadMiner || //gMineStatus[ MINE_CAMBRIA ].uiOreRunningOutPoint || !gMineStatus[ MINE_CAMBRIA ].fInfectible || //StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_H8 ) ].fEnemyControlled ) StrategicMap[ gMineStatus[MINE_CAMBRIA].StrategicIndex() ].fEnemyControlled ) { //If head miner was attacked, ore will/has run out, or enemy controlled fMineInfectible[ 1 ] = FALSE; } if( gMineStatus[ MINE_ALMA ].fAttackedHeadMiner || //gMineStatus[ MINE_ALMA ].uiOreRunningOutPoint || !gMineStatus[ MINE_ALMA ].fInfectible || //StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_I14 ) ].fEnemyControlled ) StrategicMap[ gMineStatus[MINE_ALMA].StrategicIndex() ].fEnemyControlled ) { //If head miner was attacked, ore will/has run out, or enemy controlled fMineInfectible[ 2 ] = FALSE; } if( gMineStatus[ MINE_GRUMM ].fAttackedHeadMiner || //gMineStatus[ MINE_GRUMM ].uiOreRunningOutPoint || !gMineStatus[ MINE_GRUMM ].fInfectible || //StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_H3 ) ].fEnemyControlled ) StrategicMap[ gMineStatus[MINE_GRUMM].StrategicIndex() ].fEnemyControlled ) { //If head miner was attacked, ore will/has run out, or enemy controlled fMineInfectible[ 3 ] = FALSE; } #ifdef JA2BETAVERSION if( guiCurrentScreen == AIVIEWER_SCREEN ) { //If in the AIViewer, allow any mine to get infected memset( fMineInfectible, 1, sizeof( BOOLEAN ) * 4 ); } #endif iNumMinesInfectible = fMineInfectible[0] + fMineInfectible[1] + fMineInfectible[2] + fMineInfectible[3]; if( !iNumMinesInfectible ) { return; } //Choose one of the infectible mines randomly iRandom = Random( iNumMinesInfectible ) + 1; #ifdef JA2BETAVERSION iOrigRandom = iRandom; #endif iChosenMine = 0; for( i = 0; i < 4; i++ ) { if( iRandom ) { iChosenMine++; if( fMineInfectible[i] ) { iRandom--; } } } //Now, choose a start location for the queen. switch( iChosenMine ) { case 1: //Drassen InitLairDrassen(); curr = FindUnderGroundSector( 13, 5, 1 ); curr->uiFlags |= SF_PENDING_ALTERNATE_MAP; break; case 2: //Cambria InitLairCambria(); curr = FindUnderGroundSector( 9, 8, 1 ); curr->uiFlags |= SF_PENDING_ALTERNATE_MAP; //entrance break; case 3: //Alma's mine InitLairAlma(); curr = FindUnderGroundSector( 14, 10, 1 ); curr->uiFlags |= SF_PENDING_ALTERNATE_MAP; break; case 4: //Grumm's mine InitLairGrumm(); curr = FindUnderGroundSector( 4, 8, 2 ); curr->uiFlags |= SF_PENDING_ALTERNATE_MAP; break; default: #ifdef JA2BETAVERSION { CHAR16 str[512]; swprintf( str, L"Creature quest never chose a lair and won't infect any mines. Infectible mines = %d, iRandom = %d. " L"This isn't a bug if you are not receiving income from any mines.", iNumMinesInfectible, iOrigRandom ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); } #endif return; } //Now determine how often we will spread the creatures. switch( gGameOptions.ubDifficultyLevel ) { case DIF_LEVEL_EASY: i = EASY_QUEEN_INIT_BONUS_SPREADS; AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, EASY_SPREAD_TIME_IN_MINUTES, 0 ); break; case DIF_LEVEL_MEDIUM: i = NORMAL_QUEEN_INIT_BONUS_SPREADS; AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, NORMAL_SPREAD_TIME_IN_MINUTES, 0 ); break; case DIF_LEVEL_HARD: i = HARD_QUEEN_INIT_BONUS_SPREADS; AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, HARD_SPREAD_TIME_IN_MINUTES, 0 ); break; case DIF_LEVEL_INSANE: i = INSANE_QUEEN_INIT_BONUS_SPREADS; AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, INSANE_SPREAD_TIME_IN_MINUTES, 0 ); break; } //Set things up so that the creatures can plan attacks on helpless miners and civilians while //they are sleeping. They do their planning at 10PM every day, and decide to attack sometime //during the night. AddEveryDayStrategicEvent( EVENT_CREATURE_NIGHT_PLANNING, 1320, 0 ); //Got to give the queen some early protection, so do some creature spreading. while( i-- ) { //# times spread is based on difficulty, and the values in the defines. SpreadCreatures(); } } void AddCreatureToNode( CREATURE_DIRECTIVE *node ) { node->pLevel->ubNumCreatures++; if( node->pLevel->uiFlags & SF_PENDING_ALTERNATE_MAP ) { //there is an alternate map meaning that there is a dynamic opening. From now on //we substitute this map. node->pLevel->uiFlags &= ~SF_PENDING_ALTERNATE_MAP; node->pLevel->uiFlags |= SF_USE_ALTERNATE_MAP; } } BOOLEAN PlaceNewCreature( CREATURE_DIRECTIVE *node, INT32 iDistance ) { DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CreatureSpreading1"); if( !node ) return FALSE; //check to see if the creatures are permitted to spread into certain areas. There are 4 mines (human perspective), and //creatures won't spread to them until the player controls them. Additionally, if the player has recently cleared the //mine, then temporarily prevent the spreading of creatures. if( giHabitatedDistance == iDistance ) { //FRONT-LINE CONDITIONS -- consider expansion or frontline fortification. The formulae used //in this sector are geared towards outer expansion. //we have reached the distance limitation for the spreading. We will determine if //the area is populated enough to spread further. The minimum population must be 4 before //spreading is even considered. if( node->pLevel->ubNumCreatures*10 - 10 <= (INT32)Random( 60 ) ) { // x<=1 100% // x==2 83% // x==3 67% // x==4 50% // x==5 33% // x==6 17% // x>=7 0% AddCreatureToNode( node ); return TRUE; } } else if( giHabitatedDistance > iDistance ) { // WDS - make number of mercenaries, etc. be configurable //we are within the "safe" habitated area of the creature's area of influence. The chance of //increasing the population inside this sector depends on how deep we are within the sector. if( node->pLevel->ubNumCreatures < gGameExternalOptions.iMaxEnemyGroupSize || node->pLevel->ubNumCreatures < gGameExternalOptions.ubGameMaximumNumberOfCreatures && node->pLevel->ubCreatureHabitat == QUEEN_LAIR ) { //there is ALWAYS a chance to habitate an interior sector, though the chances are slim for //highly occupied sectors. This chance is modified by the type of area we are in. INT32 iAbsoluteMaxPopulation; INT32 iMaxPopulation=-1; INT32 iChanceToPopulate; switch( node->pLevel->ubCreatureHabitat ) { case QUEEN_LAIR: //Defend the queen bonus iAbsoluteMaxPopulation = gGameExternalOptions.ubGameMaximumNumberOfCreatures; break; case LAIR: //Smaller defend the queen bonus iAbsoluteMaxPopulation = 18; break; case LAIR_ENTRANCE: //Smallest defend the queen bonus iAbsoluteMaxPopulation = 15; break; case INNER_MINE: //neg bonus -- actually promotes expansion over population, and decrease max pop here. iAbsoluteMaxPopulation = 12; break; case OUTER_MINE: //neg bonus -- actually promotes expansion over population, and decrease max pop here. iAbsoluteMaxPopulation = 10; break; case FEEDING_GROUNDS: //get free food bonus! yummy humans :) iAbsoluteMaxPopulation = 15; break; case MINE_EXIT: //close access to humans (don't want to overwhelm them) iAbsoluteMaxPopulation = 10; break; default: Assert( 0 ); return FALSE; } switch( gGameOptions.ubDifficultyLevel ) { case DIF_LEVEL_EASY: //50% iAbsoluteMaxPopulation /= 2; //Half break; case DIF_LEVEL_MEDIUM: //80% iAbsoluteMaxPopulation = iAbsoluteMaxPopulation * 4 / 5; break; case DIF_LEVEL_HARD: //100% break; case DIF_LEVEL_INSANE: //200% iAbsoluteMaxPopulation *= 2; break; } //Calculate the desired max population percentage based purely on current distant to creature range. //The closer we are to the lair, the closer this value will be to 100. iMaxPopulation = 100 - iDistance * 100 / giHabitatedDistance; iMaxPopulation = max( iMaxPopulation, 25 ); //Now, convert the previous value into a numeric population. iMaxPopulation = iAbsoluteMaxPopulation * iMaxPopulation / 100; iMaxPopulation = max( iMaxPopulation, 4 ); //The chance to populate a sector is higher for lower populations. This is calculated on //the ratio of current population to the max population. iChanceToPopulate = 100 - node->pLevel->ubNumCreatures * 100 / iMaxPopulation; if( !node->pLevel->ubNumCreatures || iChanceToPopulate > (INT32)Random( 100 ) && iMaxPopulation > node->pLevel->ubNumCreatures ) { AddCreatureToNode( node ); return TRUE; } } } else { //we are in a new area, so we will populate it AddCreatureToNode( node ); giHabitatedDistance++; return TRUE; } if( PlaceNewCreature( node->next, iDistance + 1 ) ) return TRUE; return FALSE; } void SpreadCreatures() { UINT16 usNewCreatures=0; if( giLairID == -1 ) { DecayCreatures(); return; } //queen just produced a litter of creature larvae. Let's do some spreading now. switch( gGameOptions.ubDifficultyLevel ) { case DIF_LEVEL_EASY: usNewCreatures = (UINT16)(EASY_QUEEN_REPRODUCTION_BASE + Random( 1 + EASY_QUEEN_REPRODUCTION_BONUS )); break; case DIF_LEVEL_MEDIUM: usNewCreatures = (UINT16)(NORMAL_QUEEN_REPRODUCTION_BASE + Random( 1 + NORMAL_QUEEN_REPRODUCTION_BONUS )); break; case DIF_LEVEL_HARD: usNewCreatures = (UINT16)(HARD_QUEEN_REPRODUCTION_BASE + Random( 1 + HARD_QUEEN_REPRODUCTION_BONUS )); break; case DIF_LEVEL_INSANE: usNewCreatures = (UINT16)(INSANE_QUEEN_REPRODUCTION_BASE + Random( 1 + INSANE_QUEEN_REPRODUCTION_BONUS )); break; } while( usNewCreatures-- ) { //Note, this function can and will fail if the population gets dense. This is a necessary //feature. Otherwise, the queen would fill all the cave levels with MAX_STRATEGIC_TEAM_SIZE monsters, and that would //be bad. PlaceNewCreature( lair, 0 ); } } void DecayCreatures() { //when the queen dies, we need to kill off the creatures over a period of time. } void AddCreaturesToBattle( UINT8 ubNumYoungMales, UINT8 ubNumYoungFemales, UINT8 ubNumAdultMales, UINT8 ubNumAdultFemales ) { INT32 iRandom; SOLDIERTYPE *pSoldier; MAPEDGEPOINTINFO MapEdgepointInfo = { }; UINT8 bDesiredDirection=0; UINT8 ubCurrSlot = 0; switch( gsCreatureInsertionCode ) { case INSERTION_CODE_NORTH: bDesiredDirection = SOUTHEAST; break; case INSERTION_CODE_EAST: bDesiredDirection = SOUTHWEST; break; case INSERTION_CODE_SOUTH: bDesiredDirection = NORTHWEST; break; case INSERTION_CODE_WEST: bDesiredDirection = NORTHEAST; break; case INSERTION_CODE_GRIDNO: break; default: AssertMsg( 0, "Illegal direction passed to AddCreaturesToBattle()" ); break; } #ifdef JA2TESTVERSION ScreenMsg( FONT_RED, MSG_INTERFACE, L"Creature attackers have arrived!" ); #endif if( gsCreatureInsertionCode != INSERTION_CODE_GRIDNO ) { ChooseMapEdgepoints( &MapEdgepointInfo, (UINT8)gsCreatureInsertionCode, (UINT8)(ubNumYoungMales+ubNumYoungFemales+ubNumAdultMales+ubNumAdultFemales) ); ubCurrSlot = 0; } while( ubNumYoungMales || ubNumYoungFemales || ubNumAdultMales || ubNumAdultFemales ) { iRandom = (INT32)Random( ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales + ubNumAdultFemales ); if( ubNumYoungMales && iRandom < (INT32)ubNumYoungMales ) { ubNumYoungMales--; pSoldier = TacticalCreateCreature( YAM_MONSTER ); } else if( ubNumYoungFemales && iRandom < (INT32)(ubNumYoungMales + ubNumYoungFemales) ) { ubNumYoungFemales--; pSoldier = TacticalCreateCreature( YAF_MONSTER ); } else if( ubNumAdultMales && iRandom < (INT32)(ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales) ) { ubNumAdultMales--; pSoldier = TacticalCreateCreature( AM_MONSTER ); } else if( ubNumAdultFemales && iRandom < (INT32)(ubNumYoungMales + ubNumYoungFemales + ubNumAdultMales + ubNumAdultFemales ) ) { ubNumAdultFemales--; pSoldier = TacticalCreateCreature( ADULTFEMALEMONSTER ); } else { gsCreatureInsertionCode = 0; gsCreatureInsertionGridNo = 0; gubNumCreaturesAttackingTown = 0; gubYoungMalesAttackingTown = 0; gubYoungFemalesAttackingTown = 0; gubAdultMalesAttackingTown = 0; gubAdultFemalesAttackingTown = 0; gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE; gubSectorIDOfCreatureAttack = 0; AllTeamsLookForAll( FALSE ); Assert(0); return; } pSoldier->ubInsertionDirection = bDesiredDirection; //Setup the position pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; pSoldier->aiData.bHunting = TRUE; if( gsCreatureInsertionCode != INSERTION_CODE_GRIDNO ) { if( ubCurrSlot < MapEdgepointInfo.ubNumPoints ) { //using an edgepoint pSoldier->usStrategicInsertionData = MapEdgepointInfo.sGridNo[ ubCurrSlot++ ]; } else { //no edgepoints left, so put him at the entrypoint. pSoldier->ubStrategicInsertionCode = (UINT8)gsCreatureInsertionCode; } } else { pSoldier->usStrategicInsertionData = gsCreatureInsertionGridNo; } UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 ); } gsCreatureInsertionCode = 0; gsCreatureInsertionGridNo = 0; gubNumCreaturesAttackingTown = 0; gubYoungMalesAttackingTown = 0; gubYoungFemalesAttackingTown = 0; gubAdultMalesAttackingTown = 0; gubAdultFemalesAttackingTown = 0; gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE; gubSectorIDOfCreatureAttack = 0; AllTeamsLookForAll( FALSE ); } void ChooseTownSectorToAttack( UINT8 ubSectorID, BOOLEAN fOverrideTest ) { INT32 iRandom; UINT8 ubSectorX, ubSectorY; ubSectorX = (UINT8)((ubSectorID % 16) + 1); ubSectorY = (UINT8)((ubSectorID / 16) + 1); if( !fOverrideTest ) { iRandom = PreRandom( 100 ); switch( ubSectorID ) { case SEC_D13: //DRASSEN if( iRandom < 45 ) ubSectorID = SEC_D13; else if( iRandom < 70 ) ubSectorID = SEC_C13; else ubSectorID = SEC_B13; break; case SEC_H3: //GRUMM if( iRandom < 35 ) ubSectorID = SEC_H3; else if( iRandom < 55 ) ubSectorID = SEC_H2; else if( iRandom < 70 ) ubSectorID = SEC_G2; else if( iRandom < 85 ) ubSectorID = SEC_H1; else ubSectorID = SEC_G1; break; case SEC_H8: //CAMBRIA if( iRandom < 35 ) ubSectorID = SEC_H8; else if( iRandom < 55 ) ubSectorID = SEC_G8; else if( iRandom < 70 ) ubSectorID = SEC_F8; else if( iRandom < 85 ) ubSectorID = SEC_G9; else ubSectorID = SEC_F9; break; case SEC_I14: //ALMA if( iRandom < 45 ) ubSectorID = SEC_I14; else if( iRandom < 65 ) ubSectorID = SEC_I13; else if( iRandom < 85 ) ubSectorID = SEC_H14; else ubSectorID = SEC_H13; break; default: Assert( 0 ); return; } } switch( ubSectorID ) { case SEC_D13: //DRASSEN gsCreatureInsertionCode = INSERTION_CODE_GRIDNO; gsCreatureInsertionGridNo = 20703;//dnl!!! break; case SEC_C13: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_B13: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_H3: //GRUMM gsCreatureInsertionCode = INSERTION_CODE_GRIDNO; gsCreatureInsertionGridNo = 10303; //dnl!!! break; case SEC_H2: gsCreatureInsertionCode = INSERTION_CODE_EAST; break; case SEC_G2: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_H1: gsCreatureInsertionCode = INSERTION_CODE_EAST; break; case SEC_G1: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_H8: //CAMBRIA gsCreatureInsertionCode = INSERTION_CODE_GRIDNO; gsCreatureInsertionGridNo = 13005; //dnl!!! break; case SEC_G8: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_F8: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_G9: gsCreatureInsertionCode = INSERTION_CODE_WEST; break; case SEC_F9: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_I14: //ALMA gsCreatureInsertionCode = INSERTION_CODE_GRIDNO; gsCreatureInsertionGridNo = 9726; //dnl!!! break; case SEC_I13: gsCreatureInsertionCode = INSERTION_CODE_EAST; break; case SEC_H14: gsCreatureInsertionCode = INSERTION_CODE_SOUTH; break; case SEC_H13: gsCreatureInsertionCode = INSERTION_CODE_EAST; break; default: return; } gubSectorIDOfCreatureAttack = ubSectorID; } void CreatureAttackTown( UINT8 ubSectorID, BOOLEAN fOverrideTest ) { //This is the launching point of the creature attack. UNDERGROUND_SECTORINFO *pSector; UINT8 ubSectorX, ubSectorY; if( gfWorldLoaded && gTacticalStatus.fEnemyInSector ) { //Battle currently in progress, repost the event AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + Random( 10 ), ubSectorID ); return; } gubCreatureBattleCode = CREATURE_BATTLE_CODE_NONE; ubSectorX = (UINT8)((ubSectorID % 16) + 1); ubSectorY = (UINT8)((ubSectorID / 16) + 1); if( !fOverrideTest ) { //Record the number of creatures in the sector. pSector = FindUnderGroundSector( ubSectorX, ubSectorY, 1 ); if( !pSector ) { CreatureAttackTown( ubSectorID, TRUE ); return; } gubNumCreaturesAttackingTown = pSector->ubNumCreatures; if( !gubNumCreaturesAttackingTown ) { CreatureAttackTown( ubSectorID, TRUE ); return; } pSector->ubNumCreatures = 0; //Choose one of the town sectors to attack. Sectors closer to //the mine entrance have a greater chance of being chosen. ChooseTownSectorToAttack( ubSectorID, FALSE ); ubSectorX = (UINT8)((gubSectorIDOfCreatureAttack % 16) + 1); ubSectorY = (UINT8)((gubSectorIDOfCreatureAttack / 16) + 1); } else { ChooseTownSectorToAttack( ubSectorID, TRUE ); gubNumCreaturesAttackingTown = 5; } //Now that the sector has been chosen, attack it! if( PlayerGroupsInSector( ubSectorX, ubSectorY, 0 ) ) { //we have players in the sector if( ubSectorX == gWorldSectorX && ubSectorY == gWorldSectorY && !gbWorldSectorZ ) { //This is the currently loaded sector. All we have to do is change the music and insert //the creatures tactically. if( guiCurrentScreen == GAME_SCREEN ) { gubCreatureBattleCode = CREATURE_BATTLE_CODE_TACTICALLYADD; } else { gubCreatureBattleCode = CREATURE_BATTLE_CODE_PREBATTLEINTERFACE; } } else { gubCreatureBattleCode = CREATURE_BATTLE_CODE_PREBATTLEINTERFACE; } } else if( CountAllMilitiaInSector( ubSectorX, ubSectorY ) ) { //we have militia in the sector gubCreatureBattleCode = CREATURE_BATTLE_CODE_AUTORESOLVE; } else if( !StrategicMap[ ubSectorX + MAP_WORLD_X * ubSectorY ].fEnemyControlled ) { //player controlled sector -- eat some civilians AdjustLoyaltyForCivsEatenByMonsters( ubSectorX, ubSectorY, gubNumCreaturesAttackingTown ); SectorInfo[ ubSectorID ].ubDayOfLastCreatureAttack = (UINT8)GetWorldDay(); return; } else { //enemy controlled sectors don't get attacked. return; } SectorInfo[ ubSectorID ].ubDayOfLastCreatureAttack = (UINT8)GetWorldDay(); switch( gubCreatureBattleCode ) { case CREATURE_BATTLE_CODE_PREBATTLEINTERFACE: InitPreBattleInterface( NULL, TRUE ); break; case CREATURE_BATTLE_CODE_AUTORESOLVE: gfAutomaticallyStartAutoResolve = TRUE; InitPreBattleInterface( NULL, TRUE ); break; case CREATURE_BATTLE_CODE_TACTICALLYADD: if (is_networked) { if(is_server && gCreatureEnabled == 1) PrepareCreaturesForBattle(); } else PrepareCreaturesForBattle(); break; } InterruptTime(); PauseGame(); LockPauseState( 2 ); } //Called by campaign init. void ChooseCreatureQuestStartDay() { if (gGameOptions.ubGameStyle == STYLE_REALISTIC || !gGameExternalOptions.fEnableCrepitus) return; /* // INT32 iRandom, iDay; if( !(gGameOptions.ubGameStyle == STYLE_SCIFI) || !gGameExternalOptions.fEnableCrepitus) return; //only available in science fiction mode. */ //Post the event. Once it becomes due, it will setup the queen monster's location, and //begin spreading and attacking towns from there. switch( gGameOptions.ubDifficultyLevel ) { case DIF_LEVEL_EASY: //AddPeriodStrategicEvent( EVENT_BEGIN_CREATURE_QUEST, (EASY_QUEEN_START_DAY + Random( 1 + EASY_QUEEN_START_BONUS )) * 1440 , 0 ); break; case DIF_LEVEL_MEDIUM: //AddPeriodStrategicEvent( EVENT_BEGIN_CREATURE_QUEST, (NORMAL_QUEEN_START_DAY + Random( 1 + NORMAL_QUEEN_START_BONUS )) * 1440, 0 ); break; case DIF_LEVEL_HARD: //AddPeriodStrategicEvent( EVENT_BEGIN_CREATURE_QUEST, (HARD_QUEEN_START_DAY + Random( 1 + HARD_QUEEN_START_BONUS )) * 1440, 0 ); break; case DIF_LEVEL_INSANE: //AddPeriodStrategicEvent( EVENT_BEGIN_CREATURE_QUEST, (INSANE_QUEEN_START_DAY + Random( 1 + INSANE_QUEEN_START_BONUS )) * 1440, 0 ); break; } } void DeleteDirectiveNode( CREATURE_DIRECTIVE **node ) { if( (*node)->next ) DeleteDirectiveNode( &((*node)->next) ); MemFree( *node ); *node = NULL; } //Recursively delete all nodes (from the top down). void DeleteCreatureDirectives() { if( lair ) DeleteDirectiveNode( &lair ); giLairID = 0; } void ClearCreatureQuest() { //This will remove all of the underground sector information and reinitialize it. //The only part that doesn't get added are the queen's lair. BuildUndergroundSectorInfoList(); DeleteAllStrategicEventsOfType( EVENT_BEGIN_CREATURE_QUEST ); DeleteCreatureDirectives(); } void EndCreatureQuest() { CREATURE_DIRECTIVE *curr; UNDERGROUND_SECTORINFO *pSector; INT32 i; //By setting the lairID to -1, when it comes time to spread creatures, //They will get subtracted instead. giDestroyedLairID = giLairID; giLairID = -1; //Also nuke all of the creatures in all of the other mine sectors. This //is keyed on the fact that the queen monster is killed. curr = lair; if( curr ) { //skip first node (there could be other creatures around. curr = curr->next; } while( curr ) { curr->pLevel->ubNumCreatures = 0; curr = curr->next; } //Remove the creatures that are trapped underneath Tixa pSector = FindUnderGroundSector( 9, 10, 2 ); if( pSector ) { pSector->ubNumCreatures = 0; } //Also find and nuke all creatures on any surface levels!!! //KM: Sept 3, 1999 patch for( i = 0; i < 255; i++ ) { SectorInfo[ i ].ubNumCreatures = 0; SectorInfo[ i ].ubCreaturesInBattle = 0; } } UINT8 CreaturesInUndergroundSector( UINT8 ubSectorID, UINT8 ubSectorZ ) { UNDERGROUND_SECTORINFO *pSector; UINT8 ubSectorX, ubSectorY; ubSectorX = (UINT8)SECTORX( ubSectorID ); ubSectorY = (UINT8)SECTORY( ubSectorID ); pSector = FindUnderGroundSector( ubSectorX, ubSectorY, ubSectorZ ); if( pSector ) return pSector->ubNumCreatures; return 0; } BOOLEAN MineClearOfMonsters( UINT8 ubMineIndex ) { Assert( ( ubMineIndex >= 0 ) && ( ubMineIndex < MAX_NUMBER_OF_MINES ) ); if( !gMineStatus[ ubMineIndex ].fPrevInvadedByMonsters ) { switch( ubMineIndex ) { case MINE_GRUMM: if( CreaturesInUndergroundSector( SEC_H3, 1 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_I3, 1 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_I3, 2 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_H3, 2 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_H4, 2 ) ) return FALSE; break; case MINE_CAMBRIA: if( CreaturesInUndergroundSector( SEC_H8, 1 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_H9, 1 ) ) return FALSE; break; case MINE_ALMA: if( CreaturesInUndergroundSector( SEC_I14, 1 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_J14, 1 ) ) return FALSE; break; case MINE_DRASSEN: if( CreaturesInUndergroundSector( SEC_D13, 1 ) ) return FALSE; if( CreaturesInUndergroundSector( SEC_E13, 1 ) ) return FALSE; break; case MINE_CHITZENA: case MINE_SAN_MONA: // these are never attacked break; default: #ifdef JA2BETAVERSION ScreenMsg( FONT_RED, MSG_ERROR, L"Attempting to check if mine is clear but mine index is invalid (%d).", ubMineIndex ); #endif break; } } else { //mine was previously invaded by creatures. Don't allow mine production until queen is dead. if( giLairID != -1 ) { return FALSE; } } return TRUE; } void DetermineCreatureTownComposition( UINT8 ubNumCreatures, UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales, UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales ) { INT32 i, iRandom; UINT8 ubYoungMalePercentage = 10; UINT8 ubYoungFemalePercentage = 65; UINT8 ubAdultMalePercentage = 5; UINT8 ubAdultFemalePercentage = 20; //First step is to convert the percentages into the numbers we will use. ubYoungFemalePercentage += ubYoungMalePercentage; ubAdultMalePercentage += ubYoungFemalePercentage; ubAdultFemalePercentage += ubAdultMalePercentage; if( ubAdultFemalePercentage != 100 ) { AssertMsg( 0, "Percentage for adding creatures don't add up to 100." ); } //Second step is to determine the breakdown of the creatures randomly. i = ubNumCreatures; while( i-- ) { iRandom = Random( 100 ); if( iRandom < ubYoungMalePercentage ) (*pubNumYoungMales)++; else if( iRandom < ubYoungFemalePercentage ) (*pubNumYoungFemales)++; else if( iRandom < ubAdultMalePercentage ) (*pubNumAdultMales)++; else (*pubNumAdultFemales)++; } } void DetermineCreatureTownCompositionBasedOnTacticalInformation( UINT8 *pubNumCreatures, UINT8 *pubNumYoungMales, UINT8 *pubNumYoungFemales, UINT8 *pubNumAdultMales, UINT8 *pubNumAdultFemales ) { SECTORINFO *pSector; INT32 i; SOLDIERTYPE *pSoldier; pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ]; *pubNumCreatures = 0; pSector->ubNumCreatures = 0; pSector->ubCreaturesInBattle = 0; for( i = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID; i <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; i++ ) { pSoldier = MercPtrs[ i ]; if( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife ) { switch( pSoldier->ubBodyType ) { case ADULTFEMALEMONSTER: (*pubNumCreatures)++; (*pubNumAdultFemales)++; break; case AM_MONSTER: (*pubNumCreatures)++; (*pubNumAdultMales)++; break; case YAF_MONSTER: (*pubNumCreatures)++; (*pubNumYoungFemales)++; break; case YAM_MONSTER: (*pubNumCreatures)++; (*pubNumYoungMales)++; break; } } } } BOOLEAN PrepareCreaturesForBattle() { UNDERGROUND_SECTORINFO *pSector; INT32 i, iRandom; SGPPaletteEntry LColors[3]; UINT8 ubNumColors; BOOLEAN fQueen; UINT8 ubLarvaePercentage; UINT8 ubInfantPercentage; UINT8 ubYoungMalePercentage; UINT8 ubYoungFemalePercentage; UINT8 ubAdultMalePercentage; UINT8 ubAdultFemalePercentage; UINT8 ubCreatureHabitat; UINT8 ubNumLarvae = 0; UINT8 ubNumInfants = 0; UINT8 ubNumYoungMales = 0; UINT8 ubNumYoungFemales = 0; UINT8 ubNumAdultMales = 0; UINT8 ubNumAdultFemales = 0; UINT8 ubNumCreatures; if( !gubCreatureBattleCode ) { ubNumColors = LightGetColors( LColors ); if (! gbWorldSectorZ ) { UseCreatureMusic(LColors->peBlue); return FALSE; //Creatures don't attack overworld with this battle code. } pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); if( !pSector ) { return FALSE; } //if( ubNumColors != 1 ) // ScreenMsg( FONT_RED, MSG_ERROR, L"This map has more than one light color -- KM, LC : 1" ); //By default, we only play creature music in the cave levels (the creature levels all consistently //have blue lights while human occupied mines have red lights. We always play creature music //when creatures are in the level. BOOLEAN fCreatures = pSector->ubNumCreatures > 0; switch (pSector->ubMusicMode) { case CM_AUTO: UseCreatureMusic(fCreatures); break; case CM_NEVER: UseCreatureMusic(FALSE); break; case CM_ALWAYS: UseCreatureMusic(TRUE); break; case CM_COMPAT: default: UseCreatureMusic(LColors->peBlue || fCreatures); break; } if( !fCreatures ) { return FALSE; } //gfUseCreatureMusic = TRUE; //creatures are here, so play creature music ubCreatureHabitat = pSector->ubCreatureHabitat; ubNumCreatures = pSector->ubNumCreatures; } else { //creatures are attacking a town sector //gfUseCreatureMusic = TRUE; UseCreatureMusic(TRUE); SetMusicMode( MUSIC_TACTICAL_NOTHING ); ubCreatureHabitat = MINE_EXIT; ubNumCreatures = gubNumCreaturesAttackingTown; } switch( ubCreatureHabitat ) { case QUEEN_LAIR: fQueen = TRUE; ubLarvaePercentage = 20; ubInfantPercentage = 40; ubYoungMalePercentage = 0; ubYoungFemalePercentage = 0; ubAdultMalePercentage = 30; ubAdultFemalePercentage = 10; break; case LAIR: fQueen = FALSE; ubLarvaePercentage = 15; ubInfantPercentage = 35; ubYoungMalePercentage = 10; ubYoungFemalePercentage = 5; ubAdultMalePercentage = 25; ubAdultFemalePercentage = 10; break; case LAIR_ENTRANCE: fQueen = FALSE; ubLarvaePercentage = 0; ubInfantPercentage = 15; ubYoungMalePercentage = 30; ubYoungFemalePercentage = 10; ubAdultMalePercentage = 35; ubAdultFemalePercentage = 10; break; case INNER_MINE: fQueen = FALSE; ubLarvaePercentage = 0; ubInfantPercentage = 0; ubYoungMalePercentage = 20; ubYoungFemalePercentage = 40; ubAdultMalePercentage = 10; ubAdultFemalePercentage = 30; break; case OUTER_MINE: case MINE_EXIT: fQueen = FALSE; ubLarvaePercentage = 0; ubInfantPercentage = 0; ubYoungMalePercentage = 10; ubYoungFemalePercentage = 65; ubAdultMalePercentage = 5; ubAdultFemalePercentage = 20; break; default: #ifdef JA2BETAVERSION ScreenMsg( FONT_RED, MSG_ERROR, L"Invalid creature habitat ID of %d for PrepareCreaturesForBattle. Ignoring...", ubCreatureHabitat ); #endif return FALSE; } //First step is to convert the percentages into the numbers we will use. if( fQueen ) { ubNumCreatures--; } ubInfantPercentage += ubLarvaePercentage; ubYoungMalePercentage += ubInfantPercentage; ubYoungFemalePercentage += ubYoungMalePercentage; ubAdultMalePercentage += ubYoungFemalePercentage; ubAdultFemalePercentage += ubAdultMalePercentage; if( ubAdultFemalePercentage != 100 ) { AssertMsg( 0, "Percentage for adding creatures don't add up to 100." ); } //Second step is to determine the breakdown of the creatures randomly. i = ubNumCreatures; while( i-- ) { iRandom = Random( 100 ); if( iRandom < ubLarvaePercentage ) ubNumLarvae++; else if( iRandom < ubInfantPercentage ) ubNumInfants++; else if( iRandom < ubYoungMalePercentage ) ubNumYoungMales++; else if( iRandom < ubYoungFemalePercentage ) ubNumYoungFemales++; else if( iRandom < ubAdultMalePercentage ) ubNumAdultMales++; else ubNumAdultFemales++; } if( gbWorldSectorZ ) { UNDERGROUND_SECTORINFO *pUndergroundSector; pUndergroundSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); if( !pUndergroundSector ) { //No info?!!!!! AssertMsg( 0, "Please report underground sector you are in or going to and send save if possible. KM : 0" ); return FALSE; } pUndergroundSector->ubCreaturesInBattle = pUndergroundSector->ubNumCreatures; } else { SECTORINFO *pSector; pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ]; pSector->ubNumCreatures = ubNumCreatures; pSector->ubCreaturesInBattle = ubNumCreatures; } switch( gubCreatureBattleCode ) { case CREATURE_BATTLE_CODE_NONE: //in the mines AddSoldierInitListCreatures( fQueen, ubNumLarvae, ubNumInfants, ubNumYoungMales, ubNumYoungFemales, ubNumAdultMales, ubNumAdultFemales ); break; case CREATURE_BATTLE_CODE_TACTICALLYADD: //creature attacking a town sector case CREATURE_BATTLE_CODE_PREBATTLEINTERFACE: AddCreaturesToBattle( ubNumYoungMales, ubNumYoungFemales, ubNumAdultMales, ubNumAdultFemales ); break; case CREATURE_BATTLE_CODE_AUTORESOLVE: return FALSE; } return TRUE; } void CreatureNightPlanning() { //Check the populations of the mine exits, and factor a chance for them to attack at night. UINT8 ubNumCreatures; ubNumCreatures = CreaturesInUndergroundSector( SEC_H3, 1 ); if( ubNumCreatures > 1 && ubNumCreatures * 10 > (INT32)PreRandom( 100 ) ) { //10% chance for each creature to decide it's time to attack. AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), SEC_H3 ); } ubNumCreatures = CreaturesInUndergroundSector( SEC_D13, 1 ); if( ubNumCreatures > 1 && ubNumCreatures * 10 > (INT32)PreRandom( 100 ) ) { //10% chance for each creature to decide it's time to attack. AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), SEC_D13 ); } ubNumCreatures = CreaturesInUndergroundSector( SEC_I14, 1 ); if( ubNumCreatures > 1 && ubNumCreatures * 10 > (INT32)PreRandom( 100 ) ) { //10% chance for each creature to decide it's time to attack. AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), SEC_I14 ); } ubNumCreatures = CreaturesInUndergroundSector( SEC_H8, 1 ); if( ubNumCreatures > 1 && ubNumCreatures * 10 > (INT32)PreRandom( 100 ) ) { //10% chance for each creature to decide it's time to attack. AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 +PreRandom( 429 ), SEC_H8 ); } } void CheckConditionsForTriggeringCreatureQuest( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ) { // move to Scripts/StrategicTownLoyalty.lua UINT8 ubValidMines = 0; if (gGameOptions.ubGameStyle == STYLE_REALISTIC || !gGameExternalOptions.fEnableCrepitus) return; /* if( !(gGameOptions.ubGameStyle == STYLE_SCIFI) || !gGameExternalOptions.fEnableCrepitus) return; //No scifi, no creatures... */ if( giLairID ) return; //Creature quest already begun //Count the number of "infectible mines" the player occupies if( !StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_D13 ) ].fEnemyControlled ) { ubValidMines++; } if( !StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_H8 ) ].fEnemyControlled ) { ubValidMines++; } if( !StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_I14 ) ].fEnemyControlled ) { ubValidMines++; } if( !StrategicMap[ SECTOR_INFO_TO_STRATEGIC_INDEX( SEC_H3 ) ].fEnemyControlled ) { ubValidMines++; } if( ubValidMines >= 3 ) { InitCreatureQuest(); } } BOOLEAN SaveCreatureDirectives( HWFILE hFile ) { UINT32 uiNumBytesWritten; FileWrite( hFile, &giHabitatedDistance, 4, &uiNumBytesWritten ); if( uiNumBytesWritten != sizeof( INT32 ) ) { return( FALSE ); } FileWrite( hFile, &giPopulationModifier, 4, &uiNumBytesWritten ); if( uiNumBytesWritten != sizeof( INT32 ) ) { return( FALSE ); } FileWrite( hFile, &giLairID, 4, &uiNumBytesWritten ); if( uiNumBytesWritten != sizeof( INT32 ) ) { return( FALSE ); } BOOLEAN fUseCreatureMusic = UsingCreatureMusic(); FileWrite( hFile, &fUseCreatureMusic, 1, &uiNumBytesWritten ); if( uiNumBytesWritten != sizeof( BOOLEAN ) ) { return( FALSE ); } FileWrite( hFile, &giDestroyedLairID, 4, &uiNumBytesWritten ); if( uiNumBytesWritten != sizeof( INT32 ) ) { return( FALSE ); } return( TRUE ); } BOOLEAN LoadCreatureDirectives( HWFILE hFile, UINT32 uiSavedGameVersion ) { UINT32 uiNumBytesRead; FileRead( hFile, &giHabitatedDistance, 4, &uiNumBytesRead ); if( uiNumBytesRead != sizeof( INT32 ) ) { return( FALSE ); } FileRead( hFile, &giPopulationModifier, 4, &uiNumBytesRead ); if( uiNumBytesRead != sizeof( INT32 ) ) { return( FALSE ); } FileRead( hFile, &giLairID, 4, &uiNumBytesRead ); if( uiNumBytesRead != sizeof( INT32 ) ) { return( FALSE ); } BOOLEAN fUseCreatureMusic; FileRead( hFile, &fUseCreatureMusic, 1, &uiNumBytesRead ); if( uiNumBytesRead != sizeof( BOOLEAN ) ) { return( FALSE ); } UseCreatureMusic(fUseCreatureMusic); if( uiSavedGameVersion >= 82 ) { FileRead( hFile, &giDestroyedLairID, 4, &uiNumBytesRead ); if( uiNumBytesRead != sizeof( INT32 ) ) { return( FALSE ); } } else { giDestroyedLairID = 0; } #ifdef JA2BETAVERSION if( gfClearCreatureQuest && giLairID != -1 ) { giLairID = 0; #ifdef JA2UB // no UB #else gfCreatureMeanwhileScenePlayed = FALSE; uiMeanWhileFlags &= ~(0x00000800); #endif } gfClearCreatureQuest = FALSE; #endif switch( giLairID ) { case -1: break; //creature quest finished -- it's okay case 0: break; //lair doesn't exist yet -- it's okay case 1: InitLairDrassen(); break; case 2: InitLairCambria(); break; case 3: InitLairAlma(); break; case 4: InitLairGrumm(); break; default: #ifdef JA2BETAVERSION ScreenMsg( FONT_RED, MSG_ERROR, L"Invalid restoration of creature lair ID of %d. Save game potentially hosed.", giLairID ); #endif break; } return( TRUE ); } void ForceCreaturesToAvoidMineTemporarily( UINT8 ubMineIndex ) { gMineStatus[ ubMineIndex ].usValidDayCreaturesCanInfest = (UINT16)(GetWorldDay() + 2); } BOOLEAN PlayerGroupIsInACreatureInfestedMine() { CREATURE_DIRECTIVE *curr; SOLDIERTYPE *pSoldier; INT32 i; INT16 sSectorX, sSectorY; INT8 bSectorZ; if( giLairID <= 0 ) { //Creature quest inactive return FALSE; } //Lair is active, so look for live soldier in any creature level curr = lair; while( curr ) { sSectorX = curr->pLevel->ubSectorX; sSectorY = curr->pLevel->ubSectorY; bSectorZ = (INT8)curr->pLevel->ubSectorZ; //Loop through all the creature directives (mine sectors that are infectible) and //see if players are there. for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ ) { pSoldier = MercPtrs[ i ]; if( pSoldier->bActive && pSoldier->stats.bLife && pSoldier->sSectorX == sSectorX && pSoldier->sSectorY == sSectorY && pSoldier->bSectorZ == bSectorZ && !pSoldier->flags.fBetweenSectors ) { return TRUE; } } curr = curr->next; } //Lair is active, but no mercs are in these sectors return FALSE; } //Returns TRUE if valid and creature quest over, FALSE if creature quest active or not yet started BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ, INT32 *psInsertionGridNo ) { INT32 iSwitchValue; if( !gfWorldLoaded ) { return FALSE; } if ( gbWorldSectorZ == 0 ) { return( FALSE ); } iSwitchValue = giLairID; if( iSwitchValue == -1 ) { iSwitchValue = giDestroyedLairID; } if( !iSwitchValue ) { return FALSE; } //Now make sure the mercs are in the previously infested mine switch( iSwitchValue ) { case 1: //Drassen if( gWorldSectorX == 13 && gWorldSectorY == 6 && gbWorldSectorZ == 3 || gWorldSectorX == 13 && gWorldSectorY == 7 && gbWorldSectorZ == 3 || gWorldSectorX == 13 && gWorldSectorY == 7 && gbWorldSectorZ == 2 || gWorldSectorX == 13 && gWorldSectorY == 6 && gbWorldSectorZ == 2 || gWorldSectorX == 13 && gWorldSectorY == 5 && gbWorldSectorZ == 2 || gWorldSectorX == 13 && gWorldSectorY == 5 && gbWorldSectorZ == 1 || gWorldSectorX == 13 && gWorldSectorY == 4 && gbWorldSectorZ == 1 ) { *psSectorX = 13; *psSectorY = 4; *pbSectorZ = 0; *psInsertionGridNo = 20700;//dnl!!! return TRUE; } break; case 3: //Cambria if( gWorldSectorX == 8 && gWorldSectorY == 9 && gbWorldSectorZ == 3 || gWorldSectorX == 8 && gWorldSectorY == 8 && gbWorldSectorZ == 3 || gWorldSectorX == 8 && gWorldSectorY == 8 && gbWorldSectorZ == 2 || gWorldSectorX == 9 && gWorldSectorY == 8 && gbWorldSectorZ == 2 || gWorldSectorX == 9 && gWorldSectorY == 8 && gbWorldSectorZ == 1 || gWorldSectorX == 8 && gWorldSectorY == 8 && gbWorldSectorZ == 1 ) { *psSectorX = 8; *psSectorY = 8; *pbSectorZ = 0; *psInsertionGridNo = 13002;//dnl!!! return TRUE; } break; case 2: //Alma if( gWorldSectorX == 13 && gWorldSectorY == 11 && gbWorldSectorZ == 3 || gWorldSectorX == 13 && gWorldSectorY == 10 && gbWorldSectorZ == 3 || gWorldSectorX == 13 && gWorldSectorY == 10 && gbWorldSectorZ == 2 || gWorldSectorX == 14 && gWorldSectorY == 10 && gbWorldSectorZ == 2 || gWorldSectorX == 14 && gWorldSectorY == 10 && gbWorldSectorZ == 1 || gWorldSectorX == 14 && gWorldSectorY == 9 && gbWorldSectorZ == 1 ) { *psSectorX = 14; *psSectorY = 9; *pbSectorZ = 0; *psInsertionGridNo = 9085;//dnl!!! return TRUE; } break; case 4: //Grumm if( gWorldSectorX == 4 && gWorldSectorY == 7 && gbWorldSectorZ == 3 || gWorldSectorX == 4 && gWorldSectorY == 8 && gbWorldSectorZ == 3 || gWorldSectorX == 3 && gWorldSectorY == 8 && gbWorldSectorZ == 2 || gWorldSectorX == 3 && gWorldSectorY == 8 && gbWorldSectorZ == 2 || gWorldSectorX == 3 && gWorldSectorY == 9 && gbWorldSectorZ == 2 || gWorldSectorX == 3 && gWorldSectorY == 9 && gbWorldSectorZ == 1 || gWorldSectorX == 3 && gWorldSectorY == 8 && gbWorldSectorZ == 1 ) { *psSectorX = 3; *psSectorY = 8; *pbSectorZ = 0; *psInsertionGridNo = 9822;//dnl!!! return TRUE; } break; } return( FALSE ); }
[ "jazz_ja@b41f55df-6250-4c49-8e33-4aa727ad62a1" ]
[ [ [ 1, 1732 ] ] ]
12ec62db54794b834425fc32cea6f274a91d45f3
e7c45d18fa1e4285e5227e5984e07c47f8867d1d
/Common/Com/ScdCOM/SysCADCOM.h
f9409a936d4883f7aa43398e750704e1cbf497c5
[]
no_license
abcweizhuo/Test3
0f3379e528a543c0d43aad09489b2444a2e0f86d
128a4edcf9a93d36a45e5585b70dee75e4502db4
refs/heads/master
2021-01-17T01:59:39.357645
2008-08-20T00:00:29
2008-08-20T00:00:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,718
h
// SysCADCOM.h : Declaration of the CHelper #ifndef __SYSCADCMD_H_ #define __SYSCADCMD_H_ //extern const IID DIID__ISysCADCmdEvents; #include "stdafx.h" #include "resource.h" // main symbols #include "ScdCOMIF.h" #include "ScdCOMCP.h" ///////////////////////////////////////////////////////////////////////////// // CHelper class ATL_NO_VTABLE CSysCADCmd : public CSysCADCmdHookBack, public CComObjectRootEx<CComMultiThreadModel>, public CComCoClass<CSysCADCmd, &CLSID_SysCADCmd>, public ISupportErrorInfo, public IConnectionPointContainerImpl<CSysCADCmd>, public IDispatchImpl<ISysCADCmd, &IID_ISysCADCmd, &LIBID_SysCADLib>, public IDispatchImpl<ISysCADEdit, &IID_ISysCADEdit, &LIBID_SysCADLib>, public IDispatchImpl<IBackdoor, &IID_IBackdoor, &LIBID_SysCADLib>, public IDispatchImpl<_ISysCADCmdEvents, &DIID__ISysCADCmdEvents, &LIBID_SysCADLib>, public CProxy_ISysCADCmdEvents< CSysCADCmd >, public IProvideClassInfo2Impl<&CLSID_SysCADCmd, &DIID__ISysCADCmdEvents, &LIBID_SysCADLib, 0,1> { public: CSysCADCmd() { m_bSyncCalls=true; m_bEventsOn=true; for (UINT i=0; i<MaxComEvents; i++) { m_hEventRcvd[i]=INVALID_HANDLE_VALUE; m_lEventLParam[i]=0; } m_dwSyncTimeOut=1000000; } ~CSysCADCmd() { for (UINT i=0; i<MaxComEvents; i++) if (m_hEventRcvd[i]!=INVALID_HANDLE_VALUE) CloseHandle(m_hEventRcvd[i]); } HRESULT FinalConstruct(); void FinalRelease(); DECLARE_REGISTRY_RESOURCEID(IDR_SYSCADCMD) DECLARE_PROTECT_FINAL_CONSTRUCT() //DECLARE_CLASSFACTORY_SINGLETON(CSysCADCmd) DECLARE_CLASSFACTORY() BEGIN_COM_MAP(CSysCADCmd) COM_INTERFACE_ENTRY(ISysCADCmd) COM_INTERFACE_ENTRY(ISysCADEdit) //DEL COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) COM_INTERFACE_ENTRY(IConnectionPointContainer) COM_INTERFACE_ENTRY2(IDispatch, ISysCADCmd) COM_INTERFACE_ENTRY(IBackdoor) COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer) COM_INTERFACE_ENTRY(_ISysCADCmdEvents) COM_INTERFACE_ENTRY(IProvideClassInfo2) COM_INTERFACE_ENTRY(IProvideClassInfo) // COM_INTERFACE_ENTRY(ISysCADCmd) END_COM_MAP() BEGIN_CONNECTION_POINT_MAP(CSysCADCmd) CONNECTION_POINT_ENTRY(DIID__ISysCADCmdEvents) END_CONNECTION_POINT_MAP() // ISupportsErrorInfo STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); public: // ISysCADEdit STDMETHOD(get_GrfWndIndex)(/*[out, retval]*/ long *pVal); STDMETHOD(put_GrfWndIndex)(/*[in]*/ long newVal); STDMETHOD(ZoomWindowFull)(); STDMETHOD(InsertNode)(/*[in]*/ BSTR Class, /*[in]*/ BSTR Tag, /*[in]*/ double X, /*[in]*/ double Y, /*[in]*/ double Z, /*[in]*/ double XScale, /*[in]*/ double YScale, /*[in]*/ double Rotation ); STDMETHOD(InsertLink)(/*[in]*/ BSTR Class, /*[in]*/ BSTR Tag, /*[in]*/ BSTR SrcTag, /*[in]*/ BSTR SrcIO, /*[in]*/ BSTR DstTag, /*[in]*/ BSTR DstIO, /*[in]*/ double Xs, /*[in]*/ double Ys, /*[in]*/ double Zs, /*[in]*/ double Xd, /*[in]*/ double Yd, /*[in]*/ double Zd); STDMETHOD(CreateUnit)(/*[in]*/ BSTR Class, /*[in]*/ BSTR Tag ); STDMETHOD(CreateUnitGrf)(/*[in]*/ BSTR Tag, /*[in]*/ double X, /*[in]*/ double Y, /*[in]*/ double Z, /*[in]*/ BSTR Symbol, /*[in]*/ double XScale, /*[in]*/ double YScale, /*[in]*/ double Rotation ); STDMETHOD(CreateLink)(/*[in]*/ BSTR Class, /*[in]*/ BSTR Tag, /*[in]*/ BSTR SrcTag, /*[in]*/ BSTR SrcIO, /*[in]*/ BSTR DstTag, /*[in]*/ BSTR DstIO ); STDMETHOD(CreateLinkGrf)(/*[in]*/ BSTR Tag, /*[in]*/ long DrawLineMethod); STDMETHOD(CreateLinkGrfLine)(/*[in]*/ BSTR Tag, /*[in]*/ double Xs, /*[in]*/ double Ys, /*[in]*/ double Zs, /*[in]*/ double Xd, /*[in]*/ double Yd, /*[in]*/ double Zd); // ISysCADCmd STDMETHOD(VariableSetReplayCtrl)(/*[in]*/ long Command, /* [in] */ long Param); STDMETHOD(VariableSetReplayItem)(/*[in]*/ long SequenceNo, /*[in]*/ BSTR Tag, /*[in]*/ VARIANT Value,/* [in] */ BSTR CnvTxt); STDMETHOD(OnVariableSet)(/*[in]*/ long Source, /*[in]*/ long SequenceNo, /*[in]*/ BSTR Tag, /*[in]*/ VARIANT Value,/* [in] */ BSTR CnvTxt); STDMETHOD(OnBacktrackSaved)(/*[in]*/ long result); STDMETHOD(OnBacktrackLoaded)(/*[in]*/ long result); STDMETHOD(OnScenarioSaved)(/*[in]*/ long result); STDMETHOD(OnScenarioLoaded)(/*[in]*/ long result); STDMETHOD(OnSnapshotSaved)(/*[in]*/ long result); STDMETHOD(OnSnapshotLoaded)(/*[in]*/ long result); STDMETHOD(SaveBacktrack)(/*[in]*/ BSTR bsBacktrackName); STDMETHOD(LoadBacktrack)(/*[in]*/ BSTR bsBacktrackName); STDMETHOD(SetAppWndState)(long ReqdState); STDMETHOD(get_SequenceNo)(/*[out, retval]*/ long *pVal); STDMETHOD(put_SequenceNo)(/*[in]*/ long newVal); STDMETHOD(OnIdle)(long Flags); STDMETHOD(OnStop)(long Flags); STDMETHOD(OnStepDynamic)(long Flags); STDMETHOD(OnStepProbal)(long Flags); STDMETHOD(OnStart)(long result); STDMETHOD(get_UpNAbout)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(WaitUpNAbout)(double TimeOut); STDMETHOD(get_SyncCallsOn)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_SyncCallsOn)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(get_SyncCallsTimeOut)(/*[out, retval]*/ double *pVal); STDMETHOD(put_SyncCallsTimeOut)(/*[in]*/ double newVal); STDMETHOD(LoadProject)(/*[in]*/ BSTR bsProjectName); STDMETHOD(SaveProject)(/*[in]*/ BSTR bsProjectName); STDMETHOD(LoadSnapshot)(/*[in]*/ BSTR bsSnapshotName); STDMETHOD(SaveSnapshot)(/*[in]*/ BSTR bsSnapshotName); STDMETHOD(LoadScenario)(/*[in]*/ BSTR bsScenarioName); STDMETHOD(SaveScenario)(/*[in]*/ BSTR bsScenarioName); STDMETHOD(CloseProject)(); STDMETHOD(SetTag)(/*[in]*/ BSTR Tag, /*[in]*/ VARIANT *Value); STDMETHOD(GetTag)(/*[in]*/ BSTR Tag, /*[out]*/ VARIANT *Value); STDMETHOD(put_TagValue)(/*[in]*/ BSTR Tag, /*[in]*/ VARIANT Value); STDMETHOD(get_TagValue)(/*[in]*/ BSTR Tag, /*[out]*/ VARIANT *Value); STDMETHOD(get_TagType)(/*[in]*/ BSTR Tag, /*[out]*/ long *Value); STDMETHOD(StartDynamicSolve)(); STDMETHOD(StartProbalSolve)(); STDMETHOD(Start)(); STDMETHOD(Step)(long IterMark, double WaitForNext); STDMETHOD(Stop)(); STDMETHOD(Idle)(); STDMETHOD(Wait)(/*[in]*/ double Seconds); STDMETHOD(WaitCount)(/*[in]*/ long Iterations); STDMETHOD(WaitTillSteadyState)(); STDMETHOD(WaitTillStop)(); STDMETHOD(ResetWait)(); STDMETHOD(GenerateTagReport)(/*[in]*/ BSTR Filename, /*[in]*/ BSTR Reportname); STDMETHOD(GenerateTrendReport)(/*[in]*/ BSTR Filename, /*[in]*/ BSTR Reportname); STDMETHOD(ProcessSetTags)(/*[in]*/ BSTR Filename, /*[in]*/ BSTR Reportname); STDMETHOD(SaveAndCloseReport)(/*[in]*/ BSTR Filename); STDMETHOD(ExecuteMacro)(/*[in]*/ BSTR Filename, /*[in]*/ BSTR Reportname); STDMETHOD(get_CmpFilename)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_CmpFilename)(/*[in]*/ BSTR newVal); STDMETHOD(get_CmpSort)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_CmpSort)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(get_CmpMaxCount)(/*[out, retval]*/ long *pVal); STDMETHOD(put_CmpMaxCount)(/*[in]*/ long newVal); STDMETHOD(get_CmpRelativeTolerance)(/*[out, retval]*/ double *pVal); STDMETHOD(put_CmpRelativeTolerance)(/*[in]*/ double newVal); STDMETHOD(get_CmpAbsoluteTolerance)(/*[out, retval]*/ double *pVal); STDMETHOD(put_CmpAbsoluteTolerance)(/*[in]*/ double newVal); STDMETHOD(get_CmpShowDifferentStrings)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_CmpShowDifferentStrings)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(get_CmpShowMissingTags)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_CmpShowMissingTags)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(CompareReset)(); STDMETHOD(CompareScenarios)(/*[in]*/ BSTR Filename1, /*[in]*/ BSTR Filename2); STDMETHOD(CompareScenarioToCurrent)(/*[in]*/ BSTR Filename); STDMETHOD(TestScenario)(/*[in]*/ BSTR Filename); STDMETHOD(RestartHistorian)(); STDMETHOD(Sleep)(double Seconds); STDMETHOD(Exit)(); STDMETHOD(get_EventsOn)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_EventsOn)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(get_IsStopped)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(get_IsIdling)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(get_IsRunning)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(get_StepSize)(/*[out, retval]*/ double *pVal); STDMETHOD(put_StepSize)(/*[in]*/ double newVal); STDMETHOD(get_RealTimeOn)(/*[out, retval]*/ VARIANT_BOOL *pVal); STDMETHOD(put_RealTimeOn)(/*[in]*/ VARIANT_BOOL newVal); STDMETHOD(get_RealTimeMultiplier)(/*[out, retval]*/ double *pVal); STDMETHOD(put_RealTimeMultiplier)(/*[in]*/ double newVal); // IBackdoor STDMETHOD(Register)(ULONG i_dwCastedCallback); STDMETHOD(GetResourceHInstance)(/*[out, ref]*/ULONG *hResInst); STDMETHOD(GetResourceCBRegID)(/*[out,ref]*/ ULONG *ID); private: static CScdCOMBase *sm_pCallback; VARIANT_BOOL m_bSyncCalls; // Calls are syncronous if true VARIANT_BOOL m_bEventsOn; // Events are generated // these events are triggered when event received HANDLE m_hEventRcvd[MaxComEvents]; LPARAM m_lEventLParam[MaxComEvents]; DWORD m_dwSyncTimeOut; // Timeout wait for sync calls; // Utility Methods protected: void DoEventMsg(UINT e, LPARAM l); void InitCOCmdStuff(DWORD EvId); UINT ExecCOCmdStuff(DWORD EvId); void InitCOCmdStuff(DWORD *EvIds, DWORD nEvts); UINT ExecCOCmdStuff(DWORD *EvIds, DWORD nEvts); HRESULT ReportError(LPCTSTR szDesc, UINT Code) { USES_CONVERSION; CLSID & rguid=sm_pCallback->clsidGetCLSID(); HRESULT hRes=MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, Code); return AtlReportError(rguid, T2OLE(szDesc), IID_ISysCADCmd, hRes); }; }; #endif //__SYSCADCMD_H_
[ [ [ 1, 210 ] ] ]
71716a6dc8b2a9a9b0346139df67c46b969f598c
e9d3e5a1b03dd94e740daa3ff64bd19a2059872a
/StarbuckLibrary/QtStageWebView.cpp
dca17a41f2a9495f406cea040ce8281d4df332ed
[ "Apache-2.0" ]
permissive
nukulb/Ripple-Framework
3da8703f3d67963c58a89ffc95b217dde6a328eb
8f70f5bce6722f7019f1812405d30d3fff9c1ae3
refs/heads/master
2020-12-25T03:50:44.318582
2011-08-25T09:31:51
2011-08-25T10:41:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,826
cpp
/* * Copyright 2010-2011 Research In Motion Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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 "stdafx.h" #include "QtStageWebView.h" #include "BlackBerryBus.h" using namespace BlackBerry::Starbuck; QtStageWebView::QtStageWebView(QWidget *p) : QWebView(p), waitForJsLoad(true) { //Turn off context menu's (i.e. menu when right clicking) //this->setContextMenuPolicy(Qt::NoContextMenu); // Connect signals for events connect(this, SIGNAL(urlChanged(const QUrl&)), this, SLOT(notifyUrlChanged(const QUrl&))); if (page() && page()->mainFrame()) { connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(notifyJavaScriptWindowObjectCleared())); } //Initialize headers to 0 _headersSize = 0; //enable web inspector this->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); } QtStageWebView::~QtStageWebView(void) { } void QtStageWebView::loadURL(QString url) { QNetworkRequest request(url); //Add custom headers for (unsigned int i = 0; i + 1 < _headersSize; i += 2) request.setRawHeader(_headers[i], _headers[i + 1]); load(request); } void QtStageWebView::reload() { QWebView::reload(); } void QtStageWebView::notifyUrlChanged(const QUrl& url) { emit urlChanged(url.toString()); } void QtStageWebView::notifyJavaScriptWindowObjectCleared() { registerEventbus(); QEventLoop loop; QObject::connect(this, SIGNAL(jsLoaded()), &loop, SLOT(quit())); emit javaScriptWindowObjectCleared(); if ( waitForJsLoad ) { loop.exec(); } } void QtStageWebView::registerEventbus() { QWebFrame* frame = page()->mainFrame(); frame->addToJavaScriptWindowObject(QString("eventbus2"), new BlackBerryBus(this, frame)); frame->evaluateJavaScript(BlackBerry::Starbuck::eventbusSource); // check for iframes, if found add to window object for(int i = 0; i < frame->childFrames().length(); i++) { frame->childFrames()[i]->addToJavaScriptWindowObject(QString("eventbus2"), new BlackBerryBus(this, frame->childFrames()[i])); frame->childFrames()[i]->evaluateJavaScript(BlackBerry::Starbuck::eventbusSource); } } void QtStageWebView::continueLoad() { emit jsLoaded(); waitForJsLoad = false; } bool QtStageWebView::enableCrossSiteXHR() { return this->settings()->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); } void QtStageWebView::enableCrossSiteXHR(bool xhr) { return this->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, xhr); } QVariant QtStageWebView::executeJavaScript(QString script) { return page()->mainFrame()->evaluateJavaScript(script); } QString QtStageWebView::location() { return url().toString(); } bool QtStageWebView::isHistoryBackEnabled() { return history() ? history()->canGoBack() : false; } bool QtStageWebView::isHistoryForwardEnabled() { return history() ? history()->canGoForward() : false; } void QtStageWebView::historyBack() { back(); } void QtStageWebView::historyForward() { forward(); } int QtStageWebView::historyLength() { return history() ? history()->count() : 0; } int QtStageWebView::historyPosition() { return history() ? history()->currentItemIndex() : -1; } void QtStageWebView::historyPosition(int position) { if (history() && position >= 0 && position < history()->count()) { history()->goToItem(history()->itemAt(position)); } } char** QtStageWebView::customHTTPHeaders() { return _headers; } void QtStageWebView::customHTTPHeaders(char *headers[], unsigned int headersSize) { _headers = new char*[headersSize]; for (unsigned int i = 0; i < headersSize; i++){ _headers[i] = new char[strlen(headers[i]) + 1]; strcpy(_headers[i], headers[i]); } _headersSize = headersSize; } void QtStageWebView::customHTTPHeaders(QString key, QString value) { QByteArray mKey = key.toAscii(); QByteArray mValue = value.toAscii(); char *headersArray[2]; headersArray[0] = mKey.data(); headersArray[1] = mValue.data(); customHTTPHeaders( headersArray, 2); } void QtStageWebView::visible(bool enable) { if (this->isVisible() == enable) return; (enable)? this->show():this->hide(); }
[ [ [ 1, 24 ], [ 27, 31 ], [ 35, 82 ], [ 85, 87 ], [ 92, 193 ] ], [ [ 25, 26 ], [ 32, 34 ], [ 83, 84 ], [ 88, 91 ] ] ]
257f1d4446c91a8eb13bd5ec97a51ebf665ee22b
478570cde911b8e8e39046de62d3b5966b850384
/apicompatanamdw/bcdrivers/app/messaging/plugin_bio_control_api/src/MsgBioCtrlTest.cpp
3a540f60aab2ad1acf0c957690cc3f30af2fbedd
[]
no_license
SymbianSource/oss.FCL.sftools.ana.compatanamdw
a6a8abf9ef7ad71021d43b7f2b2076b504d4445e
1169475bbf82ebb763de36686d144336fcf9d93b
refs/heads/master
2020-12-24T12:29:44.646072
2010-11-11T14:03:20
2010-11-11T14:03:20
72,994,432
0
0
null
null
null
null
UTF-8
C++
false
false
9,403
cpp
/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ #include "MsgBioCtrlTest.h" #include <eikon.hrh> #include <e32base.h> #include <eikmenup.h> #include <msvapi.h> #include <s32file.h> // RFileReadStream #include <stringloader.h> // StringLoader #include <msgbiocontrolobserver.h> // MMsgBioControlObserver #include <StringLoader.h> #include <MMsvAttachmentManager.h> #include <crichbio.h> // CRichBio #include <PluginBioControlAPITest.rsg> // resouce identifiers // LOCAL CONSTANTS AND MACROS _LIT(KBCTestResourceFile, "PluginBioControlAPITest.rsc"); _LIT(KAvkonResourceFile, "avkon.rsc"); const TInt KMenuPos = 1; //The inserting position of menu item. const TInt KMenuCommandDoBCTest = 0; // MEMBER FUNCTIONS CMsgBioCtrlTest::~CMsgBioCtrlTest() { delete iViewer; } EXPORT_C CMsgBioControl* CMsgBioCtrlTest::NewL( MMsgBioControlObserver& aObserver, CMsvSession* aSession, TMsvId aId, TMsgBioMode aEditorOrViewerMode, const RFile* aFile) { CMsgBioCtrlTest* self = new(ELeave) CMsgBioCtrlTest( aObserver, aSession, aId, aEditorOrViewerMode, aFile); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(); //self return self; } void CMsgBioCtrlTest::SetAndGetSizeL(TSize& aSize) { iViewer->SetAndGetSizeL(aSize); SetSizeWithoutNotification(aSize); if(!(iHandledCommands & ESetAndGetSizeL)) { iHandledCommands += ESetAndGetSizeL; AddResultsToRichBio(R_API_SETANDGETSIZEL,R_API_PASSED); } } void CMsgBioCtrlTest::SetMenuCommandSetL(CEikMenuPane& aMenuPane) { AddMenuItemL(aMenuPane, R_DO_BC_TEST, KMenuCommandDoBCTest, KMenuPos); if(!(iHandledCommands & ESetMenuCommandSetL)) { iHandledCommands += ESetMenuCommandSetL; AddResultsToRichBio(R_API_SETMENUCOMMANDSETL,R_API_PASSED); } } TBool CMsgBioCtrlTest::HandleBioCommandL(TInt /*aCommand*/) { if(!(iHandledCommands & EHandleBioCommandL)) { iHandledCommands += EHandleBioCommandL; AddResultsToRichBio(R_API_HANDLEBIOCOMMANDL,R_API_PASSED); } return EFalse; } TRect CMsgBioCtrlTest::CurrentLineRect() const { if(!(iHandledCommands & ECurrentLineRect)) { iHandledCommands += ECurrentLineRect; AddResultsToRichBio(R_API_CURRENTLINERECT,R_API_PASSED); } return iViewer->CurrentLineRect(); return TRect(); } TBool CMsgBioCtrlTest::IsFocusChangePossible( TMsgFocusDirection aDirection) const { if(!(iHandledCommands & EIsFocusChangePossible)) { iHandledCommands += EIsFocusChangePossible; AddResultsToRichBio(R_API_ISFOCUSCHANGEPOSSIBLE,R_API_PASSED); } if (aDirection == EMsgFocusUp) { return iViewer->IsCursorLocation(EMsgTop); } return EFalse; } HBufC* CMsgBioCtrlTest::HeaderTextL() const { if(!(iHandledCommands & EHeaderTextL)) { iHandledCommands += EHeaderTextL; AddResultsToRichBio(R_API_HEADERTEXTL,R_API_PASSED); } return StringLoader::LoadL(R_TITLE_BC_TEST, iCoeEnv); } TUint32 CMsgBioCtrlTest::OptionMenuPermissionsL() const { if(!(iHandledCommands & EOptionMenuPermissionsL)) { iHandledCommands += EOptionMenuPermissionsL; AddResultsToRichBio(R_API_OPTIONMENUPERMISSIONSL,R_API_PASSED); } return CMsgBioControl::OptionMenuPermissionsL(); } TInt CMsgBioCtrlTest::VirtualHeight() { if(!(iHandledCommands & EVirtualHeight)) { iHandledCommands += EVirtualHeight; AddResultsToRichBio(R_API_VIRTUALHEIGHT,R_API_PASSED); } CMsgBioControl::VirtualHeight(); iViewer->VirtualHeight(); return V_HEIGHT; } TInt CMsgBioCtrlTest::VirtualVisibleTop() { if(!(iHandledCommands & EVirtualVisibleTop) ) { iHandledCommands += EVirtualVisibleTop; AddResultsToRichBio(R_API_VIRTUALVISIBLETOP,R_API_PASSED); } CMsgBioControl::VirtualVisibleTop(); iViewer->VirtualVisibleTop(); return V_TOP; } TBool CMsgBioCtrlTest::IsCursorLocation(TMsgCursorLocation aLocation) const { if(!(iHandledCommands & EIsCursorLocation)) { iHandledCommands += EIsCursorLocation; AddResultsToRichBio(R_API_ISCURSORLOCATION,R_API_PASSED); } CMsgBioControl::IsCursorLocation(aLocation); return iViewer->IsCursorLocation(aLocation); } TAny* CMsgBioCtrlTest::BioControlExtension(TInt aExtensionId) { #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) if ( aExtensionId == KMsgBioControlScrollExtension ) { return static_cast<MMsgBioControlScrollExtension*> (this); } else #endif { return NULL; } } #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) TInt CMsgBioCtrlTest::ExtScrollL( TInt aPixelsToScroll, TMsgScrollDirection aDirection ) { return iViewer->ScrollL(aPixelsToScroll, aDirection); } #endif void CMsgBioCtrlTest::ExtNotifyViewEvent( TMsgViewEvent aEvent, TInt aParam ) { #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) iViewer->NotifyViewEvent( aEvent, aParam ); #endif } void CMsgBioCtrlTest::ProtectedCallsL(TBool fileBased) { TBool check = IsEditor(); check = IsFileBased(); CMsvSession* session = &(MsvSession()); if( fileBased ) { //if it is not file based, this call panics //TFileName name = FileName(); RFile file = FileHandle(); } MEikMenuObserver* menuObserver = new(ELeave)FakeObserver(); CEikMenuPane* menuPane = new(ELeave)CEikMenuPane(menuObserver); AddMenuItemL( *menuPane, R_API_PASSED, 1, 0); } void CMsgBioCtrlTest::CallNotifyEditorViewL() { // NotifyEidtorViewL - this function is not fully covered as // there is no BioBodyControL NotifyEditorViewL( EMsgBioUpdateScrollBars, 0 ); } void CMsgBioCtrlTest::RichBioFunctionCalls() { TRect rect = iViewer->CurrentLineRect(); TBool isEditor = iViewer->IsEditorBaseMode(); CEikRichTextEditor* editor = &(iViewer->Editor()); iViewer->Reset(); } TInt CMsgBioCtrlTest::CountComponentControls() const { return 1; // the viewer component } CCoeControl* CMsgBioCtrlTest::ComponentControl(TInt aIndex) const { if (aIndex == 0) { return iViewer; } return NULL; } void CMsgBioCtrlTest::SizeChanged() { iViewer->SetExtent(Position(), iViewer->Size()); } void CMsgBioCtrlTest::FocusChanged(TDrawNow /*aDrawNow*/) { iViewer->SetFocus(IsFocused()); } void CMsgBioCtrlTest::SetContainerWindowL(const CCoeControl& aContainer) { CCoeControl::SetContainerWindowL(aContainer); // The reason for creating the viewer control here is that the // construction of the viewer requires a parent with a window. So it // cannot be done in ConstructL(). // #if ! defined( __SERIES60_31__ ) && ! defined( __SERIES60_30__ ) SetExtension( this ); #endif iViewer->ConstructL(&aContainer); iViewer->ActivateL(); } TKeyResponse CMsgBioCtrlTest::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType) { return iViewer->OfferKeyEventL(aKeyEvent, aType); } CMsgBioCtrlTest::CMsgBioCtrlTest( MMsgBioControlObserver& aObserver, CMsvSession* aSession, TMsvId aId, TMsgBioMode aEditorOrViewerMode, const RFile* aFile): CMsgBioControl(aObserver, aSession, aId, aEditorOrViewerMode, aFile) { iHandledCommands = 0; } void CMsgBioCtrlTest::ConstructL() { LoadResourceL(KBCTestResourceFile); LoadResourceL(KAvkonResourceFile); LoadStandardBioResourceL(); iViewer = new (ELeave) CRichBio(ERichBioModeEditorBase); } void CMsgBioCtrlTest::AddResultsToRichBio(TInt aLabelRes, TInt aValueRes) const { TRAPD(err,AddItemL(aLabelRes,aValueRes)); if(iHandledCommands == EAllBioCommands) { TRAPD(err,AddItemL(R_API_RESULTS_SUBJECT,R_API_PASSED)); } } void CMsgBioCtrlTest::AddItemL(TInt aLabelRes, TInt aValueRes) const { iViewer->AddItemL( *StringLoader::LoadLC(aLabelRes, iCoeEnv), *StringLoader::LoadLC(aValueRes, iCoeEnv)); CleanupStack::PopAndDestroy(2); // (label and value text) } //End of File
[ "none@none" ]
[ [ [ 1, 330 ] ] ]
611d1dc6c7e24fd406f6e5f152dd400293b84fbc
b2d46af9c6152323ce240374afc998c1574db71f
/cursovideojuegos/theflostiproject/Code/Games/Laberynth/LaberynthBoard.h
33a82ee1bf2b87d116cb0e47a779081fe766a946
[]
no_license
bugbit/cipsaoscar
601b4da0f0a647e71717ed35ee5c2f2d63c8a0f4
52aa8b4b67d48f59e46cb43527480f8b3552e96d
refs/heads/master
2021-01-10T21:31:18.653163
2011-09-28T16:39:12
2011-09-28T16:39:12
33,032,640
0
0
null
null
null
null
UTF-8
C++
false
false
3,056
h
//---------------------------------------------------------------------------------- // CBoard class // Author: Enric Vergara // // Description: // ... //---------------------------------------------------------------------------------- #pragma once #ifndef INC_LABERYTNH_BOARD_H_ #define INC_LABERYTNH_BOARD_H_ //---Engine Includes--- #include "PhysX/PhysicsManager.h" #include "Graphics/ASEObject/ASEObject.h" //--------------------- //--Forward Declaration-- class CRenderManager; class CFontManager; //--------------------- //---Declaracion de nuevos tipos---- class CGameEntity:public CPhysicUserData { public: CGameEntity(): m_sName("Default"){} ~CGameEntity(){/*Nothing*/} const std::string& GetName() const {return m_sName;} void SetName(const std::string& name) {m_sName = name;} private: std::string m_sName; }; enum CollisioneGroup { GROUP_BASIC_PRIMITIVES, GROUP_GRENADES, }; #define IMPACT_MASK_1 (1<<GROUP_BASIC_PRIMITIVES) #define IMPACT_MASK_2 (1<<GROUP_BASIC_PRIMITIVES | 1<< GROUP_GRENADES) #define COLLIDABLE_MASK (1<<GROUP_BASIC_PRIMITIVES | 1<< GROUP_GRENADES) #define Y_SETTINGS 500 //---------------------------------- class CLaberynthBoard { public: CLaberynthBoard( CASEObject* baseBoardMesh, CASEObject* ballMesh, float ballRadius, CASEObject* boardMesh, const std::string& physXMeshName, const Vect3f& goalPosition, const Vect3f& startPosition, bool inSettings = false); virtual ~CLaberynthBoard(); void RenderScene (CRenderManager* renderManager, CFontManager* fontManager); void UpdateScene (float elapsedTime); CPhysicRevoluteJoint* GetRevoluteJoint1 () {return m_pPhysicRevolute_1;} CPhysicRevoluteJoint* GetRevoluteJoint2 () {return m_pPhysicRevolute_2;} private: //---PhysX Elements: CPhysicActor* m_pPhysicActor_Plane; CGameEntity* m_pGameEntity_Plane; CPhysicActor* m_pPhysicActor_Board; CGameEntity* m_pGameEntity_Board; CPhysicActor* m_pPhysicActor_Ball; CGameEntity* m_pGameEntity_Ball; CPhysicActor* m_pPhysicActor_Box; CGameEntity* m_pGameEntity_Box; CPhysicRevoluteJoint* m_pPhysicRevolute_1; CPhysicRevoluteJoint* m_pPhysicRevolute_2; CPhysicFixedJoint* m_pPhysicFixedJoint; CPhysicActor* m_pPhysicActor_GoalBox; CGameEntity* m_pGameEntity_GoalBox; CPhysicActor* m_pPhysicActor_GoalTrigger; CGameEntity* m_pGameEntity_GoalTrigger; CPhysicActor* m_pPhysicActor_FlatTrigger; CGameEntity* m_pGameEntity_FlatTrigger; CPhysicActor* m_pPhysicActor_BaseBoard; CGameEntity* m_pGameEntity_BaseBoard; std::vector<CGameEntity*> m_GameEntities; std::vector<CPhysicActor*> m_PhyscActors; float m_fBoardHeight; //---Mesh Elements: CASEObject* m_pASE_Board; CASEObject* m_pASE_Ball; CASEObject* m_pASE_BaseBoard; }; #endif //INC_LABERYTNH_BOARD_H_
[ "ohernandezba@71d53fa2-cca5-e1f2-4b5e-677cbd06613a" ]
[ [ [ 1, 107 ] ] ]
4d7bed2c1149c1f66283eb007a975c4fcb36ddf6
d7b345a8a6b0473c325fab661342de295c33b9c8
/beta/src/powerwindow/AskOpenHandler.h
6f93710ee4515fc9a655788187f7bf133ec49f8e
[]
no_license
raould/Polaris-Open-Source
67ccd647bf40de51a3dae903ab70e8c271f3f448
10d0ca7e2db9e082e1d2ed2e43fa46875f1b07b2
refs/heads/master
2021-01-01T19:19:39.148016
2010-05-10T17:39:26
2010-05-10T17:39:26
631,953
3
2
null
null
null
null
UTF-8
C++
false
false
239
h
// Copyright 2010 Hewlett-Packard under the terms of the MIT X license // found at http://www.opensource.org/licenses/mit-license.html #pragma once struct MessageHandler; class ActivePet; MessageHandler* makeAskOpenHandler(ActivePet*);
[ [ [ 1, 9 ] ] ]
fb606379258a51180f19ab1995bc20f36b8f81d9
5dc78c30093221b4d2ce0e522d96b0f676f0c59a
/src/modules/audio/openal/Sound.cpp
18c7e886bdfc70b78c9fc0ff83fdbcc646d5a31a
[ "Zlib" ]
permissive
JackDanger/love
f03219b6cca452530bf590ca22825170c2b2eae1
596c98c88bde046f01d6898fda8b46013804aad6
refs/heads/master
2021-01-13T02:32:12.708770
2009-07-22T17:21:13
2009-07-22T17:21:13
142,595
1
0
null
null
null
null
UTF-8
C++
false
false
2,010
cpp
/** * Copyright (c) 2006-2009 LOVE Development Team * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. **/ #include "Sound.h" #include <common/Exception.h> namespace love { namespace audio { namespace openal { Sound::Sound(Pool * pool, love::sound::SoundData * data) : pool(pool), buffer(0), source(source) { // Generate the buffer. alGenBuffers(1, &buffer); int fmt = pool->getFormat(data->getChannels(), data->getBits()); if(fmt == 0) throw love::Exception("Unsopported audio format."); alBufferData(buffer, fmt, data->getData(), data->getSize(), data->getSampleRate()); // Note: we're done with the sound data // at this point. No need to retain. } Sound::~Sound() { if(buffer) alDeleteBuffers(1, &buffer); } void Sound::play(love::audio::Source * s) { // Set the buffer for the sound. source = pool->find(s); if(source) alSourcei(source, AL_BUFFER, buffer); } void Sound::update(love::audio::Source * s) { // No need. } void Sound::stop(love::audio::Source * s) { // Also no need. } void Sound::rewind(love::audio::Source * s) { if(source) alSourceRewind(source); } } // openal } // audio } // love
[ "prerude@3494dbca-881a-0410-bd34-8ecbaf855390", "bartbes@3494dbca-881a-0410-bd34-8ecbaf855390" ]
[ [ [ 1, 81 ] ], [ [ 82, 82 ] ] ]
d5566801808ece5de871dba936d0b8b510448b0e
b14d5833a79518a40d302e5eb40ed5da193cf1b2
/cpp/extern/xercesc++/2.6.0/tests/UtilTests/CoreTests_RefArray.cpp
a386828983b4e0c0b817e383fcd85ac64102a337
[ "Apache-2.0" ]
permissive
andyburke/bitflood
dcb3fb62dad7fa5e20cf9f1d58aaa94be30e82bf
fca6c0b635d07da4e6c7fbfa032921c827a981d6
refs/heads/master
2016-09-10T02:14:35.564530
2011-11-17T09:51:49
2011-11-17T09:51:49
2,794,411
1
0
null
null
null
null
UTF-8
C++
false
false
7,896
cpp
/* * Copyright 1999-2000,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. */ /* * $Log: CoreTests_RefArray.cpp,v $ * Revision 1.7 2004/09/08 13:57:05 peiyongz * Apache License Version 2.0 * * Revision 1.6 2003/05/30 13:08:26 gareth * move over to macros for std:: and iostream/iostream.h issues. * * Revision 1.5 2002/02/01 22:46:28 peiyongz * sane_include * * Revision 1.4 2000/03/02 19:55:48 roddey * This checkin includes many changes done while waiting for the * 1.1.0 code to be finished. I can't list them all here, but a list is * available elsewhere. * * Revision 1.3 2000/02/06 07:48:39 rahulj * Year 2K copyright swat. * * Revision 1.2 2000/01/19 00:59:06 roddey * Get rid of dependence on old utils output streams. * * Revision 1.1.1.1 1999/11/09 01:01:52 twl * Initial checkin * * Revision 1.2 1999/11/08 20:42:27 rahul * Swat for adding in Product name and CVS comment log variable. * */ // --------------------------------------------------------------------------- // XML4C2 includes // --------------------------------------------------------------------------- #include "CoreTests.hpp" #include <xercesc/util/RefArrayOf.hpp> #include <xercesc/util/ArrayIndexOutOfBoundsException.hpp> // --------------------------------------------------------------------------- // Force a full instantiation of our array and its enumerator, just to // insure that all methods get instantiated and compiled. // --------------------------------------------------------------------------- template RefArrayOf<int>; template RefArrayEnumerator<int>; // --------------------------------------------------------------------------- // Local functions // --------------------------------------------------------------------------- static bool constructorTests() { // Some values to test with double testVals[16]; unsigned int index; for (index = 0; index < 16; index++) testVals[index] = index; // Do a basic constructor with just the count of elements RefArrayOf<double> testArray1(255); // Make sure that it has the right initial size if (testArray1.length() != 255) { XERCES_STD_QUALIFIER wcout << L" The ctor created wrong length() value" << XERCES_STD_QUALIFIER endl; return false; } // Copy construct another array from it and test the length RefArrayOf<double> testArray2(testArray1); if (testArray2.length() != 255) { XERCES_STD_QUALIFIER wcout << L" The copy ctor created wrong length() value" << XERCES_STD_QUALIFIER endl; return false; } // Test the equality of the two arrays if (testArray1 != testArray2) { XERCES_STD_QUALIFIER wcout << L" The copy ctor created unequal arrays" << XERCES_STD_QUALIFIER endl; return false; } // // Do another one where we provide the initial values. // double* initValues[16]; for (index = 0; index < 16; index++) initValues[index ] = &testVals[index]; RefArrayOf<double> testArray3(initValues, 16); if (testArray3.length() != 16) { XERCES_STD_QUALIFIER wcout << L" The init values ctor created wrong length() value" << XERCES_STD_QUALIFIER endl; return false; } // Make sure the initial values are correct for (index = 0; index < 16; index++) { if (*testArray3[index] != (double)index) { XERCES_STD_QUALIFIER wcout << L" The init values ctor did not init contents correctly" << XERCES_STD_QUALIFIER endl; return false; } } // // Create another array of a different size and assign one of the // existing ones to it and make sure that they are equal. // RefArrayOf<double> testArray4(15); testArray4 = testArray3; if (testArray4 != testArray3) { XERCES_STD_QUALIFIER wcout << L" Assignment did not create equal arrays" << XERCES_STD_QUALIFIER endl; return false; } return true; } static bool accessTests() { // Some values to test with unsigned int testVals[16]; unsigned int index; for (index = 0; index < 16; index++) testVals[index] = index; RefArrayOf<unsigned int> testArray1(16); // Fill in the array for (index = 0; index < 16; index++) testArray1[index] = &testVals[index]; // Read them back again for (index = 0; index < 16; index++) { if (testArray1[index] != &testVals[index]) { XERCES_STD_QUALIFIER wcout << L" Failed to read back values just set" << XERCES_STD_QUALIFIER endl; return false; } } // Make sure we get the expected array index error bool caughtIt = false; try { testArray1[16]; } catch(const ArrayIndexOutOfBoundsException&) { caughtIt = true; } if (!caughtIt) { XERCES_STD_QUALIFIER wcout << L" Failed to catch index error" << XERCES_STD_QUALIFIER endl; return false; } return true; } // --------------------------------------------------------------------------- // Test entry point // --------------------------------------------------------------------------- bool testRefArray() { XERCES_STD_QUALIFIER wcout << L"----------------------------------\n" << L"Testing RefArrayOf template class\n" << L"----------------------------------" << XERCES_STD_QUALIFIER endl; bool retVal = true; try { // Call other local methods to do specific tests XERCES_STD_QUALIFIER wcout << L"Testing RefArrayOf contructors" << XERCES_STD_QUALIFIER endl; if (!constructorTests()) { XERCES_STD_QUALIFIER wcout << L"RefArrayOf constructor tests failed" << XERCES_STD_QUALIFIER endl; retVal = false; } else { XERCES_STD_QUALIFIER wcout << L"RefArrayOf constructor tests passed" << XERCES_STD_QUALIFIER endl; } XERCES_STD_QUALIFIER wcout << XERCES_STD_QUALIFIER endl; XERCES_STD_QUALIFIER wcout << L"Testing RefArrayOf element access" << XERCES_STD_QUALIFIER endl; if (!accessTests()) { XERCES_STD_QUALIFIER wcout << L"RefArrayOf element access tests failed" << XERCES_STD_QUALIFIER endl; retVal = false; } else { XERCES_STD_QUALIFIER wcout << L"RefArrayOf element access tests passed" << XERCES_STD_QUALIFIER endl; } XERCES_STD_QUALIFIER wcout << XERCES_STD_QUALIFIER endl; } catch(const XMLException& toCatch) { XERCES_STD_QUALIFIER wcout << L" ERROR: Unexpected exception!\n Msg: " << toCatch.getMessage() << XERCES_STD_QUALIFIER endl; return false; } return retVal; }
[ [ [ 1, 245 ] ] ]
946846a4677daf43e860d97f8111103a07029218
e7c45d18fa1e4285e5227e5984e07c47f8867d1d
/Common/Scd/ScdLib/Scdarray.h
add980a19ad987396a605bf2a93f56ecc552f25d
[]
no_license
abcweizhuo/Test3
0f3379e528a543c0d43aad09489b2444a2e0f86d
128a4edcf9a93d36a45e5585b70dee75e4502db4
refs/heads/master
2021-01-17T01:59:39.357645
2008-08-20T00:00:29
2008-08-20T00:00:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
16,096
h
//================== SysCAD - Copyright Kenwalt (Pty) Ltd =================== // $Nokeywords: $ //=========================================================================== // SysCAD Copyright Kenwalt (Pty) Ltd 1992 #ifndef __SCDARRAY_H #define __SCDARRAY_H #ifndef __SC_DEFS_H #include "sc_defs.h" #endif #ifndef __AFXTEMPL_H__ #include <afxtempl.h> // "xafxtempl.h" #endif #ifdef __SCDARRAY_CPP #define DllImportExport DllExport #elif !defined(SCDLIB) #define DllImportExport DllImport #else #define DllImportExport #endif // ========================================================================== // // // // ========================================================================== class DllImportExport CDArray : public CArray <double, double> { protected: //byte iCnvDC; // ConversionGroup //Strng sCnvTxt; // Conversion public: CDArray() {};//iCnvDC=0;}; CDArray(const CDArray & Other); CDArray(const int Size, double Init=0.0); void Extend(int n=1) { SetSize(GetSize()+n, m_nGrowBy); }; void ExpandTo(int n) { if (GetSize()<n) { SetSize(n, m_nGrowBy); for (int i=0; i<n; i++) m_pData[i]=0; }; }; //flag SetCnvs(byte CnvDC, char * CnvTxt); double ScanMax(int SkipStart=0, int SkipEnd=0); double ScanMin(int SkipStart=0, int SkipEnd=0); flag Swop(long i1, long i2); flag Sort(flag Ascending = TRUE); flag Reverse(); flag SetAll(double d = 0.0); flag OpAdd(double d); flag OpAdd(CDArray &v, double Scl=1.0, double Off=0.0); flag OpSub(CDArray &v); flag OpMult(double d); flag OpMult(CDArray &v); flag OpDiv(CDArray &v); //flag Load(rCVMLoadHelper H, byte CnvDC=DC_); flag operator==(const CDArray &v); CDArray& operator=(const CDArray &v); CDArray& operator+=(const CDArray &v); CDArray& operator-=(const CDArray &v); CDArray& operator*=(const CDArray &v); CDArray& operator/=(const CDArray &v); CDArray& operator+=(const double v); CDArray& operator-=(const double v); CDArray& operator*=(const double v); CDArray& operator/=(const double v); double Normalise(); double Sum(); double ToCumulative(double ConstInteg=0.0, double Total=1.0, flag Inverse=false, flag Shift=false); //double Interpolate(CDArrayWork & Wrk, double XValue); double LinearInterpolate(double XValue, CDArray &X, flag Extrapolate); void dbgDump( pchar Desc = "", flag Horizontal = TRUE); //inline methods... /*#F:#R:An element in an array as specified by the index value.*/ //double& operator[](long i) //Zero based index // { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; //double operator[](long i) const { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; /*#F:#R:Length of the array (ie number of elements).*/ //long GetLen() { return m_Len; }; /*#F:#R:The last error code. Only valid if the previous vector operation returns False.*/ int GetErr() { return m_Err; }; //double Human(int i) { return Cnvs[iCnvDC]->Human(m_pData[i], False, False, sCnvTxt()); }; //void SetNormal(int i, double d) { m_pData[i]= Cnvs[iCnvDC]->Normal(d, False, False, sCnvTxt()); }; flag AdjustCumulativeEnd(double RqdCum, double ValMin, double ValMax, double & Err); flag AdjustCumulativeEnd(double RqdCum, double ValMin, double ValMax); //double* m_d; //Pointer to array of doubles protected: //void FreePts(); //long m_Len; //Current length of array static int m_Err; //Last error code only valid after a function returned False. }; // ========================================================================== // // // // ========================================================================== class DllImportExport CDMatrx : public CArray <CDArray, CDArray&> { public: void SetSizes(int n, int m, int GrowBy=-1) { SetSize(n, -1); for (int i=0 ;i<n; i++) m_pData[i].SetSize(m, GrowBy); }; //flag SetCnvs(byte CnvDC, char * CnvTxt); double ScanMax(); double ScanMin(); //flag Swop(long i1, long i2); //flag Sort(flag Ascending = TRUE); //flag Reverse(); //flag SetAll(double d = 0.0); //flag OpAdd(double d); //flag OpAdd(CDArray &v); //flag OpSub(CDArray &v); //flag OpMult(double d); //flag OpMult(CDArray &v); //flag OpDiv(CDArray &v); //flag Load(rCVMLoadHelper H, byte CnvDC=DC_); flag operator==(const CDMatrx &v); CDMatrx & operator=(const CDMatrx &v); //double Normalise(); //double Sum(); //void dbgDump( pchar Desc = "", // flag Horizontal = TRUE); //inline methods... /*#F:#R:An element in an array as specified by the index value.*/ //double& operator[](long i) //Zero based index // { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; //double operator[](long i) const { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; /*#F:#R:Length of the array (ie number of elements).*/ //long GetLen() { return m_Len; }; /*#F:#R:The last error code. Only valid if the previous vector operation returns False.*/ //int GetErr() { return m_Err; }; // //double Human(int i) { return Cnvs[iCnvDC]->Human(m_pData[i], False, False, sCnvTxt()); }; //void SetNormal(int i, double d) { m_pData[i]= Cnvs[iCnvDC]->Normal(d, False, False, sCnvTxt()); }; //double* m_d; //Pointer to array of doubles //byte iCnvDC; // ConversionGroup //Strng sCnvTxt; // Conversion protected: //void FreePts(); //long m_Len; //Current length of array //static int m_Err; //Last error code only valid after a function returned False. }; // ========================================================================== // // // // ========================================================================== //const int CDW_Linear=0; //const int CDW_TSpline=1; // //class CDArray; // //class CDArrayWork // { // protected: // int iMethod; // CDArray * pX; // public: // CDArrayWork() {iMethod=CDW_Linear; pX=NULL;}; // CDArrayWork(int Method, CDArray & X) { pX=&X; iMethod=Method; }; // void SetXArray(CDArray & X) { pX=&X; }; // void SetMethod(int Method) { iMethod=Method; }; // }; class DllImportExport CIArray : public CArray <int, int> { protected: //byte iCnvDC; // ConversionGroup //Strng sCnvTxt; // Conversion public: CIArray() {};//iCnvDC=0;}; CIArray(const CIArray & Other); void Extend(int n=1) { SetSize(GetSize()+n, m_nGrowBy); }; //flag SetCnvs(byte CnvDC, char * CnvTxt); int ScanMax(int SkipStart=0, int SkipEnd=0); int ScanMin(int SkipStart=0, int SkipEnd=0); flag Swop(long i1, long i2); flag Sort(flag Ascending = TRUE); flag Reverse(); flag SetAll(int d = 0); flag OpAdd(int d); flag OpAdd(CIArray &v, int Scl=1, int Off=0); flag OpSub(CIArray &v); flag OpMult(int d); flag OpMult(CIArray &v); flag OpDiv(CIArray &v); //flag Load(rCVMLoadHelper H, byte CnvDC=DC_); flag operator==(const CIArray &v); CIArray& operator=(const CIArray &v); //int Normalise(); int Sum(); //int ToCumulative(double ConstInteg=0.0, double Total=1.0); //double Interpolate(CIArrayWork & Wrk, double XValue); //int LinearInterpolate(double XValue, CIArray &X, flag Extrapolate); void dbgDump( pchar Desc = "", flag Horizontal = TRUE); //inline methods... /*#F:#R:An element in an array as specified by the index value.*/ //double& operator[](long i) //Zero based index // { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; //double operator[](long i) const { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; /*#F:#R:Length of the array (ie number of elements).*/ //long GetLen() { return m_Len; }; /*#F:#R:The last error code. Only valid if the previous vector operation returns False.*/ int GetErr() { return m_Err; }; //double Human(int i) { return Cnvs[iCnvDC]->Human(m_pData[i], False, False, sCnvTxt()); }; //void SetNormal(int i, double d) { m_pData[i]= Cnvs[iCnvDC]->Normal(d, False, False, sCnvTxt()); }; //void AdjustCumulativeEnd(double RqdCum, double ValMin, double ValMax); //double* m_d; //Pointer to array of doubles protected: //void FreePts(); //long m_Len; //Current length of array static int m_Err; //Last error code only valid after a function returned False. }; // ========================================================================== // // // // ========================================================================== class DllImportExport CLArray : public CArray <long, long> { }; // ========================================================================== // // // // ========================================================================== class DllImportExport CIMatrx : public CArray <CIArray, CIArray&> { public: void SetSizes(int n, int m, int GrowBy=-1) { SetSize(n, -1); for (int i=0 ;i<n; i++) m_pData[i].SetSize(m, GrowBy); }; //flag SetCnvs(byte CnvDC, char * CnvTxt); int ScanMax(); int ScanMin(); //flag Swop(long i1, long i2); //flag Sort(flag Ascending = TRUE); //flag Reverse(); //flag SetAll(double d = 0.0); //flag OpAdd(double d); //flag OpAdd(CIArray &v); //flag OpSub(CIArray &v); //flag OpMult(double d); //flag OpMult(CIArray &v); //flag OpDiv(CIArray &v); //flag Load(rCVMLoadHelper H, byte CnvDC=DC_); flag operator==(const CIMatrx &v); CIMatrx & operator=(const CIMatrx &v); //double Normalise(); //double Sum(); //void dbgDump( pchar Desc = "", // flag Horizontal = TRUE); //inline methods... /*#F:#R:An element in an array as specified by the index value.*/ //double& operator[](long i) //Zero based index // { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; //double operator[](long i) const { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; /*#F:#R:Length of the array (ie number of elements).*/ //long GetLen() { return m_Len; }; /*#F:#R:The last error code. Only valid if the previous vector operation returns False.*/ //int GetErr() { return m_Err; }; // //double Human(int i) { return Cnvs[iCnvDC]->Human(m_pData[i], False, False, sCnvTxt()); }; //void SetNormal(int i, double d) { m_pData[i]= Cnvs[iCnvDC]->Normal(d, False, False, sCnvTxt()); }; //double* m_d; //Pointer to array of doubles //byte iCnvDC; // ConversionGroup //Strng sCnvTxt; // Conversion protected: //void FreePts(); //long m_Len; //Current length of array //static int m_Err; //Last error code only valid after a function returned False. }; // ========================================================================== // // // // ========================================================================== class DllImportExport CSArray : public CArray <Strng, Strng&> { public: CSArray() {}; CSArray(const CSArray &v) { SetSize(v.GetSize()); for (int i=0; i<v.GetSize(); i++) SetAt(i, (Strng &)v[i]); }; void Extend(int n=1) { SetSize(GetSize()+n, m_nGrowBy); }; //flag Swop(long i1, long i2); //flag Sort(flag Ascending = TRUE); //flag Reverse(); void AddStrng(char * p); void AddStrng(Strng & S); flag SetAll(char * p= ""); //flag OpAdd(double d); //flag OpAdd(CDArray &v); //flag OpSub(CDArray &v); //flag OpMult(double d); //flag OpMult(CDArray &v); //flag OpDiv(CDArray &v); //flag Load(rCVMLoadHelper H, byte CnvDC=DC_); flag operator==(const CSArray &v); CSArray& operator=(const CSArray &v); //double Normalise(); //double Sum(); //void dbgDump( pchar Desc = "", // flag Horizontal = TRUE); int Find(Strng & S, flag CaseSensitive) { return Find(S(), CaseSensitive); } int Find(const char* s, flag CaseSensitive) { if (CaseSensitive) { for (int i=0; i<GetSize(); i++) if (strcmp(m_pData[i](), s)==0) return i; } else for (int i=0; i<GetSize(); i++) if (_stricmp(m_pData[i](), s)==0) return i; return -1; } //inline methods... /*#F:#R:An element in an array as specified by the index value.*/ //double& operator[](long i) //Zero based index // { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; //double operator[](long i) const { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; /*#F:#R:Length of the array (ie number of elements).*/ //long GetLen() { return m_Len; }; /*#F:#R:The last error code. Only valid if the previous vector operation returns False.*/ //int GetErr() { return m_Err; }; // //double Human(int i) { return Cnvs[iCnvDC]->Human(m_pData[i], False, False, sCnvTxt()); }; //void SetNormal(int i, double d) { m_pData[i]= Cnvs[iCnvDC]->Normal(d, False, False, sCnvTxt()); }; // ////double* m_d; //Pointer to array of doubles //byte iCnvDC; // ConversionGroup //Strng sCnvTxt; // Conversion protected: //void FreePts(); //long m_Len; //Current length of array //static int m_Err; //Last error code only valid after a function returned False. }; // ========================================================================== // // // // ========================================================================== class DllImportExport CSMatrx : public CArray <CSArray, CSArray&> { public: void SetSizes(int n, int m, int GrowBy=-1) { SetSize(n, -1); for (int i=0 ;i<n; i++) m_pData[i].SetSize(m, GrowBy); }; //flag SetCnvs(byte CnvDC, char * CnvTxt); int ScanMax(); int ScanMin(); //flag Swop(long i1, long i2); //flag Sort(flag Ascending = TRUE); //flag Reverse(); //flag SetAll(double d = 0.0); //flag OpAdd(double d); //flag OpAdd(CIArray &v); //flag OpSub(CIArray &v); //flag OpMult(double d); //flag OpMult(CIArray &v); //flag OpDiv(CIArray &v); //flag Load(rCVMLoadHelper H, byte CnvDC=DC_); flag operator==(const CSMatrx &v); CSMatrx & operator=(const CSMatrx &v); //double Normalise(); //double Sum(); //void dbgDump( pchar Desc = "", // flag Horizontal = TRUE); //inline methods... /*#F:#R:An element in an array as specified by the index value.*/ //double& operator[](long i) //Zero based index // { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; //double operator[](long i) const { ASSERT(i>=0 && i<m_Len); return m_d[i]; }; /*#F:#R:Length of the array (ie number of elements).*/ //long GetLen() { return m_Len; }; /*#F:#R:The last error code. Only valid if the previous vector operation returns False.*/ //int GetErr() { return m_Err; }; // //double Human(int i) { return Cnvs[iCnvDC]->Human(m_pData[i], False, False, sCnvTxt()); }; //void SetNormal(int i, double d) { m_pData[i]= Cnvs[iCnvDC]->Normal(d, False, False, sCnvTxt()); }; //double* m_d; //Pointer to array of doubles //byte iCnvDC; // ConversionGroup //Strng sCnvTxt; // Conversion protected: //void FreePts(); //long m_Len; //Current length of array //static int m_Err; //Last error code only valid after a function returned False. }; // ========================================================================== // // // // ========================================================================== #undef DllImportExport #endif
[ [ [ 1, 316 ], [ 318, 344 ], [ 346, 435 ] ], [ [ 317, 317 ], [ 345, 345 ] ] ]
2703eaade818909e691334cc02de5890bf64bc2a
b5ad65ebe6a1148716115e1faab31b5f0de1b493
/src/AranDx9/ArnNodeFactory.h
5dd4076ba674fca4b677994c88b07d3bdcb78c0c
[]
no_license
gasbank/aran
4360e3536185dcc0b364d8de84b34ae3a5f0855c
01908cd36612379ade220cc09783bc7366c80961
refs/heads/master
2021-05-01T01:16:19.815088
2011-03-01T05:21:38
2011-03-01T05:21:38
1,051,010
1
0
null
null
null
null
UTF-8
C++
false
false
213
h
#pragma once class ArnNode; struct NodeBase; class ArnNodeFactory { public: static ArnNode* createFromNodeBase(const NodeBase* nodeBase); private: ArnNodeFactory(void); ~ArnNodeFactory(void); };
[ [ [ 1, 13 ] ] ]
773c3fb8d0e8b51e535f42c65fe99cd36feef968
bdb1e38df8bf74ac0df4209a77ddea841045349e
/CapsuleSortor/Version 1.0 -2.0/CapsuleSortor-10-12-17/CapsuleSorter/mscomm.h
e1f1fab794648561d8045e33211e63f34eca7d38
[]
no_license
Strongc/my001project
e0754f23c7818df964289dc07890e29144393432
07d6e31b9d4708d2ef691d9bedccbb818ea6b121
refs/heads/master
2021-01-19T07:02:29.673281
2010-12-17T03:10:52
2010-12-17T03:10:52
49,062,858
0
1
null
2016-01-05T11:53:07
2016-01-05T11:53:07
null
UTF-8
C++
false
false
3,221
h
#if !defined(AFX_MSCOMM_H__68913455_18B3_4B21_A0F4_2C0D9E4FAD73__INCLUDED_) #define AFX_MSCOMM_H__68913455_18B3_4B21_A0F4_2C0D9E4FAD73__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++ // NOTE: Do not modify the contents of this file. If this class is regenerated by // Microsoft Visual C++, your modifications will be overwritten. ///////////////////////////////////////////////////////////////////////////// // CMSComm wrapper class class CMSComm : public CWnd { protected: DECLARE_DYNCREATE(CMSComm) public: CLSID const& GetClsid() { static CLSID const clsid = { 0x648a5600, 0x2c6e, 0x101b, { 0x82, 0xb6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14 } }; return clsid; } virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL) { return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); } BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE, BSTR bstrLicKey = NULL) { return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID, pPersist, bStorage, bstrLicKey); } // Attributes public: // Operations public: void SetCDHolding(BOOL bNewValue); BOOL GetCDHolding(); void SetCommID(long nNewValue); long GetCommID(); void SetCommPort(short nNewValue); short GetCommPort(); void SetCTSHolding(BOOL bNewValue); BOOL GetCTSHolding(); void SetDSRHolding(BOOL bNewValue); BOOL GetDSRHolding(); void SetDTREnable(BOOL bNewValue); BOOL GetDTREnable(); void SetHandshaking(long nNewValue); long GetHandshaking(); void SetInBufferSize(short nNewValue); short GetInBufferSize(); void SetInBufferCount(short nNewValue); short GetInBufferCount(); void SetBreak(BOOL bNewValue); BOOL GetBreak(); void SetInputLen(short nNewValue); short GetInputLen(); void SetNullDiscard(BOOL bNewValue); BOOL GetNullDiscard(); void SetOutBufferSize(short nNewValue); short GetOutBufferSize(); void SetOutBufferCount(short nNewValue); short GetOutBufferCount(); void SetParityReplace(LPCTSTR lpszNewValue); CString GetParityReplace(); void SetPortOpen(BOOL bNewValue); BOOL GetPortOpen(); void SetRThreshold(short nNewValue); short GetRThreshold(); void SetRTSEnable(BOOL bNewValue); BOOL GetRTSEnable(); void SetSettings(LPCTSTR lpszNewValue); CString GetSettings(); void SetSThreshold(short nNewValue); short GetSThreshold(); void SetOutput(const VARIANT& newValue); VARIANT GetOutput(); void SetInput(const VARIANT& newValue); VARIANT GetInput(); void SetCommEvent(short nNewValue); short GetCommEvent(); void SetEOFEnable(BOOL bNewValue); BOOL GetEOFEnable(); void SetInputMode(long nNewValue); long GetInputMode(); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MSCOMM_H__68913455_18B3_4B21_A0F4_2C0D9E4FAD73__INCLUDED_)
[ "vincen.cn@66f52ff4-a261-11de-b161-9f508301ba8e" ]
[ [ [ 1, 100 ] ] ]
acf1a3a0e7096b3462a63f89d56664fec334f71f
ee2e06bda0a5a2c70a0b9bebdd4c45846f440208
/word/CppUTest/scripts/templates/InterfaceTest.cpp
6795a0e4c726cf128987955ab0d684c56b5f5ee0
[]
no_license
RobinLiu/Test
0f53a376e6753ece70ba038573450f9c0fb053e5
360eca350691edd17744a2ea1b16c79e1a9ad117
refs/heads/master
2021-01-01T19:46:55.684640
2011-07-06T13:53:07
2011-07-06T13:53:07
1,617,721
2
0
null
null
null
null
UTF-8
C++
false
false
390
cpp
#include "CppUTest/TestHarness.h" #include "ClassName.h" #include "MockClassName.h" TEST_GROUP(ClassName) { ClassName* aClassName; MockClassName* mockClassName; void setup() { mockClassName = new MockClassName(); aClassName = mockClassName; } void teardown() { delete aClassName; } }; TEST(ClassName, Create) { FAIL("Start here"); }
[ "RobinofChina@43938a50-64aa-11de-9867-89bd1bae666e" ]
[ [ [ 1, 24 ] ] ]
81f7737967b03438630a5d5751dc6c0c408d2b14
4b0f51aeecddecf3f57a29ffa7a184ae48f1dc61
/CleanProject/OgreMaxLoader/Include/ProgressCalculator.cpp
7767fa2a7df4c18f420c875d11add0a5b0669c59
[]
no_license
bahao247/apeengine2
56560dbf6d262364fbc0f9f96ba4231e5e4ed301
f2617b2a42bdf2907c6d56e334c0d027fb62062d
refs/heads/master
2021-01-10T14:04:02.319337
2009-08-26T08:23:33
2009-08-26T08:23:33
45,979,392
0
1
null
null
null
null
UTF-8
C++
false
false
3,232
cpp
/* * OgreMaxViewer - An Ogre 3D-based viewer for .scene and .mesh files * Copyright 2008 Derek Nedelman * * This code is available under the OgreMax Free License: * -You may use this code for any purpose, commercial or non-commercial. * -If distributing derived works (that use this source code) in binary or source code form, * you must give the following credit in your work's end-user documentation: * "Portions of this work provided by OgreMax (www.ogremax.com)" * * Derek Nedelman assumes no responsibility for any harm caused by using this code. * * OgreMaxViewer was written by Derek Nedelman and released at www.ogremax.com */ //Includes--------------------------------------------------------------------- #include "ProgressCalculator.hpp" using namespace Ogre; using namespace OgreMax; //Implementation--------------------------------------------------------------- ProgressCalculator::ProgressCalculator() { this->progress = 0; this->range = 0; } ProgressCalculator::ProgressCalculator(const Ogre::String& name) { this->name = name; this->progress = 0; this->range = 0; } ProgressCalculator::~ProgressCalculator() { //Delete child calculators for (Calculators::iterator calculator = this->childCalculators.begin(); calculator != this->childCalculators.end(); ++calculator) { delete *calculator; } } const String& ProgressCalculator::GetName() const { return this->name; } Real ProgressCalculator::GetProgress() { if (!this->childCalculators.empty()) { //Reset progress this->progress = 0; //Determine the influence of each child calculator Real influence = (Real)1.0/this->childCalculators.size(); //Add the progress of all child calculators for (Calculators::iterator calculator = this->childCalculators.begin(); calculator != this->childCalculators.end(); ++calculator) { this->progress += (*calculator)->GetProgress() * influence; } } else if (this->range == 0) { //No child calculators and no range. There is no progress to be made this->progress = 1; } return this->progress; } void ProgressCalculator::SetProgress(Ogre::Real progress) { this->progress = progress; } void ProgressCalculator::Update(Real amount) { if (this->range > 0) { //Update the progress, scaling it by the inverse range this->progress += amount / this->range; //Limit the progress to [0, 1] this->progress = std::max(this->progress, (Real)0); this->progress = std::min(this->progress, (Real)1); } } Real ProgressCalculator::GetRange() const { return this->range; } void ProgressCalculator::SetRange(Real range) { this->progress = 0; this->range = range; } ProgressCalculator* ProgressCalculator::AddCalculator(const Ogre::String& name) { ProgressCalculator* calculator = new ProgressCalculator(name); this->childCalculators.push_back(calculator); return calculator; }
[ "pablosn@06488772-1f9a-11de-8b5c-13accb87f508" ]
[ [ [ 1, 115 ] ] ]
dbb635b316d19f3e5d3141ee75c925cdd87ecf49
fd3f2268460656e395652b11ae1a5b358bfe0a59
/srchybrid/TransferWnd.h
62207ff7ee84788cb0ee457efccd16a863006a44
[]
no_license
mikezhoubill/emule-gifc
e1cc6ff8b1bb63197bcfc7e67c57cfce0538ff60
46979cf32a313ad6d58603b275ec0b2150562166
refs/heads/master
2021-01-10T20:37:07.581465
2011-08-13T13:58:37
2011-08-13T13:58:37
32,465,033
4
2
null
null
null
null
UTF-8
C++
false
false
7,675
h
//this file is part of eMule //Copyright (C)2002-2005 Merkur ( [email protected] / http://www.emule-project.net ) // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. // //You should have received a copy of the GNU General Public License //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #pragma once #include "ResizableLib\ResizableFormView.h" #include "SplitterControl.h" #include "TabCtrl.hpp" #include "UploadListCtrl.h" #include "DownloadListCtrl.h" #include "QueueListCtrl.h" #include "ClientListCtrl.h" #include "DownloadClientsCtrl.h" // ==> Visual Studio 2010 Compatibility [Stulle/Avi-3k/ied] - Stulle #if _MSC_VER>=1600 #include "ButtonVE.h" #endif // <== Visual Studio 2010 Compatibility [Stulle/Avi-3k/ied] - Stulle #include "progressctrlx.h" // Client queue progress bar [Commander] - Stulle class CDropDownButton; class CToolTipCtrlX; class CTransferWnd : public CResizableFormView { DECLARE_DYNCREATE(CTransferWnd) public: CTransferWnd(CWnd* pParent = NULL); // standard constructor virtual ~CTransferWnd(); enum EWnd1Icon { w1iSplitWindow = 0, w1iDownloadFiles, w1iUploading, w1iDownloading, w1iOnQueue, w1iClientsKnown }; enum EWnd2Icon { w2iUploading = 0, w2iDownloading, w2iOnQueue, w2iClientsKnown }; enum EWnd2 { wnd2Downloading = 0, wnd2Uploading = 1, wnd2OnQueue = 2, wnd2Clients = 3 }; void ShowQueueCount(uint32 number); void UpdateListCount(EWnd2 listindex, int iCount = -1); //Xman see all sources /* void UpdateFilesCount(int iCount); */ void UpdateFilesCount(UINT iCount, UINT countsources, UINT countreadyfiles); //Xman end void Localize(); void UpdateCatTabTitles(bool force = true); // ==> Smart Category Control (SCC) [khaos/SiRoB/Stulle] - Stulle /* void VerifyCatTabSize(); */ void VerifyCatTabSize(bool _forceverify=false); // <== Smart Category Control (SCC) [khaos/SiRoB/Stulle] - Stulle int AddCategory(CString newtitle,CString newincoming,CString newcomment,CString newautocat,bool addTab=true); int AddCategoryInteractive(); void SwitchUploadList(); void ResetTransToolbar(bool bShowToolbar, bool bResetLists = true); void SetToolTipsDelay(DWORD dwDelay); void OnDisableList(); // ==> CPU/MEM usage [$ick$/Stulle] - Max void ShowRessources(); void EnableSysInfo(bool bEnable); void QueueListResize(uint8 value); // <== CPU/MEM usage [$ick$/Stulle] - Max // Dialog Data enum { IDD = IDD_TRANSFER }; CUploadListCtrl uploadlistctrl; CDownloadListCtrl downloadlistctrl; CQueueListCtrl queuelistctrl; CClientListCtrl clientlistctrl; CDownloadClientsCtrl downloadclientsctrl; protected: CSplitterControl m_wndSplitter; EWnd2 m_uWnd2; bool downloadlistactive; CDropDownButton* m_btnWnd1; CDropDownButton* m_btnWnd2; TabControl m_dlTab; int rightclickindex; int m_nDragIndex; int m_nDropIndex; int m_nLastCatTT; int m_isetcatmenu; bool m_bIsDragging; CImageList* m_pDragImage; POINT m_pLastMousePoint; uint32 m_dwShowListIDC; CToolTipCtrlX* m_tooltipCats; bool m_bLayoutInited; // ==> Visual Studio 2010 Compatibility [Stulle/Avi-3k/ied] - Stulle #if _MSC_VER>=1600 CButtonVE m_Refresh; #endif // <== Visual Studio 2010 Compatibility [Stulle/Avi-3k/ied] - Stulle // ==> Client queue progress bar [Commander] - Stulle CProgressCtrlX queueBar; CProgressCtrlX queueBar2; CFont bold; // <== Client queue progress bar [Commander] - Stulle void ShowWnd2(EWnd2 uList); void SetWnd2(EWnd2 uWnd2); void DoResize(int delta); void UpdateSplitterRange(); void DoSplitResize(int delta); void SetAllIcons(); void SetWnd1Icons(); void SetWnd2Icons(); void UpdateTabToolTips() {UpdateTabToolTips(-1);} void UpdateTabToolTips(int tab); CString GetTabStatistic(int tab); int GetTabUnderMouse(CPoint* point); int GetItemUnderMouse(CListCtrl* ctrl); // ==> Smart Category Control (SCC) [khaos/SiRoB/Stulle] - Stulle /* CString GetCatTitle(int catid); */ // <== Smart Category Control (SCC) [khaos/SiRoB/Stulle] - Stulle void EditCatTabLabel(int index,CString newlabel); void EditCatTabLabel(int index); void ShowList(uint32 dwListIDC); void SetWnd1Icon(EWnd1Icon iIcon); void SetWnd2Icon(EWnd2Icon iIcon); // ==> Advanced Transfer Window Layout [Stulle] - Stulle /* void ShowSplitWindow(bool bReDraw = false); */ void ShowSplitWindow(bool bReDraw, uint32 dwListIDC, bool bInitSplitted = false); // <== Advanced Transfer Window Layout [Stulle] - Stulle void LocalizeToolbars(); virtual BOOL PreTranslateMessage(MSG* pMsg); virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual void OnInitialUpdate(); virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); DECLARE_MESSAGE_MAP() afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); afx_msg void OnBnClickedChangeView(); afx_msg void OnBnClickedQueueRefreshButton(); afx_msg void OnDblClickDltab(); afx_msg void OnHoverDownloadList(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnHoverUploadList(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnLvnBeginDragDownloadList(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnLvnKeydownDownloadList(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnNmRClickDltab(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); afx_msg void OnSplitterMoved(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnSysColorChange(); afx_msg void OnTabMovement(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnTcnSelchangeDltab(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnWnd1BtnDropDown(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnWnd2BtnDropDown(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnPaint(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); // ==> XP Style Menu [Xanatos] - Stulle afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct); afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu); // <== XP Style Menu [Xanatos] - Stulle // ==> Smart Category Control (SCC) [khaos/SiRoB/Stulle] - Stulle void CreateCategoryMenus(); CTitleMenu m_mnuCategory; CTitleMenu m_mnuCatPriority; CTitleMenu m_mnuCatViewFilter; CTitleMenu m_mnuCatDlMode; public: int GetActiveCategory() { return m_dlTab.GetCurSel(); } // <== Smart Category Control (SCC) [khaos/SiRoB/Stulle] - Stulle // ==> Design Settings [eWombat/Stulle] - Stulle void SetBackgroundColor(int nStyle); void OnBackcolor(); protected: CBrush m_brMyBrush; // <== Design Settings [eWombat/Stulle] - Stulle // ==> Advanced Transfer Window Layout [Stulle] - Stulle public: void UpdateListCountTop(EWnd2 listindex); protected: uint32 m_dwTopListIDC; // <== Advanced Transfer Window Layout [Stulle] - Stulle };
[ "Mike.Ken.S@dd569cc8-ff36-11de-bbca-1111db1fd05b", "[email protected]@dd569cc8-ff36-11de-bbca-1111db1fd05b" ]
[ [ [ 1, 17 ], [ 19, 25 ], [ 31, 35 ], [ 37, 37 ], [ 39, 83 ], [ 85, 120 ], [ 127, 165 ], [ 167, 189 ], [ 192, 220 ] ], [ [ 18, 18 ], [ 26, 30 ], [ 36, 36 ], [ 38, 38 ], [ 84, 84 ], [ 121, 126 ], [ 166, 166 ], [ 190, 191 ] ] ]
51eed0ddfaea3dffd50f520283c89783b8cd7436
69aab86a56c78cdfb51ab19b8f6a71274fb69fba
/Code/inc/HUD/GamePanel.h
9d02d1eea9d8d5135bdf863c90ccfa457d039cbb
[ "BSD-3-Clause" ]
permissive
zc5872061/wonderland
89882b6062b4a2d467553fc9d6da790f4df59a18
b6e0153eaa65a53abdee2b97e1289a3252b966f1
refs/heads/master
2021-01-25T10:44:13.871783
2011-08-11T20:12:36
2011-08-11T20:12:36
38,088,714
0
0
null
null
null
null
UTF-8
C++
false
false
632
h
/* * GamePanel.h * * Created on: 2011-01-10 * Author: artur.m */ #ifndef GAMEPANEL_H_ #define GAMEPANEL_H_ #include "HUD/GameControl.h" #include "MathHelper.h" #include <string> class GamePanel : public GameControl { public: static shared_ptr<GamePanel> spawn(const Rectangle& bounds); virtual ~GamePanel(); virtual std::string getType() const { return "GamePanel"; } void setBitmap(const std::string& bitmap); const std::string& getBitmap() const; private: GamePanel(const Rectangle& bounds); private: std::string m_bitmap; }; #endif /* GAMEPANEL_H_ */
[ [ [ 1, 34 ] ] ]
aa6cff97273593138c806e5a0bc8a22b358b559e
1c84fe02ecde4a78fb03d3c28dce6fef38ebaeff
/Agent.h
ec2ae181733622e9a1dc754ac78bc64f0f4b0e9d
[]
no_license
aadarshasubedi/beesiege
c29cb8c3fce910771deec5bb63bcb32e741c1897
2128b212c5c5a68e146d3f888bb5a8201c8104f7
refs/heads/master
2016-08-12T08:37:10.410041
2007-12-16T20:57:33
2007-12-16T20:57:33
36,995,410
0
0
null
null
null
null
UTF-8
C++
false
false
1,130
h
#ifndef AGENT_H_ #define AGENT_H_ #include "GameObj.h" #include <NiPoint3.h> #include "CharacterController.h" #include <NxVec3.h> class NxActor; class Agent : public GameObj { public: // ctor Agent(NxActor* actor); // dtor virtual ~Agent(); // updates agent void Update(); // rotates actor to look at a certain target void LookAt (const NxVec3& target); // getters, setters void SetTarget (NxActor* target) { m_pTarget = target; } NxActor* GetTarget() const { return m_pTarget; } void SetTarget (const NxVec3& target) { m_vTargetPosition = target; } const NxVec3 GetTargetPosition() const { return m_vTargetPosition; } CharacterControllerPtr GetController() const { return m_spController; } NxActor* GetActor() const { return m_pActor; } protected: // the PhysX actor that is controlled NxActor* m_pActor; // the actor's target NxActor* m_pTarget; // the target's position NxVec3 m_vTargetPosition; // the controller that moves the actor CharacterControllerPtr m_spController; }; NiSmartPointer(Agent); #endif
[ [ [ 1, 60 ] ] ]
11edeb5b47d07147da7f8e8ea4fae15ee2e7045f
9c62af23e0a1faea5aaa8dd328ba1d82688823a5
/rl/tags/v0-1/engine/ui/src/UiSubsystem.cpp
e5e49eb26ee39ec0c3447a899a8c7981a6d4f38a
[ "ClArtistic", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
jacmoe/dsa-hl-svn
55b05b6f28b0b8b216eac7b0f9eedf650d116f85
97798e1f54df9d5785fb206c7165cd011c611560
refs/heads/master
2021-04-22T12:07:43.389214
2009-11-27T22:01:03
2009-11-27T22:01:03
null
0
0
null
null
null
null
ISO-8859-1
C++
false
false
12,889
cpp
/* This source file is part of Rastullahs Lockenpracht. * Copyright (C) 2003-2005 Team Pantheon. http://www.team-pantheon.de * * This program is free software; you can redistribute it and/or modify * it under the terms of the Clarified Artistic License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Clarified Artistic License for more details. * * You should have received a copy of the Clarified Artistic License * along with this program; if not you can get it here * http://www.jpaulmorrison.com/fbp/artistic2.htm. */ #include "UiPrerequisites.h" #include "UiSubsystem.h" #include <OgreCEGUIRenderer.h> #include <OgreCEGUIResourceProvider.h> #include "RubyInterpreter.h" #include "CoreSubsystem.h" #include "Logger.h" #include "DialogCharacter.h" #include "Console.h" #include "DebugWindow.h" #include "CharacterController.h" #include "InputManager.h" #include "CommandMapper.h" #include "CommandMapperWindow.h" #include "MessageWindow.h" #include "MainMenuWindow.h" #include "GameLoggerWindow.h" #include "TargetSelectionWindow.h" #include "CharacterStateWindow.h" #include "ContainerContentWindow.h" #include "InGameMenuWindow.h" #include "CombatWindow.h" #include "AboutWindow.h" #include "CloseConfirmationWindow.h" #include "JournalWindow.h" #include "RulesSubsystem.h" #include "QuestBook.h" #include "WindowManager.h" #include "Combat.h" #include "GameLoop.h" #include "ActorManager.h" #include "Actor.h" #include "World.h" #include "ScriptObjectRepository.h" // BEGIN TEST #include "Person.h" #include "CharacterSheetWindow.h" #include "GameObject.h" #include "Action.h" #include "ActionChoiceWindow.h" #include "ActionManager.h" #include "DsaManager.h" #include "DialogWindow.h" #include "PlaylistWindow.h" #include "Primitive.h" // END TEST template<> rl::UiSubsystem* Singleton<rl::UiSubsystem>::ms_Singleton = 0; namespace rl { const char* UiSubsystem::CEGUI_ROOT = "RootWindow"; UiSubsystem& UiSubsystem::getSingleton(void) { return Singleton<UiSubsystem>::getSingleton(); } UiSubsystem* UiSubsystem::getSingletonPtr(void) { return Singleton<UiSubsystem>::getSingletonPtr(); } UiSubsystem::UiSubsystem() : mCharacterController(0), mHero(0), mCharacter(0), mInCombat(false) { Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Init Start"); initializeUiSubsystem(); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Init Ende"); } UiSubsystem::~UiSubsystem() { delete Console::getSingletonPtr(); delete InputManager::getSingletonPtr(); GameLoopManager::getSingleton().removeSynchronizedTask(mCharacterController); delete mCharacterController; } void UiSubsystem::initializeUiSubsystem( void ) { using namespace CEGUI; Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Initialisiere UI", "UiSubsystem::initializeUiSubsystem"); World* world = CoreSubsystem::getSingleton().getWorld(); SceneManager* sceneMgr = world->getSceneManager(); Ogre::RenderWindow* window = Ogre::Root::getSingleton().getAutoCreatedWindow(); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Initialisiere CEGUI-Renderer", "UiSubsystem::initializeUiSubsystem"); OgreCEGUIRenderer* rend = new OgreCEGUIRenderer(window, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, sceneMgr); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Initialisiere CEGUI-System", "UiSubsystem::initializeUiSubsystem"); new System(rend, NULL, new OgreCEGUIResourceProvider(), (utf8*)"cegui.config"); CEGUI::Logger::getSingleton().setLoggingLevel(rl::Logger::getSingleton().getCeGuiLogDetail()); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "CEGUI-System initialisiert", "UiSubsystem::initializeUiSubsystem"); // load scheme and set up defaults ///@todo Hier sollte was Lookunabhängiges rein!!! FIXME TODO BUG! System::getSingleton().setDefaultMouseCursor((utf8*)"RastullahLook-Images", (utf8*)"MouseArrow"); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Mauszeiger", "UiSubsystem::initializeUiSubsystem"); Window* sheet = CEGUI::WindowManager::getSingleton().createWindow((utf8*)"DefaultGUISheet", (utf8*)CEGUI_ROOT); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Rootfenster", "UiSubsystem::initializeUiSubsystem"); sheet->setSize( Absolute, CEGUI::Size(Ogre::Root::getSingleton().getAutoCreatedWindow()->getWidth(), Ogre::Root::getSingleton().getAutoCreatedWindow()->getHeight())); sheet->setPosition(Absolute, CEGUI::Point(0, 0)); System::getSingleton().setGUISheet(sheet); System::getSingleton().setTooltip("RastullahLook/Tooltip"); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "CEGUI geladen", "UiSubsystem::initializeUiSubsystem"); //Initializing InputManager new InputManager(); new CommandMapper(); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "UI-Manager geladen", "UiSubsystem::initializeUiSubsystem"); InputManager::getSingleton().loadKeyMapping("keymap-german.xml"); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Keymap geladen", "UiSubsystem::initializeUiSubsystem"); new WindowManager(); new Console(); new DebugWindow(); ((RubyInterpreter*)CoreSubsystem::getSingleton().getInterpreter() )->initializeInterpreter( (VALUE(*)(...))&UiSubsystem::consoleWrite ); new TargetSelectionWindow(); mGameLogger = new GameLoggerWindow(); mCharacterStateWindow = new CharacterStateWindow(); mInGameMenuWindow = new InGameMenuWindow(); mCharacterSheet = new CharacterSheetWindow(); mJournalWindow = new JournalWindow(); RulesSubsystem::getSingleton().getQuestBook()->addQuestChangeListener(mJournalWindow); // runTest(); } void UiSubsystem::requestExit() { Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Start", "UiSubsystem::requestExit"); (new CloseConfirmationWindow())->setVisible(true); } void UiSubsystem::writeToConsole(Ogre::String text) { Console::getSingleton().write(text); } VALUE UiSubsystem::consoleWrite(VALUE self, VALUE str) { if (Console::getSingletonPtr()) { Console::getSingleton().write(RubyInterpreter::val2ceguistr(str) + " \n"); } return Qnil; } Person* UiSubsystem::getActiveCharacter() { return mCharacter; } void UiSubsystem::setActiveCharacter(Person* person) { // Nur wenn es sich verändert hat if( person != mCharacter ) { if( mCharacter != NULL ) { ScriptObjectRepository::getSingleton().disown( mCharacter ); GameLoopManager::getSingleton().removeSynchronizedTask(mCharacterController); delete mCharacterController; } ScriptObjectRepository::getSingleton().own( person ); mCharacter = person; Actor* camera = ActorManager::getSingleton().getActor("DefaultCamera"); mCharacterController = new CharacterController(camera, person->getActor()); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "CharacterController created."); GameLoopManager::getSingleton().addSynchronizedTask(mCharacterController, FRAME_STARTED ); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "CharacterController task added."); World* world = CoreSubsystem::getSingletonPtr()->getWorld(); world->setActiveActor(person->getActor()); mCharacterStateWindow->setCharacter(person); mCharacterStateWindow->update(); Logger::getSingleton().log(Logger::UI, Ogre::LML_TRIVIAL, "Actor set"); } } void UiSubsystem::showActionChoice(GameObject* obj) { ActionChoiceWindow* w = new ActionChoiceWindow(UiSubsystem::getSingleton().getActiveCharacter()); int numActions = w->showActionsOfObject(obj); if (numActions > 0) w->setVisible(true); } void UiSubsystem::useDefaultAction(GameObject* obj, Creature* actor) { obj->doAction(obj->getDefaultAction(actor), actor, NULL); //TODO: Target } void UiSubsystem::usePickedObjectDefaultActions() { GameObject* pickedObject = InputManager::getSingleton().getPickedObject(); if (pickedObject != NULL) useDefaultAction(pickedObject, getActiveCharacter()); } void UiSubsystem::closeCurrentWindow() { CeGuiWindow* wnd = rl::WindowManager::getSingleton().getTopWindow(); if (wnd != NULL && !wnd->isModal()) { wnd->setVisible(false); rl::WindowManager::getSingleton().handleMovedToBack(wnd); } } void UiSubsystem::showCharacterActionChoice() { showActionChoice(getActiveCharacter()); } void UiSubsystem::showPickedObjectActions() { GameObject* pickedObject = InputManager::getSingleton().getPickedObject(); if (pickedObject != NULL) showActionChoice(pickedObject); } void UiSubsystem::showContainerContent(Container* container) { ContainerContentWindow* wnd = new ContainerContentWindow(container); wnd->setVisible(true); } bool UiSubsystem::showInputOptionsMenu(Creature* actionHolder) { CommandMapperWindow* wnd = new CommandMapperWindow(actionHolder, InputManager::getSingleton().getCommandMapper()); wnd->setVisible(true); return true; } void UiSubsystem::showMessageWindow(const CeGuiString& message) { MessageWindow* w = new MessageWindow(); w->setText(message); w->setVisible(true); } void UiSubsystem::showMainMenu() { (new MainMenuWindow())->setVisible(true); } void UiSubsystem::showTargetWindow() { TargetSelectionWindow::getSingleton().setAction(NULL); TargetSelectionWindow::getSingleton().setVisible(true); } void UiSubsystem::showDialog(DialogCharacter* bot) { if (bot->getDialogCharacter() == NULL) bot->setDialogCharacter(getActiveCharacter()); (new DialogWindow(bot, mGameLogger))->setVisible(true); } void UiSubsystem::toggleConsole() { Console* cons = Console::getSingletonPtr(); cons->setVisible(!cons->isVisible()); } void UiSubsystem::toggleDebugWindow() { DebugWindow* dbgwnd = DebugWindow::getSingletonPtr(); dbgwnd->setVisible(!dbgwnd->isVisible()); } void UiSubsystem::toggleGameLogWindow() { mGameLogger->setVisible(!mGameLogger->isVisible()); } void UiSubsystem::toggleObjectPicking() { InputManager::getSingleton().setObjectPickingActive(true); } void UiSubsystem::showCharacterSheet() { if (mCharacterSheet->isVisible()) { mCharacterSheet->setCharacter(NULL); mCharacterSheet->setVisible(false); } else { mCharacterSheet->setCharacter(getActiveCharacter()); mCharacterSheet->setVisible(true); } } void UiSubsystem::showJournalWindow() { if (mJournalWindow->isVisible()) { mJournalWindow->setVisible(false); } else { mJournalWindow->setVisible(true); } } void UiSubsystem::showAboutWindow() { (new AboutWindow())->setVisible(true); } void UiSubsystem::showCharacterSheet(Person* chara) { CharacterSheetWindow* wnd = new CharacterSheetWindow(); wnd->setCharacter(chara); wnd->setVisible(true); } void UiSubsystem::showDescriptionWindow(GameObject* obj) { MessageWindow* wnd = new MessageWindow(); wnd->setText(obj->getDescription()); wnd->setVisible(true); } void UiSubsystem::toggleCharacterStateWindow() { mCharacterStateWindow->setVisible(!mCharacterStateWindow->isVisible()); } void UiSubsystem::toggleInGameGlobalMenu() { mInGameMenuWindow->setVisible(!mInGameMenuWindow->isVisible()); } void UiSubsystem::startCombat(Combat* combat) { setCombatMode(true); int group = combat->getGroupOf(getActiveCharacter()); (new CombatWindow(combat, group))->setVisible(true); } void UiSubsystem::setCombatMode(bool inCombat) { mInCombat = inCombat; //TODO: Irgendwann später, UI auf Kampfmodus umstellen } bool UiSubsystem::isInCombatMode() { return mInCombat; } void UiSubsystem::runTest() { } void UiSubsystem::update() { mInGameMenuWindow->update(); } CharacterController* UiSubsystem::getCharacterController() { return mCharacterController; } GameLoggerWindow* UiSubsystem::getGameLogger() { return mGameLogger; } void UiSubsystem::showPlaylist() { PlaylistWindow* wnd = new PlaylistWindow(); wnd->setVisible(true); } }
[ "blakharaz@4c79e8ff-cfd4-0310-af45-a38c79f83013" ]
[ [ [ 1, 422 ] ] ]
ef4e68421983200580e5e2bd48b7c1a30c0fb599
4466fd0571a0c60b55a6f217db97ce3fbd1a41c9
/tools/convertmakefile.cpp
7b7cb50c57e1fde29408e4c7d092d7366c901783
[]
no_license
kasonibare42/mspms2
bf286d028a3258e38a2a2b930ec2010abedda8a1
87361c02b1f47a23d383d972d163a8b4fd71393e
refs/heads/master
2020-03-23T13:26:40.617333
2009-02-09T10:12:27
2009-02-09T10:12:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,929
cpp
#include <string> #include <iostream> #include <iomanip> #include <fstream> using namespace std; int main(int argc, char* argv[]) { int iPos; ifstream inFile; ofstream outFile; string strLine; int iTasos; inFile.open("Makefile.win"); if (!inFile) { cout << "Unable to open file"; exit(1); // terminate with error } outFile.open("Makefile",ofstream::out); if (!outFile) { cout << "Unable to open file"; exit(1); // terminate with error } while (!inFile.eof()) { getline(inFile,strLine,'\n'); /////////////////////////////////////////////////////// // delete ////////////////////////////////////////////////////// //$(RES) -> N/A iPos=-1; iPos=strLine.find("$(RES)"); if (iPos!=-1) { strLine.erase(iPos); } //WINDRES -> N/A iPos=-1; iPos=strLine.find("WINDRES"); if (iPos!=-1) { strLine.erase(iPos); } //RES -> N/A iPos=-1; iPos=strLine.find("RES"); if (iPos!=-1) { strLine.erase(iPos); } //CXXINCS -> N/A iPos=-1; iPos=strLine.find("CXXINCS"); if (iPos!=-1) { strLine.erase(iPos); } //$(INCS) -> N/A iPos=-1; iPos=strLine.find("$(INCS)"); if (iPos!=-1) { strLine.erase(iPos,7); } //INCS -> N/A iPos=-1; iPos=strLine.find("INCS"); if (iPos!=-1) { strLine.erase(iPos); } //$(CXXFLAGS) -> N/A iPos=-1; iPos=strLine.find("$(CXXFLAGS)"); if (iPos!=-1) { strLine.erase(iPos); } //CXXFLAGS -> N/A iPos=-1; iPos=strLine.find("CXXFLAGS"); if (iPos!=-1) { strLine.erase(iPos); } ////////////////////////////////////////////////////// // replace ////////////////////////////////////////////////////// //# Makefile -> convertmakefile comments iPos=-1; iPos=strLine.find("# Makefile"); if (iPos!=-1) { strLine.erase(iPos); strLine.append("# Makefile converted by convertmakefile"); } //gcc.exe -> gcc iPos=-1; iPos=strLine.find("gcc.exe"); if (iPos!=-1) { strLine.replace(iPos,7,"gcc"); } //g++.exe -> gcc iPos=-1; iPos=strLine.find("g++.exe"); if (iPos!=-1) { strLine.replace(iPos,7,"g++"); } // .exe -> .x this has to be done after gcc and g++ changes iPos=-1; iPos=strLine.find(".exe"); if (iPos!=-1) { strLine.replace(iPos,4,".x"); } // LIBS -> ... iPos=-1; iPos=strLine.find("LIBS ="); if (iPos!=-1) { iTasos=-1; iTasos=strLine.find("libtasos.a"); strLine.erase(iPos); strLine.append("LIBS = "); if (iTasos!=-1){ strLine.append("mylibtasos/libtasos.a "); } strLine.append("-static -lgfortran -lgsl -lgslcblas -lm"); } cout<<strLine<<endl; outFile<<strLine<<endl; } inFile.close(); return 0; }
[ "ywangd@9d4abd89-f43f-0410-b58a-db57313e21a5" ]
[ [ [ 1, 146 ] ] ]
557d61e6eddd119f7f188620761dcd1f56e0bcbb
814b49df11675ac3664ac0198048961b5306e1c5
/Code/Engine/Sound/include/SoundManager.h
787ec8b50bd4a697bb17babe4f6762b52f0e68cd
[]
no_license
Atridas/biogame
f6cb24d0c0b208316990e5bb0b52ef3fb8e83042
3b8e95b215da4d51ab856b4701c12e077cbd2587
refs/heads/master
2021-01-13T00:55:50.502395
2011-10-31T12:58:53
2011-10-31T12:58:53
43,897,729
0
0
null
null
null
null
UTF-8
C++
false
false
1,888
h
#pragma once #ifndef _SOUND_MANAGER_ #define _SOUND_MANAGER_ #include "base.h" class CSoundManager : public CBaseControl { public: CSoundManager() : m_iCurrentMusic(0) {}; ~CSoundManager() {Done();}; bool Init(const string& _szFile); void PlaySample(const string& _szSample); void StopSample(const string& _szSample); void SetSampleVolume(const string& _szSample, float _fVolume); void PlaySample3D(const string& _szSample, Vect3f _vPosition); void ChangeMusic(const string& _szMusic, unsigned long _ulFadeOutTimeMs, bool _bRestart = true); void PlayMusic(const string& _szMusic, bool _bRestart = true); void StopMusic(const string& _szMusic); float GetMusicRemainingTime(const string& _szMusicName); void SetMusic3DPosition(const string& _szMusic, const Vect3f& _vSoundEmmiterPosition); void UpdateSound3DSystem(const Vect3f& _vListenerPosition, const Vect3f& _vListenerDirection); void StopAll(); void StopMusics(); void StopSounds(); void PauseSamples(); void ResumeSamples(); void SetMasterVolume(float _fVolume); void Pause(const string& _szMusic); void Resume(const string& _szMusic); void FadeMusicVolume(const string& _szMusic, float _fVolume, unsigned long _iTimeMs); private: void Release(); struct SSoundChannel { float m_fVolume; unsigned long m_iHandle; SSoundChannel(unsigned long _iChannel, float _fVolume) : m_iHandle(_iChannel), m_fVolume(_fVolume) {}; }; SSoundChannel* GetSample(const string& _szSample); SSoundChannel* GetMusic(const string& _szMusic); map<string,SSoundChannel*> m_mapSamples; map<string,SSoundChannel*> m_mapMusics; vector<SSoundChannel*> m_vMusics; vector<SSoundChannel*> m_vSamples; int m_iCurrentMusic; //int m_iCurrentSample; //int m_iMaxChannels; //int m_iMusicChannels; }; #endif
[ "sergivalls@576ee6d0-068d-96d9-bff2-16229cd70485", "mudarra@576ee6d0-068d-96d9-bff2-16229cd70485" ]
[ [ [ 1, 22 ], [ 24, 64 ] ], [ [ 23, 23 ] ] ]
3be60962c8cfaffac1e2052fa6c29f6637f59bf9
27d5670a7739a866c3ad97a71c0fc9334f6875f2
/CPP/Modules/TcpSymbianSerial/symbian-r6/TcpSocketEngine.h
f1d6b08d7497b3ef2ce27229c6f67c9ee458e418
[ "BSD-3-Clause" ]
permissive
ravustaja/Wayfinder-S60-Navigator
ef506c418b8c2e6498ece6dcae67e583fb8a4a95
14d1b729b2cea52f726874687e78f17492949585
refs/heads/master
2021-01-16T20:53:37.630909
2010-06-28T09:51:10
2010-06-28T09:51:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
13,054
h
/* Copyright (c) 1999 - 2010, Vodafone Group Services Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Vodafone Group Services Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef TCPSYMBIANENGINE_H #define TCPSYMBIANENGINE_H #include <e32std.h> #include <e32base.h> #include <es_sock.h> #include <in_sock.h> #ifndef SYMBIAN_9 # include <agentclient.h> #endif #include "TimeOutNotify.h" #include "Module.h" #include "DNSCache.h" //#if defined NAV2_CLIENT_UIQ3 || defined __WINS__ || defined __WINSCW__ #if defined __WINS__ || defined __WINSCW__ //neither RCONNECTION nor RAGENT #elif defined SYMBIAN_7S //symbian7.0s and later use rconnection # define RCONNECTION # include <commdbconnpref.h> #elif defined SYMBIAN_7 //symbian 7 and earlier use ragent # define RAGENT #else # error You want either RCONNECTION or RAGENT here. namespace isab { class LogMaster; class Log; } #endif namespace isab { class LogMaster; class Log; } /** Timeout for all Tcp operations. */ static const TInt KTimeOut = 30000000; // 130 seconds time-out /** Panic string for CTcpSymbianEngine.*/ _LIT(KEchoEngine, "TSSEngine"); /**Panics for CTcpSymbianEngine, CTcpSymbianRead, and CTcpSymbianWrite.*/ enum TEchoPanic{ /** trying to switch server while connected */ ESwitchServer = 0, /** Write called while not connected */ EWriteNotConnected = 1, /** Write called while writer is active. */ EWriteActive = 2, /** Unhandled state in DoCancel. */ EBadCancelStatus = 3, /** Read called while not connected. */ EReadNotConnected = 4, /** Unhandled state in RunL. */ EBadEngineState = 5, /** Unhandled state in Stop. */ EBadEngineStopState = 6, /** Unhandled state in CTcpSymbianRead::RunL */ EUnhandledReadStatus = 7, /** Unhandled state in CTcpSymbianWrite::RunL */ EUnhandledWriteStatus = 8, /** Unhandled write state in CTcpSymbianWrite::RunL. */ EBadWriteState = 9, }; /** CTcpSymbianEngine: main engine class for connection and shutdown */ class CTcpSymbianEngine : public CActive, public MTimeOutNotify { public: /** Engine status enumeration */ enum TEchoEngineState{ EComplete = 0,/** Ready for new connection. */ EConnecting = 1,/** Waiting for socket connect */ EConnected = 2,/** Socket is connected, data transfer in progress.*/ ETimedOut = 3,/** An operation timed out. */ ELinking = 4,/** Connecting to link layer (GRPS) */ ELinkFailed = 5,/** Link layer connection failed. */ ELookingUp = 6,/** Waiting on DNS lookup completion. */ ELookUpFailed = 7,/** DNS lookup has failed */ EConnectFailed = 8,/** Socket connect failed. */ EClosing = 9,/** Waiting for socket shutdown. */ EBroken = 10,/** Connection was broken. */ ESwitching = 11,/** Switching server. Set while the closing * part of the switching is in progress. */ EClosed = 12,/** Socket was closed by other end, or proxy. */ }; /** @name Constructors and destructor.*/ //@{ private: ///Constructor. ///@param aConsole CTcpSymbianEngine(class MTcpSymbianSocketUser& aConsole); ///Second phase constructor. void ConstructL(class isab::LogMaster* aLogMaster); public: ///Static constructor. ///@param aConsole pointer to datareceiver class. ///@return a new CTcpSymbianEngine object. static class CTcpSymbianEngine* NewL(class MTcpSymbianSocketUser& aConsole, class isab::LogMaster* aLogMaster); ///Static constructor. ///@param aConsole pointer to datareceiver class. ///@return a new CTcpSymbianEngine object, that has been pushed to the /// cleanup stack. static class CTcpSymbianEngine* NewLC(class MTcpSymbianSocketUser& aConsole, class isab::LogMaster* aLogMaster); ///Virtual destructor. virtual ~CTcpSymbianEngine(); //@} ///Close any current connection. Report the connection as closed by ///request to iConsole. void Stop(); ///Close any current connection. Report the reason for the closed ///connection based on arguments. ///@param aState the enginestate to set. Handled in the next /// invocation of RunL. void Stop(enum TEchoEngineState aState); ///Start an asynchronous socket connection operation. Also start ///the timeout timer. ///@param aAddr the IP number of the remote host. ///@param aPort the port to connect to. void Connect(TUint32 aAddr, TUint aPort); ///Widens the host name to a UCS16 string and then calls the other ///ConnectL function. ///@param aServerName the name of the remote host. ///@param aPort the port to connect to. ///@param aIAP the IAP to use for the link layer connection. ///@param aConsiderWLAN Whether to consider WLAN IAP/APN for this /// connection. void ConnectL(const TDesC8& aServerName, TUint aPort, TInt aIAP, TBool aConsiderWLAN); /** * Set the iHostName, iIAP, and iPort values and call ConnectL(). * @param aServerName the name of the remote host. * @param aPort the port to connect to. * @param aIAP the IAP to use for the link layer connection. * @param aConsiderWLAN Whether to consider WLAN IAP/APN for this * connection. */ void ConnectL(const TDesC& aServerName, TUint aPort, TInt aIAP, TBool aConsiderWLAN); private: /** * Start the connection sequence (link, lookup, connect) using the * current values of iHostName, iPort, and iIAP. If the enginstate * is anything but EComplete nothing will happen and the next * message on queue will be signalled. */ void ConnectL(); public: ///Tests whether the current engine state is EConnected. ///@return ETrue if the engine state is EConnected, EFalse otherwise. TBool IsConnected(); ///Triggers a callback to MTcpSymbianSocketUser::ConnectionNotify. void Query(); private: ///Start an asynchronous DNS lookup operation of the host in the ///iHostName member variable. Uses a timeout timer. void StartLookupL(); ///Starts an asynchronous link layer connection operation and a ///companion timeout timer. This operation will use the IAP index ///stored in iIAP. void OpenLinkLayerL(); ///Starts an asynchronous link layer connection operation using the ///RConnection class. This function is a no-op for the except UIQ ///and S60v1 platforms. void OpenLinkLayerConnectionL(); ///Starts an asynchronous link layer connection operation using the ///RGenricAgent class. This function is a no-op for all platforms ///except UIQ and S60v1. void OpenLinkLayerAgentL(); /** * Just completes immideately with KErrNone. Used when we don't * want neither RConnection nor RGenericAgent. */ void OpenFakeLinkLayerL(); ///Close the link layer. void CloseLinkLayer(); ///Opens a tcp sockets. Leaves if there is any error. void OpenSocketL(); ///Opens a tcp socket. ///@return the return value of RSocket::Open. TInt OpenSocket(); public: ///Start an asynchronous write operation. If this funciton is ///called while a write operation is outstanding, the thread will ///panic. ///@param aData the data to write. CTcpSymbianEngine takes ownership of /// the HBufC8 object. void Write(HBufC8* aData); private: ///Start an asynchronous read operation. void Read(); void CompleteSelf(TInt aCompleteStatus); ///@name Implemented functions from MTimeOutNotify ///Used by the timeout timers for link, lookup, and connect operations. //@{ void TimerExpired(); //@} ///@name Implemented functions from CActive //@{ void DoCancel(); void RunL(); TInt RunError(TInt aError); //@} private: ///Reset the engine so that it is ready for new connections. ///When this function returns, the state will be set to EComplete. ///May leave if RSocket::Open fails. ///@param aDuring the state during this function call void ResetL(enum TEchoEngineState aDuring); ///Reset the engine so that it is ready for new connections. Calls ///MTcpSymbianSocketUser::ConnectionNotify with the connection state ///variable set to DISCONNECTING and the reason value from this ///function's argument. When this function returns, the state will ///be set to EComplete. ///May leave if RSocket::Open fails. ///@param aDuring the state during this function call ///@param aReason the value of the reason argument in the call to //// ConnectionNotify void ResetL(enum TEchoEngineState aDuring, enum isab::Module::ConnectionNotifyReason aReason); ///Returns the current state. Protected by a RCriticalSection. ///@return the current value of iEngineStatus; enum TEchoEngineState EngineState(); ///Sets the state. Protected by a RCriticalSection. ///@param aState the new value of iEngineStatus; void SetEngineState(enum TEchoEngineState aState); /** * Sets the member variables iHostName, iPort, and iIAP from the * three arguments. * @param aServerName The new servername. * @param aPort The new port. * @param aIAP The new IAP. * @param aConsiderWLAN The new considerWLAN setting. */ void SetConnectionParamsL(const TDesC& aServerName, TUint aPort, TInt aIAP, TBool aConsiderWLAN); ///Log object class isab::Log* iLog; ///Critical region used to protect iEngineStatus. class RCriticalSection iCritical; ///The state machine variable. enum TEchoEngineState iEngineStatus; ///Used to report read data, completed writes, and connection status. class MTcpSymbianSocketUser& iConsole; ///Active object for reads. class CTcpSymbianRead* iEchoRead; ///Active object for reads. class CTcpSymbianWrite* iEchoWrite; ///The Socket handle. class RSocket iEchoSocket; ///The socket server handle class RSocketServ iSocketServ; # ifdef RCONNECTION ///The Link layer handle for S80, S90, and S60v2 class RConnection iConnection; ///Preferences when starting the connection manager. class TCommDbConnPref iPrefs; # elif defined RAGENT ///The Link layer handle for UIQ and S60v2 class RGenericAgent* iAgent; ///Link layes settings. class CStoreableOverrideSettings *iCommsOverrides; ///Preferences when starting the connection manager. class CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref iPrefs; # else //use neither # endif /** Cache of looked-up hosts. */ class RDNSCache iDNSCache; ///DNS lookup handle. class RHostResolver iResolver; ///A descriptor layer for the TNameRecord. TNameEntry iNameEntry; //this is a typedef for TPckgBuf<TNameRecord> ///Timer used to stop uncompleted link, lookup, or connect operations. class CTimeOutTimer* iTimer; ///The timeout time in microseconds. TInt iTimeOut; ///The remote host IP address. class TInetAddr iAddress; ///The remote host name. HBufC* iHostName; ///The TCP port of the remote host. TUint iPort; ///The IAP to use. TInt iIAP; /** Whether to consider WLAN IAP/APN or not. */ TBool iConsiderWLAN; }; #endif
[ [ [ 1, 323 ] ] ]
67b2c295247bbb03f1b77dc8d4098bfa4dbef6c8
94c1c7459eb5b2826e81ad2750019939f334afc8
/source/DIAEDITZBGS.h
addc0043bb19738ea24a77086fc6b927bbab04a0
[]
no_license
wgwang/yinhustock
1c57275b4bca093e344a430eeef59386e7439d15
382ed2c324a0a657ddef269ebfcd84634bd03c3a
refs/heads/master
2021-01-15T17:07:15.833611
2010-11-27T07:06:40
2010-11-27T07:06:40
37,531,026
1
3
null
null
null
null
UTF-8
C++
false
false
2,669
h
#include "CTaiShanDoc.h" #if !defined(AFX_DIAEDITZBGS_H__482F9B44_D07B_11D2_908D_0000E8593F1A__INCLUDED_) #define AFX_DIAEDITZBGS_H__482F9B44_D07B_11D2_908D_0000E8593F1A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // DIAEDITZBGS.h : header file // ///////////////////////////////////////////////////////////////////////////// // CDialogEDITZBGS dialog class CDialogEDITZBGS : public CDialog { public: BOOL CheckParmNameInput(CString parname,CString & errormessage); BOOL CheckParmInput(CString parminput); void ShowData(CString &str,float fdata); float StringToFloat(CString str); CString FloatToString(float input); CDialogEDITZBGS(CWnd* pParent = NULL); int item ; BYTE numPara; CFormularContent* jishunow; RECT datarect; int errorposition; CString errormessage; CString functionstr; CString help; int addpos; //{{AFX_DATA(CDialogEDITZBGS) enum { IDD = IDD_EDIT_ZBGS }; CEdit m_namecor; CButtonST m_hfqs; CButtonST m_ztdj; CEdit m_edit41cor; CEdit m_edit31cor; CEdit m_edit21cor; CEdit m_edit11cor; CEdit m_inputcor; CEdit m_edit24cor; CEdit m_edit44cor; CEdit m_edit43cor; CEdit m_edit42cor; CEdit m_edit34cor; CEdit m_edit33cor; CEdit m_edit32cor; CEdit m_edit23cor; CEdit m_edit22cor; CEdit m_edit14cor; CEdit m_edit13cor; CEdit m_edit12cor; CEdit m_passwordcor; CEdit m_xlinecor; CString m_name; CString m_password; CString m_input; CString m_edit11; CString m_edit21; CString m_edit31; CString m_edit41; CString m_edit12; CString m_edit13; CString m_edit14; CString m_edit22; CString m_edit23; CString m_edit24; CString m_edit32; CString m_edit33; CString m_edit34; CString m_edit42; CString m_edit43; CString m_edit44; CString m_xline; CString m_explainbrief; BOOL m_checkmm; //}}AFX_DATA //{{AFX_VIRTUAL(CDialogEDITZBGS) protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL protected: //{{AFX_MSG(CDialogEDITZBGS) virtual BOOL OnInitDialog(); afx_msg void OnCheckmm(); virtual void OnOK(); afx_msg void OnCsgs(); afx_msg void OnPaint(); afx_msg void OnDyhs(); afx_msg void OnHfqs(); afx_msg void OnMyhelp(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DIAEDITZBGS_H__482F9B44_D07B_11D2_908D_0000E8593F1A__INCLUDED_)
[ [ [ 1, 112 ] ] ]
ac6e9974b44eb0b7a44a67881dc0834f5c3bc14f
832308585885780b9c30ad188e48d3da2ed92011
/Sonority.ESE/BrowseTable.cpp
4a07d8f54ea2456a37514a6978c2a6bda1112a47
[]
no_license
NathanHowell/Sonority
8248163bdd31f4f5517076b7474d2bf2210959fc
015cf4ce1d950c07193f738e43007be29d0ca655
refs/heads/master
2016-08-07T23:00:16.057177
2010-02-16T17:35:07
2010-02-16T17:35:07
519,218
7
1
null
null
null
null
UTF-8
C++
false
false
4,195
cpp
// // Copyright (c) 2007 Sonority // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // #include "stdafx.h" #include "BrowseTable.h" #include "JetException.h" using namespace System; using namespace System::IO; using namespace System::IO::Compression; using namespace System::Text; using namespace System::Xml; using namespace System::Xml::XPath; BrowseTable::BrowseTable( JET_SESID sesid, JET_DBID dbid) : JetTableHelper(sesid, dbid, "Browse") { _objectID = GetColumn("ObjectID", JET_coltypBinary, 16, JET_bitColumnNotNULL); _updateID = GetColumn("UpdateID", JET_coltypUnsignedLong, 0, JET_bitColumnNotNULL); _updateDateTime = GetColumn("UpdateDateTime", JET_coltypDateTime, sizeof(DATE), JET_bitColumnNotNULL); _metaData = GetColumn("MetaData", JET_coltypLongBinary, 4 * 1024, JET_bitColumnNotNULL); EnsureIndex(ObjectIndex, "+ObjectID\0", JET_bitIndexPrimary | JET_bitIndexUnique | JET_bitIndexDisallowTruncation | JET_bitIndexLazyFlush); } BrowseTable::~BrowseTable() { delete _objectID; delete _updateID; delete _updateDateTime; delete _metaData; } void BrowseTable::UpdateRecord( String^ objectID, String^ parentID, UInt32 updateID, XPathNavigator^ metaData) { array<Byte>^ hashObjectID = HashString(objectID); pin_ptr<Byte> pinnedObjectID = &hashObjectID[0]; array<Byte>^ hashParentID = HashString(parentID); pin_ptr<Byte> pinnedParentID = &hashParentID[0]; DATE updateTime = DateTime::UtcNow.ToOADate(); JET_ERR err; err = JetCall(JetSetCurrentIndex(_sesid, _tableid, ObjectIndex)); err = JetCall(JetMakeKey(_sesid, _tableid, pinnedObjectID, hashObjectID->Length, JET_bitNewKey)); err = JetSeek(_sesid, _tableid, JET_bitSeekEQ); if (err == JET_errRecordNotFound) { Console::WriteLine("Adding: {0}", objectID); // use XPathNavigator::WriteSubtree to promote metadata namespaces? StringBuilder outerXml; XmlWriter^ writer = XmlWriter::Create(%outerXml); metaData->WriteSubtree(writer); writer->Flush(); MemoryStream stream(512); GZipStream gzip(%stream, CompressionMode::Compress); gzip.Write(Encoding::UTF8->GetBytes(outerXml.ToString()), 0, outerXml.Length); gzip.Flush(); array<Byte>^ compressedMetaData = stream.GetBuffer(); pin_ptr<Byte> pinnedMetaData = &compressedMetaData[0]; err = JetCall(JetPrepareUpdate(_sesid, _tableid, JET_prepInsert)); try { err = JetCall(JetSetColumn(_sesid, _tableid, _objectID->columnid, pinnedObjectID, hashObjectID->Length, 0, NULL)); err = JetCall(JetSetColumn(_sesid, _tableid, _updateID->columnid, &updateID, sizeof(updateID), 0, NULL)); err = JetCall(JetSetColumn(_sesid, _tableid, _updateDateTime->columnid, &updateTime, sizeof(updateTime), 0, NULL)); err = JetCall(JetSetColumn(_sesid, _tableid, _metaData->columnid, pinnedMetaData, static_cast<unsigned long>(stream.Length), 0, NULL)); err = JetCall(JetUpdate(_sesid, _tableid, NULL, 0, NULL)); } catch (JetException^) { JetPrepareUpdate(_sesid, _tableid, JET_prepCancel); throw; } } else { Console::WriteLine("Skipping: {0}", objectID); JetCall(err); } }
[ [ [ 1, 110 ] ] ]
78e8381ca2dcd42e6edab8b7e2038880f8cefb85
1eb441701fc977785b13ea70bc590234f4a45705
/nukak3d/src/nkPipedProcess.cpp
7a90339b4f11953cbeb875252e59dbb5f48ea32b
[]
no_license
svn2github/Nukak3D
942947dc37c56fc54245bbc489e61923c7623933
ec461c40431c6f2a04d112b265e184d260f929b8
refs/heads/master
2021-01-10T03:13:54.715360
2011-01-18T22:16:52
2011-01-18T22:16:52
47,416,318
1
2
null
null
null
null
ISO-8859-2
C++
false
false
4,420
cpp
/** * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * The Original Code is Copyright (C) 2007-2010 by Bioingenium Research Group. * Bogota - Colombia * All rights reserved. * * Author(s): Alexander Pinzón Fernández. * * ***** END GPL LICENSE BLOCK ***** */ /** * @file nkPipedProcess.cpp * @brief Piped Process. * @details Clases for manage extern process. * @author Alexander Pinzón Fernandez * @version 0.1 * @date 26/01/2009 04:04 p.m. */ #include "nkPipedProcess.h" nkPipedProcess::nkPipedProcess(wxWindow *parent, const wxString& cmd, wxProcess *process) : wxDialog( parent, wxID_ANY, "nkDicom: " + cmd,wxDefaultPosition, wxSize(400,150)), m_process(process), m_in(*process->GetInputStream()), m_err(*process->GetErrorStream()){ m_process->SetNextHandler(this); new wxStaticText(this, wxID_ANY, wxString(_("\nNukak3D: "))<<cmd<< wxString(_("\nProcess Your Request...")),wxPoint(20,10) ); m_ok = new wxButton(this, wxID_OK, _("Wait a moment..."),wxPoint(60,70)); new wxButton(this, wxID_CANCEL, _("Cancel"),wxPoint(180,70)); m_ok->Disable(); m_textIn = ""; m_textErr = ""; } BEGIN_EVENT_TABLE(nkPipedProcess, wxDialog) EVT_CLOSE(nkPipedProcess::OnClose) EVT_END_PROCESS(wxID_ANY, nkPipedProcess::OnProcessTerm) //EVT_BUTTON(nkPipedProcess::ID_DO_GET, nkPipedProcess::DoGetEvent) END_EVENT_TABLE() void nkPipedProcess::DoGet(){ if(m_process){ DoGetFromStream(m_textIn, m_in); DoGetFromStream(m_textErr, m_err); } } void nkPipedProcess::DoGetFromStream(wxString & text, wxInputStream& in){ while ( in.CanRead() ){ wxChar buffer[4096]; buffer[in.Read(buffer, WXSIZEOF(buffer) - 1).LastRead()] = _T('\0'); text.Append(buffer); } } void nkPipedProcess::DoClose(){ m_process->CloseOutput(); } void nkPipedProcess::OnClose(wxCloseEvent& event){ if ( m_process ){ wxProcess *process = m_process; m_process = NULL; process->SetNextHandler(NULL); process->CloseOutput(); } event.Skip(); } void nkPipedProcess::OnProcessTerm(wxProcessEvent& WXUNUSED(event)){ DoGet(); m_ok->SetLabel(_("Ok")); m_ok->Enable(true); delete m_process; m_process = NULL; } nkPipedProcessThread::nkPipedProcessThread(wxWindow *parent, const wxString &cmd, wxProcess *process) :nkPipedProcess(parent, cmd, process){ //nkThreadPipedProcess * mithread = new nkThreadPipedProcess(this); nkThreadPipedProcess * myThread = new nkThreadPipedProcess(this); //if ( mithread->Create() != wxTHREAD_NO_ERROR ){ if ( myThread->Create() != wxTHREAD_NO_ERROR ){ wxLogError(wxT("Can't create thread!")); } //mithread->Run(); myThread->Run(); } BEGIN_EVENT_TABLE(nkPipedProcessThread, nkPipedProcess) EVT_BUTTON(nkPipedProcessThread::ID_DO_GET, nkPipedProcessThread::DoGetEvent) END_EVENT_TABLE() void nkPipedProcessThread::DoGetEvent(wxCommandEvent & WXUNUSED(event)){ DoGet(); } nkThreadPipedProcess::nkThreadPipedProcess(nkPipedProcessThread * a_myPP) : wxThread(){ myPP = a_myPP; } void nkThreadPipedProcess::OnExit(){ myPP = NULL; } void *nkThreadPipedProcess::Entry() { while(true){ if ( TestDestroy() ) break; if(myPP ){ //mySCP->DoGet(); wxCommandEvent event( wxEVT_COMMAND_BUTTON_CLICKED, nkPipedProcessThread::ID_DO_GET); event.SetInt( nkPipedProcessThread::ID_DO_GET); // send in a thread-safe way wxPostEvent(this->myPP, event ); } wxThread::Sleep(200); } myPP = NULL; return NULL; }
[ "apinzonf@4b68e429-1748-0410-913f-c2fc311d3372" ]
[ [ [ 1, 148 ] ] ]
751bc7fa3356fa7eb657b13ffee8f2bd910077eb
ef23e388061a637f82b815d32f7af8cb60c5bb1f
/src/emu/speaker.h
5b25ef4fd6d2535511853f9d4fad1af0486896e1
[]
no_license
marcellodash/psmame
76fd877a210d50d34f23e50d338e65a17deff066
09f52313bd3b06311b910ed67a0e7c70c2dd2535
refs/heads/master
2021-05-29T23:57:23.333706
2011-06-23T20:11:22
2011-06-23T20:11:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,026
h
/*************************************************************************** speaker.h Speaker output sound device. **************************************************************************** Copyright Aaron Giles All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name 'MAME' nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ #pragma once #ifndef __EMU_H__ #error Dont include this file directly; include emu.h instead. #endif #ifndef __SPEAKER_H__ #define __SPEAKER_H__ //************************************************************************** // DEVICE CONFIGURATION MACROS //************************************************************************** // add/remove speakers #define MCFG_SPEAKER_ADD(_tag, _x, _y, _z) \ MCFG_DEVICE_ADD(_tag, SPEAKER, 0) \ speaker_device_config::static_set_position(device, _x, _y, _z); \ #define MCFG_SPEAKER_STANDARD_MONO(_tag) \ MCFG_SPEAKER_ADD(_tag, 0.0, 0.0, 1.0) #define MCFG_SPEAKER_STANDARD_STEREO(_tagl, _tagr) \ MCFG_SPEAKER_ADD(_tagl, -0.2, 0.0, 1.0) \ MCFG_SPEAKER_ADD(_tagr, 0.2, 0.0, 1.0) //************************************************************************** // TYPE DEFINITIONS //************************************************************************** // ======================> speaker_device_config class speaker_device_config : public device_config, public device_config_sound_interface { friend class speaker_device; // construction/destruction speaker_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); public: // allocators static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); virtual device_t *alloc_device(running_machine &machine) const; // inline configuration helpers speaker_device_config *next_speaker() const { return downcast<speaker_device_config *>(typenext()); } static void static_set_position(device_config *device, double x, double y, double z); protected: // inline configuration state double m_x; double m_y; double m_z; }; // ======================> speaker_device class speaker_device : public device_t, public device_sound_interface { friend class speaker_device_config; friend resource_pool_object<speaker_device>::~resource_pool_object(); // construction/destruction speaker_device(running_machine &_machine, const speaker_device_config &config); virtual ~speaker_device(); public: // getters speaker_device *next_speaker() const { return downcast<speaker_device *>(typenext()); } // internally for use by the sound system void mix(INT32 *leftmix, INT32 *rightmix, int &samples_this_update, bool suppress); protected: // device-level overrides virtual void device_start(); virtual void device_post_load(); // sound interface overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); // internal state const speaker_device_config &m_config; sound_stream * m_mixer_stream; // mixing stream #ifdef MAME_DEBUG INT32 m_max_sample; // largest sample value we've seen INT32 m_clipped_samples; // total number of clipped samples INT32 m_total_samples; // total number of samples #endif }; // device type definition extern const device_type SPEAKER; #endif /* __SOUND_H__ */
[ "Mike@localhost" ]
[ [ [ 1, 142 ] ] ]
a9da507af870d000c2e4d5deac7bcd361949bdb5
eb869f3bc7728e55b5bd6ab2ad5f2a25e7f2a0a6
/S60_V32/TraceRedirection/src/traceredirect.cpp
ed261f529d6391bd94d4c1fee0ab44565bd2c2f3
[]
no_license
runforu/musti-emulator
257420f505a519113fe7c529a3eaeda4e91d918c
0254eb549e5e0ec8e8a0a4da796b5652268aa17c
refs/heads/master
2020-05-19T07:49:09.924331
2010-11-30T06:28:37
2010-11-30T06:28:37
32,321,074
0
1
null
null
null
null
UTF-8
C++
false
false
10,640
cpp
/* ======================================================================== Name : d_traceredirect.cpp Author : DH Copyright : All right is reserved! Version : E-Mail : [email protected] Description : Copyright (c) 2009-2015 DH. This material, including documentation and any related computer programs, is protected by copyright controlled BY Du Hui(DH) ======================================================================== */ #include <kernel.h> #include <kern_priv.h> #include "d_traceredirect.h" _LIT(KLddName,"TRACEREDIRECTION"); const TInt KMajorVersionNumber = 0; const TInt KMinorVersionNumber = 1; const TInt KBuildVersionNumber = 1; const TInt KMaxTraceLength = 255; const TInt KTraceBufferSize = 256; const TInt KTraceBufferSizeMask = 0xff; const TInt KWaitTime = 0; // "NTimer::OneShot(TInt aTime, TDfc& aDfc);" is supported since S60 V5.0 // So we just use NTimer::OneShot(TInt aTime); #define DFC_CALLBACK class DTraceRedirect; class TTraceEvent { public: TInt iLength; TUint8 iText[KMaxTraceLength]; }; class DTraceEventHandler : public DKernelEventHandler { public: DTraceEventHandler() : DKernelEventHandler( HandleEvent, this ) { } TInt Create( DLogicalDevice* aDevice ); ~DTraceEventHandler(); TInt GetNextTrace( DThread* aClientThread, TDes8* aClientDes, TInt aMaxLength ); private: static TUint HandleEvent( TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis ); void HandleUserTrace( TText* aStr, TInt aLen ); public: DTraceRedirect *iChannel; TTraceEvent *iTraceBuffer; TInt iFront; TInt iBack; DMutex* iLock; // serialise calls to handler DLogicalDevice* iDevice; // open reference to LDD for avoiding lifetime issues }; TInt DTraceEventHandler::Create( DLogicalDevice* aDevice ) { TInt r; r = aDevice->Open(); if( r != KErrNone ) return r; iDevice = aDevice; iFront = 0; iBack = 0; iTraceBuffer = new TTraceEvent[KTraceBufferSize]; if( iTraceBuffer == NULL ) return KErrNoMemory; _LIT(KDataMutexName, "EventHandlerMutex"); r = Kern::MutexCreate( iLock, KDataMutexName, KMutexOrdDebug ); if( r != KErrNone ) return r; return Add(); } DTraceEventHandler::~DTraceEventHandler() { if( iLock ) iLock->Close( NULL); delete[] iTraceBuffer; if( iDevice ) iDevice->Close( NULL); } TUint DTraceEventHandler::HandleEvent( TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis ) { if( aEvent == EEventUserTrace ) { ( (DTraceEventHandler*) aThis )->HandleUserTrace( (TText*) a1, (TInt) a2 ); return ETraceHandled; } return ERunNext; } // called in CS void DTraceEventHandler::HandleUserTrace( TText* aStr, TInt aLen ) { Kern::MutexWait( *iLock ); TInt frontplus1 = ( iFront + 1 ) & KTraceBufferSizeMask; if( frontplus1 != iBack ) // check overflow { TTraceEvent *e = &iTraceBuffer[iFront]; TInt len = aLen; if( len > KMaxTraceLength ) { len = KMaxTraceLength; } XTRAPD(r, XT_DEFAULT, kumemget(e->iText, aStr, len)); if( r == KErrNone ) e->iLength = len; else e->iLength = -1; // an error will be reported in GetNextTrace() iFront = frontplus1; } Kern::MutexSignal( *iLock ); } TInt DTraceEventHandler::GetNextTrace( DThread*aClientThead, TDes8 *aClientDes, TInt aMaxLength ) { if( iBack == iFront ) { // buffer empty return KErrNotReady; } TTraceEvent *e = &iTraceBuffer[iBack]; if( e->iLength == -1 ) { return KErrCorrupt; } else { TInt len = aMaxLength; if( e->iLength < aMaxLength ) len = e->iLength; TPtr8 ptr( e->iText, len, aMaxLength ); Kern::ThreadDesWrite( aClientThead, (TAny*) aClientDes, ptr, 0 ); iBack = ( iBack + 1 ) & KTraceBufferSizeMask; } return KErrNone; } class DTraceRedirect : public DLogicalChannelBase { public: virtual ~DTraceRedirect(); DTraceRedirect(); #ifdef DFC_CALLBACK static void RxTimerDfc( TAny* aPtr ); #else static void RxTimerCallBack(TAny* aPtr); #endif protected: virtual TInt DoCreate( TInt aUnit, const TDesC8* anInfo, const TVersion& aVer ); virtual TInt Request( TInt aFunction, TAny* a1, TAny* a2 ); private: TInt DoRequest( TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2 ); TInt DoCancel( TInt aReqMask ); TInt DoControl( TInt aFunction, TAny* a1, TAny* a2 ); TInt DoRead(); public: DTraceEventHandler *iEventHandler; TRequestStatus* iClientRequestStatus; DThread* iClientThread; NTimer iRxTimer; #ifdef DFC_CALLBACK TDfc iRxCompleteDfc; #endif TDes8*iClientDes; TInt iClientDesMaxLength; }; TInt DTraceRedirect::DoCreate( TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer ) /** Create channel */ { if( !Kern::QueryVersionSupported( TVersion( KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber ), aVer ) ) return KErrNotSupported; #ifdef DFC_CALLBACK iRxCompleteDfc.SetDfcQ( Kern::TimerDfcQ() ); #endif iEventHandler = new DTraceEventHandler; if( iEventHandler == NULL ) return KErrNoMemory; return iEventHandler->Create( iDevice ); } DTraceRedirect::DTraceRedirect() : #ifdef DFC_CALLBACK iRxCompleteDfc( DTraceRedirect::RxTimerDfc, this, 2 ), iRxTimer( NULL, this ) #else iRxTimer(DTraceRedirect::RxTimerCallBack, this) #endif { iClientThread = &Kern::CurrentThread(); ( (DObject*) iClientThread )->Open(); } DTraceRedirect::~DTraceRedirect() { iRxTimer.Cancel(); iEventHandler->Close(); Kern::SafeClose( (DObject*&) iClientThread, NULL); } #ifndef DFC_CALLBACK void DTraceRedirect::RxTimerCallBack(TAny* aPtr) { DTraceRedirect *pChannel = (DTraceRedirect*)aPtr; pChannel->DoRead(); } #else void DTraceRedirect::RxTimerDfc( TAny* aPtr ) { DTraceRedirect *pChannel = (DTraceRedirect*) aPtr; pChannel->DoRead(); } #endif TInt DTraceRedirect::Request( TInt aFunction, TAny* a1, TAny* a2 ) { TInt r = KErrNone; if( aFunction == KMaxTInt ) { // DoCancel r = DoCancel( TInt( a1 ) ); } if( aFunction < 0 ) { // DoRequest TAny* arg[2]; kumemget32( arg, a2, 2 * sizeof(TAny*) ); r = DoRequest( ~aFunction, (TRequestStatus*) ( a1 ), arg[0], arg[1] ); } else { // DoControl r = DoControl( aFunction, a1, a2 ); } return r; } TInt DTraceRedirect::DoCancel( TInt aReqMask ) { if( !iClientRequestStatus ) { return KErrNone; } #ifdef DFC_CALLBACK iRxCompleteDfc.Cancel(); #endif iRxTimer.Cancel(); Kern::RequestComplete( iClientThread, iClientRequestStatus, KErrCancel ); iClientRequestStatus = 0; return KErrNone; } TInt DTraceRedirect::DoRequest( TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2 ) { TInt r = KErrNone; if( iClientRequestStatus ) { Kern::ThreadKill( iClientThread, EExitPanic, ERequestAlreadyPending, KLitKernExec ); return ( KErrNotSupported ); } switch( aReqNo ) { case RTraceRedirect::ERequestReadTrace: iClientRequestStatus = aStatus; iClientDes = (TDes8*) a1; iClientDesMaxLength = (TInt) a2; if( iClientDes == NULL || a2 == 0 ) { Kern::RequestComplete( iClientThread, aStatus, KErrArgument ); iClientDes = 0; iClientDesMaxLength = 0; } else { r = DoRead(); } break; default: Kern::RequestComplete( iClientThread, aStatus, KErrCancel ); r = KErrCancel; } return r; } TInt DTraceRedirect::DoControl( TInt aFunction, TAny* a1, TAny* a2 ) { switch( aFunction ) { } return KErrNone; } TInt DTraceRedirect::DoRead() { TInt r = iEventHandler->GetNextTrace( iClientThread, iClientDes, iClientDesMaxLength ); if( r != KErrNotReady ) { Kern::RequestComplete( iClientThread, iClientRequestStatus, r ); iClientRequestStatus = 0; iClientDes = 0; } else { // wait it #ifdef DFC_CALLBACK iRxTimer.OneShot( NKern::TimerTicks( KWaitTime ), iRxCompleteDfc ); #else iRxTimer.OneShot( NKern::TimerTicks( KWaitTime ), ETrue ); #endif } return r; } class DTraceRedirectFactory : public DLogicalDevice { public: DTraceRedirectFactory(); virtual TInt Install(); virtual void GetCaps( TDes8& aDes ) const; virtual TInt Create( DLogicalChannelBase*& aChannel ); }; // // DTraceRedirectFactory // DTraceRedirectFactory::DTraceRedirectFactory() { iVersion = TVersion( KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber ); } TInt DTraceRedirectFactory::Create( DLogicalChannelBase*& aChannel ) /** Create a new DSchedhookTest on this logical device */ { aChannel = new DTraceRedirect; return aChannel ? KErrNone : KErrNoMemory; } TInt DTraceRedirectFactory::Install() /** Install the LDD - overriding pure virtual */ { return SetName( &KLddName ); } void DTraceRedirectFactory::GetCaps( TDes8& aDes ) const /** Get capabilities - overriding pure virtual */ { TCapsTestV01 b; b.iVersion = TVersion( KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber ); aDes.FillZ( aDes.MaxLength() ); aDes.Copy( (TUint8*) &b, Min( aDes.MaxLength(), sizeof( b ) ) ); } DECLARE_STANDARD_LDD() { return new DTraceRedirectFactory; }
[ "[email protected]@c3ffc87a-496d-339f-d77d-193528aa0bc0" ]
[ [ [ 1, 417 ] ] ]
b85ede99288b14a2adb23fc67e76ac224e1fa953
22d9640edca14b31280fae414f188739a82733e4
/Code/VTK/include/vtk-5.2/vtkBoxClipDataSet.h
7ef994ff77f7d77a37efe511769e9b76230e776d
[]
no_license
tack1/Casam
ad0a98febdb566c411adfe6983fcf63442b5eed5
3914de9d34c830d4a23a785768579bea80342f41
refs/heads/master
2020-04-06T03:45:40.734355
2009-06-10T14:54:07
2009-06-10T14:54:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,254
h
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile: vtkBoxClipDataSet.h,v $ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /*---------------------------------------------------------------------------- Copyright (c) Sandia Corporation See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. ----------------------------------------------------------------------------*/ // .NAME vtkBoxClipDataSet - clip an unstructured grid // // .SECTION Description // Clipping means that is actually 'cuts' through the cells of the dataset, // returning tetrahedral cells inside of the box. // The output of this filter is an unstructured grid. // // This filter can be configured to compute a second output. The // second output is the part of the cell that is clipped away. Set the // GenerateClippedData boolean on if you wish to access this output data. // // The vtkBoxClipDataSet will triangulate all types of 3D cells (i.e, create tetrahedra). // This is necessary to preserve compatibility across face neighbors. // // To use this filter,you can decide if you will be clipping with a box or a hexahedral box. // 1) Set orientation // if(SetOrientation(0)): box (parallel with coordinate axis) // SetBoxClip(xmin,xmax,ymin,ymax,zmin,zmax) // if(SetOrientation(1)): hexahedral box (Default) // SetBoxClip(n[0],o[0],n[1],o[1],n[2],o[2],n[3],o[3],n[4],o[4],n[5],o[5]) // PlaneNormal[] normal of each plane // PlanePoint[] point on the plane // 2) Apply the GenerateClipScalarsOn() // 3) Execute clipping Update(); #ifndef __vtkBoxClipDataSet_h #define __vtkBoxClipDataSet_h #include "vtkUnstructuredGridAlgorithm.h" class vtkCell3D; class vtkCellArray; class vtkCellData; class vtkDataArray; class vtkDataSetAttributes; class vtkIdList; class vtkGenericCell; class vtkPointData; class vtkPointLocator; class vtkPoints; class VTK_GRAPHICS_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm { public: vtkTypeRevisionMacro(vtkBoxClipDataSet,vtkUnstructuredGridAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Constructor of the clipping box. static vtkBoxClipDataSet *New(); // Description // Specify the Box with which to perform the clipping. // If the box is not parallel to axis, you need to especify // normal vector of each plane and a point on the plane. void SetBoxClip(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); void SetBoxClip(const double *n0, const double *o0, const double *n1, const double *o1, const double *n2, const double *o2, const double *n3, const double *o3, const double *n4, const double *o4, const double *n5, const double *o5); // Description: // If this flag is enabled, then the output scalar values will be // interpolated, and not the input scalar data. vtkSetMacro(GenerateClipScalars,int); vtkGetMacro(GenerateClipScalars,int); vtkBooleanMacro(GenerateClipScalars,int); // Description: // Control whether a second output is generated. The second output // contains the polygonal data that's been clipped away. vtkSetMacro(GenerateClippedOutput,int); vtkGetMacro(GenerateClippedOutput,int); vtkBooleanMacro(GenerateClippedOutput,int); // Description: // Set the tolerance for merging clip intersection points that are near // the vertices of cells. This tolerance is used to prevent the generation // of degenerate primitives. Note that only 3D cells actually use this // instance variable. //vtkSetClampMacro(MergeTolerance,double,0.0001,0.25); //vtkGetMacro(MergeTolerance,double); // Description: // Return the Clipped output. vtkUnstructuredGrid *GetClippedOutput(); virtual int GetNumberOfOutputs(); // Description: // Specify a spatial locator for merging points. By default, an // instance of vtkMergePoints is used. void SetLocator(vtkPointLocator *locator); vtkGetObjectMacro(Locator,vtkPointLocator); // Description: // Create default locator. Used to create one when none is specified. The // locator is used to merge coincident points. void CreateDefaultLocator(); // Description: // Return the mtime also considering the locator. unsigned long GetMTime(); vtkGetMacro(Orientation,unsigned int); vtkSetMacro(Orientation,unsigned int); static void InterpolateEdge(vtkDataSetAttributes *attributes, vtkIdType toId, vtkIdType fromId1, vtkIdType fromId2, double t); void MinEdgeF(const unsigned int *id_v, const vtkIdType *cellIds, unsigned int *edgF ); void PyramidToTetra(const vtkIdType *pyramId, const vtkIdType *cellIds, vtkCellArray *newCellArray); void WedgeToTetra(const vtkIdType *wedgeId, const vtkIdType *cellIds, vtkCellArray *newCellArray); void CellGrid(vtkIdType typeobj, vtkIdType npts, const vtkIdType *cellIds, vtkCellArray *newCellArray); void CreateTetra(vtkIdType npts, const vtkIdType *cellIds, vtkCellArray *newCellArray); void ClipBox(vtkPoints *newPoints,vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *tets,vtkPointData *inPD, vtkPointData *outPD,vtkCellData *inCD,vtkIdType cellId, vtkCellData *outCD); void ClipHexahedron(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipBoxInOut(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); void ClipHexahedronInOut(vtkPoints *newPoints,vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); void ClipBox2D(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipBoxInOut2D(vtkPoints *newPoints,vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); void ClipHexahedron2D(vtkPoints *newPoints,vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipHexahedronInOut2D(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,vtkIdType cellId, vtkCellData **outCD); void ClipBox1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *lines, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipBoxInOut1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **lines, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); void ClipHexahedron1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *lines, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipHexahedronInOut1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **lines, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); void ClipBox0D(vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *verts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipBoxInOut0D(vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **verts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); void ClipHexahedron0D(vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray *verts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD); void ClipHexahedronInOut0D(vtkGenericCell *cell, vtkPointLocator *locator, vtkCellArray **verts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD); protected: vtkBoxClipDataSet(); ~vtkBoxClipDataSet(); virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); virtual int FillInputPortInformation(int port, vtkInformation *info); vtkPointLocator *Locator; int GenerateClipScalars; int GenerateClippedOutput; //double MergeTolerance; double BoundBoxClip[3][2]; unsigned int Orientation; double PlaneNormal[6][3]; //normal of each plane double PlanePoint[6][3]; //point on the plane private: vtkBoxClipDataSet(const vtkBoxClipDataSet&); // Not implemented. void operator=(const vtkBoxClipDataSet&); // Not implemented. }; #endif
[ "nnsmit@9b22acdf-97ab-464f-81e2-08fcc4a6931f" ]
[ [ [ 1, 246 ] ] ]
d8fc4a422ee77cdd054994bb7de36b06ffabbbe7
7d4527b094cfe62d9cd99efeed2aff7a8e8eae88
/TalkTom/TalkTom/TextToRead.cpp
8e11c9fafdac4aa55c6366d865d57c3ba583df49
[]
no_license
Evans22/talktotom
a828894df42f520730e6c47830946c8341b230dc
4e72ba6021fdb3a918af1df30bfe8642f03b1f07
refs/heads/master
2021-01-10T17:11:10.132971
2011-02-15T12:53:00
2011-02-15T12:53:00
52,947,431
1
0
null
null
null
null
UTF-8
C++
false
false
19,458
cpp
#include "stdafx.h" #include "TextToRead.h" /******************************************************* //auxiliary string function *******************************************************/ int isequal(WCHAR *s, WCHAR *t); //************************************ // Description: // to test whether target is contained in source, the function // returns the first index of the substring, or -1 indicating // no match //************************************ int SubStringIndex(WCHAR *source, WCHAR *target) { int i=0,j=0; WCHAR *s2; while(source[i]!='\0') { s2=&source[i]; if(isequal(s2,target)) return i; i++; } return -1; } int isequal(WCHAR *s,WCHAR *t) { int i=0; while(t[i]!='\0') { if(CharLower((PTSTR)s[i]) != CharLower((PTSTR)t[i])) break; i++; } if(t[i]=='\0') return 1; else return 0; } CTextToRead::CTextToRead() { //initialize com CoInitialize( NULL ); HRESULT hr = _InitSapi(); // Set the default output format if( SUCCEEDED( hr ) ) { CComPtr<ISpStreamFormat> cpStream; HRESULT hrOutputStream = m_cpVoice->GetOutputStream(&cpStream); if (hrOutputStream == S_OK) { CSpStreamFormat Fmt; hr = Fmt.AssignFormat(cpStream); if (SUCCEEDED(hr)) { m_CurrentStreamFormat = Fmt.ComputeFormatEnum(); } } } // Set default voice data if( SUCCEEDED(hr)) { hr = m_cpVoice->GetVoice(&m_currentVoiceToken); } // Get default rate if( SUCCEEDED( hr ) ) { hr = m_cpVoice->GetRate( &m_Rate ); } // Get default volume if( SUCCEEDED( hr ) ) { hr = m_cpVoice->GetVolume( &m_Volume ); } if ( SUCCEEDED( hr ) ) { SpCreateDefaultObjectFromCategoryId( SPCAT_AUDIOOUT, &m_cpOutAudio ); } m_bStop = m_bPause = false; m_pszwFileText = NULL; // we make the relation between SPSTREAMFORMAT(only for some formats) and the index this->_makeRelation(); //If any SAPI initialization failed, shut down! if (!SUCCEEDED(hr)) { //TRACE(TEXT("Error in initial SAPI\n")); return; } } HRESULT CTextToRead::_InitSapi() { HRESULT hr = m_cpVoice.CoCreateInstance( CLSID_SpVoice ); return hr; } //************************************ // Method: _ChangeVoice // FullName: CTextToRead::_ChangeVoice // Access: public // Returns: bool // param: pToken // Description: // If the new voice is different from the one that's currently // selected, it first stops any synthesis that is going on and // sets the new voice on the global voice object. //************************************ bool CTextToRead::_ChangeVoice(ISpObjectToken* pToken) { HRESULT hr = S_OK; GUID* pguidAudioFormat = NULL; int iFormat = 0; // Get the token associated with the selected voice //Determine if it is the current voice CComPtr<ISpObjectToken> pOldToken; hr = m_cpVoice->GetVoice( &pOldToken ); if (SUCCEEDED(hr)) { if (pOldToken != pToken) { // Stop speaking. This is not necessary, for the next call to work, // but just to show that we are changing voices. hr = m_cpVoice->Speak( NULL, SPF_PURGEBEFORESPEAK, 0); //// Get the id of the VOICE //WCHAR* pszTokenIds; //hr = pToken->GetId(&pszTokenIds); //CoTaskMemFree(pszTokenIds); // And set the new voice on the global voice object if (SUCCEEDED (hr) ) { hr = m_cpVoice->SetVoice( pToken ); } } } return SUCCEEDED(hr); } bool CTextToRead::_ChangeVoice(WCHAR * voice) { HRESULT hr = S_OK; ISpObjectToken * pToken = NULL; this->_GetVoice(voice, &pToken); if (pToken != NULL) { hr = this->_ChangeVoice(pToken); } return SUCCEEDED(hr); } bool CTextToRead::_NotifyWindowMessage( HWND hWnd, UINT message ) { if (hWnd == NULL) { return false; } m_message = message; HRESULT hr = S_OK; if ( !m_cpVoice ) { hr = E_FAIL; } // Set the notification message for the voice if ( SUCCEEDED( hr ) ) { // note that the TTS's window message is the responsiblity of IspVoice m_cpVoice->SetNotifyWindowMessage( hWnd, message, 0, 0 ); } // We're interested in all TTS events if( SUCCEEDED( hr ) ) { hr = m_cpVoice->SetInterest( SPFEI_ALL_TTS_EVENTS, SPFEI_ALL_TTS_EVENTS ); } return SUCCEEDED(hr); } //************************************ // Method: ReadTheFile // FullName: CTextToRead::ReadTheFile // Access: private // Returns: HRESULT // Qualifier: // Parameter: TCHAR * szFileName // Parameter: BOOL * bIsUnicode // Parameter: WCHAR * * ppszwBuff // Description: // This file opens and reads the contents of a file. It // returns a pointer to the string. // Warning, this function allocates memory for the string on // the heap so the caller must free it with 'delete'. //************************************ HRESULT CTextToRead::_ReadTheFile( TCHAR* szFileName, BOOL* bIsUnicode, WCHAR** ppszwBuff ) { // Open up the file and copy it's contents into a buffer to return HRESULT hr = 0; HANDLE hFile; DWORD dwSize = 0; DWORD dwBytesRead = 0; // First delete any memory previously allocated by this function if( m_pszwFileText ) { delete [] m_pszwFileText; } hFile = CreateFile( szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY, NULL ); if( hFile == INVALID_HANDLE_VALUE ) { *ppszwBuff = NULL; hr = E_FAIL; } if( SUCCEEDED( hr ) ) { dwSize = GetFileSize( hFile, NULL ); if( dwSize == 0xffffffff ) { *ppszwBuff = NULL; hr = E_FAIL; } } if( SUCCEEDED( hr ) ) { // Read the file contents into a wide buffer and then determine // if it's a unicode or ascii file WCHAR Signature = 0; ReadFile( hFile, &Signature, 2, &dwBytesRead, NULL ); // Check to see if its a unicode file by looking at the signature of the first character. if( 0xFEFF == Signature ) { *ppszwBuff = new WCHAR [dwSize/2]; *bIsUnicode = TRUE; ReadFile( hFile, *ppszwBuff, dwSize-2, &dwBytesRead, NULL ); (*ppszwBuff)[dwSize/2-1] = NULL; CloseHandle( hFile ); } else // MBCS source { char* pszABuff = new char [dwSize+1]; *ppszwBuff = new WCHAR [dwSize+1]; *bIsUnicode = FALSE; SetFilePointer( hFile, NULL, NULL, FILE_BEGIN ); ReadFile( hFile, pszABuff, dwSize, &dwBytesRead, NULL ); pszABuff[dwSize] = NULL; ::MultiByteToWideChar( CP_ACP, 0, pszABuff, -1, *ppszwBuff, dwSize + 1 ); delete( pszABuff ); CloseHandle( hFile ); } } return hr; } void CTextToRead::_ReadFromFile( TCHAR* szFileName, BOOL* bIsUnicode) { this->_ReadTheFile(szFileName, bIsUnicode, &m_pszwFileText); this->_ReadText(m_pszwFileText); //we allocate it in ReadTheFile delete [] m_pszwFileText; m_pszwFileText = NULL; } void CTextToRead::_ReadText( WCHAR* pszwBuff ) { HRESULT hr = S_OK; m_bStop = FALSE; // only get the string if we're not paused if( !m_bPause ) { hr = m_cpVoice->Speak( pszwBuff, SPF_ASYNC | SPF_IS_NOT_XML , NULL ); } m_bPause = FALSE; // Set state to run hr = m_cpVoice->Resume(); } void CTextToRead::_PauseRestartRead() { if( !m_bStop ) { if( !m_bPause ) { // Pause the voice... m_cpVoice->Pause(); m_bPause = TRUE; } else { // Restart the voice... m_cpVoice->Resume(); m_bPause = FALSE; } } } //************************************ // Method: StopRead // FullName: CTextToRead::StopRead // Access: public // Returns: void // Qualifier: // Description: // Stop reading, and resets global audio state to stopped //************************************ void CTextToRead::_StopRead() { // Stop current rendering with a PURGEBEFORESPEAK... HRESULT hr = m_cpVoice->Speak( NULL, SPF_PURGEBEFORESPEAK, 0 ); m_bPause = FALSE; m_bStop = TRUE; } bool CTextToRead::_PlayWave( TCHAR* szFileName ) { //not checking the accuracy of the file type if (szFileName == NULL) { return false; } CComPtr<ISpStream> cpWavStream; // User helper function found in sphelper.h to open the wav file and // get back an IStream pointer to pass to SpeakStream HRESULT hr = SPBindToFile( szFileName, SPFM_OPEN_READONLY, &cpWavStream ); if( SUCCEEDED( hr ) ) { hr = m_cpVoice->SpeakStream( cpWavStream, SPF_ASYNC, NULL ); } return SUCCEEDED(hr); } bool CTextToRead::_SaveToWavFile( WCHAR* szFileName, WCHAR* wszTextToSave ) { if (szFileName == NULL) { return false; } //check weather the last 3 character of szFileName is 'wav' int length = wcslen(szFileName); WCHAR * temp = szFileName + (length - 3); if (wcscmp(temp, TEXT("wav")) != 0) { // temp is not 'wav' return false; } USES_CONVERSION; CComPtr<ISpStreamFormat> cpOldStream; CComPtr<ISpStream> cpWavStream; CSpStreamFormat OriginalFmt; HRESULT hr = m_cpVoice->GetOutputStream( &cpOldStream ); if (hr == S_OK) { hr = OriginalFmt.AssignFormat(cpOldStream); } else { hr = E_FAIL; } // User SAPI helper function in sphelper.h to create a wav file if (SUCCEEDED(hr)) { hr = SPBindToFile( szFileName, SPFM_CREATE_ALWAYS,\ &cpWavStream, &OriginalFmt.FormatId(), \ OriginalFmt.WaveFormatExPtr() ); } if( SUCCEEDED( hr ) ) { // Set the voice's output to the wav file instead of the speakers hr = m_cpVoice->SetOutput(cpWavStream, TRUE); } if ( SUCCEEDED( hr ) ) { // Do the Speak, now the target is wav file rather than speakers this->_ReadText(wszTextToSave); } // Set output back to original stream // Wait until the speak is finished if saving to a wav file so that // the smart pointer cpWavStream doesn't get released before its // finished writing to the wav. m_cpVoice->WaitUntilDone( INFINITE ); cpWavStream.Release(); // Reset output m_cpVoice->SetOutput( cpOldStream, FALSE ); if ( SUCCEEDED( hr ) ) { return true; } else { return false; } } CTextToRead::~CTextToRead() { // delete any allocated memory if( m_pszwFileText ) { delete [] m_pszwFileText; } // Release voice, if created if ( m_cpVoice ) { m_cpVoice->SetNotifySink(NULL); m_cpVoice.Release(); } // Release outaudio, if created if(m_cpOutAudio) { m_cpOutAudio.Release(); } // Unload COM CoUninitialize(); } HRESULT CTextToRead::_GetVoice( WCHAR * voice , ISpObjectToken ** ppGotToken) { *ppGotToken = NULL; HRESULT hr; ISpObjectToken * pToken; // NOTE: Not a CComPtr! Be Careful. CComPtr<IEnumSpObjectTokens> cpEnum; hr = SpEnumTokens(SPCAT_VOICES, NULL, NULL, &cpEnum); if (hr == S_OK) { bool fSetDefault = false; while (cpEnum->Next(1, &pToken, NULL) == S_OK) { CSpDynamicString dstrDesc; hr = SpGetDescription(pToken, &dstrDesc); if (SUCCEEDED(hr)) { WCHAR * temp = dstrDesc.Copy(); if ( -1 != SubStringIndex(temp, voice) ) { //the voice is what we need. Set this voice *ppGotToken = pToken; break; } } if (FAILED(hr)) { pToken->Release(); } } } else { hr = SPERR_NO_MORE_ITEMS; } return hr; } HRESULT CTextToRead::_SetOutStreamFormat( SPSTREAMFORMAT format ) { HRESULT hr = E_FAIL; SPSTREAMFORMAT eFmt = format; CSpStreamFormat Fmt; Fmt.AssignFormat(eFmt); if ( m_cpOutAudio ) { hr = m_cpOutAudio->SetFormat( Fmt.FormatId(), Fmt.WaveFormatExPtr() ); m_CurrentStreamFormat = format; } else { hr = E_FAIL; } if( SUCCEEDED( hr ) ) { hr = m_cpVoice->SetOutput( m_cpOutAudio, FALSE ); } return hr; } HRESULT CTextToRead::_SetOutStreamFormat( int khz, int bit, bool bMono ) { // combine the three parameter into a SPSTREAMFORMAT form phrase //WCHAR swTempFormat[25]; //swprintf(swTempFormat, L"SPSF_%dkHz%dBit%s", khz, bit, bMono?L"Mono":L"Stereo"); HRESULT hr = E_FAIL; int length = m_vStreamFormat.size(); for (int i = 0;i < length;i++) { if( m_vStreamFormat[i].m_khz == khz && m_vStreamFormat[i].m_bit == bit && m_vStreamFormat[i].m_bMono == bMono) { hr = this->_SetOutStreamFormat((SPSTREAMFORMAT)m_vStreamFormat[i].m_index); break; } } return hr; } //************************************ // Method: _RegisterMessageFunc // FullName: CTextToRead::_RegisterMessageFunc // Access: public // Returns: void // Qualifier: // Parameter: UINT message message // Parameter: * func callback function // Parameter: DWORD * param parameter passed into func // Description: //************************************ void CTextToRead::_RegisterMessageFunc( UINT message, bool (*pFunc)(void *, void*), DWORD * pParam ) { MESSAGE_MAP message_map(message, pFunc, pParam); m_MessageMap.push_back(message_map); } bool CTextToRead::_UnRegisterMessage( UINT message ) { bool bFind = false; for (std::vector<MESSAGE_MAP>::iterator it = m_MessageMap.begin(); it != m_MessageMap.end(); it++) { if (message == it->m_message) { m_MessageMap.erase(it); bFind = true; break; } } return bFind; } //************************************ // Method: _DealMessage // FullName: CTextToRead::_DealMessage // Access: public // Returns: int // Qualifier: // Parameter: UINT message // Description: // if _DealMessage returns -1, it means that we do not have the corresponding // message dealing function. if it returns 0 or 1, it means the dealing function // returns it. //************************************ int CTextToRead::_DealMessage(UINT message) { int iDeal = -1; if (message == m_message) { //it is the message that we want CSpEvent event; // helper class in sphelper.h for events that releases any // allocated memory in it's destructor - SAFER than SPEVENT while( event.GetFrom(m_cpVoice) == S_OK ) { for (std::vector<MESSAGE_MAP>::iterator it = m_MessageMap.begin(); it != m_MessageMap.end(); it++) { if (event.eEventId == it->m_message) { iDeal = (int) (it->m_pFunc(it->m_pParam, NULL)); break; } } } } return iDeal; } void CTextToRead::_makeRelation() { STREAMFORMAT streamFormat; streamFormat.Generate(SPSF_8kHz8BitMono, 8, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_8kHz16BitMono, 8, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_8kHz16BitStereo, 8, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_11kHz8BitMono, 11, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_11kHz8BitStereo, 11, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_11kHz16BitMono, 11, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_11kHz16BitStereo, 11, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_12kHz8BitMono, 12, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_12kHz8BitStereo, 12, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_12kHz16BitMono, 12, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_12kHz16BitStereo, 12, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_16kHz8BitMono, 16, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_16kHz8BitStereo, 16, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_16kHz16BitMono, 16, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_16kHz16BitStereo, 16, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_22kHz8BitMono, 22, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_22kHz8BitStereo, 22, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_22kHz16BitMono, 22, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_22kHz16BitStereo, 22, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_24kHz8BitMono, 24, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_24kHz8BitStereo, 24, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_24kHz16BitMono, 24, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_24kHz16BitStereo, 24, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_32kHz8BitMono, 32, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_32kHz8BitStereo, 32, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_32kHz16BitMono, 32, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_32kHz16BitStereo, 32, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_44kHz8BitMono, 44, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_44kHz8BitStereo, 44, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_44kHz16BitMono, 44, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_44kHz16BitStereo, 44, 16, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_48kHz8BitMono, 48, 8, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_48kHz8BitStereo, 48, 8, false); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_48kHz16BitMono, 48, 16, true); m_vStreamFormat.push_back(streamFormat); streamFormat.Generate(SPSF_48kHz16BitStereo, 48, 16, false); m_vStreamFormat.push_back(streamFormat); } bool CTextToRead::_GetVoiceList(WCHAR ** ppVoiceDesArr, int* pWordsLengthArr, ULONG& numOfVoice) { HRESULT hr = E_FAIL; ISpObjectToken * pToken; // NOTE: Not a CComPtr! Be Careful. CComPtr<IEnumSpObjectTokens> cpEnum; hr = SpEnumTokens(SPCAT_VOICES, NULL, NULL, &cpEnum); if (hr == S_OK) { cpEnum->GetCount(&numOfVoice); if (ppVoiceDesArr == NULL && pWordsLengthArr == NULL) { // we only focus on the number of available voices return true; } // then get descriptions and indexes int uIndex = 0; while (cpEnum->Next(1, &pToken, NULL) == S_OK) { CSpDynamicString dstrDesc; hr = SpGetDescription(pToken, &dstrDesc); if ( SUCCEEDED(hr)) { WCHAR * temp = dstrDesc.Copy(); if (pWordsLengthArr != NULL) { pWordsLengthArr[uIndex] = wcslen(temp) + 1; } if (ppVoiceDesArr != NULL) { wcscpy(ppVoiceDesArr[uIndex], dstrDesc.Copy()); } } if ( FAILED(hr) ) { if (pWordsLengthArr != NULL) { pWordsLengthArr[uIndex] = 0; } if (ppVoiceDesArr != NULL) { ppVoiceDesArr[uIndex] = NULL; } pToken->Release(); } uIndex++; } } else return false; return true; }
[ "aicrosoft1104@61e0f6aa-79d2-64b1-0467-50e2521aa597" ]
[ [ [ 1, 818 ] ] ]
fe9138dedc3b4a84e8b00affe2f5d311d5a85aed
7b2db9b789308b341b57626b9e40d717f03ee13c
/mint/list.hpp
7d98c2d7898c3403ff48ecc80ab409052c18ea6f
[]
no_license
kinaba/mint
93be7356f06ceb6ac82fdfb1c1a13221f546a041
e9d5bfc52818b4eb157a86474cd498b27e6393e0
refs/heads/master
2016-09-06T16:43:18.702005
2009-12-18T02:21:59
2009-12-18T02:21:59
410,891
1
0
null
null
null
null
UTF-8
C++
false
false
674
hpp
#ifndef KMONOS_NET_MINT_LIST_HPP #define KMONOS_NET_MINT_LIST_HPP #include "common.hpp" #include "node.hpp" #include "list_index.hpp" #include <boost/intrusive/list_hook.hpp> namespace mint { template< typename TagList = boost::multi_index::tag<> > struct list { template<typename Super> struct node_class { typedef detail::intrusive_hook_node< boost::intrusive::list_member_hook<>, Super > type; }; template<typename SuperMeta> struct index_class { typedef detail::list_index< SuperMeta, typename TagList::type > type; }; }; } // end of namespace #endif // include guard
[ [ [ 1, 32 ] ] ]