From b5a57cc78c92b1d887b7e8de040d8663a9ba187e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 17 Sep 2008 12:56:00 +0000 Subject: new files from sakari, missed last time git-svn-id: svn://localhost/ardour2/branches/3.0@3738 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/export_timespan_selector.h | 132 +++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 gtk2_ardour/export_timespan_selector.h (limited to 'gtk2_ardour/export_timespan_selector.h') diff --git a/gtk2_ardour/export_timespan_selector.h b/gtk2_ardour/export_timespan_selector.h new file mode 100644 index 0000000000..757b2caad2 --- /dev/null +++ b/gtk2_ardour/export_timespan_selector.h @@ -0,0 +1,132 @@ +/* + Copyright (C) 2008 Paul Davis + Author: Sakari Bergen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __export_timespan_selector_h__ +#define __export_timespan_selector_h__ + +#include "public_editor.h" +#include "audio_clock.h" + +#include + +#include +#include + +#include +#include + +namespace ARDOUR { + class Location; + class ExportTimespan; + class ExportHandler; + class Session; +} + +using ARDOUR::CDMarkerFormat; + +/// +class ExportTimespanSelector : public Gtk::VBox { + private: + + typedef std::list LocationList; + typedef boost::shared_ptr HandlerPtr; + + typedef boost::shared_ptr TimespanPtr; + typedef std::list TimespanList; + typedef boost::shared_ptr TimespanListPtr; + + public: + + ExportTimespanSelector (); + ~ExportTimespanSelector (); + + void set_state (ARDOUR::ExportProfileManager::TimespanStatePtr const state_, ARDOUR::Session * session_); + + void select_one_range (Glib::ustring id); + + /* Compatibility with other elements */ + + sigc::signal CriticalSelectionChanged; + + private: + + void fill_range_list (); + void set_selection_from_state (); + + void update_selection (); + void update_timespans (); + + void change_time_format (); + + Glib::ustring construct_label (ARDOUR::Location const * location); + + Glib::ustring bbt_str (nframes_t frames); + Glib::ustring smpte_str (nframes_t frames); + Glib::ustring ms_str (nframes_t frames); + + void update_range_name (Glib::ustring const & path, Glib::ustring const & new_text); + + ARDOUR::Session * session; + + ARDOUR::ExportProfileManager::TimespanStatePtr state; + + /*** GUI components ***/ + + Gtk::HBox option_hbox; + Gtk::Label time_format_label; + + /* Time format */ + + typedef ARDOUR::ExportProfileManager::TimeFormat TimeFormat; + + struct TimeFormatCols : public Gtk::TreeModelColumnRecord + { + public: + Gtk::TreeModelColumn format; + Gtk::TreeModelColumn label; + + TimeFormatCols () { add(format); add(label); } + }; + TimeFormatCols time_format_cols; + Glib::RefPtr time_format_list; + Gtk::ComboBox time_format_combo; + + /* View */ + + struct RangeCols : public Gtk::TreeModelColumnRecord + { + public: + Gtk::TreeModelColumn location; + Gtk::TreeModelColumn label; + Gtk::TreeModelColumn selected; + Gtk::TreeModelColumn name; + + RangeCols () { add (location); add(label); add(selected); add(name); } + }; + RangeCols range_cols; + + Glib::RefPtr range_list; + Gtk::TreeView range_view; + + Gtk::ScrolledWindow range_scroller; + +}; + +#endif /* __export_timespan_selector_h__ */ -- cgit v1.2.3