| @@ -294,19 +294,26 @@ public: | |||||
| opcode = fShmControl.readOpcode(); | opcode = fShmControl.readOpcode(); | ||||
| CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeNull, opcode); | 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(); | opcode = fShmControl.readOpcode(); | ||||
| CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeSetBufferSize, opcode); | CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeSetBufferSize, opcode); | ||||
| pData->bufferSize = fShmControl.readUInt(); | pData->bufferSize = fShmControl.readUInt(); | ||||
| carla_stderr("BufferSize: %i", pData->bufferSize); | |||||
| opcode = fShmControl.readOpcode(); | opcode = fShmControl.readOpcode(); | ||||
| CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeSetSampleRate, opcode); | CARLA_SAFE_ASSERT_INT(opcode == kPluginBridgeOpcodeSetSampleRate, opcode); | ||||
| pData->sampleRate = fShmControl.readFloat(); | 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(); | CarlaThread::startThread(); | ||||
| CarlaEngine::init(clientName); | CarlaEngine::init(clientName); | ||||
| @@ -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 | // initial values | ||||
| fShmControl.writeOpcode(kPluginBridgeOpcodeNull); | fShmControl.writeOpcode(kPluginBridgeOpcodeNull); | ||||
| fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeShmControl))); | fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeShmControl))); | ||||
| fShmControl.writeInt(static_cast<int32_t>(sizeof(BridgeTimeInfo))); | |||||
| fShmControl.writeOpcode(kPluginBridgeOpcodeSetBufferSize); | fShmControl.writeOpcode(kPluginBridgeOpcodeSetBufferSize); | ||||
| fShmControl.writeInt(static_cast<int32_t>(pData->engine->getBufferSize())); | fShmControl.writeInt(static_cast<int32_t>(pData->engine->getBufferSize())); | ||||
| @@ -217,6 +217,7 @@ private: \ | |||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| #if 0 | |||||
| /* Define PRE/POST_PACKED_STRUCTURE */ | /* Define PRE/POST_PACKED_STRUCTURE */ | ||||
| #if defined(__GNUC__) || defined(__clang__) | #if defined(__GNUC__) || defined(__clang__) | ||||
| # define PRE_PACKED_STRUCTURE | # define PRE_PACKED_STRUCTURE | ||||
| @@ -229,6 +230,7 @@ private: \ | |||||
| # define PRE_PACKED_STRUCTURE | # define PRE_PACKED_STRUCTURE | ||||
| # define POST_PACKED_STRUCTURE | # define POST_PACKED_STRUCTURE | ||||
| #endif | #endif | ||||
| #endif | |||||
| /* Define OS_SEP */ | /* Define OS_SEP */ | ||||
| #ifdef CARLA_OS_WIN | #ifdef CARLA_OS_WIN | ||||
| @@ -75,7 +75,6 @@ const char* const CARLA_BRIDGE_MSG_SET_CUSTOM = "CarlaBridgeSetCustom"; //!< Hos | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct BridgeTimeInfo { | struct BridgeTimeInfo { | ||||
| bool playing; | bool playing; | ||||
| uint64_t frame; | uint64_t frame; | ||||
| @@ -85,11 +84,10 @@ struct BridgeTimeInfo { | |||||
| int32_t bar, beat, tick; | int32_t bar, beat, tick; | ||||
| float beatsPerBar, beatType; | float beatsPerBar, beatType; | ||||
| double barStartTick, ticksPerBeat, beatsPerMinute; | double barStartTick, ticksPerBeat, beatsPerMinute; | ||||
| } POST_PACKED_STRUCTURE; | |||||
| }; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct BridgeShmControl { | struct BridgeShmControl { | ||||
| union { | union { | ||||
| void* runServer; | void* runServer; | ||||
| @@ -100,7 +98,7 @@ struct BridgeShmControl { | |||||
| char _padClient[32]; | char _padClient[32]; | ||||
| }; | }; | ||||
| StackRingBuffer ringBuffer; | StackRingBuffer ringBuffer; | ||||
| } POST_PACKED_STRUCTURE; | |||||
| }; | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -51,14 +51,6 @@ struct StackRingBuffer { | |||||
| char buf[size]; | 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 | // RingBufferControl templated class | ||||