/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2004 Paul Davis
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
#ifndef __ardour_gtk_processor_selection_h__
#define __ardour_gtk_processor_selection_h__
-#include <list>
-#include <boost/shared_ptr.hpp>
+#include <vector>
-namespace ARDOUR {
- class Processor;
-}
+#include "pbd/signals.h"
+#include "pbd/xml++.h"
-struct ProcessorSelection : list<boost::shared_ptr<ARDOUR::Processor> > {};
+class XMLProcessorSelection {
+ public:
+ 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; }
+
+ private:
+ XMLNode* node;
+};
+
+class ProcessorSelection : public PBD::ScopedConnectionList, public sigc::trackable
+{
+ public:
+ ProcessorSelection () {}
+
+ XMLProcessorSelection processors;
+ sigc::signal<void> ProcessorsChanged;
+
+ ProcessorSelection& operator= (const ProcessorSelection& other);
+
+ void clear ();
+ bool empty();
+
+ void set (XMLNode* node);
+ void add (XMLNode* node);
+
+ void clear_processors ();
+};
+
+bool operator==(const ProcessorSelection& a, const ProcessorSelection& b);
#endif /* __ardour_gtk_processor_selection_h__ */