diff options
author | David Robillard <d@drobilla.net> | 2018-11-24 13:44:03 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-24 13:44:03 +0100 |
commit | a7d83f19b08eb4c6f79a82fe60c2b86db13f4420 (patch) | |
tree | d9b620bfba1e7462df4ddb3f6225cc5216c0ca81 /src/server/events/Move.cpp | |
parent | d63edc742cebd685f8a05936682210aa5c1e69a9 (diff) | |
download | ingen-a7d83f19b08eb4c6f79a82fe60c2b86db13f4420.tar.gz ingen-a7d83f19b08eb4c6f79a82fe60c2b86db13f4420.tar.bz2 ingen-a7d83f19b08eb4c6f79a82fe60c2b86db13f4420.zip |
Squashed 'waflib/' changes from 6e726eb1..5ea8f99f
5ea8f99f Improve test output spacing
0e23b29f Raise exception when test suite fails to ensure non-zero exit status
d6de073b Show run time of unit tests
5b655541 Add short configure option for ultra-strict flags
4687ba6d Use gtest-like test output
258903d9 Fix failure count in test group summaries
da07e738 Fix verbose tests with Python 3
git-subtree-dir: waflib
git-subtree-split: 5ea8f99f6e1246079c1fe6bb590c38a53aadd40d
Diffstat (limited to 'src/server/events/Move.cpp')
-rw-r--r-- | src/server/events/Move.cpp | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp deleted file mode 100644 index b0935675..00000000 --- a/src/server/events/Move.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2016 David Robillard <http://drobilla.net/> - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "ingen/Store.hpp" -#include "raul/Path.hpp" - -#include "BlockImpl.hpp" -#include "Broadcaster.hpp" -#include "Driver.hpp" -#include "Engine.hpp" -#include "EnginePort.hpp" -#include "GraphImpl.hpp" -#include "events/Move.hpp" - -namespace Ingen { -namespace Server { -namespace Events { - -Move::Move(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const Ingen::Move& msg) - : Event(engine, client, msg.seq, timestamp) - , _msg(msg) -{ -} - -bool -Move::pre_process(PreProcessContext& ctx) -{ - std::lock_guard<Store::Mutex> lock(_engine.store()->mutex()); - - if (!_msg.old_path.parent().is_parent_of(_msg.new_path)) { - return Event::pre_process_done(Status::PARENT_DIFFERS, _msg.new_path); - } - - const Store::iterator i = _engine.store()->find(_msg.old_path); - if (i == _engine.store()->end()) { - return Event::pre_process_done(Status::NOT_FOUND, _msg.old_path); - } - - if (_engine.store()->find(_msg.new_path) != _engine.store()->end()) { - return Event::pre_process_done(Status::EXISTS, _msg.new_path); - } - - EnginePort* eport = _engine.driver()->get_port(_msg.old_path); - if (eport) { - _engine.driver()->rename_port(_msg.old_path, _msg.new_path); - } - - _engine.store()->rename(i, _msg.new_path); - - return Event::pre_process_done(Status::SUCCESS); -} - -void -Move::execute(RunContext& context) -{ -} - -void -Move::post_process() -{ - Broadcaster::Transfer t(*_engine.broadcaster()); - if (respond() == Status::SUCCESS) { - _engine.broadcaster()->message(_msg); - } -} - -void -Move::undo(Interface& target) -{ - target.move(_msg.new_path, _msg.old_path); -} - -} // namespace Events -} // namespace Server -} // namespace Ingen |