summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-26 02:11:06 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-26 02:11:06 +0000
commitc52bdcf69d049a4afa107e6247321afb93c65e1b (patch)
treee61c757b4682052613b151929ae022067458e603 /libs
parenta054a74dd29197679eb6f67e6fcaa54df7d70810 (diff)
Remove unused named selection / chunk code.
git-svn-id: svn://localhost/ardour2/branches/3.0@12939 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/named_selection.h57
-rw-r--r--libs/ardour/ardour/session.h22
-rw-r--r--libs/ardour/ardour/session_selection.h39
-rw-r--r--libs/ardour/named_selection.cc131
-rw-r--r--libs/ardour/session.cc54
-rw-r--r--libs/ardour/session_state.cc49
-rw-r--r--libs/ardour/wscript1
7 files changed, 0 insertions, 353 deletions
diff --git a/libs/ardour/ardour/named_selection.h b/libs/ardour/ardour/named_selection.h
deleted file mode 100644
index c120848328..0000000000
--- a/libs/ardour/ardour/named_selection.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- Copyright (C) 2003 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
- 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.
-
-*/
-
-#ifndef __ardour_named_selection_h__
-#define __ardour_named_selection_h__
-
-#include <string>
-#include <list>
-#include <boost/shared_ptr.hpp>
-
-#include "pbd/stateful.h"
-
-class XMLNode;
-
-namespace ARDOUR
-{
-
-class Session;
-class Playlist;
-
-class NamedSelection : public PBD::Stateful
-{
-public:
- NamedSelection (std::string, std::list<boost::shared_ptr<Playlist> >&);
- NamedSelection (Session&, const XMLNode&);
- virtual ~NamedSelection ();
-
- std::string name;
- std::list<boost::shared_ptr<Playlist> > playlists;
-
- XMLNode& get_state (void);
-
- int set_state (const XMLNode&, int version);
-
- static PBD::Signal1<void,NamedSelection*> NamedSelectionCreated;
-};
-
-}/* namespace ARDOUR */
-
-#endif /* __ardour_named_selection_h__ */
-
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 4c87b759b1..518a99d961 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -111,7 +111,6 @@ class MidiControlUI;
class MidiRegion;
class MidiSource;
class MidiTrack;
-class NamedSelection;
class Playlist;
class PluginInsert;
class PluginInfo;
@@ -578,16 +577,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void add_playlist (boost::shared_ptr<Playlist>, bool unused = false);
- /* named selections */
-
- boost::shared_ptr<NamedSelection> named_selection_by_name (std::string name);
- void add_named_selection (boost::shared_ptr<NamedSelection>);
- void remove_named_selection (boost::shared_ptr<NamedSelection>);
-
- template<class T> void foreach_named_selection (T& obj, void (T::*func)(boost::shared_ptr<NamedSelection>));
- PBD::Signal0<void> NamedSelectionAdded;
- PBD::Signal0<void> NamedSelectionRemoved;
-
/* Curves and AutomationLists (TODO when they go away) */
void add_automation_list(AutomationList*);
@@ -1306,17 +1295,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void playlist_ranges_moved (std::list<Evoral::RangeMove<framepos_t> > const &);
void playlist_regions_extended (std::list<Evoral::Range<framepos_t> > const &);
- /* NAMED SELECTIONS */
-
- mutable Glib::Mutex named_selection_lock;
- typedef std::set<boost::shared_ptr<NamedSelection> > NamedSelectionList;
- NamedSelectionList named_selections;
-
- int load_named_selections (const XMLNode&);
-
- NamedSelection *named_selection_factory (std::string name);
- NamedSelection *XMLNamedSelectionFactory (const XMLNode&);
-
/* CURVES and AUTOMATION LISTS */
std::map<PBD::ID, AutomationList*> automation_lists;
diff --git a/libs/ardour/ardour/session_selection.h b/libs/ardour/ardour/session_selection.h
deleted file mode 100644
index 52c7ab0e0e..0000000000
--- a/libs/ardour/ardour/session_selection.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (C) 2002 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
- 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.
-
-*/
-
-#ifndef __ardour_session_named_selection_h__
-#define __ardour_session_named_selection_h__
-
-#include "ardour/session.h"
-#include "ardour/named_selection.h"
-
-namespace ARDOUR {
-
-template<class T> void
-Session::foreach_named_selection (T& obj, void (T::*func)(NamedSelection&))
-{
- Glib::Mutex::Lock lm (named_selection_lock);
- for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); i++) {
- (obj.*func) (**i);
- }
-}
-
-} /* namespace */
-
-#endif /* __ardour_session_named_selection_h__ */
diff --git a/libs/ardour/named_selection.cc b/libs/ardour/named_selection.cc
deleted file mode 100644
index 4bcc3f3b72..0000000000
--- a/libs/ardour/named_selection.cc
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- Copyright (C) 2003 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
- 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 "pbd/failed_constructor.h"
-#include "pbd/error.h"
-
-#include "ardour/session.h"
-#include "ardour/utils.h"
-#include "ardour/playlist.h"
-#include "ardour/named_selection.h"
-#include "ardour/session_playlists.h"
-
-#include "i18n.h"
-
-using namespace std;
-using namespace ARDOUR;
-using namespace PBD;
-
-PBD::Signal1<void,NamedSelection*> NamedSelection::NamedSelectionCreated;
-
-typedef std::list<boost::shared_ptr<Playlist> > PlaylistList;
-
-NamedSelection::NamedSelection (string n, PlaylistList& l)
- : name (n)
-{
- playlists = l;
- for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- string new_name;
-
- /* rename playlists to reflect our ownership */
-
- new_name = name;
- new_name += '/';
- new_name += (*i)->name();
-
- (*i)->set_name (new_name);
- (*i)->use();
- }
-}
-
-NamedSelection::NamedSelection (Session& session, const XMLNode& node)
-{
- XMLNode* lists_node;
- const XMLProperty* property;
-
- if ((property = node.property ("name")) == 0) {
- throw failed_constructor();
- }
-
- name = property->value();
-
- if ((lists_node = find_named_node (node, "Playlists")) == 0) {
- return;
- }
-
- XMLNodeList nlist = lists_node->children();
- XMLNodeConstIterator niter;
-
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
- const XMLNode* plnode;
- string playlist_name;
- boost::shared_ptr<Playlist> playlist;
-
- plnode = *niter;
-
- if ((property = plnode->property ("name")) != 0) {
- if ((playlist = session.playlists->by_name (property->value())) != 0) {
- playlist->use();
- playlists.push_back (playlist);
- } else {
- warning << string_compose (_("Chunk %1 uses an unknown playlist \"%2\""), name, property->value()) << endmsg;
- }
- } else {
- error << string_compose (_("Chunk %1 contains misformed playlist information"), name) << endmsg;
- throw failed_constructor();
- }
- }
-
- NamedSelectionCreated (this);
-}
-
-NamedSelection::~NamedSelection ()
-{
- for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- /* XXX who really owns these? us or the session? */
- (*i)->drop_references ();
- (*i)->release ();
- }
-}
-
-int
-NamedSelection::set_state (const XMLNode& /*node*/, int /*version*/)
-{
- return 0;
-}
-
-XMLNode&
-NamedSelection::get_state ()
-{
- XMLNode* root = new XMLNode ("NamedSelection");
- XMLNode* child;
-
- root->add_property ("name", name);
- child = root->add_child ("Playlists");
-
- for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- XMLNode* plnode = new XMLNode ("Playlist");
-
- plnode->add_property ("name", (*i)->name());
- child->add_child_nocopy (*plnode);
- }
-
- return *root;
-}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index bcba42f01d..9dacdc34cb 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -68,7 +68,6 @@
#include "ardour/graph.h"
#include "ardour/midi_track.h"
#include "ardour/midi_ui.h"
-#include "ardour/named_selection.h"
#include "ardour/operations.h"
#include "ardour/playlist.h"
#include "ardour/plugin.h"
@@ -280,9 +279,6 @@ Session::destroy ()
/* tell everyone to drop references and delete objects as we go */
- DEBUG_TRACE (DEBUG::Destruction, "delete named selections\n");
- named_selections.clear ();
-
DEBUG_TRACE (DEBUG::Destruction, "delete regions\n");
RegionFactory::delete_all_regions ();
@@ -3786,56 +3782,6 @@ Session::unmark_insert_id (uint32_t id)
}
}
-
-/* Named Selection management */
-
-boost::shared_ptr<NamedSelection>
-Session::named_selection_by_name (string name)
-{
- Glib::Mutex::Lock lm (named_selection_lock);
- for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ++i) {
- if ((*i)->name == name) {
- return *i;
- }
- }
- return boost::shared_ptr<NamedSelection>();
-}
-
-void
-Session::add_named_selection (boost::shared_ptr<NamedSelection> named_selection)
-{
- {
- Glib::Mutex::Lock lm (named_selection_lock);
- named_selections.insert (named_selections.begin(), named_selection);
- }
-
- set_dirty();
-
- NamedSelectionAdded (); /* EMIT SIGNAL */
-}
-
-void
-Session::remove_named_selection (boost::shared_ptr<NamedSelection> named_selection)
-{
- bool removed = false;
-
- {
- Glib::Mutex::Lock lm (named_selection_lock);
-
- NamedSelectionList::iterator i = find (named_selections.begin(), named_selections.end(), named_selection);
-
- if (i != named_selections.end()) {
- named_selections.erase (i);
- set_dirty();
- removed = true;
- }
- }
-
- if (removed) {
- NamedSelectionRemoved (); /* EMIT SIGNAL */
- }
-}
-
void
Session::reset_native_file_format ()
{
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 1509a757eb..40cb364d73 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -93,7 +93,6 @@
#include "ardour/midi_region.h"
#include "ardour/midi_source.h"
#include "ardour/midi_track.h"
-#include "ardour/named_selection.h"
#include "ardour/pannable.h"
#include "ardour/playlist_factory.h"
#include "ardour/port.h"
@@ -1159,15 +1158,6 @@ Session::state (bool full_state)
gain_child->add_child_nocopy (_click_gain->state (full_state));
}
- if (full_state) {
- XMLNode* ns_child = node->add_child ("NamedSelections");
- for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ++i) {
- if (full_state) {
- ns_child->add_child_nocopy ((*i)->get_state());
- }
- }
- }
-
node->add_child_nocopy (_speakers->get_state());
node->add_child_nocopy (_tempo_map->get_state());
node->add_child_nocopy (get_control_protocol_state());
@@ -1327,12 +1317,6 @@ Session::set_state (const XMLNode& node, int version)
}
}
- if ((child = find_named_node (node, "NamedSelections")) != 0) {
- if (load_named_selections (*child)) {
- goto out;
- }
- }
-
if (version >= 3000) {
if ((child = find_named_node (node, "Bundles")) == 0) {
warning << _("Session: XML state has no bundles section") << endmsg;
@@ -2224,39 +2208,6 @@ Session::get_best_session_directory_for_new_source ()
return result;
}
-int
-Session::load_named_selections (const XMLNode& node)
-{
- XMLNodeList nlist;
- XMLNodeConstIterator niter;
- NamedSelection *ns;
-
- nlist = node.children();
-
- set_dirty();
-
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
- if ((ns = XMLNamedSelectionFactory (**niter)) == 0) {
- error << _("Session: cannot create Named Selection from XML description.") << endmsg;
- }
- }
-
- return 0;
-}
-
-NamedSelection *
-Session::XMLNamedSelectionFactory (const XMLNode& node)
-{
- try {
- return new NamedSelection (*this, node);
- }
-
- catch (failed_constructor& err) {
- return 0;
- }
-}
-
string
Session::automation_dir () const
{
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index 4cece8f132..4c05af8c77 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -138,7 +138,6 @@ libardour_sources = [
'mtc_slave.cc',
'mtdm.cc',
'mute_master.cc',
- 'named_selection.cc',
'onset_detector.cc',
'operations.cc',
'pan_controllable.cc',