General cleanup and license handling

This commit is contained in:
2025-10-22 13:07:40 +10:00
parent a97b822fd8
commit e028b77ac0
11 changed files with 159 additions and 65 deletions

View File

@@ -1,3 +1,10 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
* Info: Configuration Handler
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -95,6 +102,8 @@ int configHandler_Read(configHandler_config_t** configObj) {
config_fsize = st.st_size;
} else {
logger_log_error(__func__, "stat() failed (Config file does not exist).");
logger_log_error(__func__, "This is most likely because your config file does not exist.");
logger_log_error(__func__, "Config file should be located at ~/.config/ossp/config.json");
return 1;
}

View File

@@ -1,3 +1,9 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
*/
#ifndef _CONFIG_HANDLER_H
#define _CONFIG_HANDLER_H
#include <stdbool.h>

View File

@@ -1,7 +1,7 @@
/*
* OpenSubSonicPlayer
* Goldenkrew3000 2025
* GPL-3.0
* License: GNU General Public License 3.0
* Discord Local RPC Handler
* Note: This provides server auth creds (encoded) directly to Discord, could use Spotify's API instead??
*/

View File

@@ -1,3 +1,9 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
*/
#ifndef _DISCORDRPC_H
#define _DISCORDRPC_H

View File

@@ -1,3 +1,10 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
* Info: Debug / Prototype graphical interface
*/
#include "../external/imgui/imgui.h"
#include "../external/imgui/backends/imgui_impl_sdl2.h"
#include "../external/imgui/backends/imgui_impl_opengl2.h"

View File

@@ -1,3 +1,8 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
*/
#ifndef _GUI_ENTRY_HPP
#define _GUI_ENTRY_HPP

View File

@@ -1,9 +1,15 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
* Info: OSSP Entry Point
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "gui/gui_entry.hpp"
#include "libopensubsonic/logger.h"
#include "libopensubsonic/crypto.h"
#include "libopensubsonic/httpclient.h"
#include "libopensubsonic/endpoint_ping.h"

View File

@@ -1,18 +1,18 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
* Info: Gstreamer Queue Handler
*/
#include <string.h>
#include <string>
#include <deque>
#include "playQueue.hpp"
#include <iostream> // debug
// NOTE: Acronym is OpenSubsonicPlayerQueue
std::deque<std::string> OSSPQ_Items;
int internal_OSSPQ_Init() {
//
}
int internal_OSSPQ_AppendToEnd(char* id) {
std::string cpp_id(id);
OSSPQ_Items.push_back(cpp_id);

View File

@@ -1,3 +1,9 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
*/
#ifndef _PLAYQUEUE_H
#define _PLAYQUEUE_H

View File

@@ -1,7 +1,8 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: AGPL-3.0
* License: GNU General Public License 3.0
* Info: Gstreamer Handler
*/
#include <stdio.h>
@@ -37,16 +38,56 @@ static gboolean gst_bus_call(GstBus* bus, GstMessage* message, gpointer data) {
gst_element_set_state(pipeline, GST_STATE_NULL);
isPlaying = false;
break;
case GST_MESSAGE_BUFFERING:
case GST_MESSAGE_BUFFERING: {
gint percent = 0;
gst_message_parse_buffering(message, &percent);
printf("Buffering (%d%%)...\n", (int)percent);
break;
case GST_MESSAGE_ERROR:
printf("Error\n");
}
case GST_MESSAGE_ERROR: {
gchar* debug;
GError* error;
gst_message_parse_error(message, &error, &debug);
printf("Gstreamer Error: %s\n", error);
g_error_free(error);
g_free(debug);
break;
}
case GST_MESSAGE_STATE_CHANGED:
printf("State changed\n");
break;
case GST_MESSAGE_NEW_CLOCK:
//
break;
case GST_MESSAGE_LATENCY:
//
break;
case GST_MESSAGE_STREAM_START:
//
break;
case GST_MESSAGE_ELEMENT:
//
break;
case GST_MESSAGE_ASYNC_DONE:
//
break;
case GST_MESSAGE_STREAM_STATUS:
//
break;
case GST_MESSAGE_STREAMS_SELECTED:
//
break;
case GST_MESSAGE_STREAM_COLLECTION:
//
break;
case GST_MESSAGE_DURATION_CHANGED:
//
break;
case GST_MESSAGE_TAG:
// Unused
break;
default:
printf("Unknown\n");
printf("Unknown Message. Type %ld\n", GST_MESSAGE_TYPE(message));
break;
}
@@ -205,7 +246,7 @@ int OSSPlayer_GstInit() {
// Initialize equalizer
if (configObj->audio_equalizer_enable) {
printf("Initializing equalizer...\n");
printf("Initializing %d equalizer bands...\n", configObj->audio_equalizer_graphCount);
// Dynamically append settings to the equalizer to match the config file
for (int i = 0; i < configObj->audio_equalizer_graphCount; i++) {
@@ -247,9 +288,11 @@ int OSSPlayer_GstInit() {
float freq = (float)configObj->audio_equalizer_graph[i].frequency;
float semitone = (float)configObj->audio_pitch_cents / 100.0;
freq = OSSPlayer_PitchFollow(freq, semitone);
printf("EQ band %d - F: %.2f(Fp) / G: %.2f / Q: 4.36\n", i + 1, freq, gain);
g_object_set(equalizer, fl_name, freq, NULL);
g_object_set(equalizer, fr_name, freq, NULL);
} else {
printf("EQ band %d - F: %.2f / G: %.2f / Q: 4.36\n", i + 1, (float)configObj->audio_equalizer_graph[i].frequency, gain);
g_object_set(equalizer, fl_name, (float)configObj->audio_equalizer_graph[i].frequency, NULL);
g_object_set(equalizer, fr_name, (float)configObj->audio_equalizer_graph[i].frequency, NULL);
}

View File

@@ -1,3 +1,9 @@
/*
* OpenSubsonicPlayer
* Goldenkrew3000 2025
* License: GNU General Public License 3.0
*/
#ifndef _PLAYER_H
#define _PLAYER_H