@@ -1 +1 @@ | |||||
Subproject commit 383f24f6ed41facf25eda0d32b0f6bc9aee96e53 | |||||
Subproject commit b7066201022a757cbcbd986d8c91d565e4daef90 |
@@ -100,7 +100,7 @@ struct AudioSampleRateChoice : LedDisplayChoice { | |||||
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Sample rate")); | menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Sample rate")); | ||||
std::vector<int> sampleRates = audioWidget->audioIO->getSampleRates(); | std::vector<int> sampleRates = audioWidget->audioIO->getSampleRates(); | ||||
if (sampleRates.empty()) { | if (sampleRates.empty()) { | ||||
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(None available)")); | |||||
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(Locked by device)")); | |||||
} | } | ||||
for (int sampleRate : sampleRates) { | for (int sampleRate : sampleRates) { | ||||
AudioSampleRateItem *item = new AudioSampleRateItem(); | AudioSampleRateItem *item = new AudioSampleRateItem(); | ||||
@@ -132,7 +132,7 @@ struct AudioBlockSizeChoice : LedDisplayChoice { | |||||
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Block size")); | menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Block size")); | ||||
std::vector<int> blockSizes = audioWidget->audioIO->getBlockSizes(); | std::vector<int> blockSizes = audioWidget->audioIO->getBlockSizes(); | ||||
if (blockSizes.empty()) { | if (blockSizes.empty()) { | ||||
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(None available)")); | |||||
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(Locked by device)")); | |||||
} | } | ||||
for (int blockSize : blockSizes) { | for (int blockSize : blockSizes) { | ||||
AudioBlockSizeItem *item = new AudioBlockSizeItem(); | AudioBlockSizeItem *item = new AudioBlockSizeItem(); | ||||
@@ -5,7 +5,6 @@ | |||||
#include <unistd.h> | #include <unistd.h> | ||||
#ifdef ARCH_WIN | #ifdef ARCH_WIN | ||||
#include <winsock2.h> | #include <winsock2.h> | ||||
#include <ws2tcpip.h> | |||||
#else | #else | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
@@ -303,21 +302,16 @@ static void serverConnect() { | |||||
struct sockaddr_in addr; | struct sockaddr_in addr; | ||||
memset(&addr, 0, sizeof(addr)); | memset(&addr, 0, sizeof(addr)); | ||||
addr.sin_family = AF_INET; | addr.sin_family = AF_INET; | ||||
addr.sin_port = htons(BRIDGE_PORT); | |||||
#ifdef ARCH_WIN | #ifdef ARCH_WIN | ||||
InetPton(AF_INET, BRIDGE_HOST, &addr.sin_addr); | |||||
addr.sin_addr.s_addr = inet_addr(BRIDGE_HOST); | |||||
#else | #else | ||||
inet_pton(AF_INET, BRIDGE_HOST, &addr.sin_addr); | inet_pton(AF_INET, BRIDGE_HOST, &addr.sin_addr); | ||||
#endif | #endif | ||||
addr.sin_port = htons(BRIDGE_PORT); | |||||
// Open socket | // 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); | int server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); | ||||
if (server < 0) { | if (server < 0) { | ||||
#endif | |||||
warn("Bridge server socket() failed"); | warn("Bridge server socket() failed"); | ||||
return; | return; | ||||
} | } | ||||
@@ -326,11 +320,7 @@ static void serverConnect() { | |||||
}); | }); | ||||
// Bind socket to address | // 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)); | err = bind(server, (struct sockaddr*) &addr, sizeof(addr)); | ||||
#endif | |||||
if (err) { | if (err) { | ||||
warn("Bridge server bind() failed"); | warn("Bridge server bind() failed"); | ||||
return; | return; | ||||