Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
attributes:
label: Component Version
description: Which version of foo_mac_scrobble are you using?
placeholder: e.g., 0.1.3
placeholder: e.g., 0.1.4
validations:
required: true

Expand All @@ -36,6 +36,7 @@ body:
- macOS Sequoia (15.x)
- macOS Sonoma (14.x)
- macOS Ventura (13.x)
- macOS Monterey (12.x)
- Other (specify in description)
validations:
required: true
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_foobar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
ARCHS="arm64 x86_64" \
VALID_ARCHS="arm64 x86_64" \
ONLY_ACTIVE_ARCH=NO \
MACOSX_DEPLOYMENT_TARGET=12.0 \
-derivedDataPath build \
OTHER_CPLUSPLUSFLAGS="-DFOO_LASTFM_DEBUG_DEFAULT=1 \
-DFOO_LASTFM_CI_API_KEY='\"${{ secrets.LASTFM_API_KEY }}\"' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>foobar2000_SDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>2</integer>
</dict>
</dict>
</dict>
Expand Down
90 changes: 87 additions & 3 deletions foobar2000/foo_mac_scrobble/Mac/fooLastfmMacPreferences.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,56 @@ @interface fooLastfmMacPreferences ()

@implementation fooLastfmMacPreferences

- (instancetype)init {
self = [super init];
if (self) {
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: fooLastfmMacPreferences init called";
}
}
return self;
}

- (void)loadView {
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: loadView called";
}

// Create view manually for macOS 12 compatibility
NSView* mainView = [[NSView alloc] init];
// Don't set translatesAutoresizingMaskIntoConstraints:NO for main view
self.view = mainView;

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: loadView completed";
}
}

- (void)viewDidLoad {
[super viewDidLoad];

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: viewDidLoad called";
FB2K_console_formatter() << "Last.fm UI: macOS version: " << [[NSProcessInfo processInfo].operatingSystemVersionString UTF8String];
FB2K_console_formatter() << "Last.fm UI: view frame: " << NSStringFromRect(self.view.frame).UTF8String;
}

[self setupUI];
showingSecrets = NO;

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: viewDidLoad completed";
}
}

- (void)viewWillAppear {
[super viewWillAppear];

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: viewWillAppear called";
FB2K_console_formatter() << "Last.fm UI: view bounds: " << NSStringFromRect(self.view.bounds).UTF8String;
FB2K_console_formatter() << "Last.fm UI: view subviews count: " << (int)self.view.subviews.count;
}

// Load current settings from configuration
realApiKey = foo_lastfm::cfg_api_key.get();
Expand All @@ -65,21 +107,41 @@ - (void)viewWillAppear {
}

- (void)setupUI {
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: setupUI started";
}

// Create main stack view for organizing UI elements
NSStackView* stackView = [[NSStackView alloc] init];
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: NSStackView created";
}

[stackView setOrientation:NSUserInterfaceLayoutOrientationVertical];
[stackView setAlignment:NSLayoutAttributeLeading];
[stackView setSpacing:8];
[stackView setTranslatesAutoresizingMaskIntoConstraints:NO];

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: NSStackView configured";
}

[self.view addSubview:stackView];
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: NSStackView added to view";
}

// Set standard system margins
CGFloat inset = 19.0; // Adjustable margin size
// Set standard margins
CGFloat inset = 19.0;
[stackView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:inset].active = YES;
[stackView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-inset].active = YES;
[stackView.topAnchor constraintEqualToAnchor:self.view.topAnchor constant:inset].active = YES;
[stackView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-inset].active = YES;

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: NSStackView constraints set";
}

// Add title label
NSTextField* titleLabel = [[NSTextField alloc] init];
[titleLabel setStringValue:@"Last.fm Scrobbler Settings"];
Expand All @@ -88,6 +150,11 @@ - (void)setupUI {
[titleLabel setEditable:NO];
[titleLabel setFont:[NSFont systemFontOfSize:15]];
[stackView addArrangedSubview:titleLabel];

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: Title label added";
FB2K_console_formatter() << "Last.fm UI: StackView arranged subviews count: " << (int)stackView.arrangedSubviews.count;
}

