-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClockMaster.h
More file actions
35 lines (24 loc) · 940 Bytes
/
ClockMaster.h
File metadata and controls
35 lines (24 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// This file is part of the Open Audio Live System project, a live audio environment
// Copyright (c) 2026 - Mathis DELGADO
//
// This project is distributed under the Creative Commons CC-BY-NC-SA licence. https://creativecommons.org/licenses/by-nc-sa/4.0
#ifndef CLOCKMASTER_H
#define CLOCKMASTER_H
#include "netutils/LowLatSocket.h"
#include "NetworkMapper.h"
#include "clock.h"
#include <unordered_map>
class ClockMaster {
public:
ClockMaster(uint16_t self_uid, const std::string& iface, std::shared_ptr<NetworkMapper> nmapper);
~ClockMaster() = default;
void begin_sync_process();
void sync_process();
private:
void start_clock_sync(PeerInfos& slave);
void process_packet(ClockSyncPacket& csp, uint16_t originator);
std::shared_ptr<NetworkMapper> m_nmapper;
std::shared_ptr<LowLatSocket> m_sync_socket;
std::unordered_map<uint16_t, ClockSyncState> m_sync_states;
};
#endif //CLOCKMASTER_H