mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
refs #255 move voice channel handling from CVoiceVatlib into a dedicated class CVoiceChannel
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
class IVoiceChannel;
|
||||
|
||||
/*!
|
||||
* Interface to a connection to a ATC voice server for use in flight simulation.
|
||||
*
|
||||
@@ -49,35 +51,9 @@ namespace BlackCore
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief IVoice currently supports two different com units
|
||||
*/
|
||||
enum ComUnit
|
||||
{
|
||||
COM1 = 0, /*!< ComUnit 1 */
|
||||
COM2 /*!< ComUnit 2 */
|
||||
};
|
||||
|
||||
//! Com status
|
||||
enum ConnectionStatus
|
||||
{
|
||||
Disconnected = 0, //!< Not connected
|
||||
Disconnecting, //!< In transition to disconnected
|
||||
DisconnectedError, //!< Disconnected due to socket error
|
||||
Connecting, //!< Connection initiated but not established
|
||||
Connected, //!< Connection established
|
||||
ConnectingFailed, //!< Failed to connect
|
||||
};
|
||||
|
||||
//! Virtual destructor.
|
||||
virtual ~IVoice() {}
|
||||
|
||||
/*!
|
||||
* \brief Own aircraft's callsign
|
||||
* \param callsign
|
||||
*/
|
||||
virtual void setMyAircraftCallsign(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Audio devices
|
||||
* \return
|
||||
@@ -128,6 +104,9 @@ namespace BlackCore
|
||||
*/
|
||||
virtual QString micTestResultAsString() const = 0;
|
||||
|
||||
//! Get voice channel object
|
||||
virtual IVoiceChannel *getVoiceChannel(qint32 channelIndex) const = 0;
|
||||
|
||||
public slots:
|
||||
|
||||
/*!
|
||||
@@ -150,68 +129,6 @@ namespace BlackCore
|
||||
*/
|
||||
virtual void setInputDevice(const BlackMisc::Audio::CAudioDevice &device) = 0;
|
||||
|
||||
/*!
|
||||
* Get COM1/2 voice rooms, which then allows to retrieve information
|
||||
* such as audio status etc.
|
||||
*/
|
||||
virtual BlackMisc::Audio::CVoiceRoomList getComVoiceRoomsWithAudioStatus() const = 0;
|
||||
|
||||
/*!
|
||||
* Get COM1/2 voice rooms, const and with no status update
|
||||
*/
|
||||
virtual BlackMisc::Audio::CVoiceRoomList getComVoiceRooms() const = 0;
|
||||
|
||||
/*!
|
||||
* \brief Join voice room
|
||||
* \param comUnit COM1/2
|
||||
* \param voiceRoom
|
||||
*/
|
||||
virtual void joinVoiceRoom(const ComUnit comUnit, const BlackMisc::Audio::CVoiceRoom &voiceRoom) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Leave voice room
|
||||
* \param comUnit COM1/2
|
||||
*/
|
||||
virtual void leaveVoiceRoom(const ComUnit comUnit) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Leave all voice rooms
|
||||
*/
|
||||
virtual void leaveAllVoiceRooms() = 0;
|
||||
|
||||
/*!
|
||||
* \brief Set room output volume for COM unit
|
||||
*/
|
||||
virtual void setRoomOutputVolume(const ComUnit comUnit, const qint32 volumne) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Start transmitting
|
||||
*/
|
||||
virtual void startTransmitting(const ComUnit comUnit) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Stop transmitting
|
||||
*/
|
||||
virtual void stopTransmitting(const ComUnit comUnit) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Get voice room callsings
|
||||
* \return
|
||||
*/
|
||||
virtual BlackMisc::Aviation::CCallsignList getVoiceRoomCallsigns(const ComUnit comUnit) const = 0;
|
||||
|
||||
/*!
|
||||
* \brief Is muted?
|
||||
*/
|
||||
virtual bool isMuted() const = 0;
|
||||
|
||||
/*!
|
||||
* \brief Switch audio output, enable or disable given COM unit.
|
||||
* \param comUnit
|
||||
* \param enable enable or disable output
|
||||
*/
|
||||
virtual void switchAudioOutput(const ComUnit comUnit, bool enable) = 0;
|
||||
|
||||
/*!
|
||||
* \brief Enable audio loopback to route recorded voice from microphone to speakers
|
||||
* \param enable (default true)
|
||||
@@ -220,40 +137,6 @@ namespace BlackCore
|
||||
|
||||
signals:
|
||||
|
||||
//! The status of a room has changed.
|
||||
void connectionStatusChanged(ComUnit comUnit, ConnectionStatus oldStatus, ConnectionStatus newStatus);
|
||||
|
||||
// Signals about users joining and leaving
|
||||
/*!
|
||||
* \brief User with callsign joined room
|
||||
*/
|
||||
void userJoinedRoom(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
/*!
|
||||
* \brief User with callsign left room
|
||||
*/
|
||||
void userLeftRoom(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
// Audio signals
|
||||
/*!
|
||||
* \brief Audio for given unit started
|
||||
*/
|
||||
void audioStarted(const ComUnit comUnit);
|
||||
|
||||
/*!
|
||||
* \brief Audio for given unit stopped
|
||||
*/
|
||||
void audioStopped(const ComUnit comUnit);
|
||||
|
||||
/*!
|
||||
* \brief Audio started
|
||||
*/
|
||||
void globalAudioStarted();
|
||||
|
||||
/*!
|
||||
* \brief Audio stopped
|
||||
*/
|
||||
void globalAudioStopped();
|
||||
|
||||
// Test signals
|
||||
/*!
|
||||
* \brief Squelch test completed
|
||||
@@ -275,7 +158,4 @@ namespace BlackCore
|
||||
|
||||
} // namespace BlackCore
|
||||
|
||||
Q_DECLARE_METATYPE(BlackCore::IVoice::ComUnit)
|
||||
Q_DECLARE_METATYPE(BlackCore::IVoice::ConnectionStatus)
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user