Ardour  8.12
audio_playlist_importer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Sakari Bergen <sakari.bergen@beatwaves.net>
3  * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __ardour_audio_playlist_importer_h__
22 #define __ardour_audio_playlist_importer_h__
23 
24 #include <list>
25 #include <memory>
26 
27 #include "pbd/xml++.h"
28 #include "pbd/id.h"
29 
32 
33 namespace ARDOUR {
34 
35 class AudioRegionImportHandler;
36 class AudioRegionImporter;
37 class AudioPlaylistImporter;
38 class Session;
39 
41 {
42  public:
43  typedef std::shared_ptr<AudioPlaylistImporter> PlaylistPtr;
44  typedef std::list<PlaylistPtr> PlaylistList;
45 
46  AudioPlaylistImportHandler (XMLTree const & source, Session & session, AudioRegionImportHandler & region_handler, const char * nodename = "Playlists");
48  virtual std::string get_info () const;
49 
50  void get_regions (XMLNode const & node, ElementList & list) const;
51  void update_region_id (XMLProperty* id_prop);
52 
53  void playlists_by_diskstream (PBD::ID const & id, PlaylistList & list) const;
54 
55  protected:
57 };
58 
60 {
61  public:
63  AudioPlaylistImportHandler (source, session, region_handler, "UnusedPlaylists") { }
64  std::string get_info () const;
65 };
66 
68 {
69  public:
70  AudioPlaylistImporter (XMLTree const & source, Session & session, AudioPlaylistImportHandler & handler, XMLNode const & node);
73 
74  std::string get_info () const;
75 
76  void set_diskstream (PBD::ID const & id);
77  PBD::ID const & orig_diskstream () const { return orig_diskstream_id; }
78 
79  protected:
80  bool _prepare_move ();
81  void _cancel_move ();
82  void _move ();
83 
84  private:
85  typedef std::list<std::shared_ptr<AudioRegionImporter> > RegionList;
86 
88 
90  XMLNode const & orig_node;
95 };
96 
97 } // namespace ARDOUR
98 
99 #endif
void get_regions(XMLNode const &node, ElementList &list) const
std::shared_ptr< AudioPlaylistImporter > PlaylistPtr
void playlists_by_diskstream(PBD::ID const &id, PlaylistList &list) const
AudioPlaylistImportHandler(XMLTree const &source, Session &session, AudioRegionImportHandler &region_handler, const char *nodename="Playlists")
AudioRegionImportHandler & region_handler
virtual std::string get_info() const
void update_region_id(XMLProperty *id_prop)
AudioPlaylistImporter(XMLTree const &source, Session &session, AudioPlaylistImportHandler &handler, XMLNode const &node)
AudioPlaylistImportHandler & handler
PBD::ID const & orig_diskstream() const
std::string get_info() const
AudioPlaylistImporter(AudioPlaylistImporter const &other)
std::list< std::shared_ptr< AudioRegionImporter > > RegionList
void _cancel_move()
Cancel move.
void set_diskstream(PBD::ID const &id)
Virtual interface class for element import handlers.
std::list< ElementPtr > ElementList
Virtual interface class for element importers.
UnusedAudioPlaylistImportHandler(XMLTree const &source, Session &session, AudioRegionImportHandler &region_handler)
Definition: id.h:35
Definition: xml++.h:114
Definition: xml++.h:74
#define LIBARDOUR_API
void session(lua_State *L)