summaryrefslogtreecommitdiffstats
path: root/ui/qt/utils/rtp_audio_routing.h
blob: 51117b169d16066853ddc6d51bc4ca93dc57e28d (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/** @file
 *
 * Declarations of RTP audio routing class
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef RTP_AUDIO_ROUTING_H
#define RTP_AUDIO_ROUTING_H

#include "config.h"

#include <QMetaType>

typedef enum {
    channel_any,          // Used just for changes of mute
    channel_mono,         // Play
    channel_stereo_left,  // L
    channel_stereo_right, // R
    channel_stereo_both   // L+R
} audio_routing_channel_t;

class AudioRouting
{
public:
    AudioRouting() = default;
    ~AudioRouting() = default;
    AudioRouting(const AudioRouting &) = default;
    AudioRouting &operator=(const AudioRouting &) = default;

    AudioRouting(bool muted, audio_routing_channel_t channel);
    bool isMuted() { return muted_; }
    void setMuted(bool muted) { muted_ = muted; }
    audio_routing_channel_t getChannel() { return channel_; }
    void setChannel(audio_routing_channel_t channel) { channel_ = channel; }
    char const *formatAudioRoutingToString();
    AudioRouting getNextChannel(bool stereo_available);
    AudioRouting convert(bool stereo_available);
    void mergeAudioRouting(AudioRouting new_audio_routing);

private:
    bool muted_;
    audio_routing_channel_t channel_;
};
Q_DECLARE_METATYPE(AudioRouting)

#define AUDIO_MUTED true
#define AUDIO_UNMUTED false


#endif // RTP_AUDIO_ROUTING_H