Skip to content

Commit

Permalink
SPM added
Browse files Browse the repository at this point in the history
  • Loading branch information
chanonly123 committed Feb 9, 2025
1 parent 1a6c405 commit 657e1da
Show file tree
Hide file tree
Showing 18 changed files with 398 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// swift-tools-version:5.9
import PackageDescription

let package = Package(
name: "JuceMixPlayerSwift",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "JuceMixPlayerSwift",
targets: ["JuceMixPlayerSwift"])
],
targets: [
.target(
name: "JuceMixPlayerSwift",
dependencies: ["juce_mix_player_static"],
path: "dist",
sources: ["bridge.c"],
publicHeadersPath: "include",
linkerSettings: [
.linkedFramework("AVFoundation"),
.linkedFramework("AudioToolbox"),
.linkedFramework("CoreAudioKit"),
.linkedFramework("CoreAudio"),
.linkedFramework("Accelerate"),
.linkedFramework("CoreMIDI"),
.linkedFramework("Foundation"),
.linkedFramework("MobileCoreServices"),
.linkedLibrary("c++")
]
),
.binaryTarget(
name: "juce_mix_player_static",
path: "dist/juce_lib.xcframework"
)
]
)
1 change: 1 addition & 0 deletions dist/bridge.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "bridge.h"
1 change: 1 addition & 0 deletions dist/include/bridge.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "juce_wrapper_c.h"
48 changes: 48 additions & 0 deletions dist/juce_lib.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>juce_lib.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>juce_lib.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>juce_lib.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>juce_lib.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
57 changes: 57 additions & 0 deletions dist/juce_lib.xcframework/ios-arm64/Headers/juce_wrapper_c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#ifdef __cplusplus
#define EXPORT_C_FUNC extern "C" __attribute__((visibility("default"))) __attribute__((used))
#else
#define EXPORT_C_FUNC extern
#endif

EXPORT_C_FUNC void Java_com_rmsl_juce_Native_juceMessageManagerInit();
EXPORT_C_FUNC void juce_enableLogs(int enable);

