Add bare-minimum extension-reaper-macos REAPER extension skeleton
C/C++ extension built directly against the vendored Cockos reaper-sdk headers (no Rust/reaper-rs wrapper layer). Loads, registers a test action, and confirms via REAPER's console — confirmed working in REAPER 2026-07-15. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#ifndef _WDL_BITFIELD_H_
|
||||
#define _WDL_BITFIELD_H_
|
||||
|
||||
#include "heapbuf.h"
|
||||
|
||||
class WDL_BitField // ultra simple bit field
|
||||
{
|
||||
public:
|
||||
bool SetSize(int sz) // clears state
|
||||
{
|
||||
void *b=m_hb.ResizeOK((sz+7)/8);
|
||||
if (b) memset(b,0,m_hb.GetSize());
|
||||
return !!b;
|
||||
}
|
||||
int GetApproxSize() const { return m_hb.GetSize()*8; } // may return slightly greater than the size set
|
||||
|
||||
bool IsSet(unsigned int idx) const
|
||||
{
|
||||
const unsigned char mask = 1<<(idx&7);
|
||||
idx>>=3;
|
||||
return idx < (unsigned int)m_hb.GetSize() && (((unsigned char *)m_hb.Get())[idx]&mask);
|
||||
}
|
||||
void Set(unsigned int idx)
|
||||
{
|
||||
const unsigned char mask = 1<<(idx&7);
|
||||
idx>>=3;
|
||||
if (idx < (unsigned int)m_hb.GetSize()) ((unsigned char *)m_hb.Get())[idx] |= mask;
|
||||
}
|
||||
|
||||
private:
|
||||
WDL_HeapBuf m_hb;
|
||||
};
|
||||
|
||||
#endif //_WDL_BITFIELD_H_
|
||||
Reference in New Issue
Block a user