remove a couple of boost::signals2 trouble spots; fix some --strict compile time warnings

git-svn-id: svn://localhost/ardour2/branches/3.0@6378 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-12-20 16:50:41 +00:00
parent 96cd6c993b
commit 738387f9a4
25 changed files with 76 additions and 68 deletions

View File

@ -682,6 +682,7 @@ Editor::Editor ()
ControlProtocol::ZoomOut.connect (*this, boost::bind (&Editor::temporal_zoom_step, this, true));
ControlProtocol::ScrollTimeline.connect (*this, boost::bind (&Editor::control_scroll, this, _1));
BasicUI::AccessAction.connect (*this, boost::bind (&Editor::access_action, this, _1, _2));
Session::AskAboutPlaylistDeletion.connect (*this, boost::bind (&Editor::playlist_deletion_dialog, this, _1));
Config->ParameterChanged.connect (*this, boost::bind (&Editor::parameter_changed, this, _1));
@ -1075,8 +1076,6 @@ Editor::set_session (Session *t)
update_title ();
_session->history().Changed.connect (_session_connections, boost::bind (&Editor::history_changed, this));
/* These signals can all be emitted by a non-GUI thread. Therefore the
handlers for them must not attempt to directly interact with the GUI,
but use Gtkmm2ext::UI::instance()->call_slot();
@ -1087,12 +1086,17 @@ Editor::set_session (Session *t)
_session->RouteAdded.connect (_session_connections, boost::bind (&Editor::handle_new_route, this, _1));
_session->DurationChanged.connect (_session_connections, boost::bind (&Editor::handle_new_duration, this));
_session->DirtyChanged.connect (_session_connections, boost::bind (&Editor::update_title, this));
_session->StateSaved.connect (_session_connections, boost::bind (&Editor::update_title, this));
_session->AskAboutPlaylistDeletion.connect (_session_connections, boost::bind (&Editor::playlist_deletion_dialog, this, _1));
_session->TimecodeOffsetChanged.connect (_session_connections, boost::bind (&Editor::update_just_timecode, this));
_session->tempo_map().StateChanged.connect (_session_connections, boost::bind (&Editor::tempo_map_changed, this, _1));
_session->Located.connect (_session_connections, boost::bind (&Editor::located, this));
_session->config.ParameterChanged.connect (_session_connections, boost::bind (&Editor::parameter_changed, this, _1));
_session->StateSaved.connect (_session_connections, boost::bind (&Editor::session_state_saved, this, _1));
_session->locations()->added.connect (_session_connections, sigc::mem_fun(*this, &Editor::add_new_location));
_session->locations()->removed.connect (_session_connections, sigc::mem_fun(*this, &Editor::location_gone));
_session->locations()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display));
_session->locations()->StateChanged.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display_s));
_session->locations()->end_location()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::end_location_changed));
_session->history().Changed.connect (_session_connections, boost::bind (&Editor::history_changed, this));
if (Profile->get_sae()) {
BBT_Time bbt;
@ -1139,19 +1143,7 @@ Editor::set_session (Session *t)
Config->map_parameters (pc);
_session->config.map_parameters (pc);
refresh_location_display ();
/* static signal - no need to drop connection when session is deleted (XXX or we are?)*/
_session->StateSaved.connect (*this, boost::bind (&Editor::session_state_saved, this, _1));
_session->locations()->added.connect (_session_connections, sigc::mem_fun(*this, &Editor::add_new_location));
_session->locations()->removed.connect (_session_connections, sigc::mem_fun(*this, &Editor::location_gone));
_session->locations()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display));
_session->locations()->StateChanged.connect (_session_connections, sigc::mem_fun(*this, &Editor::refresh_location_display_s));
_session->locations()->end_location()->changed.connect (_session_connections, sigc::mem_fun(*this, &Editor::end_location_changed));
handle_new_duration ();
restore_ruler_visibility ();
@ -3920,8 +3912,9 @@ Editor::control_layout_scroll (GdkEventScroll* ev)
void
Editor::session_state_saved (string snap_name)
{
ENSURE_GUI_THREAD (*this, &Editor::session_state_saved, snap_name)
ENSURE_GUI_THREAD (*this, &Editor::session_state_saved, snap_name);
update_title ();
_snapshots->redisplay ();
}

View File