EXPORT_C_FUNC void* JuceMixPlayer_init(int record, int play);
EXPORT_C_FUNC void JuceMixPlayer_deinit(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_play(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_pause(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_stop(void *ptr);

EXPORT_C_FUNC void JuceMixPlayer_set(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_setSettings(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_onStateUpdate(void* ptr, void (*JuceMixPlayerCallbackString)(void*, const char*));

/// callback with progress value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_onProgress(void* ptr, void (*onProgress)(void*, float));

EXPORT_C_FUNC void JuceMixPlayer_onError(void* ptr, void (*onError)(void*, const char*));

/// value returns time in seconds
EXPORT_C_FUNC float JuceMixPlayer_getDuration(void *ptr);

/// returns 1 if playing else 0
EXPORT_C_FUNC int JuceMixPlayer_isPlaying(void *ptr);

/// value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_seek(void* ptr, float value);

// MARK: Recorder

EXPORT_C_FUNC void JuceMixPlayer_prepareRecorder(void* ptr, const char* file);

EXPORT_C_FUNC void JuceMixPlayer_startRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_stopRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_onRecStateUpdate(void* ptr, void (*onStateUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecProgress(void* ptr, void (*onProgress)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onRecError(void* ptr, void (*onError)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecLevel(void* ptr, void (*onLevel)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onDeviceUpdate(void* ptr, void (*onDeviceUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_setUpdatedDevices(void* ptr, const char* json);
Binary file added dist/juce_lib.xcframework/ios-arm64/juce_lib.a
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#ifdef __cplusplus
#define EXPORT_C_FUNC extern "C" __attribute__((visibility("default"))) __attribute__((used))
#else
#define EXPORT_C_FUNC extern
#endif

EXPORT_C_FUNC void Java_com_rmsl_juce_Native_juceMessageManagerInit();
EXPORT_C_FUNC void juce_enableLogs(int enable);

EXPORT_C_FUNC void* JuceMixPlayer_init(int record, int play);
EXPORT_C_FUNC void JuceMixPlayer_deinit(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_play(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_pause(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_stop(void *ptr);

EXPORT_C_FUNC void JuceMixPlayer_set(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_setSettings(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_onStateUpdate(void* ptr, void (*JuceMixPlayerCallbackString)(void*, const char*));

/// callback with progress value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_onProgress(void* ptr, void (*onProgress)(void*, float));

EXPORT_C_FUNC void JuceMixPlayer_onError(void* ptr, void (*onError)(void*, const char*));

/// value returns time in seconds
EXPORT_C_FUNC float JuceMixPlayer_getDuration(void *ptr);

/// returns 1 if playing else 0
EXPORT_C_FUNC int JuceMixPlayer_isPlaying(void *ptr);

/// value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_seek(void* ptr, float value);

// MARK: Recorder

EXPORT_C_FUNC void JuceMixPlayer_prepareRecorder(void* ptr, const char* file);

EXPORT_C_FUNC void JuceMixPlayer_startRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_stopRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_onRecStateUpdate(void* ptr, void (*onStateUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecProgress(void* ptr, void (*onProgress)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onRecError(void* ptr, void (*onError)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecLevel(void* ptr, void (*onLevel)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onDeviceUpdate(void* ptr, void (*onDeviceUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_setUpdatedDevices(void* ptr, const char* json);
Binary file not shown.
48 changes: 48 additions & 0 deletions dist/juce_lib.xcframework/juce_lib.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>juce_lib.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>juce_lib.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>juce_lib.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>juce_lib.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#ifdef __cplusplus
#define EXPORT_C_FUNC extern "C" __attribute__((visibility("default"))) __attribute__((used))
#else
#define EXPORT_C_FUNC extern
#endif

EXPORT_C_FUNC void Java_com_rmsl_juce_Native_juceMessageManagerInit();
EXPORT_C_FUNC void juce_enableLogs(int enable);

EXPORT_C_FUNC void* JuceMixPlayer_init(int record, int play);
EXPORT_C_FUNC void JuceMixPlayer_deinit(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_play(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_pause(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_stop(void *ptr);

EXPORT_C_FUNC void JuceMixPlayer_set(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_setSettings(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_onStateUpdate(void* ptr, void (*JuceMixPlayerCallbackString)(void*, const char*));

/// callback with progress value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_onProgress(void* ptr, void (*onProgress)(void*, float));

EXPORT_C_FUNC void JuceMixPlayer_onError(void* ptr, void (*onError)(void*, const char*));

/// value returns time in seconds
EXPORT_C_FUNC float JuceMixPlayer_getDuration(void *ptr);

/// returns 1 if playing else 0
EXPORT_C_FUNC int JuceMixPlayer_isPlaying(void *ptr);

/// value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_seek(void* ptr, float value);

// MARK: Recorder

EXPORT_C_FUNC void JuceMixPlayer_prepareRecorder(void* ptr, const char* file);

EXPORT_C_FUNC void JuceMixPlayer_startRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_stopRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_onRecStateUpdate(void* ptr, void (*onStateUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecProgress(void* ptr, void (*onProgress)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onRecError(void* ptr, void (*onError)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecLevel(void* ptr, void (*onLevel)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onDeviceUpdate(void* ptr, void (*onDeviceUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_setUpdatedDevices(void* ptr, const char* json);
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#ifdef __cplusplus
#define EXPORT_C_FUNC extern "C" __attribute__((visibility("default"))) __attribute__((used))
#else
#define EXPORT_C_FUNC extern
#endif

EXPORT_C_FUNC void Java_com_rmsl_juce_Native_juceMessageManagerInit();
EXPORT_C_FUNC void juce_enableLogs(int enable);

EXPORT_C_FUNC void* JuceMixPlayer_init(int record, int play);
EXPORT_C_FUNC void JuceMixPlayer_deinit(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_play(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_pause(void* ptr);
EXPORT_C_FUNC void JuceMixPlayer_stop(void *ptr);

EXPORT_C_FUNC void JuceMixPlayer_set(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_setSettings(void* ptr, const char* json);

EXPORT_C_FUNC void JuceMixPlayer_onStateUpdate(void* ptr, void (*JuceMixPlayerCallbackString)(void*, const char*));

/// callback with progress value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_onProgress(void* ptr, void (*onProgress)(void*, float));

EXPORT_C_FUNC void JuceMixPlayer_onError(void* ptr, void (*onError)(void*, const char*));

/// value returns time in seconds
EXPORT_C_FUNC float JuceMixPlayer_getDuration(void *ptr);

/// returns 1 if playing else 0
EXPORT_C_FUNC int JuceMixPlayer_isPlaying(void *ptr);

/// value range 0 to 1
EXPORT_C_FUNC void JuceMixPlayer_seek(void* ptr, float value);

// MARK: Recorder

EXPORT_C_FUNC void JuceMixPlayer_prepareRecorder(void* ptr, const char* file);

EXPORT_C_FUNC void JuceMixPlayer_startRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_stopRecorder(void* ptr);

EXPORT_C_FUNC void JuceMixPlayer_onRecStateUpdate(void* ptr, void (*onStateUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecProgress(void* ptr, void (*onProgress)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onRecError(void* ptr, void (*onError)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_onRecLevel(void* ptr, void (*onLevel)(void* ptr, float));

EXPORT_C_FUNC void JuceMixPlayer_onDeviceUpdate(void* ptr, void (*onDeviceUpdate)(void* ptr, const char*));

EXPORT_C_FUNC void JuceMixPlayer_setUpdatedDevices(void* ptr, const char* json);
Binary file not shown.
Loading

0 comments on commit 657e1da

Please sign in to comment.