mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
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
This commit is contained in:
parent
1f2c5ba533
commit
2b90eeade9
14 changed files with 91 additions and 25 deletions
|
|
@ -564,21 +564,11 @@ ARDOUR_UI::update_disk_space()
|
||||||
int secs;
|
int secs;
|
||||||
nframes_t fr = session->frame_rate();
|
nframes_t fr = session->frame_rate();
|
||||||
|
|
||||||
if (session->actively_recording()){
|
rec_enabled_diskstreams = 0;
|
||||||
|
session->foreach_route (this, &ARDOUR_UI::count_recenabled_diskstreams);
|
||||||
rec_enabled_diskstreams = 0;
|
|
||||||
session->foreach_route (this, &ARDOUR_UI::count_recenabled_diskstreams);
|
if (rec_enabled_diskstreams) {
|
||||||
|
frames /= rec_enabled_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 ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hrs = frames / (fr * 3600);
|
hrs = frames / (fr * 3600);
|
||||||
|
|
|
||||||
|
|
@ -689,6 +689,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
void map_meter_falloff ();
|
void map_meter_falloff ();
|
||||||
|
|
||||||
void toggle_control_protocol (ARDOUR::ControlProtocolInfo*);
|
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__ */
|
#endif /* __ardour_gui_h__ */
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,9 @@ ARDOUR_UI::setup_transport ()
|
||||||
auditioning_alert_button.set_name ("TransportAuditioningAlert");
|
auditioning_alert_button.set_name ("TransportAuditioningAlert");
|
||||||
auditioning_alert_button.signal_pressed().connect (mem_fun(*this,&ARDOUR_UI::audition_alert_toggle));
|
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 (solo_alert_button, false, false);
|
||||||
alert_box.pack_start (auditioning_alert_button, false, false);
|
alert_box.pack_start (auditioning_alert_button, false, false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -478,10 +478,36 @@ 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
|
void
|
||||||
ARDOUR_UI::build_control_surface_menu ()
|
ARDOUR_UI::build_control_surface_menu ()
|
||||||
{
|
{
|
||||||
list<ControlProtocolInfo*>::iterator i;
|
list<ControlProtocolInfo*>::iterator i;
|
||||||
|
bool with_feedback;
|
||||||
|
|
||||||
/* !!! this has to match the top level entry from ardour.menus */
|
/* !!! 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)));
|
(bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i)));
|
||||||
|
|
||||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||||
|
|
||||||
|
with_feedback = false;
|
||||||
|
|
||||||
if ((*i)->protocol || (*i)->requested) {
|
if ((*i)->protocol || (*i)->requested) {
|
||||||
tact->set_active ();
|
tact->set_active ();
|
||||||
|
|
@ -509,6 +537,34 @@ ARDOUR_UI::build_control_surface_menu ()
|
||||||
ui += "<menuitem action='";
|
ui += "<menuitem action='";
|
||||||
ui += action_name;
|
ui += action_name;
|
||||||
ui += "'/>\n";
|
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 ());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,11 +129,11 @@ static const gchar *snap_mode_strings[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const gchar *zoom_focus_strings[] = {
|
static const gchar *zoom_focus_strings[] = {
|
||||||
N_("Focus Left"),
|
N_("Left"),
|
||||||
N_("Focus Right"),
|
N_("Right"),
|
||||||
N_("Focus Center"),
|
N_("Center"),
|
||||||
N_("Focus Playhead"),
|
N_("Playhead"),
|
||||||
N_("Focus Edit Cursor"),
|
N_("Edit Cursor"),
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2589,6 +2589,7 @@ Editor::setup_toolbar ()
|
||||||
Gtkmm2ext::set_size_request_to_display_given_text (zoom_focus_selector, "Focus Center", 2+FUDGE, 0);
|
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));
|
set_popdown_strings (zoom_focus_selector, internationalize (zoom_focus_strings));
|
||||||
zoom_focus_selector.signal_changed().connect (mem_fun(*this, &Editor::zoom_focus_selection_done));
|
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);
|
zoom_box.pack_start (zoom_focus_selector, false, false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ void
|
||||||
Editor::export_session()
|
Editor::export_session()
|
||||||
{
|
{
|
||||||
if (session) {
|
if (session) {
|
||||||
export_range (0, session->current_end_frame());
|
export_range (session->current_start_frame(), session->current_end_frame());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ struct ControlProtocolInfo {
|
||||||
std::string path;
|
std::string path;
|
||||||
bool requested;
|
bool requested;
|
||||||
bool mandatory;
|
bool mandatory;
|
||||||
|
bool supports_feedback;
|
||||||
XMLNode* state;
|
XMLNode* state;
|
||||||
|
|
||||||
ControlProtocolInfo() : descriptor (0), protocol (0), state (0) {}
|
ControlProtocolInfo() : descriptor (0), protocol (0), state (0) {}
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ ControlProtocolManager::control_protocol_discover (string path)
|
||||||
cpi->protocol = 0;
|
cpi->protocol = 0;
|
||||||
cpi->requested = false;
|
cpi->requested = false;
|
||||||
cpi->mandatory = descriptor->mandatory;
|
cpi->mandatory = descriptor->mandatory;
|
||||||
|
cpi->supports_feedback = descriptor->supports_feedback;
|
||||||
cpi->state = 0;
|
cpi->state = 0;
|
||||||
|
|
||||||
control_protocol_info.push_back (cpi);
|
control_protocol_info.push_back (cpi);
|
||||||
|
|
|
||||||
|
|
@ -3288,7 +3288,19 @@ Session::remove_redirect (Redirect* redirect)
|
||||||
nframes_t
|
nframes_t
|
||||||
Session::available_capture_duration ()
|
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) {
|
if (_total_free_4k_blocks * scale > (double) max_frames) {
|
||||||
return max_frames;
|
return max_frames;
|
||||||
|
|
|
||||||
|
|
@ -1111,7 +1111,7 @@ Session::terminate_midi_thread ()
|
||||||
void
|
void
|
||||||
Session::poke_midi_thread ()
|
Session::poke_midi_thread ()
|
||||||
{
|
{
|
||||||
char c;
|
static char c = 0;
|
||||||
|
|
||||||
if (write (midi_request_pipe[1], &c, 1) != 1) {
|
if (write (midi_request_pipe[1], &c, 1) != 1) {
|
||||||
error << string_compose(_("cannot send signal to midi thread! (%1)"), strerror (errno)) << endmsg;
|
error << string_compose(_("cannot send signal to midi thread! (%1)"), strerror (errno)) << endmsg;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ class ControlProtocol : public sigc::trackable, public Stateful, public BasicUI
|
||||||
|
|
||||||
virtual int set_feedback (bool yn) { return 0; }
|
virtual int set_feedback (bool yn) { return 0; }
|
||||||
virtual bool get_feedback () const { return false; }
|
virtual bool get_feedback () const { return false; }
|
||||||
virtual bool supports_feedback () const { return false; }
|
|
||||||
|
|
||||||
sigc::signal<void> ActiveChanged;
|
sigc::signal<void> ActiveChanged;
|
||||||
|
|
||||||
|
|
@ -114,6 +113,7 @@ extern "C" {
|
||||||
void* ptr; /* protocol can store a value here */
|
void* ptr; /* protocol can store a value here */
|
||||||
void* module; /* not for public access */
|
void* module; /* not for public access */
|
||||||
int mandatory; /* if non-zero, always load and do not make optional */
|
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*);
|
bool (*probe)(ControlProtocolDescriptor*);
|
||||||
ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
|
ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
|
||||||
void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
|
void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
|
||||||
|
|
||||||
int set_feedback (bool yn);
|
int set_feedback (bool yn);
|
||||||
bool get_feedback () const;
|
bool get_feedback () const;
|
||||||
bool supports_feedback () const { return true; }
|
|
||||||
|
|
||||||
XMLNode& get_state ();
|
XMLNode& get_state ();
|
||||||
int set_state (const XMLNode&);
|
int set_state (const XMLNode&);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ static ControlProtocolDescriptor generic_midi_descriptor = {
|
||||||
ptr : 0,
|
ptr : 0,
|
||||||
module : 0,
|
module : 0,
|
||||||
mandatory : 0,
|
mandatory : 0,
|
||||||
|
supports_feedback : true,
|
||||||
probe : probe_generic_midi_protocol,
|
probe : probe_generic_midi_protocol,
|
||||||
initialize : new_generic_midi_protocol,
|
initialize : new_generic_midi_protocol,
|
||||||
destroy : delete_generic_midi_protocol
|
destroy : delete_generic_midi_protocol
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ static ControlProtocolDescriptor tranzport_descriptor = {
|
||||||
ptr : 0,
|
ptr : 0,
|
||||||
module : 0,
|
module : 0,
|
||||||
mandatory : 0,
|
mandatory : 0,
|
||||||
|
supports_feedback : false,
|
||||||
probe : probe_tranzport_protocol,
|
probe : probe_tranzport_protocol,
|
||||||
initialize : new_tranzport_protocol,
|
initialize : new_tranzport_protocol,
|
||||||
destroy : delete_tranzport_protocol
|
destroy : delete_tranzport_protocol
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue