Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/AvsCommands/choose_stream.h
T
torstenandCopilot 7a6be7474e Qt6 migration: Fix BUILD_RTI=OFF build errors in TrainingAreaBase
- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document

C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+

Build status: BUILD_RTI=OFF successful (0 errors, warnings only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-23 20:49:23 +02:00

99 lines
3.5 KiB
C++
Executable File

/**
* @RDE_HEADER@
* ChooseStream
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Fröbel, SLSE, 2017-06-29
*/
#pragma once
#include <AudioVideoManagement/icommand.h>
#include <AudioVideoManagement/ava_types.h>
#include "svcavmcommon_export.h"
#include <QtCore/QString>
#include <boost/optional.hpp>
namespace AudioVideoManagement
{
class IAvaComm;
class IAvaCommandDoneObserver;
namespace AvaCommands
{
/**
* Example protocol for chooseStream:
* @code
* ==> b'chooseStream "av_0045" 1 "CTCVideo-1"\n'
* <== b'200 OK\r\n'
* <== b'221 "av_0040" "CTCVideo-1" 1523026547.94 STREAMPOS\r\n' -- for each previously active stream
* <== b'221 "av_0053" "CTCVideo-1" 1523026547.94 STREAMPOS\r\n'
* <== b'221 "av_0045" "CTCVideo-1" 1523026547.94 STREAMPOS\r\n'
* <== b'221 "av_0036" "CTCVideo-1" 1523026547.94 STREAMPOS\r\n'
* <== b'223 "av_0036" "CTCVideo-1" 3 STREAMSTATE\r\n' -- for each previously active video *and* audio stream
* <== b'223 "av_0040" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'223 "av_0045" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'223 "av_0053" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'223 "av_0040" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'223 "av_0053" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'223 "av_0045" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'223 "av_0036" "CTCVideo-1" 3 STREAMSTATE\r\n'
* <== b'220 "av_0045" "CTCVideo-1" 1523026548.00 1523026548.00 0.00 STREAMINFO\r\n' -- for the newly chosen stream
* <== b'221 "av_0045" "CTCVideo-1" 1523026548.00 STREAMPOS\r\n'
* <== b'222 "av_0045" "CTCVideo-1" 100 STREAMSPEED\r\n'
* <== b'223 "av_0045" "CTCVideo-1" 0 STREAMSTATE\r\n'
* <== b'224 "av_0045" "CTCVideo-1" 1 0 STREAMMODE\r\n'
* <== b'225 "av_0045" "CTCVideo-1" 1 STREAMAUDIOMUTE\r\n' -- optional, in case the stream has an audio part
* <== b'228 "av_0045" "CTCVideo-1" 1 STREAMVOLUMECHANGED\r\n'
* <== b'225 "av_0045" "CTCVideo-1" 1 STREAMAUDIOMUTE\r\n'
* <== b'223 "av_0045" "CTCVideo-1" 1 STREAMSTATE\r\n'
* @endcode
*
* The order of those responses is deterministic.
* See AVS-Software src/app/AVS_Workstation/app/presentationgroup.cpp:
* int PresentationGroup::sendInfo(QString stream, int type)
*
* So we synchronize on the StreamMode response as everything thereafter is optional.
*
* @author Christian Fröbel
*/
class AVM_COMMON_EXPORT ChooseStream final : public ICommand
{
Q_OBJECT
public:
ChooseStream(IAvaComm *comm, IAvaCommandDoneObserver *doneObserver, const QString &dialogId, const QString &streamName);
void send() override;
QString debug() const override { return QLatin1String("ChooseStream: ") + m_streamName; }
/**
* May only be called after the command has successfully completed.
*/
///{@
AvaStreamInfo streamInfo() const { return *m_streamInfo; }
AvaStreamState streamState() const { return *m_streamState; }
///@}
private slots:
void onStreamInfoReceived(const QString &dialogId, const QString &streamName, const AvaStreamInfo &streamInfo);
void onStreamStateReceived(const QString &dialogId, const QString &streamName, AvaStreamState streamState);
void onStreamModeReceived(const QString &dialogId, const QString &streamName, bool pint, bool autoStop);
private:
void done();
const QString m_dialogId;
const QString m_streamName;
boost::optional<AvaStreamInfo> m_streamInfo;
boost::optional<AvaStreamState> m_streamState;
IAvaComm *m_comm;
IAvaCommandDoneObserver *m_observer;
};
}} // namespace AudioVideoManagement::AvaCommands