Ardour  9.0-pre0-582-g084a23a80d
source_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
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 <stdint.h>
24 #include <string>
25 
26 #include "pbd/pthread_utils.h"
27 #include "ardour/source.h"
28 
29 class XMLNode;
30 
31 namespace ARDOUR
32 {
33 class Session;
34 class AudioSource;
35 class Playlist;
36 
38 {
39 public:
40  static void init ();
41  static void terminate ();
42 
43  static PBD::Signal<void(std::shared_ptr<Source>)> SourceCreated;
44 
45  static std::shared_ptr<Source> create (Session&, const XMLNode& node, bool async = false);
46  static std::shared_ptr<Source> createSilent (Session&, const XMLNode& node, samplecnt_t, float sample_rate);
47  static std::shared_ptr<Source> createExternal (DataType, Session&, const std::string& path, int chn, Source::Flag, bool announce = true, bool async = false);
48  static std::shared_ptr<Source> createWritable (DataType, Session&, const std::string& path, samplecnt_t rate, bool announce = true, bool async = false);
49  static std::shared_ptr<Source> createForRecovery (DataType, Session&, const std::string& path, int chn);
50  static std::shared_ptr<Source> createFromPlaylist (DataType, Session&, std::shared_ptr<Playlist> p, const PBD::ID& orig, const std::string& name, uint32_t chn, timepos_t start, timepos_t const& len, bool copy, bool defer_peaks);
51 
52  static Glib::Threads::Cond PeaksToBuild;
53  static Glib::Threads::Mutex peak_building_lock;
54 
55  static bool peak_thread_run;
56  static std::vector<PBD::Thread*> peak_thread_pool;
57 
58  static std::list<std::weak_ptr<AudioSource>> files_with_peaks;
59 
60  static int peak_work_queue_length ();
61  static int setup_peakfile (std::shared_ptr<Source>, bool async);
62 };
63 
64 } // namespace ARDOUR
65 
static std::shared_ptr< Source > createForRecovery(DataType, Session &, const std::string &path, int chn)
static std::shared_ptr< Source > create(Session &, const XMLNode &node, bool async=false)
static int setup_peakfile(std::shared_ptr< Source >, bool async)
static std::shared_ptr< Source > createFromPlaylist(DataType, Session &, std::shared_ptr< Playlist > p, const PBD::ID &orig, const std::string &name, uint32_t chn, timepos_t start, timepos_t const &len, bool copy, bool defer_peaks)
static void terminate()
static bool peak_thread_run
static std::list< std::weak_ptr< AudioSource > > files_with_peaks
static std::vector< PBD::Thread * > peak_thread_pool
static void init()
static std::shared_ptr< Source > createSilent(Session &, const XMLNode &node, samplecnt_t, float sample_rate)
static PBD::Signal< void(std::shared_ptr< Source >)> SourceCreated
static int peak_work_queue_length()
static std::shared_ptr< Source > createExternal(DataType, Session &, const std::string &path, int chn, Source::Flag, bool announce=true, bool async=false)
static Glib::Threads::Mutex peak_building_lock
static std::shared_ptr< Source > createWritable(DataType, Session &, const std::string &path, samplecnt_t rate, bool announce=true, bool async=false)
static Glib::Threads::Cond PeaksToBuild
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