Ardour  8.12
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 #ifndef __ardour_source_factory_h__
21 #define __ardour_source_factory_h__
22 
23 #include <memory>
24 #include <stdint.h>
25 #include <string>
26 
27 #include "pbd/pthread_utils.h"
28 #include "ardour/source.h"
29 
30 class XMLNode;
31 
32 namespace ARDOUR
33 {
34 class Session;
35 class AudioSource;
36 class Playlist;
37 
39 {
40 public:
41  static void init ();
42  static void terminate ();
43 
44  static PBD::Signal1<void, std::shared_ptr<Source>> SourceCreated;
45 
46  static std::shared_ptr<Source> create (Session&, const XMLNode& node, bool async = false);
47  static std::shared_ptr<Source> createSilent (Session&, const XMLNode& node, samplecnt_t, float sample_rate);
48  static std::shared_ptr<Source> createExternal (DataType, Session&, const std::string& path, int chn, Source::Flag, bool announce = true, bool async = false);
49  static std::shared_ptr<Source> createWritable (DataType, Session&, const std::string& path, samplecnt_t rate, bool announce = true, bool async = false);
50  static std::shared_ptr<Source> createForRecovery (DataType, Session&, const std::string& path, int chn);
51  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);
52 
53  static Glib::Threads::Cond PeaksToBuild;
54  static Glib::Threads::Mutex peak_building_lock;
55 
56  static bool peak_thread_run;
57  static std::vector<PBD::Thread*> peak_thread_pool;
58 
59  static std::list<std::weak_ptr<AudioSource>> files_with_peaks;
60 
61  static int peak_work_queue_length ();
62  static int setup_peakfile (std::shared_ptr<Source>, bool async);
63 };
64 
65 } // namespace ARDOUR
66 
67 #endif /* __ardour_source_factory_h__ */
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 int peak_work_queue_length()
static PBD::Signal1< void, std::shared_ptr< Source > > SourceCreated
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:35
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t