mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Refine Stem-Export selection options
Allow to exclude muted, or hidden tracks from stem-export selection actions.
This commit is contained in:
parent
0d1d6d6975
commit
3506600270
2 changed files with 62 additions and 21 deletions
|
|
@ -19,6 +19,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
#include <gtkmm/menu.h>
|
||||||
|
|
||||||
#include "pbd/convert.h"
|
#include "pbd/convert.h"
|
||||||
|
|
||||||
|
|
@ -29,8 +32,6 @@
|
||||||
#include "ardour/route.h"
|
#include "ardour/route.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include "export_channel_selector.h"
|
#include "export_channel_selector.h"
|
||||||
#include "route_sorter.h"
|
#include "route_sorter.h"
|
||||||
|
|
||||||
|
|
@ -547,18 +548,37 @@ RegionExportChannelSelector::handle_selection ()
|
||||||
TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager)
|
TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager)
|
||||||
: ExportChannelSelector(session, manager)
|
: ExportChannelSelector(session, manager)
|
||||||
, track_output_button(_("Apply track/bus processing"))
|
, track_output_button(_("Apply track/bus processing"))
|
||||||
, select_tracks_button (_("Select all tracks"))
|
|
||||||
, select_busses_button (_("Select all busses"))
|
|
||||||
, select_none_button (_("Deselect all"))
|
|
||||||
{
|
{
|
||||||
pack_start(main_layout);
|
pack_start(main_layout);
|
||||||
|
|
||||||
|
// Populate Selection Menu
|
||||||
|
{
|
||||||
|
using namespace Gtk::Menu_Helpers;
|
||||||
|
|
||||||
|
select_menu.set_text (_("Selection Actions"));
|
||||||
|
select_menu.disable_scrolling ();
|
||||||
|
|
||||||
|
select_menu.AddMenuElem (MenuElem (_("Select tracks"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_tracks)));
|
||||||
|
select_menu.AddMenuElem (MenuElem (_("Select busses"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_busses)));
|
||||||
|
select_menu.AddMenuElem (MenuElem (_("Deselect all"), sigc::mem_fun (*this, &TrackExportChannelSelector::select_none)));
|
||||||
|
select_menu.AddMenuElem (SeparatorElem ());
|
||||||
|
|
||||||
|
exclude_hidden = new Gtk::CheckMenuItem (_("Exclude Hidden"));
|
||||||
|
exclude_hidden->set_active (false);
|
||||||
|
exclude_hidden->show();
|
||||||
|
select_menu.AddMenuElem (*exclude_hidden);
|
||||||
|
|
||||||
|
exclude_muted = new Gtk::CheckMenuItem (_("Exclude Muted"));
|
||||||
|
exclude_muted->set_active (true);
|
||||||
|
exclude_muted->show();
|
||||||
|
select_menu.AddMenuElem (*exclude_muted);
|
||||||
|
}
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
options_box.pack_start(track_output_button);
|
options_box.set_spacing (8);
|
||||||
options_box.pack_start (select_tracks_button);
|
options_box.pack_start (track_output_button, false, false);
|
||||||
options_box.pack_start (select_busses_button);
|
options_box.pack_start (select_menu, false, false);
|
||||||
options_box.pack_start (select_none_button);
|
main_layout.pack_start (options_box, false, false);
|
||||||
main_layout.pack_start(options_box, false, false);
|
|
||||||
|
|
||||||
// Track scroller
|
// Track scroller
|
||||||
track_scroller.add (track_view);
|
track_scroller.add (track_view);
|
||||||
|
|
@ -589,10 +609,6 @@ TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * sessio
|
||||||
column->pack_start (*text_renderer, false);
|
column->pack_start (*text_renderer, false);
|
||||||
column->add_attribute (text_renderer->property_text(), track_cols.label);
|
column->add_attribute (text_renderer->property_text(), track_cols.label);
|
||||||
|
|
||||||
select_tracks_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::select_tracks));
|
|
||||||
select_busses_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::select_busses));
|
|
||||||
select_none_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::select_none));
|
|
||||||
|
|
||||||
track_output_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::track_outputs_selected));
|
track_output_button.signal_clicked().connect (sigc::mem_fun (*this, &TrackExportChannelSelector::track_outputs_selected));
|
||||||
|
|
||||||
fill_list();
|
fill_list();
|
||||||
|
|
@ -600,6 +616,12 @@ TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * sessio
|
||||||
show_all_children ();
|
show_all_children ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TrackExportChannelSelector::~TrackExportChannelSelector ()
|
||||||
|
{
|
||||||
|
delete exclude_hidden;
|
||||||
|
delete exclude_muted;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TrackExportChannelSelector::sync_with_manager ()
|
TrackExportChannelSelector::sync_with_manager ()
|
||||||
{
|
{
|
||||||
|
|
@ -610,11 +632,19 @@ TrackExportChannelSelector::sync_with_manager ()
|
||||||
void
|
void
|
||||||
TrackExportChannelSelector::select_tracks ()
|
TrackExportChannelSelector::select_tracks ()
|
||||||
{
|
{
|
||||||
|
bool excl_hidden = exclude_hidden->get_active ();
|
||||||
|
bool excl_muted = exclude_muted->get_active ();
|
||||||
|
|
||||||
for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
|
for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
|
||||||
Gtk::TreeModel::Row row = *it;
|
Gtk::TreeModel::Row row = *it;
|
||||||
boost::shared_ptr<Route> route = row[track_cols.route];
|
boost::shared_ptr<Route> route = row[track_cols.route];
|
||||||
if (boost::dynamic_pointer_cast<Track> (route)) {
|
if (boost::dynamic_pointer_cast<Track> (route)) {
|
||||||
// it's a track
|
if (excl_muted && route->muted ()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (excl_hidden && route->is_hidden ()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
row[track_cols.selected] = true;
|
row[track_cols.selected] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -624,11 +654,19 @@ TrackExportChannelSelector::select_tracks ()
|
||||||
void
|
void
|
||||||
TrackExportChannelSelector::select_busses ()
|
TrackExportChannelSelector::select_busses ()
|
||||||
{
|
{
|
||||||
|
bool excl_hidden = exclude_hidden->get_active ();
|
||||||
|
bool excl_muted = exclude_muted->get_active ();
|
||||||
|
|
||||||
for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
|
for (Gtk::ListStore::Children::iterator it = track_list->children().begin(); it != track_list->children().end(); ++it) {
|
||||||
Gtk::TreeModel::Row row = *it;
|
Gtk::TreeModel::Row row = *it;
|
||||||
boost::shared_ptr<Route> route = row[track_cols.route];
|
boost::shared_ptr<Route> route = row[track_cols.route];
|
||||||
if (!boost::dynamic_pointer_cast<Track> (route)) {
|
if (!boost::dynamic_pointer_cast<Track> (route)) {
|
||||||
// it's not a track, must be a bus
|
if (excl_muted && route->muted ()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (excl_hidden && route->is_hidden ()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
row[track_cols.selected] = true;
|
row[track_cols.selected] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
#include <gtkmm/treemodel.h>
|
#include <gtkmm/treemodel.h>
|
||||||
#include <gtkmm/treeview.h>
|
#include <gtkmm/treeview.h>
|
||||||
|
|
||||||
|
#include "widgets/ardour_dropdown.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
class ExportChannelConfiguration;
|
class ExportChannelConfiguration;
|
||||||
|
|
@ -243,6 +245,7 @@ class TrackExportChannelSelector : public ExportChannelSelector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager);
|
TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager);
|
||||||
|
~TrackExportChannelSelector ();
|
||||||
|
|
||||||
virtual void sync_with_manager ();
|
virtual void sync_with_manager ();
|
||||||
|
|
||||||
|
|
@ -276,9 +279,9 @@ class TrackExportChannelSelector : public ExportChannelSelector
|
||||||
|
|
||||||
Gtk::HBox options_box;
|
Gtk::HBox options_box;
|
||||||
Gtk::CheckButton track_output_button;
|
Gtk::CheckButton track_output_button;
|
||||||
Gtk::Button select_tracks_button;
|
ArdourWidgets::ArdourDropdown select_menu;
|
||||||
Gtk::Button select_busses_button;
|
Gtk::CheckMenuItem* exclude_hidden;
|
||||||
Gtk::Button select_none_button;
|
Gtk::CheckMenuItem* exclude_muted;
|
||||||
void select_tracks ();
|
void select_tracks ();
|
||||||
void select_busses ();
|
void select_busses ();
|
||||||
void select_none ();
|
void select_none ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue