Browse Source

Fix windows bridge build

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
d1f2f83a94
3 changed files with 5 additions and 15 deletions
  1. +1
    -1
      dep/oui-blendish
  2. +2
    -2
      src/app/AudioWidget.cpp
  3. +2
    -12
      src/bridge.cpp

+ 1
- 1
dep/oui-blendish

@@ -1 +1 @@
Subproject commit 383f24f6ed41facf25eda0d32b0f6bc9aee96e53
Subproject commit b7066201022a757cbcbd986d8c91d565e4daef90

+ 2
- 2
src/app/AudioWidget.cpp View File

@@ -100,7 +100,7 @@ struct AudioSampleRateChoice : LedDisplayChoice {
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Sample rate"));
std::vector<int> sampleRates = audioWidget->audioIO->getSampleRates();
if (sampleRates.empty()) {
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(None available)"));
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(Locked by device)"));
}
for (int sampleRate : sampleRates) {
AudioSampleRateItem *item = new AudioSampleRateItem();
@@ -132,7 +132,7 @@ struct AudioBlockSizeChoice : LedDisplayChoice {
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "Block size"));
std::vector<int> blockSizes = audioWidget->audioIO->getBlockSizes();
if (blockSizes.empty()) {
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(None available)"));
menu->addChild(construct<MenuLabel>(&MenuLabel::text, "(Locked by device)"));
}
for (int blockSize : blockSizes) {
AudioBlockSizeItem *item = new AudioBlockSizeItem();


+ 2
- 12
src/bridge.cpp View File

@@ -5,7 +5,6 @@
#include <unistd.h>
#ifdef ARCH_WIN
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
@@ -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;


Loading…
Cancel
Save