Beispiel #1
0
void CNBTreeListView::SetDevices(NBLogicalDevicePtrList *pListLogicalDevice)
{
	ATLASSERT(pListLogicalDevice);
	if(!pListLogicalDevice)
		return;

	CTreeItem tiLogicalDevice, tiUnitDevice;

	for(NBLogicalDevicePtrList::iterator itLogicalDevice = pListLogicalDevice->begin();
		itLogicalDevice != pListLogicalDevice->end(); itLogicalDevice++)
	{
		// register logical device
		tiLogicalDevice = SetDevice(TVI_ROOT, *itLogicalDevice);
		if((*itLogicalDevice)->IsGroup())
		{
			// add children
			for(UINT32 i = 0; i < (*itLogicalDevice)->DevicesTotal(); i++)
			{
				tiUnitDevice = SetDevice(tiLogicalDevice, (*(*itLogicalDevice))[i]);
			}

			GetTreeControl().Expand(tiLogicalDevice, TVE_EXPAND);
		}
	}
}
Beispiel #2
0
void MDINPUT_SetInput(int aport, const char *type, void *ptr)
{
 int itype = 0;

 if(!strcasecmp(type, "none"))
 {
  itype = DEVICE_NONE;
 }
 if(!strcasecmp(type, "gamepad"))
 {
  itype = DEVICE_MD3B;
 }
 else if(!strcasecmp(type, "gamepad6"))
 {
  itype = DEVICE_MD6B;
 }
 else if(!strcasecmp(type, "gamepad2"))
 {
  itype = DEVICE_MS2B;
 }
 else if(!strcasecmp(type, "megamouse"))
 {
  itype = DEVICE_MM;
 }

 data_ptr[aport] = ptr;
 SetDevice(aport, itype);

 UpdateBusThing(md_timestamp);
}
Beispiel #3
0
BOOL Gadgets2NetworkPrefs(struct NetPEditor_DATA *data)

{
    STRPTR str = NULL;
    IPTR lng = 0;

    GET(data->netped_deviceString, MUIA_String_Contents, &str);
    SetDevice(str);
    GET(data->netped_IPString, MUIA_String_Contents, &str);
    SetIP(str);
    GET(data->netped_maskString, MUIA_String_Contents, &str);
    SetMask(str);
    GET(data->netped_gateString, MUIA_String_Contents, &str);
    SetGate(str);
    GET(data->netped_DNSString[0], MUIA_String_Contents, &str);
    SetDNS(0, str);
    GET(data->netped_DNSString[1], MUIA_String_Contents, &str);
    SetDNS(1, str);
    GET(data->netped_hostString, MUIA_String_Contents, &str);
    SetHost(str);
    GET(data->netped_domainString, MUIA_String_Contents, &str);
    SetDomain(str);
    GET(data->netped_DHCPState, MUIA_Cycle_Active, &lng);
    SetDHCP(lng);
    GET(data->netped_Autostart, MUIA_Selected, &lng);
    SetAutostart(lng);

    return TRUE;
}
bool CD3DBillBoardParticleEmitter::CloneFrom(CNameObject * pObject,UINT Param)
{
	if(!pObject->IsKindOf(GET_CLASS_INFO(CD3DBillBoardParticleEmitter)))
		return false;

	if(!CD3DObject::CloneFrom(pObject,Param))
		return false;

	CD3DBillBoardParticleEmitter * pSrcObject=(CD3DBillBoardParticleEmitter *)pObject;

	SetDevice(pSrcObject->GetDevice());

	if(!LoadFromResource(pSrcObject->m_pModelResource,pSrcObject->m_MaxParticleCount))
		return false;

	

		
	m_ParticleCount=pSrcObject->m_ParticleCount;
	m_IsPlaying=pSrcObject->m_IsPlaying;
	m_StartTime=pSrcObject->m_StartTime;
	m_RecentUpdateTime=pSrcObject->m_RecentUpdateTime;
	m_PlaySpeedRate=pSrcObject->m_PlaySpeedRate;
	m_EmitterRate=pSrcObject->m_EmitterRate;	
	
	memcpy(m_pParticleVertexBuffer,pSrcObject->m_pParticleVertexBuffer,sizeof(PARTICLE_RECT)*m_ParticleCount);

	m_SubMesh.SetVertexCount(m_ParticleCount*4);
	m_SubMesh.SetIndexCount(m_ParticleCount*6);
	m_SubMesh.SetPrimitiveCount(m_ParticleCount*2);

	return true;
}
int main()
{
	//---------------------------------------------------------
	// Security Param's
	//---------------------------------------------------------
	uint8 SecurePATSAccessBCM[2] 	= {0x27, 0x21};
	uint8 SecureAccess[2] 		= {0x27, 0x03};
	
	//---------------------------------------------------------
	// BCM Param's
	//---------------------------------------------------------
	uint8 IgnitionOn[5] 	= {0x31, 0x01, 0x20, 0x38, 0x01};
	uint8 ProgSession[2]	= {0x10, 0x82};
		
	//---------------------------------------------------------
	// START
	//---------------------------------------------------------	
	prtPortHandle = EDG_query_open_port_handle();
	EDG_set_auto_tp(1);

	//---------------------------------------------------------
	// BCM Commands
	//---------------------------------------------------------
	SetDevice("BCM", 0x726, "10MYX351_BCM_IMMOBY-11");
	//EDG_delay(5000);
	EDG_send_binary(ExtendedAccess, 2);	
	EDG_q_send_msg(prtPortHandle, NULL,0,CMDTYPE_SECURITYACCESS,SecurePATSAccessBCM, 2);
	EDG_delay(500);
	EDG_send_binary(IgnitionOn, 5);
	EDG_delay(500);
	//EDG_send_binary(ProgSession, 2);
	
	return 0;
}
Beispiel #6
0
long AudioManager::SetAudioOutType(int nType)
{
    returnv_if_fail(m_pDeviceCtrl != NULL, WME_E_FAIL);
	long ret = WME_E_FAIL;
//#ifdef ANDROID
	IWmeMediaDeviceEnumerator* pEnum = NULL;
    m_pEngine->CreateMediaDeviceEnumerator(m_wmt, WmeDeviceOut, &pEnum);
    returnv_if_fail(pEnum != NULL, WME_E_FAIL);
	int nSpeakerNum = 0;
	pEnum->GetDeviceNumber(nSpeakerNum);
	for(int i=0;i<nSpeakerNum;i++)
	{
		if(i== nType)
		{
			IWmeMediaDevice *pdevice = NULL;
			pEnum->GetDevice(i,&pdevice);
			if(NULL != pdevice)
			{
				ret=SetDevice(pdevice, AUDIO_DEV_SPEAKER);
			}
			break;
		}
	}

    //m_pDeviceCtrl->SetPlayOutStreamType(nType);
//#endif
    return ret;
}
Beispiel #7
0
UmRlcEntity::UmRlcEntity()
{
  SetDevice (NULL);
  SetRadioBearer (NULL);
  SetRlcPduSequenceNumber (0);
  SetRlcMode(RlcEntity::UM_RLC_MODE);
}
bool CD3DWOWM2RibbonEmitter::CloneFrom(CNameObject * pObject,UINT Param)
{
	if(!pObject->IsKindOf(GET_CLASS_INFO(CD3DWOWM2RibbonEmitter)))
		return false;

	if(!CD3DObject::CloneFrom(pObject,Param))
		return false;

	CD3DWOWM2RibbonEmitter * pSrcObject=(CD3DWOWM2RibbonEmitter *)pObject;

	SetDevice(pSrcObject->GetDevice());

	if(!Init(pSrcObject->m_pModelResource,pSrcObject->m_EmitterIndex))
		return false;

	

	m_RibbonCount=pSrcObject->m_RibbonCount;
	m_StartTime=pSrcObject->m_StartTime;
	m_RecentCreatePos=pSrcObject->m_RecentCreatePos;
	m_ClipLength=pSrcObject->m_ClipLength;	

	memcpy(m_pRibbonVertexBuffer,pSrcObject->m_pRibbonVertexBuffer,sizeof(RIBBON_PAIR)*m_RibbonCount);

	m_SubMesh.SetVertexCount(m_RibbonCount*2);		
	m_SubMesh.SetPrimitiveCount((m_RibbonCount-1)*2);

	return true;
}
Beispiel #9
0
CMidiDevice::CMidiDevice ()
    : m_nOut(0), m_hMidiOut(NULL)
{
    // No status byte
    m_abOut[0] = '0';

    SetDevice(GetOption(midioutdev));
}
Beispiel #10
0
void atapi_cdrom_device::process_buffer()
{
	if(m_cdrom != m_image->get_cdrom_file())
	{
		m_media_change = true;
		SetDevice(m_image->get_cdrom_file());
	}
	atapi_hle_device::process_buffer();
}
Beispiel #11
0
void SpotifyServer::NewConnection() {
  QTcpSocket* socket = server_->nextPendingConnection();
  SetDevice(socket);

  qLog(Info) << "Connection from port" << socket->peerPort();

  // Send any login messages that were queued before the client connected
  foreach (const pb::spotify::Message& message, queued_login_messages_) {
    SendOrQueueMessage(message);
  }
TPrinter::TPrinter()
{
  Device = NULL;
  Driver = NULL;
  Port = NULL;
  DeviceModule = 0;
  DevSettings = NULL;
  Error = 0;
  SetDevice(NULL, NULL, NULL);  // Associate with default printer
}
LatencyTestUtil::LatencyTestUtil(LatencyTestDevice* device)
 :  Handler(getThis())
{
    if (device != NULL)
    {
        SetDevice(device);
    }

    reset();
}
void CD3DGUIWndRect::SetRender(CD3DBaseRender * pRender)
{
	m_pRender=pRender;
	if(m_pRender)
	{
		SetDevice(m_pRender->GetDevice());
		if(m_SubMesh.GetMaterial().GetFX()==NULL)
			SetFXFromMemory(_T("DEFAULT_UI_WIN_RECT_FX"),(LPVOID)DEFAULT_UI_WIN_RECT_FX,(int)strlen(DEFAULT_UI_WIN_RECT_FX));
	}
}
//Init 
bool OutDevice::Init(DWORD coLevel /*  = DISCL_FOREGROUND | DISCL_NONEXCLUSIVE */ )
{
	//SetDataFormat
	if(!SetDevice())
		return false;
	if(!SetCoLevel(coLevel))
		return false;
	m_dirInputKeyBoard->Acquire();
	m_dirInputMouse->Acquire();
	return true;
}
Beispiel #16
0
AmRlcEntity::AmRlcEntity()
{
  SetDevice (NULL);
  SetRadioBearer (NULL);
  SetRlcMode(RlcEntity::AM_RLC_MODE);
  SetRlcPduSequenceNumber (0);
  m_amStateVariables = new AmStateVariables ();
  m_sentAMDs = new std::vector<AmdRecord*> ();
  m_receivedAMDs = new std::vector<AmdRecord*> ();

}
Beispiel #17
0
LatencyTest::LatencyTest(LatencyTestDevice* device)
 :  Handler(getThis())
{
    if (device != NULL)
    {
        SetDevice(device);
    }

    reset();

    srand(Timer::GetTicksMs());
}
Beispiel #18
0
void MDIO_Init(bool overseas, bool PAL, bool overseas_reported, bool PAL_reported)
{
 is_overseas = overseas;
 is_pal = PAL;
 is_overseas_reported = overseas_reported;
 is_pal_reported = PAL_reported;

 for(int i = 0; i < PORT_MAX; i++)
  SetDevice(i, DEVICE_NONE);

 UpdateBusThing(md_timestamp);
}
Beispiel #19
0
_MessageHandlerBase::_MessageHandlerBase(QIODevice* device, QObject* parent)
  : QObject(parent),
    device_(NULL),
    flush_abstract_socket_(NULL),
    flush_local_socket_(NULL),
    reading_protobuf_(false),
    expected_length_(0),
    is_device_closed_(false) {
  if (device) {
    SetDevice(device);
  }
}
Beispiel #20
0
void CMidiChCtrlDlg::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: ここにメッセージ ハンドラー コードを追加するか、既定の処理を呼び出します。
	if (theCh) {
		SetDevice();
		for (int i = 0; i < numMultiCtrl; i++) {
			pMulCtrl[i]->SetValue();
		}
		for (int i = 0; i < numChecker; i++) {
			pChecker[i]->UpdateState();
		}
	}
	CDialogEx::OnTimer(nIDEvent);
}
Beispiel #21
0
int main()
{
	//---------------------------------------------------------
	// HVAC DTC Read
	//---------------------------------------------------------
	uint8 HVACDTCRead[3] 	= {0x19, 0x02, 0xAF};
	SetDevice("HVAC", 0x733, "");
	while (1)
	{
		EDG_send_binary(HVACDTCRead, 3);
		EDG_delay(2000);
	}
	return 0;
}
void SpotifyServer::NewConnection() {
  QTcpSocket* socket = server_->nextPendingConnection();
  SetDevice(socket);

  qLog(Info) << "Connection from port" << socket->peerPort();

  // Send any login messages that were queued before the client connected
  for (const pb::spotify::Message& message : queued_login_messages_) {
    SendOrQueueMessage(message);
  }
  queued_login_messages_.clear();

  // Don't take any more connections from clients
  disconnect(server_, SIGNAL(newConnection()), this, 0);
}
Beispiel #23
0
mobileView::mobileView(BRect r, const char *name, GSM *g = NULL) : BView(r, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW|B_PULSE_NEEDED) {
	// initialize data
	SetDevice(g);
	//
	this->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

	BRect r = this->Bounds();
	r.InsetBy(5,5);
	r.bottom = r.top + CAPTION_SIZE;
	// my top
	top = r.bottom + 5;
	this->AddChild(caption = new BStringView(r,"viewCaption",NULL,B_FOLLOW_LEFT_RIGHT|B_FOLLOW_TOP));
	BFont myfont(be_plain_font); myfont.SetSize(CAPTION_SIZE);
	caption->SetFont(&myfont,B_FONT_SIZE);
}
Beispiel #24
0
		xSceneManager::xSceneManager(IDirect3DDevice9 *pD3DDevice)
		{

#if DEBUG_LEVEL >= 3

			LogWrite(LT_CONSTRUCTOR, "Constructor Called");

#endif

			//Set the Render Device
			SetDevice(pD3DDevice);

			m_xSceneTimer.Start();

			frameRate.Init(60);
			frameRate.SetSpeedFactor();
		}
