Ardour  9.0-pre0-582-g084a23a80d
audio_playlist_source.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2015 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <memory>
23 #include <string>
24 
25 #include "ardour/ardour.h"
26 #include "ardour/audiosource.h"
27 #include "ardour/playlist_source.h"
28 
29 namespace ARDOUR {
30 
31 class AudioPlaylist;
32 
34 public:
36 
37  bool empty() const;
38  std::string construct_peak_filepath (const std::string& audio_path, const bool in_session = false, const bool old_peak_name = false) const;
39  uint32_t n_channels() const;
40  bool clamped_at_unity () const { return false; }
41 
44 
45  float sample_rate () const;
47 
48  XMLNode& get_state () const;
49  int set_state (const XMLNode&, int version);
50 
51  bool can_truncate_peaks() const { return false; }
52  bool can_be_analysed() const { return _length.is_positive(); }
53 
54 protected:
55  friend class SourceFactory;
56 
57  AudioPlaylistSource (Session&, const PBD::ID& orig, const std::string& name, std::shared_ptr<AudioPlaylist>, uint32_t chn,
58  timepos_t const & begin, timepos_t const & len, Source::Flag flags);
60 
61 
62 private:
64  std::string _peak_path;
65 
66  int set_state (const XMLNode&, int version, bool with_descendants);
67 };
68 
69 } /* namespace */
70 
AudioPlaylistSource(Session &, const PBD::ID &orig, const std::string &name, std::shared_ptr< AudioPlaylist >, uint32_t chn, timepos_t const &begin, timepos_t const &len, Source::Flag flags)
AudioPlaylistSource(Session &, const XMLNode &)
int set_state(const XMLNode &, int version, bool with_descendants)
int set_state(const XMLNode &, int version)
samplecnt_t read_unlocked(Sample *dst, samplepos_t start, samplecnt_t cnt) const
XMLNode & get_state() const
std::string construct_peak_filepath(const std::string &audio_path, const bool in_session=false, const bool old_peak_name=false) const
samplecnt_t write_unlocked(Sample const *src, samplecnt_t cnt)
uint32_t n_channels() const
Definition: id.h:34
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t