OpenShot Library | libopenshot-audio  0.2.0
juce_OggVorbisAudioFormat.h
1 
2 /** @weakgroup juce_audio_formats-codecs
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  By using JUCE, you agree to the terms of both the JUCE 5 End-User License
15  Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
16  27th April 2017).
17 
18  End User License Agreement: www.juce.com/juce-5-licence
19  Privacy Policy: www.juce.com/juce-5-privacy-policy
20 
21  Or: You may also use this code under the terms of the GPL v3 (see
22  www.gnu.org/licenses).
23 
24  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
25  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
26  DISCLAIMED.
27 
28  ==============================================================================
29 */
30 
31 namespace juce
32 {
33 
34 #if JUCE_USE_OGGVORBIS || defined (DOXYGEN)
35 
36 //==============================================================================
37 /**
38  Reads and writes the Ogg-Vorbis audio format.
39 
40  To compile this, you'll need to set the JUCE_USE_OGGVORBIS flag.
41 
42  @see AudioFormat,
43 
44  @tags{Audio}
45 */
47 {
48 public:
49  //==============================================================================
51  ~OggVorbisAudioFormat() override;
52 
53  //==============================================================================
54  Array<int> getPossibleSampleRates() override;
55  Array<int> getPossibleBitDepths() override;
56  bool canDoStereo() override;
57  bool canDoMono() override;
58  bool isCompressed() override;
59  StringArray getQualityOptions() override;
60 
61  //==============================================================================
62  /** Tries to estimate the quality level of an ogg file based on its size.
63 
64  If it can't read the file for some reason, this will just return 1 (medium quality),
65  otherwise it will return the approximate quality setting that would have been used
66  to create the file.
67 
68  @see getQualityOptions
69  */
70  int estimateOggFileQuality (const File& source);
71 
72  //==============================================================================
73  /** Metadata property name used by the Ogg writer - if you set a string for this
74  value, it will be written into the ogg file as the name of the encoder app.
75 
76  @see createWriterFor
77  */
78  static const char* const encoderName;
79 
80  static const char* const id3title; /**< Metadata key for setting an ID3 title. */
81  static const char* const id3artist; /**< Metadata key for setting an ID3 artist name. */
82  static const char* const id3album; /**< Metadata key for setting an ID3 album. */
83  static const char* const id3comment; /**< Metadata key for setting an ID3 comment. */
84  static const char* const id3date; /**< Metadata key for setting an ID3 date. */
85  static const char* const id3genre; /**< Metadata key for setting an ID3 genre. */
86  static const char* const id3trackNumber; /**< Metadata key for setting an ID3 track number. */
87 
88  //==============================================================================
89  AudioFormatReader* createReaderFor (InputStream* sourceStream,
90  bool deleteStreamIfOpeningFails) override;
91 
92  AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
93  double sampleRateToUse,
94  unsigned int numberOfChannels,
95  int bitsPerSample,
96  const StringPairArray& metadataValues,
97  int qualityOptionIndex) override;
98 
99 private:
100  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OggVorbisAudioFormat)
101 };
102 
103 
104 #endif
105 
106 } // namespace juce
107 
108 /** @}*/
juce::OggVorbisAudioFormat::id3album
static const char *const id3album
Metadata key for setting an ID3 album.
Definition: juce_OggVorbisAudioFormat.h:82
juce::StringArray
A special array for holding a list of strings.
Definition: juce_StringArray.h:38
juce::OggVorbisAudioFormat::encoderName
static const char *const encoderName
Metadata property name used by the Ogg writer - if you set a string for this value,...
Definition: juce_OggVorbisAudioFormat.h:78
juce::OggVorbisAudioFormat::id3genre
static const char *const id3genre
Metadata key for setting an ID3 genre.
Definition: juce_OggVorbisAudioFormat.h:85
juce::InputStream
The base class for streams that read data.
Definition: juce_InputStream.h:40
juce::AudioFormat
Subclasses of AudioFormat are used to read and write different audio file formats.
Definition: juce_AudioFormat.h:43
juce::OggVorbisAudioFormat::id3title
static const char *const id3title
Metadata key for setting an ID3 title.
Definition: juce_OggVorbisAudioFormat.h:80
juce::OggVorbisAudioFormat::id3date
static const char *const id3date
Metadata key for setting an ID3 date.
Definition: juce_OggVorbisAudioFormat.h:84
juce::OggVorbisAudioFormat::id3comment
static const char *const id3comment
Metadata key for setting an ID3 comment.
Definition: juce_OggVorbisAudioFormat.h:83
juce::Array< int >
JUCE_API
#define JUCE_API
This macro is added to all JUCE public class declarations.
Definition: juce_StandardHeader.h:143
juce::OutputStream
The base class for streams that write data to some kind of destination.
Definition: juce_OutputStream.h:41
juce::File
Represents a local file or directory.
Definition: juce_File.h:44
juce::OggVorbisAudioFormat
Reads and writes the Ogg-Vorbis audio format.
Definition: juce_OggVorbisAudioFormat.h:46
juce::StringPairArray
A container for holding a set of strings which are keyed by another string.
Definition: juce_StringPairArray.h:38
juce::OggVorbisAudioFormat::id3artist
static const char *const id3artist
Metadata key for setting an ID3 artist name.
Definition: juce_OggVorbisAudioFormat.h:81
juce::AudioFormatWriter
Writes samples to an audio file stream.
Definition: juce_AudioFormatWriter.h:48
juce::OggVorbisAudioFormat::id3trackNumber
static const char *const id3trackNumber
Metadata key for setting an ID3 track number.
Definition: juce_OggVorbisAudioFormat.h:86
juce::AudioFormatReader
Reads samples from an audio file stream.
Definition: juce_AudioFormatReader.h:48