-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lee Jun Kit
committed
Aug 14, 2021
1 parent
8595377
commit 8c59642
Showing
9 changed files
with
146 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// spottie_curl.c | ||
// Spottie | ||
// | ||
// Created by Lee Jun Kit on 14/8/21. | ||
// | ||
|
||
#include "spottie_curl.h" | ||
|
||
CURLcode curl_easy_setopt_string(CURL *curl, CURLoption option, const char *param) { | ||
return curl_easy_setopt(curl, option, param); | ||
} | ||
|
||
CURLcode curl_easy_setopt_bool(CURL *curl, CURLoption option, bool param) { | ||
return curl_easy_setopt(curl, option, param); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// spottie_curl.h | ||
// Spottie | ||
// | ||
// Created by Lee Jun Kit on 14/8/21. | ||
// | ||
|
||
#ifndef spottie_curl_h | ||
#define spottie_curl_h | ||
|
||
#include <stdbool.h> | ||
#include <curl/curl.h> | ||
|
||
CURLcode curl_easy_setopt_string(CURL *curl, CURLoption option, const char *param); | ||
CURLcode curl_easy_setopt_bool(CURL *curl, CURLoption option, bool param); | ||
|
||
#endif /* spottie_curl_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// PlayerCore.swift | ||
// Spottie | ||
// | ||
// Created by Lee Jun Kit on 14/8/21. | ||
// | ||
|
||
import Foundation | ||
|
||
class PlayerCore { | ||
func run() { | ||
let t = Thread.init { | ||
/* | ||
librespot_init(f.toOpaque()) { user_data, ptr, len in | ||
if let pointer = ptr { | ||
let data = Data(bytes: pointer, count: Int(len)) | ||
do { | ||
let ff: Foo = Unmanaged.fromOpaque(user_data!).takeUnretainedValue(); | ||
let json = try ff.rawDecode(data) | ||
print(json) | ||
} catch { | ||
print("json error: \(error.localizedDescription)") | ||
} | ||
} | ||
} | ||
*/ | ||
} | ||
t.name = "AnvilRust" | ||
t.start() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// player_core.h | ||
// Spottie | ||
// | ||
// Created by Lee Jun Kit on 14/8/21. | ||
// | ||
|
||
#ifndef player_core_h | ||
#define player_core_h | ||
|
||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
void librespot_init(const void *user_data, | ||
void (*event_callback)(const void*, uint8_t*, uintptr_t)); | ||
|
||
|
||
#endif /* player_core_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
||
#include "player_core.h" | ||
#include "spottie_curl.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters