Skip to content

Commit

Permalink
Adaptive open set 10 22 19 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbashford authored Oct 24, 2019
1 parent 690adff commit 3004a73
Show file tree
Hide file tree
Showing 27 changed files with 3,375 additions and 2,708 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(AvSpeechInNoise)
project(AvSpeechInNoise VERSION 1.3.0 LANGUAGES CXX)

add_subdirectory(googletest)
add_subdirectory(GSL)
add_subdirectory(av-speech-in-noise)

9 changes: 1 addition & 8 deletions av-speech-in-noise/adaptive-track/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
set(
SOURCES
"src/AdaptiveTrack.cpp"
)

add_library(adaptive-track ${SOURCES})
add_library(adaptive-track src/AdaptiveTrack.cpp)
target_include_directories(adaptive-track PUBLIC include)
target_include_directories(adaptive-track PRIVATE include/adaptive-track)
target_compile_options(adaptive-track PRIVATE -Wall -Wextra -pedantic -Werror)
target_link_libraries(adaptive-track recognition-test)

26 changes: 17 additions & 9 deletions av-speech-in-noise/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
set(
SOURCES
"AvFoundationPlayers.mm"
"CocoaView.mm"
"main.mm"
)
find_library(AV_FOUNDATION AVFoundation)
if (NOT AV_FOUNDATION)
message(FATAL_ERROR "AVFoundation not found")
Expand All @@ -24,7 +18,21 @@ find_library(MEDIA_TOOLBOX MediaToolbox)
if (NOT MEDIA_TOOLBOX)
message(MEDIA_TOOLBOX "MediaToolbox not found")
endif()
add_executable(AvSpeechInNoise MACOSX_BUNDLE ${SOURCES})
target_compile_options(AvSpeechInNoise PRIVATE -Wall -Wextra -pedantic -Werror)
add_executable(AvSpeechInNoise MACOSX_BUNDLE
AvFoundationPlayers.mm
CocoaView.mm
main.mm
)
target_compile_features(AvSpeechInNoise PRIVATE cxx_std_17)
target_link_libraries(AvSpeechInNoise recognition-test stimulus-players presentation target-list adaptive-track ${AV_FOUNDATION} ${CORE_AUDIO} ${COCOA} ${CORE_MEDIA} ${MEDIA_TOOLBOX})
target_link_libraries(AvSpeechInNoise
recognition-test
stimulus-players
presentation
target-list
adaptive-track
${AV_FOUNDATION}
${CORE_AUDIO}
${COCOA}
${CORE_MEDIA}
${MEDIA_TOOLBOX}
)
1 change: 1 addition & 0 deletions av-speech-in-noise/apps/CocoaView.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class CocoaView : public av_speech_in_noise::View {
std::string audioDevice() override;
void populateAudioDeviceMenu(std::vector<std::string>) override;
void addSubview(NSView *);
void setDelegate(id<NSWindowDelegate>);
void center();
private:
std::string browseModal(NSOpenPanel *panel);
Expand Down
4 changes: 4 additions & 0 deletions av-speech-in-noise/apps/CocoaView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,10 @@ - (void)exitTest {
[window.contentView addSubview:view];
}

void CocoaView::setDelegate(id<NSWindowDelegate> delegate) {
[window setDelegate:delegate];
}

void CocoaView::center() {
[window center];
}
13 changes: 13 additions & 0 deletions av-speech-in-noise/apps/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ - (void)timerCallback {
}
};

@interface WindowDelegate : NSObject<NSWindowDelegate>
- (void)windowWillClose:(NSNotification *)notification;
@end

@implementation WindowDelegate
- (void)windowWillClose:(NSNotification *) __unused notification
{
[NSApp terminate:self];
}
@end

int main() {
using namespace av_speech_in_noise;
MacOsDirectoryReader reader;
Expand Down Expand Up @@ -365,6 +376,8 @@ int main() {
view.addSubview(testSetupView.view());
view.addSubview(experimenterView.view());
view.center();
auto delegate = [WindowDelegate alloc];
view.setDelegate(delegate);
auto subjectScreenSize = subjectScreenFrame.size;
auto subjectViewHeight = subjectScreenSize.height / 4;
auto subjectScreenWidth = subjectScreenSize.width;
Expand Down
1 change: 0 additions & 1 deletion av-speech-in-noise/av-speech-in-noise/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
add_library(av-speech-in-noise INTERFACE)
target_include_directories(av-speech-in-noise INTERFACE include)
target_compile_features(av-speech-in-noise INTERFACE cxx_std_14)

Loading

0 comments on commit 3004a73

Please sign in to comment.