Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
22 
23 #include <list>
24 #include <memory>
25 
26 #include "pbd/xml++.h"
27 #include "pbd/id.h"
28 
31 
32 namespace ARDOUR {
33 
34 class AudioRegionImportHandler;
35 class AudioRegionImporter;
36 class AudioPlaylistImporter;
37 class Session;
38 
40 {
41  public:
42  typedef std::shared_ptr<AudioPlaylistImporter> PlaylistPtr;
43  typedef std::list<PlaylistPtr> PlaylistList;
44 
45  AudioPlaylistImportHandler (XMLTree const & source, Session & session, AudioRegionImportHandler & region_handler, const char * nodename = "Playlists");
47  virtual std::string get_info () const;
48 
49  void get_regions (XMLNode const & node, ElementList & list) const;
50  void update_region_id (XMLProperty* id_prop);
51 
52  void playlists_by_diskstream (PBD::ID const & id, PlaylistList & list) const;
53 
54  protected:
56 };
57 
59 {
60  public:
62  AudioPlaylistImportHandler (source, session, region_handler, "UnusedPlaylists") { }
63  std::string get_info () const;
64 };
65 
67 {
68  public:
69  AudioPlaylistImporter (XMLTree const & source, Session & session, AudioPlaylistImportHandler & handler, XMLNode const & node);
72 
73  std::string get_info () const;
74 
75  void set_diskstream (PBD::ID const & id);
76  PBD::ID const & orig_diskstream () const { return orig_diskstream_id; }
77 
78  protected:
79  bool _prepare_move ();
80  void _cancel_move ();
81  void _move ();
82 
83  private:
84  typedef std::list<std::shared_ptr<AudioRegionImporter> > RegionList;
85 
87 
89  XMLNode const & orig_node;
94 };
95 
96 } // namespace ARDOUR
97 
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:34
Definition: xml++.h:114
Definition: xml++.h:74
#define LIBARDOUR_API
void session(lua_State *L)