Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
sync.h
1#pragma once
2
3#include <cstdint>
4
5#include "util/d_string.h"
6
7// SyncType values correspond to the index of the first option of the specific
8// type in the selection menu. There are 9 different levels for each type (see
9// also SyncLevel)
10enum SyncType : uint8_t {
11 SYNC_TYPE_EVEN = 0,
12 SYNC_TYPE_TRIPLET = 10,
13 SYNC_TYPE_DOTTED = 19,
14};
15
16// Triplet swing not supported yet.
17#define MIN_SWING_INERVAL 1
18#define MAX_SWING_INTERVAL (SYNC_TYPE_TRIPLET - 1)
19#define NUM_SWING_INTERVALS SYNC_TYPE_TRIPLET
20
21// NOTE: These names are correct only for default resolution!
22enum SyncLevel : uint8_t {
23 SYNC_LEVEL_NONE = 0,
24 SYNC_LEVEL_WHOLE = 1,
25 SYNC_LEVEL_2ND = 2,
26 SYNC_LEVEL_4TH = 3,
27 SYNC_LEVEL_8TH = 4,
28 SYNC_LEVEL_16TH = 5,
29 SYNC_LEVEL_32ND = 6,
30 SYNC_LEVEL_64TH = 7,
31 SYNC_LEVEL_128TH = 8,
32 SYNC_LEVEL_256TH = 9,
33};
34
35#define MAX_SYNC_LEVEL 9
36#define NUM_SYNC_VALUES 28
37
38enum SyncLevel syncValueToSyncLevel(int32_t option);
39
40enum SyncType syncValueToSyncType(int32_t value);
41
42void syncValueToString(uint32_t value, StringBuf& buffer, int32_t tickMagnitude);
43
45int32_t wrapSwingIntervalSyncLevel(int32_t value);
46
48int32_t clampSwingIntervalSyncLevel(int32_t value);
Definition d_string.h:106