diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2015-02-15 15:05:22 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2015-02-15 15:05:22 +1000 |
commit | 2a04ff8641df26d5bdccb3061af3afea8f68fe23 (patch) | |
tree | c4bcf283579720a1a99fa952ad43e9368604ea46 /libs/ardour/test/test_ui.cc | |
parent | 964c04eec5f01a4d2a487dc6380173a01fd94aaa (diff) |
Add TestUI class to properly handle EventLoop invalidation
This fixes the programming error: Session RT event... warnings
while running ardour tests
Diffstat (limited to 'libs/ardour/test/test_ui.cc')
-rw-r--r-- | libs/ardour/test/test_ui.cc | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/libs/ardour/test/test_ui.cc b/libs/ardour/test/test_ui.cc new file mode 100644 index 0000000000..202c19a699 --- /dev/null +++ b/libs/ardour/test/test_ui.cc @@ -0,0 +1,66 @@ +/* + Copyright (C) 2015 Tim Mayberry + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "test_ui.h" + +#include <glibmm/threads.h> + +#include "pbd/error.h" + +#include "ardour/session_event.h" +#include "ardour/rc_configuration.h" + +#include "pbd/abstract_ui.cc" // instantiate template + +using namespace ARDOUR; + +template class AbstractUI<TestUIRequest>; + +TestUI::TestUI () + : AbstractUI<TestUIRequest> ("test_ui") +{ + + pthread_set_name ("test_ui_thread"); + + run_loop_thread = Glib::Threads::Thread::self (); + + set_event_loop_for_thread (this); + + SessionEvent::create_per_thread_pool ("test", 512); + + m_test_receiver.listen_to (PBD::error); + m_test_receiver.listen_to (PBD::info); + m_test_receiver.listen_to (PBD::fatal); + m_test_receiver.listen_to (PBD::warning); + + /* We can't use VSTs here as we have a stub instead of the + required bits in gtk2_ardour. + */ + Config->set_use_lxvst (false); +} + +TestUI::~TestUI () +{ + m_test_receiver.hangup (); +} + +void +TestUI::do_request (TestUIRequest* req) +{ + +} |