Removed boost::thread dependency, chatpad & headset do no longer work

This commit is contained in:
Ingo Ruhnke 2011-03-25 22:45:13 +01:00
parent 93b6e0d49b
commit f883486fcd
8 changed files with 31 additions and 28 deletions

1
README
View file

@ -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 \

View file

@ -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", [

13
TODO
View file

@ -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

View file

@ -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

View file

@ -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];

View file

@ -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);

View file

@ -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;

View file

@ -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()