Ardour  9.0-pre0-582-g084a23a80d
ffmpegfilesource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Marijn Kruisselbrink <mek@google.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _ardour_ffmpegfile_source_h_
20 #define _ardour_ffmpegfile_source_h_
21 
22 #include <string>
23 
24 #include "ardour/audiofilesource.h"
26 
27 namespace ARDOUR {
28 
30 public:
31  FFMPEGFileSource(ARDOUR::Session &, const std::string &path, int chn, Flag);
33 
34  /* AudioSource API */
35  float sample_rate() const { return _ffmpeg.samplerate (); }
36  bool clamped_at_unity () const { return false; }
37 
38  /* AudioFileSource API */
39  void flush () {}
40  int update_header (samplepos_t when, struct tm&, time_t) { return 0; }
41  int flush_header () { return 0; }
43 
44  static int get_soundfile_info (const std::string& path, SoundFileInfo& _info, std::string& error_msg);
45  static bool safe_audio_file_extension (const std::string &file);
46 
47 protected:
48  /* FileSource API */
49  void close ();
50  /* AudioSource API */
52  samplecnt_t write_unlocked (Sample const *, samplecnt_t) { return 0; }
53 
54 private:
56  int _channel;
57 };
58 
59 }
60 #endif
int update_header(samplepos_t when, struct tm &, time_t)
FFMPEGFileSource(ARDOUR::Session &, const std::string &path, int chn, Flag)
samplecnt_t read_unlocked(Sample *dst, samplepos_t start, samplecnt_t cnt) const
FFMPEGFileImportableSource _ffmpeg
static bool safe_audio_file_extension(const std::string &file)
samplecnt_t write_unlocked(Sample const *, samplecnt_t)
static int get_soundfile_info(const std::string &path, SoundFileInfo &_info, std::string &error_msg)
#define LIBARDOUR_API
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t