Skip to content

Commit 6a5b8e2

Browse files
committed
Submitted draft of the InAudioFileStream implementation on MacOS
1 parent afb1e0b commit 6a5b8e2

File tree

4 files changed

+318
-127
lines changed

4 files changed

+318
-127
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*******************************************************************************
44

55
=== 1.0.27 ===
6-
6+
* Better support of MacOS.
77

88
=== 1.0.26 ===
99
* Updated build scripts.

include/lsp-plug.in/mm/InAudioFileStream.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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: 19 апр. 2020 г.
@@ -37,17 +37,19 @@ 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 InAudioFileStream: public IInAudioStream
4545
{
4646
protected:
47-
#ifdef USE_LIBSNDFILE
48-
typedef SNDFILE handle_t;
49-
#else
47+
#if defined(PLATFORM_WINDOWS)
5048
typedef struct WAVEFILE handle_t;
49+
#elif defined(PLATFORM_MACOSX)
50+
typedef void handle_t;
51+
#else
52+
typedef SNDFILE handle_t;
5153
#endif
5254

5355
protected:
@@ -57,10 +59,12 @@ namespace lsp
5759
bool bSeekable;
5860

5961
protected:
60-
#ifdef USE_LIBSNDFILE
61-
static status_t decode_sf_error(SNDFILE *fd);
62-
#else
62+
#if defined(PLATFORM_WINDOWS)
6363
ssize_t read_acm_convert(void *dst, size_t nframes, size_t fmt);
64+
#elif defined(PLATFORM_MACOSX)
65+
static status_t decode_os_status(uint32_t code);
66+
#else
67+
static status_t decode_sf_error(SNDFILE *fd);
6468
#endif
6569

6670
virtual ssize_t direct_read(void *dst, size_t nframes, size_t fmt) override;

0 commit comments

Comments
 (0)