summaryrefslogtreecommitdiffstats
path: root/ServerInfo.hh
blob: 6dea7a9d76c2ef8beebcb28661ddff679d1adf7b (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef fooserverinfohhfoo
#define fooserverinfohhfoo

#include <gtkmm.h>
#include <map>

#include <polyp/polyplib.h>

class SinkInfo;
class SourceInfo;
class ServerInfo;

#include "SinkWindow.hh"
#include "SourceWindow.hh"
#include "MainWindow.hh"
 
class SinkInfo {
public:

    SinkInfo(const struct pa_sink_info &i);
    ~SinkInfo();
    
    void update(const struct pa_sink_info &i);
    void showWindow();
    
    Glib::ustring name, description;
    uint32_t index;
    struct pa_sample_spec sample_spec;
    uint32_t monitor_source;
    uint32_t owner_module;
    uint32_t volume;
    uint32_t latency;

    SinkWindow *sinkWindow;
};

class SourceInfo {
public:
    SourceInfo(const struct pa_source_info &i);
    ~SourceInfo();

    void update(const struct pa_source_info &i);
    void showWindow();
    
    Glib::ustring name, description;
    uint32_t index;
    struct pa_sample_spec sample_spec;
    uint32_t owner_module;
    uint32_t monitor_of_sink;

    SourceWindow *sourceWindow;
};

class ServerInfo {
public:
    ServerInfo(struct pa_context &c);
    ~ServerInfo();

    void updateInfo(const struct pa_sink_info &i);
    void updateInfo(const struct pa_source_info &i);

    void showSinkWindow(uint32_t index);
    void showSourceWindow(uint32_t index);

    SourceInfo* getSourceInfo(uint32_t index);
    SinkInfo* getSinkInfo(uint32_t index);
    
protected:
    std::map<int, SinkInfo*> sinks;
    std::map<int, SourceInfo*> sources;

    struct pa_context &context;
};

#endif