2007-04-26 16:54:31 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2007-2009 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2007-04-26 16:54:31 -04:00
|
|
|
|
2007-06-27 16:23:48 -04:00
|
|
|
#ifndef __ardour_gtk_processor_selection_h__
|
|
|
|
#define __ardour_gtk_processor_selection_h__
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2017-05-05 07:31:49 -04:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "pbd/signals.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/xml++.h"
|
2007-08-01 18:18:46 -04:00
|
|
|
|
2017-05-05 07:31:49 -04:00
|
|
|
class XMLProcessorSelection {
|
2007-08-01 18:18:46 -04:00
|
|
|
public:
|
2017-05-05 07:31:49 -04:00
|
|
|
XMLProcessorSelection() : node (0) {}
|
|
|
|
~XMLProcessorSelection() { if (node) { delete node; } }
|
|
|
|
|
|
|
|
void set (XMLNode* n) {
|
|
|
|
if (node) {
|
|
|
|
delete node;
|
|
|
|
}
|
|
|
|
node = n;
|
|
|
|
}
|
|
|
|
|
|
|
|
void add (XMLNode* newchild) {
|
|
|
|
if (!node) {
|
|
|
|
node = new XMLNode ("add");
|
|
|
|
}
|
|
|
|
node->add_child_nocopy (*newchild);
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear () {
|
|
|
|
if (node) {
|
|
|
|
delete node;
|
|
|
|
node = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool empty () const { return node == 0 || node->children().empty(); }
|
|
|
|
|
|
|
|
const XMLNode& get_node() const { return *node; }
|
2007-08-01 18:18:46 -04:00
|
|
|
|
|
|
|
private:
|
2017-05-05 07:31:49 -04:00
|
|
|
XMLNode* node;
|
2007-08-01 18:18:46 -04:00
|
|
|
};
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2017-05-05 07:31:49 -04:00
|
|
|
class ProcessorSelection : public PBD::ScopedConnectionList, public sigc::trackable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorSelection () {}
|
|
|
|
|
|
|
|
XMLProcessorSelection processors;
|
|
|
|
sigc::signal<void> ProcessorsChanged;
|
|
|
|
|
|
|
|
|
|
|
|
void clear ();
|
|
|
|
bool empty();
|
|
|
|
|
|
|
|
void set (XMLNode* node);
|
|
|
|
void add (XMLNode* node);
|
|
|
|
|
|
|
|
void clear_processors ();
|
2017-11-23 05:29:07 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
ProcessorSelection& operator= (const ProcessorSelection& other);
|
|
|
|
ProcessorSelection (ProcessorSelection const&);
|
2017-05-05 07:31:49 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
bool operator==(const ProcessorSelection& a, const ProcessorSelection& b);
|
|
|
|
|
2007-06-27 16:23:48 -04:00
|
|
|
#endif /* __ardour_gtk_processor_selection_h__ */
|