当前位置: 首页>>代码示例>>C++>>正文


C++ Controller::addListener方法代码示例

本文整理汇总了C++中Controller::addListener方法的典型用法代码示例。如果您正苦于以下问题:C++ Controller::addListener方法的具体用法?C++ Controller::addListener怎么用?C++ Controller::addListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controller的用法示例。


在下文中一共展示了Controller::addListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gluiMainWindow

void gluiMainWindow (int control){
	switch(control){
	case 0:
		subGlui->hide();
		bt3->enable();
		break;
	case 1:
		//inicializar LeapMotion y FMod
		controller.addListener(leap);
		sonido.init();
		simulator=1;
		luces();
		bt1->disable();
		break;
	case 3:
		enable=1;
		bt3->disable();
		break;
	case -3:
		bt4->disable();
		controller.removeListener(leap);
		exit(0);
		break;
	}
	glutPostRedisplay();
}
开发者ID:joasanm,项目名称:Theremin,代码行数:26,代码来源:glmain.cpp

示例2: main

/* ----------------------------------------------------------------------------------------- */
int main(int argc, char ** argv)
{
  int infile = 0, outfile = 0;
  double filter = 0;
  parse_argv(argc, argv, &infile, &outfile, &filter);

  if(infile != 0) {
    play(infile);
    return 0;
  }
 
  // Create a sample listener and controller
  CListener listener;
  Controller controller;
 
  if(outfile != 0)
    listener.set_robot_output(outfile);

  listener.set_filter(filter);

  // Have the sample listener receive events from the controller
  controller.addListener(listener);

  // Keep this process running until Enter is pressed
  std::cout << "Press Enter to quit..." << std::endl;
  std::cin.get();

  // Remove the sample listener when done
  controller.removeListener(listener);

  return 0;
}
开发者ID:lager1,项目名称:leap_hand,代码行数:33,代码来源:leap_to_hand.cpp

示例3: main

int main()
{
  // Create a sample listener and controller
  SampleListener listener;
  Controller controller;

  listener.Mouse = new MouseManager();
  listener.mystate = 0;
  listener.clickcount = 0;
  listener.pressstate = 0;
  listener.side = 0;
  listener.pressedDelay = 0;
  listener.rclick = 0;
  listener.sensibility = 8;
  listener.active = false;

  listener.lastFrameID = -1;
  listener.lastToggle = 0;
  listener.lastEvent = time(0);

  std::cout << "width: "  << listener.Mouse->w_width  << std::endl;
  std::cout << "height: " << listener.Mouse->w_height << std::endl;

  // Have the sample listener receive events from the controller
  controller.addListener(listener);

  // Keep this process running until Enter is pressed
  std::cout << "Press Enter to quit..." << std::endl;
  std::cin.get();

  // Remove the sample listener when done
  controller.removeListener(listener);

  return 0;
}
开发者ID:GCorbel,项目名称:leapmouse,代码行数:35,代码来源:Leapmouse.cpp

示例4: main

int main(int argc, const char *argv[]){
	screen_width = (unsigned int)CGDisplayPixelsWide(kCGDirectMainDisplay);
	screen_height = (unsigned int)CGDisplayPixelsHigh(kCGDirectMainDisplay);
	CGPoint current_point = CGEventGetLocation(CGEventCreate(nil));

	screen = controller.calibratedScreens()[0];
	if(!screen.isValid()){
		cout << "This screen has not been calibrated." << endl;
		return 0;
	}
	
	// Create a sample listener and controller
	SampleListener listener;
	
	// Have the sample listener receive events from the controller
	controller.addListener(listener);
	
	// Keep this process running until Enter is pressed
	std::cout << "Press Enter to quit..." << std::endl;
	std::cin.get();
	
	// Remove the sample listener when done
	controller.removeListener(listener);
	
	return 0;
}
开发者ID:yoneken,项目名称:leap_test,代码行数:26,代码来源:mouse_mac.cpp

示例5: main

int main(int argc, char** argv) {

    ros::init(argc, argv, "leap_motion");
    ros::NodeHandle nh("leap_motion");

    bool setup_params[7];

    // Read parameters from the defined in listener_params.yaml
    nh.getParam("/enable_controller_info", setup_params[0] );
    nh.getParam("/enable_frame_info", setup_params[1] );
    nh.getParam("/enable_hand_info", setup_params[2] );

    nh.getParam("/enable_gesture_circle", setup_params[3] );
    nh.getParam("/enable_gesture_swipe", setup_params[4] );
    nh.getParam("/enable_gesture_screen_tap", setup_params[5] );
    nh.getParam("/enable_gesture_key_tap", setup_params[6] );

    LeapListener listener(setup_params);
    // Add a publisher to the leapListener object
    listener.ros_publisher = nh.advertise<leap_motion::Human>("leap_device", 1);

    Controller controller;
    controller.addListener(listener);
    // Keep doing ROS spin until shutdown() or Ctrl+C
    ros::spin();
    controller.removeListener(listener);

    return 0;
}
开发者ID:warp1337,项目名称:rosleapmotion,代码行数:29,代码来源:lmc_driver_node.cpp

示例6: main

int main(int argc , char ** argv) {
	screen = controller.calibratedScreens()[0];
	if(!screen.isValid()){
		cout << "This screen has not been calibrated." << endl;
		return 0;
	}

	srand((unsigned int)time(NULL));

	// Have the sample listener receive events from the controller
	controller.addListener(listener);

	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA);
	glutInitWindowSize(screen_width, screen_height);
	glutInitWindowPosition(0, 0);
	window = glutCreateWindow("LEAP intersection Test");
	glutDisplayFunc(&DrawGLScene);
	glutIdleFunc(&Idle);
	glutReshapeFunc(&ReSizeGLScene);
	glutKeyboardFunc(&NormalKeyPressed);
	glutSpecialFunc(&SpecialKeyPressed);

	glDisable(GL_DEPTH_TEST);								// Disables Depth Testing
	glShadeModel(GL_SMOOTH);								// Enables Smooth Color Shading
	
	glutMainLoop();

	return 0;
}
开发者ID:yoneken,项目名称:leap_test,代码行数:30,代码来源:Fitts.cpp

