diff --git a/README b/README index 9ead42f..166df64 100644 --- a/README +++ b/README @@ -51,7 +51,6 @@ On Ubuntu 10.10 you can install all the required libraries via: $ sudo apt-get install \ g++ \ libboost1.42-dev \ - libboost-thread1.42-dev \ scons \ pkg-config \ libusb-1.0-0-dev \ diff --git a/SConstruct b/SConstruct index ab3d92f..c3cbc8c 100644 --- a/SConstruct +++ b/SConstruct @@ -135,16 +135,6 @@ if not conf.CheckLibWithHeader('X11', 'X11/Xlib.h', 'C++'): print 'libx11-dev must be installed!' Exit(1) -# boost-thread checks -if not conf.CheckCXXHeader('boost/thread/thread.hpp'): - print 'libboost-thread-dev must be installed!' - Exit(1) - -if not conf.CheckLib('boost_thread-mt', language='C++'): - if not conf.CheckLib('boost_thread', language='C++'): - print 'libboost-thread-dev must be installed!' - Exit(1) - env = conf.Finish() env.Bin2H("src/xboxdrv_vfs.hpp", [ diff --git a/TODO b/TODO index 534f0d7..2ff9f35 100644 --- a/TODO +++ b/TODO @@ -100,11 +100,12 @@ Aborted * check that threads are cleaned up in daemon +* headset and chatpad still use thread -Stuff to do before 0.7.4 release: -================================= +* go through checklist, disable headset and chatpad support for now -* invert y axis on --evdev +Stuff +===== if (opts.priority == Options::kPriorityRealtime) { @@ -137,6 +138,12 @@ Stuff to do before 0.7.4 release: } } + +Stuff to do before 0.7.4 release: +================================= + +* invert y axis on --evdev + * add double-click button, in the same wayne as hold-button * add --controller 4 or --controller-count 4 or something like that diff --git a/src/chatpad.cpp b/src/chatpad.cpp index ec3dc22..d875a93 100644 --- a/src/chatpad.cpp +++ b/src/chatpad.cpp @@ -30,8 +30,8 @@ Chatpad::Chatpad(libusb_device_handle* handle, uint16_t bcdDevice, m_no_init(no_init), m_debug(debug), m_quit_thread(false), - m_read_thread(), - m_keep_alive_thread(), + //m_read_thread(), + //m_keep_alive_thread(), m_uinput(), m_led_state(0) { @@ -98,8 +98,8 @@ Chatpad::Chatpad(libusb_device_handle* handle, uint16_t bcdDevice, Chatpad::~Chatpad() { m_quit_thread = true; - m_read_thread->join(); - m_keep_alive_thread->join(); + //m_read_thread->join(); + //m_keep_alive_thread->join(); } void @@ -196,8 +196,8 @@ Chatpad::set_led(unsigned int led, bool state) void Chatpad::start_threads() { - m_read_thread.reset(new boost::thread(boost::bind(&Chatpad::read_thread, this))); - m_keep_alive_thread.reset(new boost::thread(boost::bind(&Chatpad::keep_alive_thread, this))); + //m_read_thread.reset(new boost::thread(boost::bind(&Chatpad::read_thread, this))); + //m_keep_alive_thread.reset(new boost::thread(boost::bind(&Chatpad::keep_alive_thread, this))); } void diff --git a/src/chatpad.hpp b/src/chatpad.hpp index f5922d3..47e4dcf 100644 --- a/src/chatpad.hpp +++ b/src/chatpad.hpp @@ -19,8 +19,8 @@ #ifndef HEADER_XBOXDRV_CHATPAD_HPP #define HEADER_XBOXDRV_CHATPAD_HPP -#include <boost/thread.hpp> #include <libusb.h> +#include <memory> class LinuxUinput; @@ -132,8 +132,8 @@ private: bool m_quit_thread; - std::auto_ptr<boost::thread> m_read_thread; - std::auto_ptr<boost::thread> m_keep_alive_thread; + //std::auto_ptr<boost::thread> m_read_thread; + //std::auto_ptr<boost::thread> m_keep_alive_thread; std::auto_ptr<LinuxUinput> m_uinput; int m_keymap[256]; bool m_state[256]; diff --git a/src/headset.cpp b/src/headset.cpp index 180ef59..cd2baca 100644 --- a/src/headset.cpp +++ b/src/headset.cpp @@ -19,6 +19,7 @@ #include "headset.hpp" #include <fstream> +#include <errno.h> #include "helper.hpp" #include "raise_exception.hpp" @@ -29,8 +30,8 @@ Headset::Headset(libusb_device_handle* handle, const std::string& dump_filename, const std::string& play_filename) : m_handle(handle), - m_read_thread(), - m_write_thread(), + //m_read_thread(), + //m_write_thread(), m_quit_read_thread(false), m_quit_write_thread(false) { @@ -43,16 +44,19 @@ Headset::Headset(libusb_device_handle* handle, throw std::runtime_error(out.str()); } +#ifdef FIXME m_read_thread.reset(new boost::thread(boost::bind(&Headset::read_thread, this, dump_filename, debug))); if (!play_filename.empty()) { m_write_thread.reset(new boost::thread(boost::bind(&Headset::write_thread, this, play_filename))); } +#endif } Headset::~Headset() { +#ifdef FIXME if (m_read_thread.get()) m_read_thread->join(); @@ -61,6 +65,7 @@ Headset::~Headset() m_read_thread.release(); m_write_thread.release(); +#endif int ret = libusb_release_interface(m_handle, 1); diff --git a/src/headset.hpp b/src/headset.hpp index 5c1d401..cc13822 100644 --- a/src/headset.hpp +++ b/src/headset.hpp @@ -20,14 +20,14 @@ #define HEADER_XBOXDRV_HEADSET_HPP #include <libusb.h> -#include <boost/thread.hpp> +#include <string> class Headset { private: libusb_device_handle* m_handle; - std::auto_ptr<boost::thread> m_read_thread; - std::auto_ptr<boost::thread> m_write_thread; + //std::auto_ptr<boost::thread> m_read_thread; + //std::auto_ptr<boost::thread> m_write_thread; bool m_quit_read_thread; bool m_quit_write_thread; diff --git a/src/xbox360_controller.cpp b/src/xbox360_controller.cpp index 131c65a..8502011 100644 --- a/src/xbox360_controller.cpp +++ b/src/xbox360_controller.cpp @@ -49,6 +49,7 @@ Xbox360Controller::Xbox360Controller(libusb_device* dev, usb_claim_interface(0, try_detach); usb_submit_read(endpoint_in, 32); +#ifdef FIXME // create chatpad if (chatpad) { @@ -71,6 +72,7 @@ Xbox360Controller::Xbox360Controller(libusb_device* dev, { m_headset.reset(new Headset(m_handle, headset_debug, headset_dump, headset_play)); } +#endif } Xbox360Controller::~Xbox360Controller()