add canvas item types to enum system
[ardour.git] / gtk2_ardour / export_timespan_selector.cc
index 41257e12484fe82d1dd6a060b138a7a0b75bc9fa..d6ca02fe0387ab91e5d4395ad2a415608eff5d1a 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "ardour_ui.h"
 
-#include "ardour/tempo.h"
 #include "ardour/location.h"
 #include "ardour/types.h"
 #include "ardour/session.h"
@@ -51,7 +50,7 @@ ExportTimespanSelector::ExportTimespanSelector (ARDOUR::Session * session, Profi
        option_hbox.pack_start (time_format_label, false, false, 0);
        option_hbox.pack_start (time_format_combo, false, false, 6);
 
-       Gtk::Button* b = manage (new Gtk::Button (_("Select All")));
+       Gtk::Button* b = Gtk::manage (new Gtk::Button (_("Select All")));
        b->signal_clicked().connect (
                sigc::bind (
                        sigc::mem_fun (*this, &ExportTimespanSelector::set_selection_state_of_all_timespans), true
@@ -59,7 +58,7 @@ ExportTimespanSelector::ExportTimespanSelector (ARDOUR::Session * session, Profi
                );
        option_hbox.pack_start (*b, false, false, 6);
        
-       b = manage (new Gtk::Button (_("Deselect All")));
+       b = Gtk::manage (new Gtk::Button (_("Deselect All")));
        b->signal_clicked().connect (
                sigc::bind (
                        sigc::mem_fun (*this, &ExportTimespanSelector::set_selection_state_of_all_timespans), false
@@ -121,9 +120,7 @@ ExportTimespanSelector::add_range_to_selection (ARDOUR::Location const * loc)
        ExportTimespanPtr span = _session->get_export_handler()->add_timespan();
 
        std::string id;
-       if (loc == state->session_range.get()) {
-               id = "session";
-       } else if (loc == state->selection_range.get()) {
+       if (loc == state->selection_range.get()) {
                id = "selection";
        } else {
                id = loc->id().to_s();
@@ -308,7 +305,7 @@ ExportTimespanSelector::ms_str (framecnt_t frames) const
        mins = (int) floor (left / (_session->frame_rate() * 60.0f));
        left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
        secs = (int) floor (left / (float) _session->frame_rate());
-       left -= (framecnt_t) floor (secs * _session->frame_rate());
+       left -= (framecnt_t) floor ((double)(secs * _session->frame_rate()));
        sec_promilles = (int) (left * 1000 / (float) _session->frame_rate() + 0.5);
 
        oss << std::setfill('0') << std::right <<
@@ -368,9 +365,7 @@ ExportTimespanSelectorSingle::fill_range_list ()
        if (!state) { return; }
 
        std::string id;
-       if (!range_id.compare (X_("session"))) {
-               id = state->session_range->id().to_s();
-       } else if (!range_id.compare (X_("selection"))) {
+       if (!range_id.compare (X_("selection"))) {
                id = state->selection_range->id().to_s();
        } else {
                id = range_id;
@@ -460,9 +455,8 @@ ExportTimespanSelectorMultiple::set_selection_from_state ()
                for (tree_it = range_list->children().begin(); tree_it != range_list->children().end(); ++tree_it) {
                        Location * loc = tree_it->get_value (range_cols.location);
 
-                       if ((!id.compare ("session") && loc == state->session_range.get()) ||
-                           (!id.compare ("selection") && loc == state->selection_range.get()) ||
-                           (!id.compare (loc->id().to_s()))) {
+                       if ((id == "selection" && loc == state->selection_range.get()) ||
+                           (id == loc->id().to_s())) {
                                tree_it->set_value (range_cols.selected, true);
                        }
                }