1#ifndef WAVELENGTH_SESSION_COORDINATOR_H
2#define WAVELENGTH_SESSION_COORDINATOR_H
55 bool is_password_protected,
const QString &password);
64 static bool JoinWavelength(
const QString &frequency,
const QString &password = QString());
93 static bool SendFile(
const QString &file_path);
284 void onMessageSent(
const QString &frequency,
const QString &message);
313 qDebug() <<
"Configuration changed:" << key;
322 void onPttDenied(
const QString &frequency,
const QString &reason) {
void onMessageSent(const QString &frequency, const QString &message)
Slot triggered when a message is sent. Relays the signal and publishes the event via WavelengthEventB...
Definition session_coordinator.cpp:147
static SessionCoordinator * GetInstance()
Gets the singleton instance of the WavelengthSessionCoordinator.
Definition session_coordinator.h:25
void ConnectSignals()
Connects signals between the various Wavelength components. Called during Initialize().
Definition session_coordinator.cpp:172
void wavelengthCreated(QString frequency)
Emitted when a wavelength is successfully created. Relayed from WavelengthCreator.
static void CloseWavelength(const QString &frequency)
Closes a specific wavelength (only if the current user is the host). Unregisters the wavelength local...
Definition session_coordinator.cpp:52
void remoteAudioAmplitudeUpdate(QString frequency, qreal amplitude)
Emitted when remote audio amplitude updates are received. Relayed from WavelengthMessageService.
static QString GetActiveWavelength()
Gets the frequency identifier of the currently active wavelength. Delegates the call to WavelengthSta...
Definition session_coordinator.cpp:69
void messageReceived(QString frequency, const QString &message)
Emitted when a message is received. Relayed from WavelengthMessageProcessor/Joiner.
void Initialize()
Initializes the coordinator and its underlying components. Connects signals between various Wavelengt...
Definition session_coordinator.cpp:15
static bool IsWavelengthJoined(const QString &frequency)
Checks if the user is considered joined to a specific wavelength (based on registry presence)....
Definition session_coordinator.cpp:97
static WavelengthInfo GetWavelengthInfo(const QString &frequency, bool *is_host=nullptr)
Retrieves detailed information about a specific wavelength. Delegates the call to WavelengthStateMana...
Definition session_coordinator.cpp:65
void onAuthenticationFailed(const QString &frequency)
Slot triggered when authentication fails during join. Relays the signal and publishes the event via W...
Definition session_coordinator.cpp:159
void onConnectionError(const QString &errorMessage)
Slot triggered when a connection error occurs. Relays the signal and publishes the event via Waveleng...
Definition session_coordinator.cpp:153
void activeWavelengthChanged(QString frequency)
Emitted when the active wavelength changes. Relayed from WavelengthStateManager.
static int GetJoinedWavelengthCount()
Gets the count of wavelengths the user is currently joined to. Delegates the call to WavelengthStateM...
Definition session_coordinator.cpp:81
static void SetActiveWavelength(const QString &frequency)
Sets the specified frequency as the currently active wavelength. Delegates the call to WavelengthStat...
Definition session_coordinator.cpp:93
void messageSent(QString frequency, const QString &message)
Emitted when a message is successfully sent. Relayed from WavelengthMessageService.
void onWavelengthCreated(const QString &frequency)
Slot triggered when a wavelength is created. Relays the signal and publishes the event via Wavelength...
Definition session_coordinator.cpp:117
static bool IsActiveWavelengthHost()
Checks if the current user is the host of the currently active wavelength. Delegates the call to Wave...
Definition session_coordinator.cpp:73
static bool SendMessage(const QString &message)
Sends a text message to the currently active wavelength. Delegates the call to WavelengthMessageServi...
Definition session_coordinator.cpp:57
void onActiveWavelengthChanged(const QString &frequency)
Slot triggered when the active wavelength changes. Relays the signal and publishes the event via Wave...
Definition session_coordinator.cpp:165
void onAudioDataReceived(const QString &frequency, const QByteArray &audio_data)
Relays the audioDataReceived signal.
Definition session_coordinator.h:337
void pttGranted(QString frequency)
Emitted when PTT transmission is granted. Relayed from WavelengthMessageService.
void wavelengthLeft(QString frequency)
Emitted when the user leaves the active wavelength. Relayed from WavelengthLeaver.
static bool JoinWavelength(const QString &frequency, const QString &password=QString())
Initiates joining an existing wavelength. Delegates the call to WavelengthJoiner and registers the wa...
Definition session_coordinator.cpp:32
void onWavelengthClosed(const QString &frequency)
Slot triggered when a wavelength is closed. Relays the signal and publishes the event via WavelengthE...
Definition session_coordinator.cpp:135
SessionCoordinator(const SessionCoordinator &)=delete
Deleted copy constructor to prevent copying.
static void SetRelayServerAddress(const QString &address)
Sets the relay server address in the configuration. Delegates the call to WavelengthConfig.
Definition session_coordinator.cpp:109
void onPttStartReceiving(const QString &frequency, const QString &sender_id)
Relays the pttStartReceiving signal.
Definition session_coordinator.h:327
static bool SendFile(const QString &file_path)
Sends a file to the currently active wavelength. Delegates the call to WavelengthMessageService.
Definition session_coordinator.cpp:61
static bool IsWavelengthPasswordProtected(const QString &frequency)
Checks if a specific wavelength is password protected. Delegates the call to WavelengthStateManager.
Definition session_coordinator.cpp:85
void pttDenied(QString frequency, QString reason)
Emitted when PTT transmission is denied. Relayed from WavelengthMessageService.
void onRemoteAudioAmplitudeUpdate(const QString &frequency, const qreal amplitude)
Relays the remoteAudioAmplitudeUpdate signal.
Definition session_coordinator.h:342
void wavelengthClosed(QString frequency)
Emitted when a wavelength is closed (by host or server). Relayed from multiple components.
void onWavelengthLeft(const QString &frequency)
Slot triggered when the active wavelength is left. Relays the signal and publishes the event via Wave...
Definition session_coordinator.cpp:129
void onPttDenied(const QString &frequency, const QString &reason)
Relays the pttDenied signal.
Definition session_coordinator.h:322
SessionCoordinator & operator=(const SessionCoordinator &)=delete
Deleted assignment operator to prevent assignment.
void wavelengthJoined(QString frequency)
Emitted when a wavelength is successfully joined. Relayed from WavelengthJoiner.
void pttStartReceiving(QString frequency, QString sender_id)
Emitted when another user starts PTT transmission. Relayed from WavelengthMessageService.
~SessionCoordinator() override=default
Private destructor.
static void onConfigChanged(const QString &key)
Slot triggered when a configuration setting changes. Logs the change.
Definition session_coordinator.h:312
SessionCoordinator(QObject *parent=nullptr)
Private constructor to enforce the singleton pattern.
Definition session_coordinator.h:351
void userKicked(QString frequency, const QString &reason)
Emitted when the current user is kicked from a frequency. Relayed from WavelengthMessageProcessor.
void onMessageReceived(const QString &frequency, const QString &message)
Slot triggered when a message is received. Relays the signal and publishes the event via WavelengthEv...
Definition session_coordinator.cpp:141
static bool CreateWavelength(const QString &frequency, bool is_password_protected, const QString &password)
Initiates the creation of a new wavelength. Delegates the call to WavelengthCreator and registers the...
Definition session_coordinator.cpp:20
static void LoadConfig()
Loads the application configuration using WavelengthConfig. Sets default values if the configuration ...
Definition session_coordinator.cpp:232
void pttStopReceiving(QString frequency)
Emitted when another user stops PTT transmission. Relayed from WavelengthMessageService.
static QString GetRelayServerAddress()
Gets the configured relay server address. Delegates the call to WavelengthConfig.
Definition session_coordinator.cpp:105
static void LeaveWavelength()
Leaves the currently active wavelength. Unregisters the wavelength locally and delegates the call to ...
Definition session_coordinator.cpp:42
void onWavelengthJoined(const QString &frequency)
Slot triggered when a wavelength is joined. Relays the signal and publishes the event via WavelengthE...
Definition session_coordinator.cpp:123
void audioDataReceived(QString frequency, const QByteArray &audio_data)
Emitted when raw audio data is received. Relayed from WavelengthMessageService.
void onPttStopReceiving(const QString &frequency)
Relays the pttStopReceiving signal.
Definition session_coordinator.h:332
void connectionError(const QString &error_message)
Emitted when a connection error occurs. Relayed from WavelengthCreator/Joiner.
static QList< QString > GetJoinedWavelengths()
Gets a list of frequencies the user is currently joined to. Delegates the call to WavelengthStateMana...
Definition session_coordinator.cpp:77
static QString GetRelayServerUrl()
Gets the full URL (ws://address:port) of the relay server. Delegates the call to WavelengthConfig.
Definition session_coordinator.cpp:113
static bool IsWavelengthHost(const QString &frequency)
Checks if the current user is the host of a specific wavelength. Delegates the call to WavelengthStat...
Definition session_coordinator.cpp:89
void onPttGranted(const QString &frequency)
Relays the pttGranted signal.
Definition session_coordinator.h:317
void authenticationFailed(QString frequency)
Emitted when authentication fails during join. Relayed from WavelengthJoiner.
static bool IsWavelengthConnected(const QString &frequency)
Checks if the WebSocket connection for a specific wavelength is established and valid....
Definition session_coordinator.cpp:101
Structure holding information about a specific wavelength (frequency).
Definition wavelength_registry.h:13