summaryrefslogtreecommitdiff
path: root/gtk2_ardour/engine_dialog.h
blob: ac96fbc5203181bc5ba857346b46260e80897f56 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
    Copyright (C) 2010 Paul Davis

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#ifndef __gtk2_ardour_engine_dialog_h__
#define __gtk2_ardour_engine_dialog_h__

#include <map>
#include <vector>
#include <string>

#include <gtkmm/checkbutton.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/notebook.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/table.h>
#include <gtkmm/expander.h>
#include <gtkmm/box.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/button.h>

class EngineControl : public Gtk::VBox {
  public:
	EngineControl ();
	~EngineControl ();

	static bool need_setup ();
	int setup_engine ();

	bool was_used() const { return _used; }
	XMLNode& get_state ();
	void set_state (const XMLNode&);

  private:
    /* core fields used by all backends */

    Gtk::ComboBoxText backend_combo;
    Gtk::ComboBoxText input_device_combo;
    Gtk::ComboBoxText output_device_combo;
    Gtk::ComboBoxText sample_rate_combo;
    Gtk::ComboBoxText buffer_size_combo;
    Gtk::Adjustment input_latency_adjustment;
    Gtk::SpinButton input_latency;
    Gtk::Adjustment output_latency_adjustment;
    Gtk::SpinButton output_latency;
    Gtk::Adjustment input_channels_adjustment;
    Gtk::SpinButton input_channels;
    Gtk::Adjustment output_channels_adjustment;
    Gtk::SpinButton output_channels;
    Gtk::Adjustment ports_adjustment;
    Gtk::SpinButton ports_spinner;
    Gtk::Label latency_label;

    /* JACK specific */
    
    Gtk::CheckButton realtime_button;
    Gtk::CheckButton no_memory_lock_button;
    Gtk::CheckButton unlock_memory_button;
    Gtk::CheckButton soft_mode_button;
    Gtk::CheckButton monitor_button;
    Gtk::CheckButton force16bit_button;
    Gtk::CheckButton hw_monitor_button;
    Gtk::CheckButton hw_meter_button;
    Gtk::CheckButton verbose_output_button;
    
    
    Gtk::ComboBoxText preset_combo;
    Gtk::ComboBoxText serverpath_combo;
    Gtk::ComboBoxText driver_combo;
    Gtk::ComboBoxText interface_combo;
    Gtk::ComboBoxText timeout_combo;
    Gtk::ComboBoxText dither_mode_combo;
    Gtk::ComboBoxText audio_mode_combo;
    Gtk::ComboBoxText midi_driver_combo;
    
    Gtk::Table basic_packer;
    Gtk::Table options_packer;
    Gtk::Table device_packer;
    Gtk::HBox basic_hbox;
    Gtk::HBox options_hbox;
    Gtk::HBox device_hbox;
    Gtk::Notebook notebook;
    
    bool _used;
    
    static bool engine_running ();
    
    void driver_changed ();
    void backend_changed ();

    void redisplay_latency ();
    uint32_t get_rate();
    void audio_mode_changed ();
    void interface_changed ();
    void list_devices ();
};

#endif /* __gtk2_ardour_engine_dialog_h__ */