11/*
2- * Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3- * (C) 2023 Vladimir Sadovnikov <[email protected] > 2+ * Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+ * (C) 2025 Vladimir Sadovnikov <[email protected] > 44 *
55 * This file is part of lsp-runtime-lib
66 * Created on: 20 апр. 2020 г.
@@ -37,18 +37,21 @@ namespace lsp
3737{
3838 namespace mm
3939 {
40- #ifndef USE_LIBSNDFILE
40+ #if defined(PLATFORM_WINDOWS)
4141 struct WAVEFILE ;
42- #endif /* USE_LIBSNDFILE */
42+ #endif /* PLATFORM_WINDOWS */
4343
4444 class OutAudioFileStream : public IOutAudioStream
4545 {
4646 protected:
4747
48- #ifdef USE_LIBSNDFILE
49- typedef SNDFILE handle_t ;
50- #else
48+ #if defined(PLATFORM_WINDOWS)
5149 typedef struct WAVEFILE handle_t ;
50+ #elif defined(PLATFORM_MACOSX)
51+ typedef void handle_t ;
52+ #else
53+ typedef SNDFILE handle_t ;
54+
5255 #endif
5356
5457 protected:
@@ -57,28 +60,31 @@ namespace lsp
5760 bool bSeekable;
5861
5962 protected:
60- #ifdef USE_LIBSNDFILE
61- static status_t decode_sf_error (SNDFILE *fd);
62- static bool select_sndfile_format (SF_INFO *info, audio_stream_t *fmt, size_t codec);
63- #else
63+ #if defined(PLATFORM_WINDOWS)
6464 virtual ssize_t conv_write (const void *src, size_t nframes, size_t fmt);
6565 ssize_t write_acm_convert (const void *src, size_t nframes);
6666 status_t flush_handle (handle_t *hHandle, bool eof);
67+ #elif defined(PLATFORM_MACOSX)
68+ static status_t decode_os_status (uint32_t code);
69+ static uint32_t select_file_format (size_t codec);
70+ #else
71+ static status_t decode_sf_error (SNDFILE *fd);
72+ static bool select_sndfile_format (SF_INFO *info, audio_stream_t *fmt, size_t codec);
6773 #endif
6874
69- virtual ssize_t direct_write (const void *src, size_t nframes, size_t fmt);
70-
71- virtual size_t select_format (size_t rfmt);
72-
7375 status_t flush_internal (bool eof);
7476 status_t do_close ();
7577 static status_t close_handle (handle_t *h);
7678
79+ protected:
80+ virtual ssize_t direct_write (const void *src, size_t nframes, size_t fmt) override ;
81+ virtual size_t select_format (size_t rfmt) override ;
82+
7783 public:
7884 explicit OutAudioFileStream ();
7985 OutAudioFileStream (const OutAudioFileStream &) = delete ;
8086 OutAudioFileStream (OutAudioFileStream &&) = delete ;
81- virtual ~OutAudioFileStream ();
87+ virtual ~OutAudioFileStream () override ;
8288
8389 OutAudioFileStream & operator = (const OutAudioFileStream &) = delete ;
8490 OutAudioFileStream & operator = (OutAudioFileStream &&) = delete ;
@@ -111,11 +117,10 @@ namespace lsp
111117 */
112118 virtual status_t open (const io::Path *path, const audio_stream_t *fmt, size_t codec);
113119
114- virtual status_t close ();
115-
116- virtual status_t flush ();
117-
118- virtual wssize_t seek (wsize_t nframes);
120+ public: // IOutAudioStream
121+ virtual status_t close () override ;
122+ virtual status_t flush () override ;
123+ virtual wssize_t seek (wsize_t nframes) override ;
119124 };
120125
121126 } /* namespace mm */
0 commit comments