diff options
-rw-r--r-- | Userland/Libraries/LibAudio/FlacLoader.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibAudio/Loader.h | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibAudio/WavLoader.h | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibAudio/FlacLoader.h b/Userland/Libraries/LibAudio/FlacLoader.h index ed4f65cd4c..4ea284f831 100644 --- a/Userland/Libraries/LibAudio/FlacLoader.h +++ b/Userland/Libraries/LibAudio/FlacLoader.h @@ -100,6 +100,7 @@ public: virtual int total_samples() override { return static_cast<int>(m_total_samples); } virtual u32 sample_rate() override { return m_sample_rate; } virtual u16 num_channels() override { return m_num_channels; } + virtual String format_name() override { return "FLAC (.flac)"; } virtual PcmSampleFormat pcm_format() override { return m_sample_format; } virtual RefPtr<Core::File> file() override { return m_file; } diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibAudio/Loader.h index 596dd5d08c..30efc60088 100644 --- a/Userland/Libraries/LibAudio/Loader.h +++ b/Userland/Libraries/LibAudio/Loader.h @@ -50,6 +50,8 @@ public: virtual u32 sample_rate() = 0; virtual u16 num_channels() = 0; + // Human-readable name of the file format, of the form <full abbreviation> (.<ending>) + virtual String format_name() = 0; virtual PcmSampleFormat pcm_format() = 0; virtual RefPtr<Core::File> file() = 0; }; @@ -68,6 +70,7 @@ public: int total_samples() const { return m_plugin->total_samples(); } u32 sample_rate() const { return m_plugin->sample_rate(); } u16 num_channels() const { return m_plugin->num_channels(); } + String format_name() const { return m_plugin->format_name(); } u16 bits_per_sample() const { return pcm_bits_per_sample(m_plugin->pcm_format()); } RefPtr<Core::File> file() const { return m_plugin->file(); } diff --git a/Userland/Libraries/LibAudio/WavLoader.h b/Userland/Libraries/LibAudio/WavLoader.h index 39b045a4c3..40d7f098ca 100644 --- a/Userland/Libraries/LibAudio/WavLoader.h +++ b/Userland/Libraries/LibAudio/WavLoader.h @@ -52,6 +52,7 @@ public: virtual int total_samples() override { return m_total_samples; } virtual u32 sample_rate() override { return m_sample_rate; } virtual u16 num_channels() override { return m_num_channels; } + virtual String format_name() override { return "RIFF WAVE (.wav)"; } virtual PcmSampleFormat pcm_format() override { return m_sample_format; } virtual RefPtr<Core::File> file() override { return m_file; } |