Browse Source

Remove bridge packing, other stuff to ensure timePos bridge works

tags/1.9.4
falkTX 11 years ago
parent
commit
9febdaddc3
5 changed files with 21 additions and 17 deletions
  1. +12
    -5
      source/backend/engine/CarlaEngineBridge.cpp
  2. +5
    -0
      source/backend/plugin/BridgePlugin.cpp
  3. +2
    -0
      source/includes/CarlaDefines.h
  4. +2
    -4
      source/utils/CarlaBridgeUtils.hpp
  5. +0
    -8
      source/utils/CarlaRingBuffer.hpp

+ 12
- 5
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -294,19 +294,26 @@ public:

opcode = fShmControl.readOpcode();
CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeNull, opcode);
const uint32_t structSize = fShmControl.readUInt();
CARLA_SAFE_ASSERT_INT2(structSize == sizeof(BridgeShmControl), structSize, sizeof(BridgeShmControl));
carla_stderr("Struct Size: %i", structSize);

const uint32_t shmStructSize = fShmControl.readUInt();
CARLA_SAFE_ASSERT_INT2(shmStructSize == sizeof(BridgeShmControl), shmStructSize, sizeof(BridgeShmControl));

const uint32_t timeStructSize = fShmControl.readUInt();
CARLA_SAFE_ASSERT_INT2(timeStructSize == sizeof(BridgeTimeInfo), timeStructSize, sizeof(BridgeTimeInfo));

opcode = fShmControl.readOpcode();
CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeSetBufferSize, opcode);
pData->bufferSize = fShmControl.readUInt();
carla_stderr("BufferSize: %i", pData->bufferSize);

opcode = fShmControl.readOpcode();
CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeSetSampleRate, opcode);
pData->sampleRate = fShmControl.readFloat();
carla_stderr("SampleRate: %f", pData->sampleRate);

carla_stdout("Carla Client Info:");
carla_stdout(" BufferSize: %i", pData->bufferSize);
carla_stdout(" SampleRate: %f", pData->sampleRate);
carla_stdout(" sizeof(BridgeShmControl): %i/" P_SIZE, shmStructSize, sizeof(BridgeShmControl));
carla_stdout(" sizeof(BridgeTimeInfo): %i/" P_SIZE, timeStructSize, sizeof(BridgeTimeInfo));

CarlaThread::startThread();
CarlaEngine::init(clientName);


+ 5
- 0
source/backend/plugin/BridgePlugin.cpp View File

@@ -1892,9 +1892,14 @@ public:
}
}

carla_stdout("Carla Server Info:");
carla_stdout(" sizeof(BridgeShmControl): " P_SIZE, sizeof(BridgeShmControl));
carla_stdout(" sizeof(BridgeTimeInfo): " P_SIZE, sizeof(BridgeTimeInfo));

// initial values
fShmControl.writeOpcode(kPluginBridgeOpcodeNull);
fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeShmControl)));
fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeTimeInfo)));

fShmControl.writeOpcode(kPluginBridgeOpcodeSetBufferSize);
fShmControl.writeInt(static_cast<int32_t>(pData->engine->getBufferSize()));


+ 2
- 0
source/includes/CarlaDefines.h View File

@@ -217,6 +217,7 @@ private: \
# endif
#endif

#if 0
/* Define PRE/POST_PACKED_STRUCTURE */
#if defined(__GNUC__) || defined(__clang__)
# define PRE_PACKED_STRUCTURE
@@ -229,6 +230,7 @@ private: \
# define PRE_PACKED_STRUCTURE
# define POST_PACKED_STRUCTURE
#endif
#endif

/* Define OS_SEP */
#ifdef CARLA_OS_WIN


+ 2
- 4
source/utils/CarlaBridgeUtils.hpp View File

@@ -75,7 +75,6 @@ const char* const CARLA_BRIDGE_MSG_SET_CUSTOM = "CarlaBridgeSetCustom"; //!< Hos

// -----------------------------------------------------------------------

PRE_PACKED_STRUCTURE
struct BridgeTimeInfo {
bool playing;
uint64_t frame;
@@ -85,11 +84,10 @@ struct BridgeTimeInfo {
int32_t bar, beat, tick;
float beatsPerBar, beatType;
double barStartTick, ticksPerBeat, beatsPerMinute;
} POST_PACKED_STRUCTURE;
};

// -----------------------------------------------------------------------

PRE_PACKED_STRUCTURE
struct BridgeShmControl {
union {
void* runServer;
@@ -100,7 +98,7 @@ struct BridgeShmControl {
char _padClient[32];
};
StackRingBuffer ringBuffer;
} POST_PACKED_STRUCTURE;
};

// -----------------------------------------------------------------------



+ 0
- 8
source/utils/CarlaRingBuffer.hpp View File

@@ -51,14 +51,6 @@ struct StackRingBuffer {
char buf[size];
};

PRE_PACKED_STRUCTURE
struct StackPackedRingBuffer {
static const uint32_t size = 4096;
int32_t head, tail, written;
bool invalidateCommit;
char buf[size];
} POST_PACKED_STRUCTURE;

// -----------------------------------------------------------------------
// RingBufferControl templated class



Loading…
Cancel
Save