Added local music playback, cleaned macOS cmake support, and reworked gstreamer player logic

This commit is contained in:
2026-03-17 12:20:46 +10:00
parent 6de7ae441d
commit dcd4720f4c
10 changed files with 558 additions and 15 deletions
+17 -2
View File
@@ -44,7 +44,7 @@ static gboolean gst_bus_call(GstBus* bus, GstMessage* message, gpointer data) {
case GST_MESSAGE_BUFFERING: {
gint percent = 0;
gst_message_parse_buffering(message, &percent);
printf("Buffering (%d%%)...\n", (int)percent);
//printf("Buffering (%d%%)...\n", (int)percent);
break;
}
case GST_MESSAGE_ERROR: {
@@ -57,7 +57,7 @@ static gboolean gst_bus_call(GstBus* bus, GstMessage* message, gpointer data) {
break;
}
case GST_MESSAGE_STATE_CHANGED:
printf("State changed\n");
//printf("State changed\n");
break;
case GST_MESSAGE_NEW_CLOCK:
//
@@ -361,6 +361,8 @@ int OSSPlayer_GstInit() {
}
// Initialize reverb
}
int OSSPlayer_GstDeInit() {
@@ -432,6 +434,19 @@ void OSSPlayer_GstECont_Playbin3_Stop() {
isPlaying = false; // Notify player thread to attempt to load next song
}
void OSSPlayer_GstECont_Playbin3_PlayPause() {
GstState state;
gst_element_get_state (pipeline, &state, NULL, 0);
if (state == GST_STATE_PLAYING) {
gst_element_set_state (pipeline, GST_STATE_PAUSED);
g_print ("Paused\n");
} else {
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_print ("Playing\n");
}
}
/*
* Utility Functions
*/
+6 -3
View File
@@ -13,10 +13,11 @@ extern "C" {
#include "playQueue.hpp"
void* OSSPlayer_GMainLoop(void*);
void* OSSPlayer_ThrdInit(void*);
void* OSSPlayer_GMainLoop(void* arg);
void* OSSPlayer_ThrdInit(void* arg);
int OSSPlayer_GstInit();
int OSSPlayer_QueueAppend(char* title, char* artist, char* id, long duration);
int OSSPlayer_QueueAppend_Song(char* title, char* artist, char* id, long duration);
int OSSPlayer_QueueAppend_Radio(char* name, char* id, char* radioUrl);
OSSPQ_SongStruct* OSSPlayer_QueuePopFront();
float OSSPlayer_GstECont_InVolume_Get();
@@ -25,6 +26,8 @@ float OSSPlayer_GstECont_OutVolume_Get();
void OSSPlayer_GstECont_OutVolume_set(float val);
float OSSPlayer_GstECont_Pitch_Get();
void OSSPlayer_GstECont_Pitch_Set(float cents);
void OSSPlayer_GstECont_Playbin3_Stop();
void OSSPlayer_GstECont_Playbin3_PlayPause();
float OSSPlayer_DbLinMul(float db);
float OSSPlayer_PitchFollow(float freq, float semitone);