2014-05-01 06:06:16 -05:00
|
|
|
/*
|
|
|
|
|
Copyright (C) 2012 Waves Audio Ltd.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2014-05-06 03:21:18 -05:00
|
|
|
#ifndef __device_connection_control_h__
|
|
|
|
|
#define __device_connection_control_h__
|
2014-05-01 06:06:16 -05:00
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
#include <gtkmm/layout.h>
|
|
|
|
|
#include "waves_ui.h"
|
|
|
|
|
|
|
|
|
|
class XMLTree;
|
|
|
|
|
|
|
|
|
|
class DeviceConnectionControl : public Gtk::Layout
|
|
|
|
|
{
|
|
|
|
|
public:
|
2014-05-06 03:21:18 -05:00
|
|
|
enum ConnectionNumber {
|
|
|
|
|
NoNumber = 0
|
|
|
|
|
};
|
2014-05-22 08:42:52 -05:00
|
|
|
|
|
|
|
|
static const char* id_name;
|
2014-05-06 03:21:18 -05:00
|
|
|
|
2014-05-19 18:04:58 -05:00
|
|
|
DeviceConnectionControl (const std::string& device_capture_name, bool active, uint16_t capture_number, const std::string& track_name);
|
|
|
|
|
DeviceConnectionControl (const std::string& device_playback_name, bool active, uint16_t playback_number);
|
|
|
|
|
DeviceConnectionControl (const std::string& midi_capture_name, bool active);
|
2014-05-12 09:21:16 -05:00
|
|
|
DeviceConnectionControl (bool active);
|
|
|
|
|
|
2014-05-19 18:04:58 -05:00
|
|
|
bool build_layout (const std::string& file_name);
|
2014-05-06 03:21:18 -05:00
|
|
|
void set_number (uint16_t number);
|
|
|
|
|
void set_active (bool active);
|
2014-05-19 18:04:58 -05:00
|
|
|
void set_track_name (const std::string& new_track_name);
|
2014-05-06 03:21:18 -05:00
|
|
|
sigc::signal2<void, DeviceConnectionControl*, bool> signal_active_changed;
|
2014-05-01 06:06:16 -05:00
|
|
|
|
|
|
|
|
private:
|
2014-05-19 18:04:58 -05:00
|
|
|
void init(const std::string& name, bool active, uint16_t number, const std::string& track_name="");
|
2014-05-06 03:21:18 -05:00
|
|
|
void on_active_on(WavesButton*);
|
|
|
|
|
void on_active_off(WavesButton*);
|
2014-05-01 06:06:16 -05:00
|
|
|
|
2014-05-16 04:53:12 -05:00
|
|
|
// flag which reflects control "active" state
|
|
|
|
|
bool _active;
|
|
|
|
|
|
|
|
|
|
WavesUI::WidgetMap _children;
|
2014-05-06 03:21:18 -05:00
|
|
|
WavesButton* _active_on_button;
|
|
|
|
|
WavesButton* _active_off_button;
|
2014-05-01 06:06:16 -05:00
|
|
|
Gtk::Label* _name_label;
|
|
|
|
|
Gtk::Label* _number_label;
|
|
|
|
|
Gtk::Label* _track_name_label;
|
|
|
|
|
};
|
|
|
|
|
|
2014-05-06 03:21:18 -05:00
|
|
|
#endif // __device_connection_control_h__
|