summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-10-13 15:07:50 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-10-13 15:07:50 +0000
commit2b90eeade92f750e85408f25b2d34af3e695f1cf (patch)
tree0057ef49e6c3692f2933bfffc22ec5db4ae402e4
parent1f2c5ba533d1e257e35c042feb79561757e03f4b (diff)
session export starts from session start marker; add tooltips for rude solo + audition; start work on control protocol feedback control (unfinished but compiles and runs
git-svn-id: svn://localhost/ardour2/trunk@985 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/ardour_ui.cc20
-rw-r--r--gtk2_ardour/ardour_ui.h1
-rw-r--r--gtk2_ardour/ardour_ui2.cc3
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc56
-rw-r--r--gtk2_ardour/editor.cc11
-rw-r--r--gtk2_ardour/editor_export_audio.cc2
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h1
-rw-r--r--libs/ardour/control_protocol_manager.cc1
-rw-r--r--libs/ardour/session.cc14
-rw-r--r--libs/ardour/session_midi.cc2
-rw-r--r--libs/surfaces/control_protocol/control_protocol/control_protocol.h2
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.h1
-rw-r--r--libs/surfaces/generic_midi/interface.cc1
-rw-r--r--libs/surfaces/tranzport/interface.cc1
14 files changed, 91 insertions, 25 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index b2da3fdc4c..8f86054ddd 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -564,21 +564,11 @@ ARDOUR_UI::update_disk_space()
int secs;
nframes_t fr = session->frame_rate();
- if (session->actively_recording()){
-
- rec_enabled_diskstreams = 0;
- session->foreach_route (this, &ARDOUR_UI::count_recenabled_diskstreams);
-
- if (rec_enabled_diskstreams) {
- frames /= rec_enabled_diskstreams;
- }
-
- } else {
-
- /* hmmm. shall we divide by the route count? or the diskstream count?
- or what? for now, do nothing ...
- */
-
+ rec_enabled_diskstreams = 0;
+ session->foreach_route (this, &ARDOUR_UI::count_recenabled_diskstreams);
+
+ if (rec_enabled_diskstreams) {
+ frames /= rec_enabled_diskstreams;
}
hrs = frames / (fr * 3600);
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 69f2cd0492..4b03352bb6 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -689,6 +689,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void map_meter_falloff ();
void toggle_control_protocol (ARDOUR::ControlProtocolInfo*);
+ void toggle_control_protocol_feedback (ARDOUR::ControlProtocolInfo*, const char* group_name, const char* action_name);
};
#endif /* __ardour_gui_h__ */
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index f1b8ddad2f..7f724312aa 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -363,6 +363,9 @@ ARDOUR_UI::setup_transport ()
auditioning_alert_button.set_name ("TransportAuditioningAlert");
auditioning_alert_button.signal_pressed().connect (mem_fun(*this,&ARDOUR_UI::audition_alert_toggle));
+ tooltips().set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
+ tooltips().set_tip (auditioning_alert_button, _("When active, auditioning is taking place\nClick to stop the audition"));
+
alert_box.pack_start (solo_alert_button, false, false);
alert_box.pack_start (auditioning_alert_button, false, false);
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index d7c294c681..e764779300 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -479,9 +479,35 @@ ARDOUR_UI::toggle_control_protocol (ControlProtocolInfo* cpi)
}
void
+ARDOUR_UI::toggle_control_protocol_feedback (ControlProtocolInfo* cpi, const char* group, const char* action)
+{
+ if (!session) {
+ /* this happens when we build the menu bar when control protocol support
+ has been used in the past for some given protocol - the item needs
+ to be made active, but there is no session yet.
+ */
+ return;
+ }
+
+ if (cpi->protocol) {
+ Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (group, action);
+
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ bool x = tact->get_active();
+
+ if (tact && x != cpi->protocol->get_feedback()) {
+ cpi->protocol->set_feedback (!x);
+ }
+ }
+ }
+}
+
+void
ARDOUR_UI::build_control_surface_menu ()
{
list<ControlProtocolInfo*>::iterator i;
+ bool with_feedback;
/* !!! this has to match the top level entry from ardour.menus */
@@ -501,6 +527,8 @@ ARDOUR_UI::build_control_surface_menu ()
(bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i)));
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ with_feedback = false;
if ((*i)->protocol || (*i)->requested) {
tact->set_active ();
@@ -509,6 +537,34 @@ ARDOUR_UI::build_control_surface_menu ()
ui += "<menuitem action='";
ui += action_name;
ui += "'/>\n";
+
+ if ((*i)->supports_feedback) {
+
+ string submenu_name = action_name;
+
+ submenu_name += "SubMenu";
+
+ ActionManager::register_action (editor->editor_actions, submenu_name.c_str(), _("Controls"));
+
+ action_name += "Feedback";
+
+ Glib::RefPtr<Action> act = ActionManager::register_toggle_action (editor->editor_actions, action_name.c_str(), _("Feedback"),
+ (bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol_feedback),
+ *i,
+ "Editor",
+ action_name.c_str())));
+
+ ui += "<menu action='";
+ ui += submenu_name;
+ ui += "'>\n<menuitem action='";
+ ui += action_name;
+ ui += "'/>\n</menu>\n";
+
+ if ((*i)->protocol) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ tact->set_active ((*i)->protocol->get_feedback ());
+ }
+ }
}
}
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index ed09a03597..67f3acccf9 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -129,11 +129,11 @@ static const gchar *snap_mode_strings[] = {
};
static const gchar *zoom_focus_strings[] = {
- N_("Focus Left"),
- N_("Focus Right"),
- N_("Focus Center"),
- N_("Focus Playhead"),
- N_("Focus Edit Cursor"),
+ N_("Left"),
+ N_("Right"),
+ N_("Center"),
+ N_("Playhead"),
+ N_("Edit Cursor"),
0
};
@@ -2589,6 +2589,7 @@ Editor::setup_toolbar ()
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, "Focus Center", 2+FUDGE, 0);
set_popdown_strings (zoom_focus_selector, internationalize (zoom_focus_strings));
zoom_focus_selector.signal_changed().connect (mem_fun(*this, &Editor::zoom_focus_selection_done));
+ ARDOUR_UI::instance()->tooltips().set_tip (zoom_focus_selector, _("Zoom focus"));
zoom_box.pack_start (zoom_focus_selector, false, false);
diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc
index 7ea87a2969..fd40b9cae0 100644
--- a/gtk2_ardour/editor_export_audio.cc
+++ b/gtk2_ardour/editor_export_audio.cc
@@ -55,7 +55,7 @@ void
Editor::export_session()
{
if (session) {
- export_range (0, session->current_end_frame());
+ export_range (session->current_start_frame(), session->current_end_frame());
}
}
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index 99de5479fb..39e4803637 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -23,6 +23,7 @@ struct ControlProtocolInfo {
std::string path;
bool requested;
bool mandatory;
+ bool supports_feedback;
XMLNode* state;
ControlProtocolInfo() : descriptor (0), protocol (0), state (0) {}
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index 7170b45656..1ff6c28ef3 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -189,6 +189,7 @@ ControlProtocolManager::control_protocol_discover (string path)
cpi->protocol = 0;
cpi->requested = false;
cpi->mandatory = descriptor->mandatory;
+ cpi->supports_feedback = descriptor->supports_feedback;
cpi->state = 0;
control_protocol_info.push_back (cpi);
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index d5ff3d223c..e8f6ec1023 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -3288,7 +3288,19 @@ Session::remove_redirect (Redirect* redirect)
nframes_t
Session::available_capture_duration ()
{
- const double scale = 4096.0 / sizeof (Sample);
+ float sample_bytes_on_disk;
+
+ switch (Config->get_native_file_data_format()) {
+ case FormatFloat:
+ sample_bytes_on_disk = 4;
+ break;
+
+ case FormatInt24:
+ sample_bytes_on_disk = 3;
+ break;
+ }
+
+ double scale = 4096.0 / sample_bytes_on_disk;
if (_total_free_4k_blocks * scale > (double) max_frames) {
return max_frames;
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 1af00ca337..fe08b40127 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -1111,7 +1111,7 @@ Session::terminate_midi_thread ()
void
Session::poke_midi_thread ()
{
- char c;
+ static char c = 0;
if (write (midi_request_pipe[1], &c, 1) != 1) {
error << string_compose(_("cannot send signal to midi thread! (%1)"), strerror (errno)) << endmsg;
diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h
index 3635b267ce..a689d49431 100644
--- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h
+++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h
@@ -47,7 +47,6 @@ class ControlProtocol : public sigc::trackable, public Stateful, public BasicUI
virtual int set_feedback (bool yn) { return 0; }
virtual bool get_feedback () const { return false; }
- virtual bool supports_feedback () const { return false; }
sigc::signal<void> ActiveChanged;
@@ -114,6 +113,7 @@ extern "C" {
void* ptr; /* protocol can store a value here */
void* module; /* not for public access */
int mandatory; /* if non-zero, always load and do not make optional */
+ bool supports_feedback; /* if true, protocol has toggleable feedback mechanism */
bool (*probe)(ControlProtocolDescriptor*);
ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h
index d008744727..6fba16bccd 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h
@@ -34,7 +34,6 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
int set_feedback (bool yn);
bool get_feedback () const;
- bool supports_feedback () const { return true; }
XMLNode& get_state ();
int set_state (const XMLNode&);
diff --git a/libs/surfaces/generic_midi/interface.cc b/libs/surfaces/generic_midi/interface.cc
index 230be694f2..c70b5b6b61 100644
--- a/libs/surfaces/generic_midi/interface.cc
+++ b/libs/surfaces/generic_midi/interface.cc
@@ -42,6 +42,7 @@ static ControlProtocolDescriptor generic_midi_descriptor = {
ptr : 0,
module : 0,
mandatory : 0,
+ supports_feedback : true,
probe : probe_generic_midi_protocol,
initialize : new_generic_midi_protocol,
destroy : delete_generic_midi_protocol
diff --git a/libs/surfaces/tranzport/interface.cc b/libs/surfaces/tranzport/interface.cc
index 29a0fde043..f6d0dc8206 100644
--- a/libs/surfaces/tranzport/interface.cc
+++ b/libs/surfaces/tranzport/interface.cc
@@ -35,6 +35,7 @@ static ControlProtocolDescriptor tranzport_descriptor = {
ptr : 0,
module : 0,
mandatory : 0,
+ supports_feedback : false,
probe : probe_tranzport_protocol,
initialize : new_tranzport_protocol,
destroy : delete_tranzport_protocol