GUIManager::GUIManager(video::IVideoDevice*dev)
:m_Skin(0)
{	
	m_benchmarkItem=new BenchmarkItem(mT("GUIManager"));
	m_renderBI=m_benchmarkItem->addSubItem(mT("Render"));
	m_updateBI=m_benchmarkItem->addSubItem(mT("Update"));

	m_renderQueue=new GUIBatchRenderer();

	m_specifications=new LanguageFontSpecification();

	SetDevice(dev);
	if(!s_defaultElementRegistered)
	{
		s_defaultElementRegistered=true;
		_loadDefaultFactories();
	}
}
void CDisplayRect::OnMove(int x, int y) 
{
	CDialog::OnMove(x, y);
	
	// TODO: Add your message handler code here
	GetWindowRect(&m_rcWindow);
	DWORD dwNewDeviceNum;

	if(m_rcWindow.left < 0)
	{
		return;
	}
	
	if( (DWORD)m_rcWindow.right + (DWORD)m_rcWindow.left > 2 * m_dwScreenWidth )
	{
		if( (DWORD)m_rcWindow.top + (DWORD)m_rcWindow.bottom > 2 * m_dwScreenHeight)
		{
			dwNewDeviceNum = 3;
		}
		else 
		{
			dwNewDeviceNum = 1;
		}
	}
	else
	{
		if( (DWORD)m_rcWindow.top + (DWORD)m_rcWindow.bottom > 2 * m_dwScreenHeight)
		{
			dwNewDeviceNum = 2;
		}
		else 
		{
			dwNewDeviceNum = 0;
		}
	}
	
	if(dwNewDeviceNum != m_dwOldDeviceNum)
	{
		if(SetDevice(dwNewDeviceNum))
		{
			m_dwOldDeviceNum = dwNewDeviceNum;
		}
	}
}
Beispiel #27
0
int main()
{
	//---------------------------------------------------------
	// Security Param's
	//---------------------------------------------------------
	uint8 SecureAccess[2] = { 0x27, 0x01 };
	uint8 SecurePATSAccessBCM[2] = { 0x27, 0x21 };

	//---------------------------------------------------------
	// Result Param's
	//---------------------------------------------------------
	



	//---------------------------------------------------------
	// Command Param's
	//---------------------------------------------------------
	int VehicleModeResult = 0;
	int SpeedLimitResult = 0;
	uint8 IPMBFactoryCal[6] = { 0x31, 0x01, 0xF0, 0x1D, 0x1F, 0x00 };
	uint8 IPMBFactoryCalResult[6] = { 0x31, 0x03, 0xF0, 0x1D };
	

	prtPortHandle = EDG_query_open_port_handle();
	EDG_set_auto_tp(1);


	//---------------------------------------------------------
	// BCM Set Normal Mode
	//---------------------------------------------------------
	SetDevice("IPMB", 0x7B1, "CMR EESE");
	EDG_send_binary(ExtendedAccess, 2);
	EDG_delay(500);
	EDG_q_send_msg(prtPortHandle, NULL, 0, CMDTYPE_SECURITYACCESS, SecureAccess, 2);
	EDG_delay(500);
	EDG_send_binary(IPMBFactoryCal, 6);

	

		
	return 0;
}
Beispiel #28
0
int main()
{
	//---------------------------------------------------------
	// HVAC DTC Read
	//---------------------------------------------------------
	SetDevice("GSM", 0x732, "X250_ETS_DIAG_1");
	while (1)
	{
		EDG_send_binary(ExtendedAccess, 2);
		EDG_delay(300);
		EDG_q_send_msg(prtPortHandle, NULL, 0, CMDTYPE_SECURITYACCESS, SecureAccess, 2);
		EDG_delay(300);
		EDG_send_binary(GSM_Move, 4);
		EDG_delay(3000);
		EDG_send_binary(ECUReset, 2);
		EDG_delay(300);
	}
	return 0;
}
Beispiel #29
0
static void
ParseDeviceControl(DviWidget dw)		/* Parse the x commands */
{
        char str[20], str1[50];
	int c, n;

	GetWord (dw, str, 20);
	switch (str[0]) {			/* crude for now */
	case 'T':				/* output device */
		GetWord (dw, str, 20);
		SetDevice (dw, str);
		break;
	case 'i':				/* initialize */
		InitTypesetter (dw);
		break;
	case 't':				/* trailer */
		break;
	case 'p':				/* pause -- can restart */
		break;
	case 's':				/* stop */
		StopSeen = 1;
		return;
	case 'r':				/* resolution when prepared */
		break;
	case 'f':				/* font used */
		n = GetNumber (dw);
		GetWord (dw, str, 20);
		GetLine (dw, str1, 50);
		SetFontPosition (dw, n, str, str1);
		break;
	case 'H':				/* char height */
		break;
	case 'S':				/* slant */
		break;
	}
	while (DviGetC (dw, &c) != '\n')	/* skip rest of input line */
		if (c == EOF)
			return;
	return;
}
Beispiel #30
0
int WINAPI mEndScene(LPDIRECT3DDEVICE9 Device)
{
	SetDevice(Device);
	/*HANDLE ThreadLuaHandler;*/

	if(!create_run)
	{
		CreateLine();
		create_run = true;
	}

	ThreadDrawOn();

	/*
	ThreadLuaHandler = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)ThreadLoadingLua, NULL, NULL, NULL);
	WaitForSingleObject(ThreadLuaHandler, INFINITE);
	*/

	/*ThreadLoadingLua();*/

	return oEndScene(Device);
}