From d1f2f83a943404da8364cd088e3f5dbb849c3bc6 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 18 Mar 2018 06:31:12 -0400 Subject: [PATCH] Fix windows bridge build --- dep/oui-blendish | 2 +- src/app/AudioWidget.cpp | 4 ++-- src/bridge.cpp | 14 ++------------ 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/dep/oui-blendish b/dep/oui-blendish index 383f24f6..b7066201 160000 --- a/dep/oui-blendish +++ b/dep/oui-blendish @@ -1 +1 @@ -Subproject commit 383f24f6ed41facf25eda0d32b0f6bc9aee96e53 +Subproject commit b7066201022a757cbcbd986d8c91d565e4daef90 diff --git a/src/app/AudioWidget.cpp b/src/app/AudioWidget.cpp index 6577a399..617e179c 100644 --- a/src/app/AudioWidget.cpp +++ b/src/app/AudioWidget.cpp @@ -100,7 +100,7 @@ struct AudioSampleRateChoice : LedDisplayChoice { menu->addChild(construct(&MenuLabel::text, "Sample rate")); std::vector sampleRates = audioWidget->audioIO->getSampleRates(); if (sampleRates.empty()) { - menu->addChild(construct(&MenuLabel::text, "(None available)")); + menu->addChild(construct(&MenuLabel::text, "(Locked by device)")); } for (int sampleRate : sampleRates) { AudioSampleRateItem *item = new AudioSampleRateItem(); @@ -132,7 +132,7 @@ struct AudioBlockSizeChoice : LedDisplayChoice { menu->addChild(construct(&MenuLabel::text, "Block size")); std::vector blockSizes = audioWidget->audioIO->getBlockSizes(); if (blockSizes.empty()) { - menu->addChild(construct(&MenuLabel::text, "(None available)")); + menu->addChild(construct(&MenuLabel::text, "(Locked by device)")); } for (int blockSize : blockSizes) { AudioBlockSizeItem *item = new AudioBlockSizeItem(); diff --git a/src/bridge.cpp b/src/bridge.cpp index 9e06db7b..c91e3958 100644 --- a/src/bridge.cpp +++ b/src/bridge.cpp @@ -5,7 +5,6 @@ #include #ifdef ARCH_WIN #include - #include #else #include #include @@ -303,21 +302,16 @@ static void serverConnect() { struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; + addr.sin_port = htons(BRIDGE_PORT); #ifdef ARCH_WIN - InetPton(AF_INET, BRIDGE_HOST, &addr.sin_addr); + addr.sin_addr.s_addr = inet_addr(BRIDGE_HOST); #else inet_pton(AF_INET, BRIDGE_HOST, &addr.sin_addr); #endif - addr.sin_port = htons(BRIDGE_PORT); // Open socket -#ifdef ARCH_WIN - SOCKET server = socket(result->ai_family, result->ai_socktype, result->ai_protocol); - if (server == INVALID_SOCKET) { -#else int server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (server < 0) { -#endif warn("Bridge server socket() failed"); return; } @@ -326,11 +320,7 @@ static void serverConnect() { }); // Bind socket to address -#ifdef ARCH_WIN - err = bind(server, result->ai_addr, (int)result->ai_addrlen); -#else err = bind(server, (struct sockaddr*) &addr, sizeof(addr)); -#endif if (err) { warn("Bridge server bind() failed"); return;