diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-25 17:48:55 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-25 17:48:55 +0000 |
commit | 3cd8138a419cb165f56070ace0b21a1e63ec5a43 (patch) | |
tree | 51efe9abff24a1367be227aebf8e2901433b0b88 /libs/surfaces | |
parent | eb6e352dd0a307badf68ae4a216d15c03b4685de (diff) |
convert from Glib:: to Glib::Threads for all thread-related API
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
7 files changed, 63 insertions, 67 deletions
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h index 0c7f600e2c..da7340182e 100644 --- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h +++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h @@ -8,7 +8,7 @@ #include <pthread.h> #include <usb.h> -#include <glibmm/thread.h> +#include <glibmm/threads.h> #include "ardour/types.h" @@ -130,7 +130,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol ARDOUR::gain_t gain_fraction; - Glib::Mutex update_lock; + Glib::Threads::Mutex update_lock; bool screen_invalid[2][20]; char screen_current[2][20]; diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index d6a75f66f9..e23e8725ae 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -24,7 +24,6 @@ #include <glibmm/fileutils.h> #include <glibmm/miscutils.h> -#include <glibmm/thread.h> #include "pbd/controllable_descriptor.h" #include "pbd/error.h" @@ -186,8 +185,8 @@ GenericMidiControlProtocol::reload_maps () void GenericMidiControlProtocol::drop_all () { - Glib::Mutex::Lock lm (pending_lock); - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm (pending_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) { delete *i; @@ -213,7 +212,7 @@ GenericMidiControlProtocol::drop_all () void GenericMidiControlProtocol::drop_bindings () { - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ) { if (!(*i)->learned()) { @@ -286,7 +285,7 @@ GenericMidiControlProtocol::_send_feedback () first on to ALSA. */ - Glib::Mutex::Lock lm (controllables_lock, Glib::TRY_LOCK); + Glib::Threads::Mutex::Lock lm (controllables_lock, Glib::Threads::TRY_LOCK); if (!lm.locked ()) { return; } @@ -306,7 +305,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c) return false; } - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); MIDIControllables::iterator tmp; for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ) { @@ -320,7 +319,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c) } { - Glib::Mutex::Lock lm (pending_lock); + Glib::Threads::Mutex::Lock lm (pending_lock); MIDIPendingControllables::iterator ptmp; for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) { @@ -350,7 +349,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c) } { - Glib::Mutex::Lock lm (pending_lock); + Glib::Threads::Mutex::Lock lm (pending_lock); MIDIPendingControllable* element = new MIDIPendingControllable; element->first = mc; @@ -366,8 +365,8 @@ GenericMidiControlProtocol::start_learning (Controllable* c) void GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc) { - Glib::Mutex::Lock lm (pending_lock); - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm (pending_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); MIDIPendingControllables::iterator tmp; @@ -390,8 +389,8 @@ GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc) void GenericMidiControlProtocol::stop_learning (Controllable* c) { - Glib::Mutex::Lock lm (pending_lock); - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm (pending_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); MIDIControllable* dptr = 0; /* learning timed out, and we've been told to consider this attempt to learn to be cancelled. find the @@ -417,7 +416,7 @@ void GenericMidiControlProtocol::delete_binding (PBD::Controllable* control) { if (control != 0) { - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) { MIDIControllable* existingBinding = (*iter); @@ -437,7 +436,7 @@ void GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos, int control_number) { if (control != NULL) { - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); MIDI::channel_t channel = (pos & 0xf); MIDI::byte value = control_number; @@ -489,7 +488,7 @@ GenericMidiControlProtocol::get_state () node->add_child_nocopy (*children); - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) { /* we don't care about bindings that come from a bindings map, because @@ -529,7 +528,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) boost::shared_ptr<Controllable> c; { - Glib::Mutex::Lock lm (pending_lock); + Glib::Threads::Mutex::Lock lm (pending_lock); for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) { delete *i; } @@ -537,7 +536,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version) } { - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); controllables.clear (); nlist = node.children(); // "Controls" @@ -666,7 +665,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath) /* controllable */ if ((mc = create_binding (*child)) != 0) { - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); controllables.push_back (mc); } @@ -764,7 +763,7 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node) void GenericMidiControlProtocol::reset_controllables () { - Glib::Mutex::Lock lm2 (controllables_lock); + Glib::Threads::Mutex::Lock lm2 (controllables_lock); for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end(); ) { MIDIControllable* existingBinding = (*iter); diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h index ee1144a667..a7c420cc41 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -21,7 +21,7 @@ #define ardour_generic_midi_control_protocol_h #include <list> -#include <glibmm/thread.h> +#include <glibmm/threads.h> #include "ardour/types.h" #include "control_protocol/control_protocol.h" @@ -118,8 +118,8 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol { typedef std::pair<MIDIControllable*,PBD::ScopedConnection> MIDIPendingControllable; typedef std::list<MIDIPendingControllable* > MIDIPendingControllables; MIDIPendingControllables pending_controllables; - Glib::Mutex controllables_lock; - Glib::Mutex pending_lock; + Glib::Threads::Mutex controllables_lock; + Glib::Threads::Mutex pending_lock; bool start_learning (PBD::Controllable*); void stop_learning (PBD::Controllable*); diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 7a9e34195e..080aef1e3d 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -28,8 +28,6 @@ #include <pthread.h> #include <boost/smart_ptr.hpp> -#include <glibmm/thread.h> - #include "pbd/abstract_ui.h" #include "midi++/types.h" #include "ardour/types.h" diff --git a/libs/surfaces/mackie/surface_port.h b/libs/surfaces/mackie/surface_port.h index 70b1df4580..7dc20a06f2 100644 --- a/libs/surfaces/mackie/surface_port.h +++ b/libs/surfaces/mackie/surface_port.h @@ -19,7 +19,6 @@ #define surface_port_h #include <midi++/types.h> -#include <glibmm/thread.h> #include "pbd/signals.h" #include "midi_byte_array.h" diff --git a/libs/surfaces/tranzport/tranzport_control_protocol.h b/libs/surfaces/tranzport/tranzport_control_protocol.h index 53d64e8e98..1c318007b0 100644 --- a/libs/surfaces/tranzport/tranzport_control_protocol.h +++ b/libs/surfaces/tranzport/tranzport_control_protocol.h @@ -33,7 +33,7 @@ #include <usb.h> #endif -#include <glibmm/thread.h> +#include <glibmm/threads.h> #include "ardour/types.h" #include "control_protocol/control_protocol.h" @@ -170,7 +170,7 @@ private: ARDOUR::gain_t gain_fraction; - Glib::Mutex update_lock; + Glib::Threads::Mutex update_lock; std::bitset<ROWS*COLUMNS> screen_invalid; char screen_current[ROWS][COLUMNS]; diff --git a/libs/surfaces/wiimote/wiimote.h b/libs/surfaces/wiimote/wiimote.h index c7c2cd59c9..4ab19749e5 100644 --- a/libs/surfaces/wiimote/wiimote.h +++ b/libs/surfaces/wiimote/wiimote.h @@ -4,7 +4,7 @@ #include "ardour/types.h" #include "control_protocol/control_protocol.h" -#include <glibmm/thread.h> +#include <glibmm/threads.h> #include "pbd/abstract_ui.h" @@ -16,7 +16,7 @@ namespace ARDOUR { } #define ENSURE_WIIMOTE_THREAD(slot) \ - if (Glib::Thread::self() != main_thread) {\ + if (Glib::Threads::Thread::self() != main_thread) { \ slot_mutex.lock();\ slot_list.push_back(slot);\ slot_cond.signal();\ @@ -26,42 +26,42 @@ namespace ARDOUR { class WiimoteControlProtocol : public ARDOUR::ControlProtocol { - public: - WiimoteControlProtocol (ARDOUR::Session &); - virtual ~WiimoteControlProtocol (); - - static bool probe(); - - int set_active (bool yn); - XMLNode& get_state(); - int set_state(const XMLNode&); - - void wiimote_callback(cwiid_wiimote_t *, int, union cwiid_mesg [], - struct timespec *); - - private: - - void wiimote_main(); - volatile bool main_thread_quit; - volatile bool restart_discovery; - - Glib::Thread *main_thread; - - void update_led_state(); - - bool callback_thread_registered_for_ardour; - - static uint16_t button_state; - - cwiid_wiimote_t *wiimote_handle; - - Glib::Cond slot_cond; - Glib::Mutex slot_mutex; - - std::list< sigc::slot<void> > slot_list; - - sigc::connection transport_state_conn; - sigc::connection record_state_conn; + public: + WiimoteControlProtocol (ARDOUR::Session &); + virtual ~WiimoteControlProtocol (); + + static bool probe(); + + int set_active (bool yn); + XMLNode& get_state(); + int set_state(const XMLNode&); + + void wiimote_callback(cwiid_wiimote_t *, int, union cwiid_mesg [], + struct timespec *); + + private: + + void wiimote_main(); + volatile bool main_thread_quit; + volatile bool restart_discovery; + + Glib::Threads::Thread *main_thread; + + void update_led_state(); + + bool callback_thread_registered_for_ardour; + + static uint16_t button_state; + + cwiid_wiimote_t *wiimote_handle; + + Glib::Threads::Cond slot_cond; + Glib::Threads::Mutex slot_mutex; + + std::list< sigc::slot<void> > slot_list; + + sigc::connection transport_state_conn; + sigc::connection record_state_conn; }; |