Ardour  9.0-pre0-582-g084a23a80d
mp3filesource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Robin Gareus <robin@gareus.org>
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_mp3file_source_h_
20 #define _ardour_mp3file_source_h_
21 
22 #include "ardour/audiofilesource.h"
24 #include <string>
25 
26 namespace ARDOUR {
27 
29 public:
30  Mp3FileSource (ARDOUR::Session&, const std::string& path, int chn, Flag);
32 
33  /* AudioSource API */
34  float sample_rate() const { return _mp3.samplerate (); }
35  bool clamped_at_unity () const { return false; }
36 
37  /* AudioFileSource API */
38  void flush () {}
39  int update_header (samplepos_t when, struct tm&, time_t) { return 0; }
40  int flush_header () { return 0; }
42 
43  static int get_soundfile_info (std::string path, SoundFileInfo& _info, std::string& error_msg);
44 
45 protected:
46  /* FileSource API */
47  void close ();
48  /* AudioSource API */
50  samplecnt_t write_unlocked (Sample const *, samplecnt_t) { return 0; }
51 
52 private:
54  int _channel;
55 };
56 
57 };
58 #endif
Mp3FileImportableSource _mp3
Definition: mp3filesource.h:53
samplecnt_t write_unlocked(Sample const *, samplecnt_t)
Definition: mp3filesource.h:50
Mp3FileSource(ARDOUR::Session &, const std::string &path, int chn, Flag)
bool clamped_at_unity() const
Definition: mp3filesource.h:35
int update_header(samplepos_t when, struct tm &, time_t)
Definition: mp3filesource.h:39
samplecnt_t read_unlocked(Sample *dst, samplepos_t start, samplecnt_t cnt) const
float sample_rate() const
Definition: mp3filesource.h:34
static int get_soundfile_info(std::string path, SoundFileInfo &_info, std::string &error_msg)
void set_header_natural_position()
Definition: mp3filesource.h:41
#define LIBARDOUR_API
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t