From 5d310c008fb024425fecc7fe6a6b9da371a64085 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 13 Jan 2018 20:37:17 -1000 Subject: [PATCH] AudioSubmix reference fix; macOS window icon --- lib/audiodev/AudioVoice.cpp | 4 ++-- lib/mac/WindowCocoa.mm | 14 +++++++++++++- logvisor | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/audiodev/AudioVoice.cpp b/lib/audiodev/AudioVoice.cpp index 8e710d9..73aaf24 100644 --- a/lib/audiodev/AudioVoice.cpp +++ b/lib/audiodev/AudioVoice.cpp @@ -169,7 +169,7 @@ size_t AudioVoiceMono::_pumpAndMix(size_t frames) } else { - AudioSubmix& smx = reinterpret_cast(m_head->m_mainSubmix); + AudioSubmix& smx = *m_head->m_mainSubmix; m_cb->routeAudio(oDone, 1, dt, m_head->m_mainSubmix->m_busId, scratchPre.data(), scratchPost.data()); DefaultMonoMtx.mixMonoSampleData(m_head->clientMixInfo(), scratchPost.data(), smx._getMergeBuf(oDone), oDone); @@ -319,7 +319,7 @@ size_t AudioVoiceStereo::_pumpAndMix(size_t frames) } else { - AudioSubmix& smx = reinterpret_cast(m_head->m_mainSubmix); + AudioSubmix& smx = *m_head->m_mainSubmix; m_cb->routeAudio(oDone, 2, dt, m_head->m_mainSubmix->m_busId, scratchPre.data(), scratchPost.data()); DefaultStereoMtx.mixStereoSampleData(m_head->clientMixInfo(), scratchPost.data(), smx._getMergeBuf(oDone), oDone); diff --git a/lib/mac/WindowCocoa.mm b/lib/mac/WindowCocoa.mm index e9f973e..e4d460c 100644 --- a/lib/mac/WindowCocoa.mm +++ b/lib/mac/WindowCocoa.mm @@ -15,7 +15,7 @@ #endif namespace boo {class WindowCocoa; class GraphicsContextCocoa;} -@interface WindowCocoaInternal : NSWindow +@interface WindowCocoaInternal : NSWindow { std::shared_ptr booWindow; id touchBarProvider; @@ -1608,11 +1608,23 @@ std::shared_ptr _WindowCocoaNew(SystemStringView title, NSOpenGLContext NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:YES]; + self.delegate = self; self.releasedWhenClosed = NO; self.title = [NSString stringWithUTF8String:title.data()]; + + NSString* titleImgPath = [[NSBundle mainBundle] pathForResource:@"mainicon" ofType:@"icns"]; + NSImage* titleImg = [[NSImage alloc] initByReferencingFile:titleImgPath]; + [self setRepresentedURL:[NSURL URLWithString:@""]]; + NSButton* iconButton = [self standardWindowButton:NSWindowDocumentIconButton]; + [iconButton setImage:titleImg]; + booWindow = bw; return self; } +- (BOOL)window:(NSWindow*)window shouldPopUpDocumentPathMenu:(NSMenu*)menu +{ + return NO; +} - (void)setFrameDefault { [self setFrame:[self genFrameDefault] display:NO]; diff --git a/logvisor b/logvisor index f28fa0d..b89d18c 160000 --- a/logvisor +++ b/logvisor @@ -1 +1 @@ -Subproject commit f28fa0dbb2e59d02eb659542b28b13f8d1bfe4fb +Subproject commit b89d18c47181371c7871f49751f5d657f02f1fd6