@ -113,6 +113,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
: sigc::trackable(other)
, PBD::ScopedConnectionList()
, trackview (other.trackview)
{

View File

@ -50,7 +50,8 @@ namespace ARDOUR {
Transport = 0x400,
Slave = 0x800,
SessionEvents = 0x800,
MidiIO = 0x1000
MidiIO = 0x1000,
MackieControl = 0x2000
};
}
@ -58,12 +59,13 @@ namespace ARDOUR {
#ifndef NDEBUG
#define DEBUG_TRACE(bits,str) if ((bits) & ARDOUR::debug_bits) { ARDOUR::debug_print (# bits, str); }
#define DEBUG_STR_SET(id,s) std::stringstream __debug_str ## id; __debug_str ## id << s;
#define DEBUG_STR_DECL(id) std::stringstream __debug_str ## id;
#define DEBUG_STR(id) __debug_str ## id
#define DEBUG_STR_APPEND(id,s) __debug_str ## id << s;
#else
#define DEBUG_TRACE(bits,fmt,...) /*empty*/
#define DEBUG_STR_SET(a,b) /* empty */
#define DEBUG_STR(a) /* empty */
#define DEBUG_STR_APPEND(a,b) /* empty */
#endif
#endif /* __ardour_debug_h__ */

View File

@ -4,9 +4,10 @@
#include <list>
#include <boost/signals2.hpp>
#include "pbd/abstract_ui.h"
#include "pbd/signals.h"
namespace MIDI {
class port;
class Port;
}
namespace ARDOUR {

View File

@ -548,7 +548,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
0 for "yes, delete this playlist",
1 for "no, don't delete this playlist".
*/
PBD::Signal1<void,boost::shared_ptr<Playlist> > AskAboutPlaylistDeletion;
static PBD::Signal1<int,boost::shared_ptr<Playlist> > AskAboutPlaylistDeletion;
/** handlers should return 0 for "ignore the rate mismatch",
!0 for "do not use this session"
@ -1464,6 +1464,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void update_have_rec_enabled_diskstream ();
gint _have_rec_enabled_diskstream;
static int ask_about_playlist_deletion (boost::shared_ptr<Playlist>);
/* realtime "apply to set of routes" operations */
SessionEvent* get_rt_event (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override,
void (Session::*method) (boost::shared_ptr<RouteList>, bool, bool));

View File

@ -173,7 +173,7 @@ InternalSend::get_state()
}
int
InternalSend::set_our_state (const XMLNode& node, int version)
InternalSend::set_our_state (const XMLNode& node, int /*version*/)
{
const XMLProperty* prop;

View File

@ -427,7 +427,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
}
int
LadspaPlugin::set_state_2X (const XMLNode& node, int version)
LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
{
XMLNodeList nodes;
XMLProperty *prop;

View File

@ -107,8 +107,10 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
#ifndef NDEBUG
DEBUG_TRACE (DEBUG::MidiDiskstreamIO, "wrote MidiEvent to Buffer: ");
for (size_t i=0; i < ev_size; ++i) {
DEBUG_STR_SET(a, hex);
DEBUG_STR(a) << "0x" << (int)write_loc[i] << ' ';
DEBUG_STR_DECL(a);
DEBUG_STR_APPEND(a,hex);
DEBUG_STR_APPEND(a,"0x");
DEBUG_STR_APPEND(a,(int)write_loc[i]);
DEBUG_TRACE (DEBUG::MidiDiskstreamIO, DEBUG_STR(a).str());
}
DEBUG_TRACE (DEBUG::MidiDiskstreamIO, "\n");

View File

@ -124,6 +124,7 @@ MidiControlUI::reset_ports ()
for (MIDI::Manager::PortList::iterator i = plist.begin(); i != plist.end(); ++i) {
int fd;
if ((fd = (*i)->selectable ()) >= 0) {
Glib::RefPtr<IOSource> psrc = IOSource::create (fd, IO_IN|IO_HUP|IO_ERR);

View File

@ -114,6 +114,7 @@ PBD::Signal0<void> Session::EndTimeChanged;
PBD::Signal0<void> Session::AutoBindingOn;
PBD::Signal0<void> Session::AutoBindingOff;
PBD::Signal2<void,std::string, std::string> Session::Exported;
PBD::Signal1<int,boost::shared_ptr<Playlist> > Session::AskAboutPlaylistDeletion;
static void clean_up_session_event (SessionEvent* ev) { delete ev; }
const SessionEvent::RTeventCallback Session::rt_cleanup (clean_up_session_event);
@ -387,8 +388,6 @@ Session::destroy ()
AudioDiskstream::free_working_buffers();
// BOOST::SIGNALS: Route::SyncOrderKeys.clear();
DEBUG_TRACE (DEBUG::Destruction, "delete named selections\n");
for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ) {
NamedSelectionList::iterator tmp;

View File

@ -872,8 +872,9 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
}
#ifndef NDEBUG
DEBUG_STR_SET(foo,"sending ");
DEBUG_STR(foo) << transmitting_timecode_time;
DEBUG_STR_DECL(foo)
DEBUG_STR_APPEND(foo,"sending ");
DEBUG_STR_APPEND(foo, transmitting_timecode_time);
DEBUG_TRACE (DEBUG::MTC, string_compose ("%1 qfm = %2, stamp = %3\n", DEBUG_STR(foo).str(), next_quarter_frame_to_send,
out_stamp));
#endif

View File

@ -578,7 +578,7 @@ Session::follow_slave (nframes_t nframes)
}
#if 1
if (abs(average_slave_delta) > _slave->resolution()) {
if ((nframes_t) abs(average_slave_delta) > _slave->resolution()) {
cerr << "average slave delta greater than slave resolution (" << _slave->resolution() << "), going to silent motion\n";
goto silent_motion;
}

View File

@ -33,7 +33,7 @@ using namespace ARDOUR;
using namespace Glib;
SessionEvent*
Session::get_rt_event (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override,
Session::get_rt_event (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override,
void (Session::*method) (boost::shared_ptr<RouteList>, bool, bool))
{
SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
@ -51,7 +51,7 @@ Session::set_solo (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeve
}
void
Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool group_override)
Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool /* group_override */)
{
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
if (!(*i)->is_hidden()) {
@ -100,7 +100,7 @@ Session::set_listen (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTe
}
void
Session::rt_set_listen (boost::shared_ptr<RouteList> rl, bool yn, bool group_override)
Session::rt_set_listen (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_override*/ )
{
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
if (!(*i)->is_hidden()) {
@ -118,7 +118,7 @@ Session::set_mute (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeve
}
void
Session::rt_set_mute (boost::shared_ptr<RouteList> rl, bool yn, bool group_override)
Session::rt_set_mute (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_override*/)
{
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
if (!(*i)->is_hidden()) {

View File

@ -276,10 +276,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
Processor::ProcessorCreated.connect (*this, boost::bind (&Session::add_processor, this, _1));
NamedSelection::NamedSelectionCreated.connect (*this, boost::bind (&Session::add_named_selection, this, _1));
AutomationList::AutomationListCreated.connect (*this, boost::bind (&Session::add_automation_list, this, _1));
// BOOST SIGNALS
// Controllable::Destroyed.connect (*this, boost::bind (&Session::remove_controllable, this, _1));
Controllable::Destroyed.connect (*this, boost::bind (&Session::remove_controllable, this, _1));
IO::PortCountChanged.connect (*this, boost::bind (&Session::ensure_buffers, this, _1));
/* stop IO objects from doing stuff until we're ready for them */
@ -2290,6 +2287,12 @@ struct RegionCounter {
RegionCounter() : count (0) {}
};
int
Session::ask_about_playlist_deletion (boost::shared_ptr<Playlist> p)
{
return *AskAboutPlaylistDeletion (p);
}
int
Session::cleanup_sources (CleanupReport& rep)
{
@ -2311,12 +2314,11 @@ Session::cleanup_sources (CleanupReport& rep)
/* step 1: consider deleting all unused playlists */
/* BOOST SIGNALS
if (playlists->maybe_delete_unused (boost::bind (AskAboutPlaylistDeletion, _1));
if (playlists->maybe_delete_unused (boost::bind (Session::ask_about_playlist_deletion, _1))) {
ret = 0;
goto out;
}
*/
/* step 2: find all un-used sources */
rep.paths.clear ();

View File

@ -1687,7 +1687,7 @@ TempoMap::bbt_add (const BBT_Time& start, const BBT_Time& other) const
* add the BBT interval @param increment to @param start and return the result
*/
BBT_Time
TempoMap::bbt_add (const BBT_Time& start, const BBT_Time& increment, const TempoMetric& metric) const
TempoMap::bbt_add (const BBT_Time& start, const BBT_Time& increment, const TempoMetric& /*metric*/) const
{
BBT_Time result = start;
BBT_Time op = increment; /* argument is const, but we need to modify it */

View File

@ -135,7 +135,6 @@ void MidiClockTicker::transport_looped()
void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*transport_bbt*/, const Timecode::Time& /*transport_smpt*/)
{
#ifdef WITH_JACK_MIDI
if (!Config->get_send_midi_clock() || _session == 0 || _session->transport_speed() != 1.0f)
return;
@ -162,7 +161,6 @@ void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*
_last_tick = next_tick;
}
#endif // WITH_JACK_MIDI
}
double MidiClockTicker::one_ppqn_in_frames(nframes_t transport_position)

View File

@ -142,7 +142,7 @@ public:
* @param y y coordinate.
* @return Pair consisting of the child under (x, y) (or 0) and the index of the child under (x, y) (or -1)
*/
std::pair<T*, int> get_child_at_position (int x, int y) const
std::pair<T*, int> get_child_at_position (int /*x*/, int y) const
{
std::list<Gtk::Widget const *> children = _internal_vbox.get_children ();
std::list<Gtk::Widget const *>::iterator i = children.begin();
@ -202,7 +202,7 @@ private:
}
void drag_data_received (
Glib::RefPtr<Gdk::DragContext> const & context, int x, int y, Gtk::SelectionData const & selection_data, guint info, guint time
Glib::RefPtr<Gdk::DragContext> const & context, int x, int y, Gtk::SelectionData const & selection_data, guint /*info*/, guint time
)
{
/* work out where it was dropped */

View File

@ -212,7 +212,7 @@ JACK_MidiPort::flush (void* jack_port_buffer)
}
int
JACK_MidiPort::read (byte * buf, size_t bufsize)
JACK_MidiPort::read (byte *, size_t)
{
timestamp_t time;
Evoral::EventType type;

View File

@ -17,7 +17,7 @@ AbstractUI<RequestObject>::AbstractUI (const string& name)
}
template <typename RequestObject> void
AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_id, string thread_name, uint32_t num_requests)
AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_id, string /*thread name*/, uint32_t num_requests)
{
if (target_gui != name()) {
return;

View File

@ -46,7 +46,7 @@ class ScopedConnectionList : public boost::noncopyable
private:
/* this class is not copyable */
ScopedConnectionList(const ScopedConnectionList&) {}
ScopedConnectionList(const ScopedConnectionList&);
/* this lock is shared by all instances of a ScopedConnectionList.
We do not want one mutex per list, and since we only need the lock

View File

@ -38,6 +38,7 @@ UndoTransaction::UndoTransaction ()
UndoTransaction::UndoTransaction (const UndoTransaction& rhs)
: Command(rhs._name)
, PBD::ScopedConnectionList ()
, _clearing(false)
{
clear ();

View File

@ -109,7 +109,7 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu
void prev_track (uint32_t initial_id);
private:
ControlProtocol (const ControlProtocol&) {} /* noncopyable */
ControlProtocol (const ControlProtocol&); /* noncopyable */
};
extern "C" {

View File

@ -149,9 +149,10 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) {
ptmp = i;
++ptmp;
if (((*i).first)->get_controllable() == c) {
(*i).second.disconnect();
delete (*i).first;
if (((*i)->first)->get_controllable() == c) {
(*i)->second.disconnect();
delete (*i)->first;
delete *i;
pending_controllables.erase (i);
}
i = ptmp;
@ -174,13 +175,11 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
{
Glib::Mutex::Lock lm (pending_lock);
#if 0 // BOOST SIGNALS
std::pair<MIDIControllable *, boost::signals2::scoped_connection> element;
element.first = mc;
element.second = c->LearningFinished.connect (bind (mem_fun (*this, &GenericMidiControlProtocol::learning_stopped), mc));
MIDIPendingControllable* element = new MIDIPendingControllable;
element->first = mc;
c->LearningFinished.connect (element->second, boost::bind (&GenericMidiControlProtocol::learning_stopped, this, mc));
pending_controllables.push_back (element);
#endif
}
mc->learn_about_external_control ();
@ -199,8 +198,9 @@ GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc)
tmp = i;
++tmp;
if ( (*i).first == mc) {
(*i).second.disconnect();
if ( (*i)->first == mc) {
(*i)->second.disconnect();
delete *i;
pending_controllables.erase(i);
}
@ -222,11 +222,12 @@ GenericMidiControlProtocol::stop_learning (Controllable* c)
*/
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) {
if (((*i).first)->get_controllable() == c) {
(*i).first->stop_learning ();
dptr = (*i).first;
(*i).second.disconnect();
if (((*i)->first)->get_controllable() == c) {
(*i)->first->stop_learning ();
dptr = (*i)->first;
(*i)->second.disconnect();
delete *i;
pending_controllables.erase (i);
break;
}
@ -350,6 +351,9 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
{
Glib::Mutex::Lock lm (pending_lock);
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) {
delete *i;
}
pending_controllables.clear ();
}

View File

@ -51,7 +51,8 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
typedef std::set<MIDIControllable*> MIDIControllables;
MIDIControllables controllables;
typedef std::list<std::pair<MIDIControllable*,sigc::connection> > MIDIPendingControllables;
typedef std::pair<MIDIControllable*,PBD::Connection> MIDIPendingControllable;
typedef std::list<MIDIPendingControllable* > MIDIPendingControllables;
MIDIPendingControllables pending_controllables;
Glib::Mutex controllables_lock;
Glib::Mutex pending_lock;

View File

@ -82,7 +82,7 @@ def create_stored_revision():
try:
text = '#include "ardour/svn_revision.h"\n'
text += 'namespace ARDOUR { extern const char* svn_revision = \"' + rev + '\"; }\n'
text += 'namespace ARDOUR { const char* svn_revision = \"' + rev + '\"; }\n'
print 'Writing svn revision info to libs/ardour/svn_revision.cc'
o = file('libs/ardour/svn_revision.cc', 'w')
o.write(text)