Merge branch 'master' into ardour-merge

Conflicts:
	gtk2_ardour/ardour_ui.cc
	gtk2_ardour/ardour_ui2.cc
	gtk2_ardour/editor.cc
	gtk2_ardour/mixer_strip.cc
	gtk2_ardour/route_time_axis.cc
	gtk2_ardour/route_ui.h
	gtk2_ardour/ui/audio_time_axis.xml
	gtk2_ardour/ui/editor_mixer.xml
	gtk2_ardour/ui/meter_strip.xml
	gtk2_ardour/waves_button.cc
	gtk2_ardour/waves_button.h
	gtk2_ardour/waves_zoom_control.cc
	gtk2_ardour/waves_zoom_control.h
This commit is contained in:
Paul Davis 2014-08-27 12:38:27 -04:00
commit 31d500e3a9
71 changed files with 1015 additions and 116 deletions

View file

@ -971,7 +971,7 @@ ArdourButton::on_focus_out_event (GdkEventFocus* ev)
bool
ArdourButton::on_key_release_event (GdkEventKey *ev)
{
if (_focused && (ev->keyval == GDK_KEY_space || ev->keyval == GDK_Return)) {
if (_focused && (ev->keyval == GDK_space || ev->keyval == GDK_Return)) {
signal_clicked();
if (_action) {
_action->activate ();

View file

@ -212,9 +212,15 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, _status_bar_visibility (X_("status-bar"))
, _feedback_exists (false)
, _dsp_load_adjustment (0)
, _hd_load_adjustment (0)
, _dsp_load_label(0)
, _hd_load_label(0)
, _hd_remained_time_label(0)
, editor (0)
, mixer (0)
//, meterbridge (0)
, _bit_depth_button(0)
, _sample_rate_button(0)
, _frame_rate_button(0)
, splash (0)
{
Gtkmm2ext::init(localedir);
@ -314,6 +320,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
ARDOUR::GUIIdle.connect (forever_connections, MISSING_INVALIDATOR, boost::bind(&ARDOUR_UI::gui_idle_handler, this), gui_context());
EngineStateController::instance()->SampleRateChanged.connect_same_thread (update_connections_to_toolbar_buttons, boost::bind (&ARDOUR_UI::update_sample_rate_button, this) );
EngineStateController::instance()->EngineRunning.connect_same_thread (update_connections_to_toolbar_buttons, boost::bind (&ARDOUR_UI::update_sample_rate_button, this) );
/* lets get this party started */
setup_gtk_ardour_enums ();
@ -436,6 +445,7 @@ ARDOUR_UI::engine_running ()
}
update_disk_space ();
update_disk_usage ();
update_cpu_load ();
update_sample_rate (EngineStateController::instance()->get_current_sample_rate() );
update_timecode_format ();
@ -1092,6 +1102,7 @@ ARDOUR_UI::every_second ()
update_cpu_load ();
update_buffer_load ();
update_disk_space ();
update_disk_usage ();
update_timecode_format ();
if (nsm && nsm->is_active ()) {
@ -1236,6 +1247,10 @@ ARDOUR_UI::update_cpu_load ()
snprintf (buf, sizeof (buf), _("DSP: <span foreground=\"%s\">%5.1f%%</span>"), c >= 90 ? X_("red") : X_("green"), c);
cpu_load_label.set_markup (buf);
_dsp_load_adjustment->set_value (c);
stringstream ss;
ss << (int)c;
_dsp_load_label->set_text ( ss.str() + "%" );
}
void
@ -1279,6 +1294,8 @@ ARDOUR_UI::count_recenabled_streams (Route& route)
void
ARDOUR_UI::update_disk_space()
{
string result;
if (_session == 0) {
return;
}
@ -1295,8 +1312,10 @@ ARDOUR_UI::update_disk_space()
if (!opt_frames) {
/* Available space is unknown */
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">Unknown</span>"));
result = "Unknown";
} else if (opt_frames.get_value_or (0) == max_framecnt) {
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">24hrs+</span>"));
result = "24hrs+";
} else {
rec_enabled_streams = 0;
_session->foreach_route (this, &ARDOUR_UI::count_recenabled_streams);
@ -1305,6 +1324,8 @@ ARDOUR_UI::update_disk_space()
if (rec_enabled_streams) {
frames /= rec_enabled_streams;
} else {
frames /= _session->nroutes ();
}
int hrs;
@ -1315,6 +1336,7 @@ ARDOUR_UI::update_disk_space()
if (hrs > 24) {
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">&gt;24 hrs</span>"));
result =">24hrs";
} else {
frames -= hrs * fr * 3600;
mins = frames / (fr * 60);
@ -1329,10 +1351,29 @@ ARDOUR_UI::update_disk_space()
low ? X_("red") : X_("green"),
hrs, mins, secs
);
stringstream ss;
ss << hrs << "h " << mins << "m ";
result = ss.str();
}
}
disk_space_label.set_markup (buf);
_hd_remained_time_label->set_text(result);
}
void
ARDOUR_UI::update_disk_usage ()
{
if (_session == 0) {
return;
}
uint32_t const hd_buffer = 100 - (_session ? _session->capture_load () : 100);
_hd_load_adjustment->set_value (hd_buffer);
stringstream ss;
ss << hd_buffer;
_hd_load_label->set_text ( ss.str() + "%" );
}
void
@ -2206,6 +2247,7 @@ ARDOUR_UI::map_transport_state ()
editor->get_waves_button ("transport_loop_button").set_active (false);
}
update_disk_space ();
update_disk_usage ();
}
}
@ -2946,7 +2988,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
continue;
}
int pos = full_session_name.rfind(suffix);
size_t pos = full_session_name.rfind(suffix);
// if not *.ardour file was choosen
if( !(pos == full_session_name.size() - suffix.size()) )
@ -4622,3 +4664,25 @@ ARDOUR_UI::transport_numpad_event (int num)
}
}
}
void
ARDOUR_UI::open_media_folder ()
{
if (!_session) {
return;
}
#if defined (PLATFORM_WINDOWS)
//ShellExecute (NULL, "open", _session->session_directory ().sources_root ().c_str (), NULL, NULL, SW_SHOW);
ShellExecute (NULL, "open", _session->session_directory ().sound_path ().c_str (), NULL, NULL, SW_SHOW);
#elif defined (__APPLE__)
//std::string command = "open \"" + _session->session_directory ().sources_root () + "\"";
std::string command = "open \"" + _session->session_directory ().sound_path () + "\"";
system (command.c_str ());
#else
/* nix */
/* XXX what to do here ? */
#endif
}

