summaryrefslogtreecommitdiffstats
path: root/MainWindow.hh
blob: d13dca36e5c943d80a325c098690b5ea9a68e8be (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
#ifndef foomainwindowhhfoo
#define foomainwindowhhfoo

#include <gtkmm.h>
#include <libglademm.h>
#include <polyp/polyplib.h>

class MainWinow;

#include "ServerInfo.hh"

class MainWindow : public Gtk::Window {
public:
    MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
    virtual ~MainWindow();
    static MainWindow* create();

    Gtk::Label *statusLabel,
        *serverNameLabel,
        *serverVersionLabel,
        *defaultSampleTypeLabel,
        *userNameLabel,
        *hostNameLabel;

    Gtk::Button *deviceOpenButton,
        *moduleOpenButton,
        *connectButton;

    Gtk::TreeView *deviceTreeView, *moduleTreeView;

protected:

    class DeviceTreeModelColumns : public Gtk::TreeModel::ColumnRecord {
    public:
        
        DeviceTreeModelColumns() {
            add(name);
            add(description);
            add(index);
            add(type);
        }

        Gtk::TreeModelColumn<Glib::ustring> name;
        Gtk::TreeModelColumn<Glib::ustring> description;
        Gtk::TreeModelColumn<int> index;
        Gtk::TreeModelColumn<int> type;
    };

    DeviceTreeModelColumns deviceTreeModelColumns;
    Glib::RefPtr<Gtk::TreeStore> deviceTreeStore;

    Gtk::TreePath sinkPath, sourcePath;

public:
    virtual void updateInfo(const struct pa_server_info &i);
    virtual void updateInfo(SinkInfo &i);
    virtual void updateInfo(SourceInfo &i);

    virtual void removeInfo(SinkInfo &i);
    virtual void removeInfo(SourceInfo &i);

    virtual void onDeviceTreeViewCursorChanged();
    virtual void onDeviceTreeViewRowActivated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* /* column */);

    virtual void showSuccess(const char *t);
    virtual void showFailure(const char *t);
    virtual void clearAllData();

    virtual void onDeviceOpenButton();
    virtual void onConnectButton();
};

#endif