// Add spacer
NSView* spacer1 = [[NSView alloc] init];
Expand Down Expand Up @@ -221,6 +288,12 @@ - (void)setupUI {

// Update status label after UI setup
[self updateStatusLabel];

if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: setupUI completed";
FB2K_console_formatter() << "Last.fm UI: Final stackView subviews count: " << (int)stackView.arrangedSubviews.count;
FB2K_console_formatter() << "Last.fm UI: View hierarchy ready";
}
}

- (void)updateStatusLabel {
Expand Down Expand Up @@ -620,7 +693,18 @@ - (IBAction)onAuthenticateClicked:(id)sender {
class preferences_page_lastfm : public preferences_page {
public:
service_ptr instantiate() override {
return fb2k::wrapNSObject([fooLastfmMacPreferences new]);
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: preferences_page instantiate() called";
}
auto controller = [fooLastfmMacPreferences new];
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: fooLastfmMacPreferences controller created";
}
auto wrapped = fb2k::wrapNSObject(controller);
if (foo_lastfm::cfg_debug_enabled.get()) {
FB2K_console_formatter() << "Last.fm UI: NSObject wrapped for foobar2000";
}
return wrapped;
}
const char* get_name() override { return "Last.fm Scrobbler"; }
GUID get_guid() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 15.6;
MARKETING_VERSION = 0.1.3;
MARKETING_VERSION = 0.1.4;
OTHER_LDFLAGS = "-lcurl";
PRODUCT_BUNDLE_IDENTIFIER = "com.foobar2000.foo-mac-scrobble";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -565,7 +565,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 15.6;
MARKETING_VERSION = 0.1.3;
MARKETING_VERSION = 0.1.4;
OTHER_LDFLAGS = "-lcurl";
PRODUCT_BUNDLE_IDENTIFIER = "com.foobar2000.foo-mac-scrobble";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
4 changes: 2 additions & 2 deletions foobar2000/foo_mac_scrobble/lastfm_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ bool LastfmApi::send_api_request(const std::map<std::string, std::string>& param
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15L);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5L);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "foo_mac_scrobble/0.1.3 (macOS)");
curl_easy_setopt(curl, CURLOPT_USERAGENT, "foo_mac_scrobble/0.1.4 (macOS)");
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");

// Log request details for debugging
Expand All @@ -364,7 +364,7 @@ bool LastfmApi::send_api_request(const std::map<std::string, std::string>& param
FB2K_console_formatter() << "CURLOPT_TIMEOUT: 15";
FB2K_console_formatter() << "CURLOPT_CONNECTTIMEOUT: 5";
FB2K_console_formatter() << "CURLOPT_FOLLOWLOCATION: 0";
FB2K_console_formatter() << "CURLOPT_USERAGENT: foo_mac_scrobble/0.1.3 (macOS)";
FB2K_console_formatter() << "CURLOPT_USERAGENT: foo_mac_scrobble/0.1.4 (macOS)";
FB2K_console_formatter() << "CURLOPT_ACCEPT_ENCODING: <empty>";
FB2K_console_formatter() << "Post data length: " << (int)post_data.size();
FB2K_console_formatter() << "----------------------------";
Expand Down
2 changes: 1 addition & 1 deletion foobar2000/foo_mac_scrobble/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// update finder to find updates; for that to work, you must have ONLY ONE declaration per DLL. If there are multiple
// declarations, the component is assumed to be outdated and a version number of "0" is assumed, to overwrite the
// component with whatever is currently on the site assuming that it comes with proper version numbers.
DECLARE_COMPONENT_VERSION("Last.fm Scrobbler", "0.1.3",
DECLARE_COMPONENT_VERSION("Last.fm Scrobbler", "0.1.4",
"Last.fm scrobbler for foobar2000 on macOS\n"
"\n"
"Automatically scrobbles tracks to Last.fm\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>foobar2000_component_client.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<key>pfc-Mac.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>3</integer>
</dict>
<key>pfc-iOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>5</integer>
</dict>
</dict>
</dict>
Expand Down
Loading