View file

@ -148,6 +148,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void launch_reference ();
void show_about ();
void hide_about ();
void open_media_folder ();
void idle_load (const std::string& path);
void finish();
@ -226,6 +227,17 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void focus_on_clock ();
AudioClock* big_clock;
WavesButton* _bit_depth_button;
WavesButton* _sample_rate_button;
WavesButton* _frame_rate_button;
void on_bit_depth_button (WavesButton*);
void on_sample_rate_button (WavesButton*);
void on_frame_rate_button (WavesButton*);
void update_bit_depth_button ();
void update_sample_rate_button ();
void update_frame_rate_button ();
PBD::ScopedConnectionList update_connections_to_toolbar_buttons;
TimeInfoBox* time_info_box;
VideoTimeLine *video_timeline;
@ -546,6 +558,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
Gtk::Label disk_space_label;
void update_disk_space ();
void update_disk_usage ();
Gtk::Label timecode_format_label;
@ -771,6 +784,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
VisibilityGroup _status_bar_visibility;
Gtk::Adjustment* _dsp_load_adjustment;
Gtk::Adjustment* _hd_load_adjustment;
Gtk::Label* _dsp_load_label;
Gtk::Label* _hd_load_label;
Gtk::Label* _hd_remained_time_label;
/** A ProcessThread so that we have some thread-local buffers for use by
* PluginEqGui::impulse_analysis ().

View file

@ -244,6 +244,9 @@ ARDOUR_UI::setup_transport ()
act = ActionManager::get_action (X_("Common"), X_("toggle-meterbridge"));
editor->get_waves_button ("meter_bridge_on_button").set_related_action (act);
act = ActionManager::get_action (X_("Common"), X_("OpenMediaFolder"));
editor->get_waves_button ("media_button").set_related_action (act);
update_output_operation_mode_buttons();
transport_base.set_name ("TransportBase");

View file

@ -227,6 +227,10 @@ ARDOUR_UI::set_session (Session *s)
editor_meter_peak_display.show();
}
}
update_bit_depth_button ();
update_sample_rate_button ();
update_frame_rate_button ();
}
int
@ -396,9 +400,11 @@ ARDOUR_UI::toggle_meterbridge ()
mixer_tact->set_active(false);
editor->get_container ("edit_pane").hide ();
editor->get_container ("meter_bridge_view_home").show ();
editor->get_container ("compact_meter_bridge_home").hide ();
} else {
editor->get_container ("meter_bridge_view_home").hide ();
editor->get_container ("edit_pane").show ();
editor->get_container ("compact_meter_bridge_home").show ();
}
}

View file

@ -66,6 +66,7 @@
#include "control_protocol/control_protocol.h"
#include "i18n.h"
#include "utils.h"
using namespace std;
using namespace ARDOUR;
@ -80,18 +81,110 @@ ARDOUR_UI::create_editor ()
try {
editor = new Editor ();
_dsp_load_adjustment = &editor->get_adjustment ("dsp_load_adjustment");
_hd_load_adjustment = &editor->get_adjustment("hd_load_adjustment");
_dsp_load_label = &editor->get_label("dsp_load_label");
_hd_load_label = &editor->get_label("hd_load_label");
_hd_remained_time_label = &editor->get_label("hd_remained_time");
_bit_depth_button = &editor->get_waves_button("bit_depth_button");
_sample_rate_button = &editor->get_waves_button("sample_rate_button");
_frame_rate_button = &editor->get_waves_button("frame_rate_button");
}
catch (failed_constructor& err) {
return -1;
}
_bit_depth_button->signal_clicked.connect(sigc::mem_fun (*this, &ARDOUR_UI::on_bit_depth_button));
_sample_rate_button->signal_clicked.connect(sigc::mem_fun (*this, &ARDOUR_UI::on_sample_rate_button));
_frame_rate_button->signal_clicked.connect(sigc::mem_fun (*this, &ARDOUR_UI::on_frame_rate_button));
editor->Realized.connect (sigc::mem_fun (*this, &ARDOUR_UI::editor_realized));
editor->signal_window_state_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::main_window_state_event_handler), true));
return 0;
}
void
ARDOUR_UI::on_bit_depth_button (WavesButton*)
{
tracks_control_panel->show ();
}
void
ARDOUR_UI::on_sample_rate_button (WavesButton*)
{
tracks_control_panel->show ();
}
void
ARDOUR_UI::on_frame_rate_button (WavesButton*)
{
tracks_control_panel->show ();
}
void
ARDOUR_UI::update_bit_depth_button ()
{
if( _session && _bit_depth_button )
{
string file_data_format;
switch (_session->config.get_native_file_data_format ()) {
case FormatFloat:
file_data_format = "32 bit";
break;
case FormatInt24:
file_data_format = "24 bit";
break;
case FormatInt16:
file_data_format = "16 bit";
break;
}
_bit_depth_button->set_text (file_data_format);
}
}
void
ARDOUR_UI::update_sample_rate_button ()
{
if( !_sample_rate_button )
return;
std::string active_sr = ARDOUR_UI_UTILS::rate_as_string(EngineStateController::instance()->get_current_sample_rate());
_sample_rate_button->set_text (active_sr);
}
void
ARDOUR_UI::update_frame_rate_button ()
{
if( !_frame_rate_button )
return;
string timecode_format_string;
switch( _timecode_format ) {
case Timecode::timecode_24:
timecode_format_string = "24 fps";
break;
case Timecode::timecode_25:
timecode_format_string = "25 fps";
break;
case Timecode::timecode_30:
timecode_format_string = "30 fps";
break;
case Timecode::timecode_23976:
timecode_format_string = "23.976 fps";
break;
case Timecode::timecode_2997:
timecode_format_string = "29.97 fps";
break;
default:
break;
}
_frame_rate_button->set_text (timecode_format_string);
}
void
ARDOUR_UI::install_actions ()
{
@ -216,6 +309,8 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (common_actions, X_("Manual"), S_("Help|Manual"), mem_fun(*this, &ARDOUR_UI::launch_manual));
ActionManager::register_action (common_actions, X_("Reference"), _("Reference"), mem_fun(*this, &ARDOUR_UI::launch_reference));
ActionManager::register_action (common_actions, X_("OpenMediaFolder"), _("OpenMediaFolder"), mem_fun(*this, &ARDOUR_UI::open_media_folder));
act = ActionManager::register_action (common_actions, X_("Save"), _("Save"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::save_state), string(""), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);

View file

@ -425,10 +425,20 @@ ARDOUR_UI::parameter_changed (std::string p)
void
ARDOUR_UI::session_parameter_changed (const std::string& param)
{
if (param == "native-file-data-format" || param == "native-file-header-format")
if ( param == "native-file-data-format" )
{
update_format();
if ( param == "timecode-format")
update_bit_depth_button ();
}
else if (param == "native-file-header-format")
{
update_format();
}
else if ( param == "timecode-format" )
{
update_timecode_format();
update_frame_rate_button ();
}
}
void

View file

@ -1293,7 +1293,7 @@ Editor::update_title ()
namespace {
const size_t mixer_bridge_strip_max_name_size = 9;
const size_t meter_bridge_strip_max_name_size = 6;
const size_t meter_bridge_strip_max_name_size = 8;
}
void
Editor::set_session (Session *t)

View file

@ -703,6 +703,8 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
(*x)->route()->solo_safe_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_safe_display, this), gui_context());
(*x)->route()->active_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_active_display, this), gui_context ());
// connect to DnD reordering signal
(*x)->relative_tracks_reorder_request.connect(*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::move_selected_tracks_relatively, this, _1, _2, _3), gui_context());
}
update_rec_display ();
@ -1570,6 +1572,80 @@ EditorRoutes::move_selected_tracks (bool up)
_model->reorder (neworder);
}
void
EditorRoutes::move_selected_tracks_relatively (const PBD::ID& source_track_id, const PBD::ID& target_track_id, bool after_target)
{
if (source_track_id == target_track_id) {
return;
}
RouteTimeAxisView* source_rtv = _editor->get_route_view_by_route_id(source_track_id);
Selection& selection = _editor->get_selection();
RouteList routes;
RouteList routes_to_move;
TreeModel::Children rows = _model->children();
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri) {
boost::shared_ptr<Route> route = (*ri)[_columns.route];
TimeAxisView* tv = (*ri)[_columns.tv];
// selected tracks: add to the move list but if it's not a target
if (selection.selected(tv) &&
route->id() != target_track_id) {
routes_to_move.push_back(route);
continue;
}
// master track should always be the first
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
if (rtv->is_master_track() ) {
routes.push_front(route);
} else {
routes.push_back (route);
}
}
RouteList::iterator insert_position;
for (RouteList::iterator iter = routes.begin(); iter != routes.end(); ++iter) {
if ((*iter)->id() == target_track_id ) {
insert_position = iter;
break;
}
}
// insert the pack of tracks to be moved to the correct possition
if (after_target) {
++insert_position;
}
routes.insert(insert_position, routes_to_move.begin(), routes_to_move.end() );
std::vector<int> neworder;
for (RouteList::const_iterator iter = routes.begin(); iter != routes.end(); ++iter) {
uint32_t order = (*iter)->order_key ();
neworder.push_back (order);
}
#ifndef NDEBUG
DEBUG_TRACE (DEBUG::OrderKeys, "New order after moving tracks:\n");
for (vector<int>::iterator i = neworder.begin(); i != neworder.end(); ++i) {
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("\t%1\n", *i));
}
DEBUG_TRACE (DEBUG::OrderKeys, "-------\n");
for (vector<int>::iterator i = neworder.begin(); i != neworder.end(); ++i) {
if (*i >= (int) neworder.size()) {
cerr << "Trying to move something to " << *i << " of " << neworder.size() << endl;
}
assert (*i < (int) neworder.size ());
}
#endif
_model->reorder (neworder);
}
void
EditorRoutes::update_input_active_display ()
{

View file

@ -36,6 +36,8 @@ public:
}
void move_selected_tracks (bool);
void move_selected_tracks_relatively (const PBD::ID& source_track_id, const PBD::ID& target_track_id, bool after_target);
void show_track_in_display (TimeAxisView &);
void suspend_redisplay () {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 745 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,007 B

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

@ -126,7 +126,16 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, const std::string& layout_s
}
}
string cut_string(const string& route_name, size_t max_name_size)
namespace {
bool is_vowel_letter(char letter)
{
if( letter=='a' || letter=='e' || letter=='i' || letter=='o' ||
letter=='q' || letter=='u' || letter=='y')
return true;
return false;
}
string cut_string(string route_name, size_t max_name_size)
{
if ( max_name_size == 0 )
return route_name;
@ -139,12 +148,25 @@ string cut_string(const string& route_name, size_t max_name_size)
}
else
{
cutted_route_name.assign(route_name, 0, max_name_size-3);
cutted_route_name += "...";
// first step: delete vowel letters
int i = route_name.size()-1; // iterator
while( i >= 0 && route_name.size() > max_name_size )
{
if( is_vowel_letter( route_name[i] ) )
route_name.erase(i, 1);
else
--i;
}
if ( route_name.size()<=max_name_size )
cutted_route_name = route_name;
else // second step: leave only first letters
cutted_route_name.assign(route_name, 0, max_name_size);
}
return cutted_route_name;
}
}
MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt, const std::string& layout_script_file, size_t max_name_size)
: AxisView(sess)

View file

@ -52,12 +52,14 @@ using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ARDOUR_UI_UTILS;
Gdk::Cursor* MonoPanner::__touch_cursor;
MonoPanner::MonoPanner (boost::shared_ptr<ARDOUR::PannerShell> p)
: PannerInterface (p->panner())
, _panner_shell (p)
, position_control (_panner->pannable()->pan_azimuth_control)
, drag_start_x (0)
, last_drag_x (0)
, drag_start_y (0)
, last_drag_y (0)
, accumulated_delta (0)
, detented (false)
, position_binder (position_control)
@ -70,6 +72,13 @@ MonoPanner::MonoPanner (boost::shared_ptr<ARDOUR::PannerShell> p)
}
}
if (__touch_cursor == 0) {
__touch_cursor = new Gdk::Cursor (Gdk::Display::get_default(),
::get_icon ("panner_touch_cursor"),
12,
12);
}
position_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&MonoPanner::value_change, this), gui_context());
_panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&MonoPanner::bypass_handler, this), gui_context());
@ -127,12 +136,15 @@ MonoPanner::on_button_press_event (GdkEventButton* ev)
if (PannerInterface::on_button_press_event (ev)) {
return true;
}
if (_panner_shell->bypassed()) {
return false;
}
drag_start_x = ev->x;
last_drag_x = ev->x;
get_window()->set_cursor (*__touch_cursor);
drag_start_y = ev->y;
last_drag_y = ev->y;
_dragging = false;
_tooltip.target_stop_drag ();
@ -203,6 +215,8 @@ MonoPanner::on_button_release_event (GdkEventButton* ev)
return false;
}
get_window()->set_cursor();
_dragging = false;
_tooltip.target_stop_drag ();
accumulated_delta = 0;
@ -261,7 +275,7 @@ MonoPanner::on_motion_notify_event (GdkEventMotion* ev)
}
int w = get_width();
double delta = (ev->x - last_drag_x) / (double) w;
double delta = (last_drag_y - ev->y) / (double) w;
/* create a detent close to the center */
@ -286,7 +300,7 @@ MonoPanner::on_motion_notify_event (GdkEventMotion* ev)
position_control->set_value (pv + delta);
}
last_drag_x = ev->x;
last_drag_y = ev->y;
return true;
}