示例7: main

int main(int argc, char** argv) {
	controller.addListener(listener);

	// Keep this process running until Enter is pressed
	std::cout << "Press Enter to quit..." << std::endl;
	std::cin.get();

	// Remove the sample listener when done
	controller.removeListener(listener);

	return 0;
}
开发者ID:Drone2,项目名称:utils,代码行数:12,代码来源:leap.cpp

示例8: main

int main(int argc, char** argv) {
	// Create a sample listener and controller
	SampleListener listener;
	Controller controller;
	// Have the sample listener receive events from the controller
	controller.addListener(listener);
	if(argc > 1 && strcmp(argv[1], "--bg") == 0)
		controller.setPolicy(Leap::Controller::POLICY_BACKGROUND_FRAMES);
	getchar();
	// Remove the sample listener when done
	controller.removeListener(listener);
	return 0;
}
开发者ID:robot-friends,项目名称:DoMyBiddingRobot,代码行数:13,代码来源:gestures.cpp

示例9: setup

void LeapCinderVectorFieldApp::setup()
{
	m_LeapController.addListener( m_LeapListener );

	/** timing data */
	m_fLastTime = getElapsedSeconds();
	m_fFrameTime = 0;

	/** background image */
	//m_BGImage = gl::Texture( loadImage( loadAsset( "testBg.jpg" ) ) );

	/** vector field */
	m_VectorField = new VectorFieldController();
}
开发者ID:seanfoo73,项目名称:LeapExperiments,代码行数:14,代码来源:LeapCinderVectorFieldApp.cpp

示例10: main

int main() {
	// Create a sample listener and controller
	myFingers listener;
	Controller controller;
	// Have the sample listener receive events from the controller
	controller.addListener(listener);

	// Keep this process running until Enter is pressed
	std::cout << "Press Enter to quit..." << std::endl;
	std::cin.get();

	// Remove the sample listener when done
	controller.removeListener(listener);

	return 0;
}
开发者ID:BeTheNerd,项目名称:determineFingers,代码行数:16,代码来源:Source.cpp

示例11: main

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  MangoListener listener;

  Controller controller;
  controller.addListener(listener);

  std::cout << "Mango started, press enter to quit..." << std::endl;
  app.exec();
  std::cin.get();

  controller.removeListener(listener);

  return 0;
}
开发者ID:tritania,项目名称:Mango,代码行数:17,代码来源:mango.cpp

示例12: main

int main(int argc, char **argv, char **envp) {
	if (argc == 1) {
		cerr << "Usage: " << argv[0] << " <basenote>" << endl
			<< "\tThe basenote can be any number starting from 0 (lowest C)" << endl
			<< "\tRemember that the scale is divided in 12 half-tones" << endl;
		return 1;
	}

	const int basenote = atoi(argv[1]);
	SoundClient soundClient;
	LeapListener listener(basenote, soundClient);
	Controller controller;
	controller.addListener(listener);

	cout << "Press Enter to quit..." << endl;
	cin.get();

	controller.removeListener(listener);
	return 0;
}
开发者ID:Belial2010,项目名称:LeapMidi,代码行数:20,代码来源:main.cpp

示例13: main

int main(int argc, char** argv) {
  // Create a sample listener and controller
  SampleListener listener;
  Controller controller;

  // Have the sample listener receive events from the controller
  controller.addListener(listener);

  if (argc > 1 && strcmp(argv[1], "--bg") == 0)
    controller.setPolicy(Leap::Controller::POLICY_BACKGROUND_FRAMES);

  // Keep this process running until Enter is pressed
  std::cout << "Press Enter to quit..." << std::endl;
  std::cin.get();

  // Remove the sample listener when done
  controller.removeListener(listener);

  return 0;
}
开发者ID:Bobeye,项目名称:LeapMotion,代码行数:20,代码来源:Sample.cpp

示例14: main

int main(int argc , char ** argv) {
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
	glutInitWindowSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
	glutInitWindowPosition(0, 0);
	window = glutCreateWindow("LEAP Axis Test");
	glutDisplayFunc(&DrawGLScene);
	glutIdleFunc(&Idle);
	glutReshapeFunc(&ReSizeGLScene);
	glutKeyboardFunc(&NormalKeyPressed);
	glutSpecialFunc(&SpecialKeyPressed);
	InitGL(DEFAULT_WIDTH, DEFAULT_HEIGHT);
	
	// Have the sample listener receive events from the controller
	controller.addListener(listener);

	glutMainLoop();

	return 0;
}
开发者ID:yoneken,项目名称:leap_test,代码行数:20,代码来源:cycle.cpp

示例15: main

int main() {
    // Create a sample listener and controller
    SampleListener listener;
    Controller controller;
    
    // Have the sample listener receive events from the controller
    controller.addListener(listener);
    
    file = fopen("/dev/tty.usbmodemfd1311", "w");  //Opening device file
    
    // Keep this process running until Enter is pressed
    std::cout << "Press Enter to quit..." << std::endl;
    std::cin.get();
    
    // Remove the sample listener when done
    controller.removeListener(listener);
    
    fclose(file);
    
    return 0;
}
开发者ID:gibsjose,项目名称:MarbleSorterLeapController,代码行数:21,代码来源:main.cpp


注:本文中的Controller::addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。