#include "export_timespan_selector.h"
-#include "ardour_ui.h"
-
#include "ardour/location.h"
#include "ardour/types.h"
#include "ardour/session.h"
)
);
option_hbox.pack_start (*b, false, false, 6);
-
+
b = Gtk::manage (new Gtk::Button (_("Deselect All")));
b->signal_clicked().connect (
sigc::bind (
time_format_list = Gtk::ListStore::create (time_format_cols);
time_format_combo.set_model (time_format_list);
- time_format_combo.set_name ("PaddedButton");
iter = time_format_list->append();
row = *iter;
/* Range view */
range_list = Gtk::ListStore::create (range_cols);
+ // order by location start times
+ range_list->set_sort_column(range_cols.location, Gtk::SORT_ASCENDING);
+ range_list->set_sort_func(range_cols.location, sigc::mem_fun(*this, &ExportTimespanSelector::location_sorter));
range_view.set_model (range_list);
range_view.set_headers_visible (true);
}
}
+int
+ExportTimespanSelector::location_sorter(Gtk::TreeModel::iterator a, Gtk::TreeModel::iterator b)
+{
+ Location *l1 = (*a)[range_cols.location];
+ Location *l2 = (*b)[range_cols.location];
+ const Location *ls = _session->locations()->session_range_location();
+
+ // always sort session range first
+ if (l1 == ls)
+ return -1;
+ if (l2 == ls)
+ return +1;
+
+ return l1->start() - l2->start();
+}
+
void
ExportTimespanSelector::add_range_to_selection (ARDOUR::Location const * loc)
{