View file

@ -62,8 +62,8 @@ class MonoPanner : public PannerInterface
boost::shared_ptr<PBD::Controllable> position_control;
PBD::ScopedConnectionList panvalue_connections;
PBD::ScopedConnectionList panshell_connections;
int drag_start_x;
int last_drag_x;
int drag_start_y;
int last_drag_y;
double accumulated_delta;
bool detented;
@ -73,6 +73,8 @@ class MonoPanner : public PannerInterface
bool _dragging;
static Gdk::Cursor* __touch_cursor;
void bypass_handler ();
void pannable_handler ();
};

View file

@ -90,6 +90,7 @@ using namespace Editing;
using namespace std;
using std::list;
RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed,
Session* sess,
ArdourCanvas::Canvas& canvas,
@ -111,15 +112,20 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed,
, color_mode_menu (0)
, gm (sess, "track_header_gain_meter.xml")
, _ignore_set_layer_display (false)
, _ignore_dnd_requests (false)
, gain_meter_home (get_box ("gain_meter_home"))
, selected_track_color_box (get_container ("selected_track_color_box"))
, track_color_box (get_container ("track_color_box"))
, upper_drop_indicator(get_event_box ("upper_drop_indicator"))
, lower_drop_indicator(get_event_box ("lower_drop_indicator"))
{
}
void
RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
{
disable_header_dnd ();
RouteUI::set_route (rt);
CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main for %1", rt->name()));
@ -168,6 +174,8 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
if (is_master_track() ) {
// do not display number for master track
TimeAxisView::set_number_is_hidden(true);
} else {
enable_header_dnd ();
}
playlist_button.set_visible(is_track() && track()->mode() == ARDOUR::Normal);
@ -1106,6 +1114,73 @@ RouteTimeAxisView::speed_changed ()
Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&RouteTimeAxisView::reset_samples_per_pixel, this));
}
bool
RouteTimeAxisView::handle_route_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time)
{
// check if the target of the drop is expected by our drop zone
if (RouteUI::header_target.get_target () == drag_dest_find_target (context) &&
drag_get_source_widget(context) != this) {
context->drag_status(context->get_suggested_action(), time);
if (context->get_suggested_action() ) {
int height = get_height();
if (y <= height/2) {
upper_drop_indicator.show();
lower_drop_indicator.hide();
} else {
lower_drop_indicator.show();
upper_drop_indicator.hide();
}
return true;
}
}
context->drag_refuse(time);
return false;
}
void
RouteTimeAxisView::handle_route_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time)
{
upper_drop_indicator.hide();
lower_drop_indicator.hide();
}
void
RouteTimeAxisView::handle_route_drag_begin (const Glib::RefPtr<Gdk::DragContext>& context)
{
_ebox_release_can_act = false;
// mark dragged track selected anyway
if (!_editor.get_selection().selected(this) ) {
_editor.get_selection().clear_tracks();
_editor.get_selection().add(this);
}
//GZ TO-DO: Draw DnD icon for track header
}
void
RouteTimeAxisView::handle_route_drag_end(const Glib::RefPtr<Gdk::DragContext>& context)
{
}
void
RouteTimeAxisView::handle_route_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const SelectionData& selection_data, guint info, guint time)
{
PBD::ID source_route_id = selection_data.get_data_as_string ();
// emit signal
int height = get_height();
relative_tracks_reorder_request(source_route_id, _route->id(), y > height/2 );
context->drop_finish(true, time);
}
void
RouteTimeAxisView::update_diskstream_display ()
{
@ -1119,6 +1194,12 @@ RouteTimeAxisView::update_diskstream_display ()
void
RouteTimeAxisView::selection_click (GdkEventButton* ev)
{
if (dnd_in_progress() ) {
return;
}
if (ev->type == GDK_BUTTON_PRESS) {
if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
/* special case: select/deselect all tracks */
@ -1131,13 +1212,16 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
return;
}
switch (ArdourKeyboard::selection_type (ev->state)) {
case Selection::Toggle:
_editor.get_selection().toggle (this);
break;
case Selection::Set:
if (!_editor.get_selection().selected (this)) {
_editor.get_selection().set (this);
}
break;
case Selection::Extend:
@ -1148,6 +1232,26 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
_editor.get_selection().add (this);
break;
}
} else if (ev->type == GDK_BUTTON_RELEASE) {
switch (ArdourKeyboard::selection_type (ev->state)) {
case Selection::Toggle:
break;
case Selection::Set:
if (_editor.get_selection().selected (this)) {
_editor.get_selection().set (this);
}
break;
case Selection::Extend:
break;
case Selection::Add:
break;
}
}
}
void
@ -2557,3 +2661,22 @@ RouteTimeAxisView::remove_child (boost::shared_ptr<TimeAxisView> c)
}
}
}
void
RouteTimeAxisView::control_ebox_resize_started()
{
if (dnd_operation_enabled () ) {
_ignore_dnd_requests = true;
disable_header_dnd ();
}
}
void
RouteTimeAxisView::control_ebox_resize_ended()
{
if (_ignore_dnd_requests ) {
_ignore_dnd_requests = false;
enable_header_dnd ();
}
}

View file

@ -149,6 +149,14 @@ public:
std::string state_id() const;
void set_ignore_dnd_requests(bool ignore) {_ignore_dnd_requests = ignore; }
bool check_ignore_dnd_requests() {return _ignore_dnd_requests; }
virtual void control_ebox_resize_started();
virtual void control_ebox_resize_ended();
PBD::Signal3<void, const PBD::ID&, const PBD::ID&, bool> relative_tracks_reorder_request;
protected:
friend class StreamView;
@ -176,6 +184,12 @@ protected:
~ProcessorAutomationInfo ();
};
// DnD heandlers for route header
virtual void handle_route_drag_begin (const Glib::RefPtr<Gdk::DragContext>& context);
virtual void handle_route_drag_end(const Glib::RefPtr<Gdk::DragContext>& context);
virtual void handle_route_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
virtual bool handle_route_drag_motion (const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time);
virtual void handle_route_drag_leave (const Glib::RefPtr<Gdk::DragContext>& context, guint time);
void update_diskstream_display ();
@ -253,6 +267,9 @@ protected:
ArdourCanvas::Canvas& parent_canvas;
bool no_redraw;
Gtk::EventBox& upper_drop_indicator;
Gtk::EventBox& lower_drop_indicator;
WavesButton& route_group_button;
WavesButton& playlist_button;
WavesButton& automation_button;
@ -305,6 +322,7 @@ protected:
UnderlayMirrorList _underlay_mirrors;
bool _ignore_set_layer_display;
bool _ignore_dnd_requests;
private:

View file

@ -64,6 +64,8 @@ using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
using namespace PBD;
Gtk::TargetEntry RouteUI::header_target("HEADER", (Gtk::TargetFlags)0 ,ROUTE_HEADER);
uint32_t RouteUI::_max_invert_buttons = 3;
PBD::Signal1<void, boost::shared_ptr<Route> > RouteUI::BusSendDisplayChanged;
boost::weak_ptr<Route> RouteUI::_showing_sends_to;
@ -83,6 +85,8 @@ RouteUI::RouteUI (ARDOUR::Session* sess, const std::string& layout_script_file)
, rec_enable_button (get_waves_button ("rec_enable_button"))
, show_sends_button (get_waves_button ("show_sends_button"))
, monitor_input_button (get_waves_button ("monitor_input_button"))
, _dnd_operation_in_progress (false)
, _dnd_operation_enabled (false)
{
set_attributes (*this, *xml_tree ()->root (), XMLNodeMap ());
if (sess) init ();
@ -151,6 +155,18 @@ RouteUI::init ()
monitor_input_button.signal_button_release_event().connect (sigc::mem_fun(*this, &RouteUI::monitor_input_release));
BusSendDisplayChanged.connect_same_thread (*this, boost::bind(&RouteUI::bus_send_display_changed, this, _1));
// DnD callbacks
// source side
signal_drag_begin().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_begin));
signal_drag_data_get().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_data_get));
signal_drag_begin().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_end));
// destination callbacks
signal_drag_motion().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_motion));
signal_drag_leave().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_leave));
signal_drag_drop().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_drop));
signal_drag_data_received().connect (sigc::mem_fun(*this, &RouteUI::on_route_drag_data_received));
}
void
@ -173,6 +189,11 @@ RouteUI::self_delete ()
delete this;
}
namespace {
size_t default_palette_color = 9;
size_t master_color = 3;
}
void
RouteUI::set_route (boost::shared_ptr<Route> rp)
{
@ -185,9 +206,19 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
Editor* editor = dynamic_cast<Editor*>( &(ARDOUR_UI::instance()->the_editor()) );
if( editor!=NULL && editor->set_session_in_progress() )
color = MixerStrip::palette_random_color();
{
if( _route->is_master() )
color = (Gdk::Color)(MixerStrip::XMLColor[master_color]);
else
color = (Gdk::Color)(MixerStrip::XMLColor[14]);
color = MixerStrip::palette_random_color();
}
else
{
if( _route->is_master() )
color = (Gdk::Color)(MixerStrip::XMLColor[master_color]);
else
color = (Gdk::Color)(MixerStrip::XMLColor[default_palette_color]);
}
set_color (color);
}
@ -267,6 +298,88 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
update_solo_display ();
}
void RouteUI::enable_header_dnd ()
{
std::vector<Gtk::TargetEntry> targets;
targets.push_back(header_target);
drag_source_set(targets, Gdk::BUTTON1_MASK);
drag_dest_set(targets, DEST_DEFAULT_HIGHLIGHT);
_dnd_operation_enabled = true;
}
bool RouteUI::disable_header_dnd ()
{
// disable DnD operations
drag_source_unset ();
drag_dest_unset ();
_dnd_operation_enabled = false;
}
void
RouteUI::on_route_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)
{
_dnd_operation_in_progress = true;
handle_route_drag_begin(context);
}
void
RouteUI::on_route_drag_end(const Glib::RefPtr<Gdk::DragContext>& context)
{
_dnd_operation_in_progress = false;
handle_route_drag_end(context);
}
void
RouteUI::on_route_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time)
{
switch (info)
{
case RouteUI::ROUTE_HEADER:
{
// Put route id, if we have a route
if (_route) {
std::string route_id_string =_route->id().to_s();
selection_data.set(8, (const guint8*)route_id_string.c_str(), route_id_string.length() + 1 );
break;
}
}
default:
break;
}
}
bool
RouteUI::on_route_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time)
{
return handle_route_drag_motion(context, x, y, time);
}
void
RouteUI::on_route_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time)
{
handle_route_drag_leave(context, time);
}
bool
RouteUI::on_route_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time)
{
if (RouteUI::header_target.get_target () == drag_dest_find_target (context) )
{
// request the data from the source:
drag_get_data (context, RouteUI::header_target.get_target (), time );
return true;
}
return false;
}
void
RouteUI::on_route_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time)
{
handle_route_drag_data_received(context, x, y, selection_data, info, time);
}
void
RouteUI::polarity_changed ()
{

View file

@ -56,6 +56,14 @@ class ArdourButton;
class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView
{
public:
enum {
ROUTE_HEADER
// add more targets here
} DnDTargets;
static Gtk::TargetEntry header_target;
RouteUI(ARDOUR::Session*, const std::string& layout_script_file);
virtual ~RouteUI();
@ -65,6 +73,35 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView
virtual void set_route (boost::shared_ptr<ARDOUR::Route>);
virtual void set_button_names () = 0;
// DnD
void enable_header_dnd ();
bool disable_header_dnd ();
bool dnd_operation_enabled () { return _dnd_operation_enabled; }
// DnD callback handlers:
// source callbacks
void on_route_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
void on_route_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time);
void on_route_drag_end(const Glib::RefPtr<Gdk::DragContext>& context);
// destination callbacks
bool on_route_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time);
void on_route_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time);
bool on_route_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time);
void on_route_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
// HANDLERS WHICH MUST BE DEFINED in inheriting class for DnD support
// define in inheriting class if you want custom drag icon to be set
virtual void handle_route_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context) {};
// define in inheriting class if you want actions on dnd end
virtual void handle_route_drag_end(const Glib::RefPtr<Gdk::DragContext>& context) {};
// define this in inheriting class to provide the responce on a draging above the widget
virtual bool handle_route_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) { context->drag_refuse(time); return false; };
// define this in inheriting class to provide the responce on a leaving the widget with drag
virtual void handle_route_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time) {};
// define this in inheriting class to provide the responce and actions on the destination side
virtual void handle_route_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time) {context->drop_finish(false, time); };
bool is_track() const;
bool is_audio_track() const;
bool is_master_track() const;
@ -93,7 +130,6 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView
bool wait_for_release;
bool multiple_mute_change;
bool multiple_solo_change;
WavesButton& master_mute_button;
WavesButton& mute_button;
WavesButton& solo_button;
@ -225,6 +261,8 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView
*/
static PBD::Signal1<void, boost::shared_ptr<ARDOUR::Route> > BusSendDisplayChanged;
bool dnd_in_progress() {return _dnd_operation_in_progress; }
protected:
PBD::ScopedConnectionList route_connections;
bool self_destruct;
@ -281,6 +319,9 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView
static boost::weak_ptr<ARDOUR::Route> _showing_sends_to;
static uint32_t _max_invert_buttons;
bool _dnd_operation_in_progress;
bool _dnd_operation_enabled;
};
#endif /* __ardour_route_ui__ */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Before After
Before After

View file

@ -338,10 +338,15 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
}
if (event->button == 1) {
selection_click (event);
}
_ebox_release_can_act = true;
if (maybe_set_cursor (event->y) > 0) {
_resize_drag_start = event->y_root;
control_ebox_resize_started();
}
return true;
@ -429,6 +434,7 @@ TimeAxisView::controls_ebox_button_release (GdkEventButton* ev)
}
_editor.stop_canvas_autoscroll ();
_resize_drag_start = -1;
control_ebox_resize_ended();
}
if (!_ebox_release_can_act) {
@ -1201,7 +1207,7 @@ TimeAxisView::preset_height (Height h)
case HeightLarge:
return 66;
case HeightNormal:
return 44;
return 45;
case HeightSmall:
return 22;
case HeightMaximum:

View file

@ -227,6 +227,7 @@ class TimeAxisView : public virtual AxisView
bool _number_is_hidden;
bool _hidden;
bool in_destructor;
bool _ebox_release_can_act;
Gtk::Menu* _size_menu;
ArdourCanvas::Container* _canvas_display;
double _y_position;
@ -256,6 +257,10 @@ class TimeAxisView : public virtual AxisView
virtual bool controls_ebox_motion (GdkEventMotion*);
virtual bool controls_ebox_leave (GdkEventCrossing*);
// Define in inheriting class to rect on control ebox resizing
virtual void control_ebox_resize_started() {}
virtual void control_ebox_resize_ended() {}
/** Display the standard LHS control menu at when.
*
* @param when the popup activation time
@ -294,7 +299,6 @@ private:
double _resize_drag_start;
GdkCursor* _preresize_cursor;
bool _have_preresize_cursor;
bool _ebox_release_can_act;
static uint32_t button_height;
static uint32_t extra_height;

View file

@ -939,7 +939,7 @@ TracksControlPanel::cleanup_output_channels_list()
}
playback_controls.pop_back();
_device_capture_list.remove(*item);
_device_playback_list.remove(*item);
delete item;
}
}

View file

@ -62,15 +62,15 @@
text="CANCEL"
x="0"
y="155"
width="70"
width="69"
height="25"/>
<Button style="generic_button"
id="ok_button"
text="OK"
x="71"
x="70"
y="155"
width="70"
width="69"
height="25"/>
</Layout>
</Dialog>

View file

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<RouteUI bgnormal="#383838" bgactive="#545454">
<Vbox>
<EventBox id="upper_drop_indicator" visible="false" noshowall="true" height="2" bgnormal="#1CA3B3" bgactive="#1CA3B3"/>
>>>>>>> master
<HBox>
<VBox>
<EventBox height="1" bgnormal="#494949" bgactive="#494949"/>
@ -138,4 +141,6 @@
</VBox>
<EventBox width="1" bgnormal="#000000" bgactive="#000000"/>
</HBox>
<EventBox id="lower_drop_indicator" visible="false" noshowall="true" height="2" bgnormal="#1CA3B3" bgactive="#1CA3B3" box.pack="end"/>
</Vbox>
</RouteUI>

View file

@ -134,7 +134,8 @@
<VBox id="info_panel_home"
noshowall="true"
visible="false">
<EventBox bgnormal="#4F4F4F" width="97">
<EventBox bgnormal="#4F4F4F"
width="97">
<VBox>
<HBox box.padding="4">
<HBox width="7"/>
@ -142,7 +143,8 @@
text="IN Grisha, Kolya"
winfont="Arial Bold 7"
macfont="Helvetica Bold 7"/>
<HBox box.fill="true" box.expand="true"/>
<HBox box.fill="true"
box.expand="true"/>
</HBox>
<HBox>
<HBox width="7"/>
@ -150,7 +152,8 @@
text="OUT please code it"
winfont="Arial Bold 7"
macfont="Helvetica Bold 7"/>
<HBox box.fill="true" box.expand="true"/>
<HBox box.fill="true"
box.expand="true"/>
</HBox>
<HBox height="5"/>
</VBox>
@ -171,14 +174,16 @@
<HBox id="gain_meter_home"/>
<HBox id="invert_button_box"
visible="false"/>
<EventBox bgnormal="#000000"
width="50">
<VBox borderwidth="1"
spacing="1">
<VBox>
<HBox>
<EventBox width="1"
bgnormal="#383838"/>s
<VBox id="track_buttons_home"
visible="false"
noshowall="true">
<HBox spacing="1">
<EventBox height="1"
bgnormal="#000000"/>s
<HBox>
<iconbutton id="rec_enable_button"
width="47"
height="20"
@ -187,6 +192,8 @@
prelighticon="inspector_record_prelight"
visible="false"
noshowall="true"/>
<EventBox width="1"
bgnormal="#000000"/>s
<iconbutton id="monitor_input_button"
width="47"
height="20"
@ -196,7 +203,9 @@
visible="false"
noshowall="true"/>
</HBox>
<HBox spacing="1">
<EventBox height="1"
bgnormal="#000000"/>s
<HBox>
<iconbutton id="mute_button"
width="47"
height="20"
@ -206,6 +215,8 @@
prelighticon="inspector_mute_prelight"
visible="false"
noshowall="true"/>
<EventBox width="1"
bgnormal="#000000"/>s
<iconbutton id="solo_button"
width="47"
height="20"
@ -216,7 +227,13 @@
visible="false"
noshowall="true"/>
</HBox>
<EventBox height="1"
bgnormal="#000000"/>s
</VBox>
<EventBox width="1"
bgnormal="#383838"/>s
</HBox>
<iconbutton id="master_mute_button"
width="95"
height="41"
@ -234,8 +251,9 @@
winfont ="Arial 10"
macfont ="Helvetica 10"/>
</VBox>
</EventBox>
<HBox visible="false" noshowall="true">
<HBox visible="false"
noshowall="true">
>>>>>>> master
<Button id="show_sends_button"/>
<Button id="monitor_disk_button"/>
<Button id="comment_button"/>

View file

@ -32,17 +32,54 @@
normalicon="tracks"
activeicon="tracks_active"
prelighticon="tracks_prelight"/>
<Layout width="407" height="51">
<icon source="top_bar_background.png"
tooltip="--------------------&#xA;This is a mockup&#xA;--------------------" />
<icon source="top_bar_background.png"/>
<HBox id="time_info_box_home"
x="60"
y="4"/>
<HBox id="primary_clock_home"
x="132"
y="6"/>
<Button id="bit_depth_button"
text="bit depth"
fgnormal="#ffffff"
winfont ="Arial 8"
macfont ="Helvetica 8"
x="270"
y="5"
width="63"
height="18"
normalicon="top_bar_button"
activeicon="top_bar_button"
prelighticon="top_bar_button"/>
<Button id="sample_rate_button"
text="sample rate"
fgnormal="#ffffff"
winfont ="Arial 8"
macfont ="Helvetica 8"
x="270"
y="28"
width="63"
height="18"
normalicon="top_bar_button"
activeicon="top_bar_button"
prelighticon="top_bar_button"/>
<Button id="frame_rate_button"
text="frame rate"
winfont ="Arial 8"
macfont ="Helvetica 8"
x="335"
y="28"
width="63"
height="18"
normalicon="top_bar_button"
activeicon="top_bar_button"
prelighticon="top_bar_button"/>
</Layout>
<Layout box.pack="end" width="114">
<Layout box.pack="end" width="114" height="51">
<icon source="metrics_display.png"/>
<Adjustment id="dsp_load_adjustment"
minvalue="1"
maxvalue="100"
@ -53,13 +90,54 @@
handlesource="dsp_load_fader_handle.png"
minposx="0"
minposy="3"
maxposx="78"
maxposx="56"
maxposy="3"
readonly="true"
x="28"
y="8"
width="56"
height="5"/>
<Label id="dsp_load_label"
style="generic_control"
text="%"
fgnormal="#ffffff"
winfont ="Arial 8"
macfont ="Helvetica 8"
x="87"
y="8"/>
<icon source="metrics_display.png"
tooltip="--------------------&#xA;This is a mockup&#xA;--------------------"/>
<Adjustment id="hd_load_adjustment"
minvalue="1"
maxvalue="100"
initialvalue="50"
readonly="fals"/>
<Fader adjustment="hd_load_adjustment"
facesource="dsp_load_fader_face.png"
handlesource="dsp_load_fader_handle.png"
minposx="0"
minposy="3"
maxposx="56"
maxposy="3"
readonly="true"
x="28"
y="18"
width="56"
height="5"/>
<Label id="hd_load_label"
style="generic_control"
text="%"
fgnormal="#ffffff"
winfont ="Arial 8"
macfont ="Helvetica 8"
x="87"
y="18"/>
<Label id="hd_remained_time"
style="generic_control"
fgnormal="#ffffff"
winfont ="Arial 9"
macfont ="Helvetica 9"
x="58"
y="33"/>
</Layout>
<EventBox bgnormal="#383838"
width="420"
@ -259,13 +337,13 @@
table.yfill="true"
table.yexpand="true"
bgnormal="#3E3E3E">
<VBox id="edit_controls_vbox" height="800"/>
<VBox id="edit_controls_vbox"/>
</Layout>
</Table>
</VPaned>
</HPaned>
<EventBox id="mixer_bridge_view_home"
height="400"
height="426"
box.pack="end"
visible="false"
noshowall="true"/>

View file

@ -33,6 +33,7 @@
underlaysource="slider_controller_fader_underlay.png"
handlesource="slider_controller_fader_handle.png"
activehandlesource="slider_controller_fader_handle.png"
touchcursor="fader_touch_cursor.png"
minposx="10"
minposy="196"
maxposx="10"

View file

@ -58,8 +58,10 @@
<Button id="name_button"
width="37"
height="24"
winfont="Arial 10"
macfont="Helvetica 10"/>
fgnormal="#ffffff"
fgactive="#ffffff"
winfont="Arial 8"
macfont="Helvetica 8"/>
<EventBox bgnormal="#000000"
bgactive="#000000"
height="1"/>

View file

@ -47,6 +47,7 @@
underlaysource="slider_controller_fader_underlay.png"
handlesource="slider_controller_fader_handle.png"
activehandlesource="slider_controller_fader_handle.png"
touchcursor="fader_touch_cursor.png"
minposx="10"
minposy="196"
maxposx="10"

View file

@ -33,6 +33,7 @@
underlaysource="slider_controller_fader_underlay.png"
handlesource="slider_controller_fader_handle.png"
activehandlesource="slider_controller_fader_handle.png"
touchcursor="fader_touch_cursor.png"
minposx="10"
minposy="196"
maxposx="10"

View file

@ -595,6 +595,14 @@ WavesUI::set_attributes (Gtk::Widget& widget, const XMLNode& definition, const X
event_box->set_visible_window (visible_window);
}
Gtkmm2ext::Fader* fader = dynamic_cast<Gtkmm2ext::Fader*> (&widget);
if (fader) {
property = xml_property (definition, "touchcursor", styles, "");
if (!property.empty ()) {
fader->set_touch_cursor (property);
}
}
Gtk::Label* label = dynamic_cast<Gtk::Label*> (&widget);
if (label) {
property = xml_property (definition, "justify", styles, "left");

View file

@ -25,7 +25,6 @@
#include "dbg_msg.h"
using namespace ARDOUR_UI_UTILS;
WavesZoomControl::WavesZoomControl (Gtk::Adjustment& adjustment)
: _adjustment (adjustment)
, _state (StateIdle)

View file

@ -777,13 +777,31 @@
<None Include="..\icons\export_icons.sh" />
</ItemGroup>
<ItemGroup>
<Xml Include="..\ui\add_tracks_dialog.xml" />
<Xml Include="..\ui\audio_time_axis.xml" />
<Xml Include="..\ui\automation_time_axis.xml" />
<Xml Include="..\ui\compact_meter_bridge.xml" />
<Xml Include="..\ui\compact_meter_strip.xml" />
<Xml Include="..\ui\device_capture_control.xml" />
<Xml Include="..\ui\device_playback_control.xml" />
<Xml Include="..\ui\editor_mixer.xml" />
<Xml Include="..\ui\editor_window.xml" />
<Xml Include="..\ui\inspector_gain_meter.xml" />
<Xml Include="..\ui\master_ui.xml" />
<Xml Include="..\ui\master_ui_gain_meter.xml" />
<Xml Include="..\ui\meter_bridge_view.xml" />
<Xml Include="..\ui\meter_strip.xml" />
<Xml Include="..\ui\meter_strip_gain_meter.xml" />
<Xml Include="..\ui\midi_device_control.xml" />
<Xml Include="..\ui\mixer_bridge_view.xml" />
<Xml Include="..\ui\mixer_gain_meter.xml" />
<Xml Include="..\ui\mixer_strip.xml" />
<Xml Include="..\ui\session_close_dialog.xml" />
<Xml Include="..\ui\session_dialog.xml" />
<Xml Include="..\ui\session_lock_dialog.xml" />
<Xml Include="..\ui\time_info_box.xml" />
<Xml Include="..\ui\tracks_preferences.xml" />
<Xml Include="..\ui\track_header_gain_meter.xml" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -2168,5 +2168,59 @@
<Xml Include="..\ui\session_lock_dialog.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\add_tracks_dialog.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\audio_time_axis.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\automation_time_axis.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\compact_meter_bridge.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\compact_meter_strip.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\editor_mixer.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\inspector_gain_meter.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\master_ui.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\master_ui_gain_meter.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\meter_bridge_view.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\meter_strip.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\meter_strip_gain_meter.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\mixer_bridge_view.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\mixer_gain_meter.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\mixer_strip.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\session_close_dialog.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\time_info_box.xml">
<Filter>ui</Filter>
</Xml>
<Xml Include="..\ui\track_header_gain_meter.xml">
<Filter>ui</Filter>
</Xml>
</ItemGroup>
</Project>

View file

@ -226,6 +226,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void butler_transport_work ();
void refresh_disk_space ();
float get_disk_usage_percentage();
int load_diskstreams_2X (XMLNode const &, int);

View file

@ -49,6 +49,10 @@
#include <sys/statvfs.h>
#endif
#ifdef _WIN32
#include <windows.h>
#endif
#include <glib.h>
#include <glib/gstdio.h>
@ -2111,6 +2115,64 @@ Session::refresh_disk_space ()
}
}
#endif
#ifdef _WIN32
BOOL fResult;
const char *pszDrive = NULL;
DWORD dwSectPerClust,
dwBytesPerSect,
dwFreeClusters,
dwTotalClusters;
if( session_dirs.empty() )
return;
pszDrive = session_dirs.begin()->path.c_str();
fResult = GetDiskFreeSpace (pszDrive,
&dwSectPerClust,
&dwBytesPerSect,
&dwFreeClusters,
&dwTotalClusters);
if( 0 != fResult )
{
float number_of_4K_blocks_in_cluster = dwSectPerClust*dwBytesPerSect/4096.0;
_total_free_4k_blocks = floor (dwFreeClusters * number_of_4K_blocks_in_cluster);
}
return;
#endif
}
float
Session::get_disk_usage_percentage ()
{
#if __APPLE__ || (HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H)
vector<space_and_path>::iterator i = session_dirs.begin();
struct statfs statfsbuf;
statfs (i->path.c_str(), &statfsbuf);
return 100 - (statfsbuf.f_bfree * 100.0)/(statfsbuf.f_blocks);
#endif
#ifdef _WIN32
BOOL fResult;
const char *pszDrive = NULL;
DWORD dwSectPerClust,
dwBytesPerSect,
dwFreeClusters,
dwTotalClusters;
pszDrive = session_dirs.begin()->path.c_str();
fResult = GetDiskFreeSpace (pszDrive,
&dwSectPerClust,
&dwBytesPerSect,
&dwFreeClusters,
&dwTotalClusters);
return 100 - (dwFreeClusters*100.0)/dwTotalClusters;
#endif
return -1;
}
string

View file

@ -140,6 +140,8 @@ Fader::Fader (Gtk::Adjustment& adj,
, _default_value (adjustment.get_value())
, _dragging (false)
, _read_only (read_only)
, _grab_window (0)
, _touch_cursor (0)
{
PBD::Searchpath spath(ARDOUR::ardour_data_search_path());
@ -193,6 +195,9 @@ Fader::Fader (Gtk::Adjustment& adj,
Fader::~Fader ()
{
if (_touch_cursor) {
delete _touch_cursor;
}
}
void
@ -262,6 +267,10 @@ Fader::on_button_press_event (GdkEventButton* ev)
return false;
}
if (_touch_cursor) {
get_window()->set_cursor (*_touch_cursor);
}
double hx;
double hy;
get_handle_position (hx, hy);
@ -313,6 +322,10 @@ Fader::on_button_release_event (GdkEventButton* ev)
return false;
}
if (_touch_cursor) {
get_window()->set_cursor ();
}
if (_dragging) { //temp
remove_modal_grab();
_dragging = false;
@ -458,6 +471,26 @@ Fader::set_default_value (float d)
update_unity_position ();
}
void
Fader::set_touch_cursor (const std::string& icon_name)
{
PBD::Searchpath spath(ARDOUR::ardour_data_search_path());
spath.add_subdirectory_to_paths ("icons");
std::string icon_file_path;
if (PBD::find_file (spath, icon_name, icon_file_path)) {
_touch_cursor = new Gdk::Cursor (Gdk::Display::get_default(),
Gdk::Pixbuf::create_from_file (icon_file_path),
12,
12);
} else {
throw failed_constructor();
}
}
void
Fader::update_unity_position ()
{

View file

@ -52,8 +52,8 @@ class LIBGTKMM2EXT_API Fader : public CairoWidget
virtual ~Fader ();
void set_controllable (boost::shared_ptr<PBD::Controllable> c) { binding_proxy.set_controllable (c); }
void set_default_value (float);
void set_touch_cursor (const std::string& icon_name);
protected:
void get_handle_position (double& x, double& y);
@ -88,6 +88,8 @@ class LIBGTKMM2EXT_API Fader : public CairoWidget
bool _hovering;
GdkWindow* _grab_window;
Gdk::Cursor *_touch_cursor;
double _grab_loc_x;
double _grab_loc_y;
double _grab_start_x;