2 Copyright (C) 2008 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __export_timespan_selector_h__
22 #define __export_timespan_selector_h__
24 #include "public_editor.h"
25 #include "audio_clock.h"
30 #include <boost/shared_ptr.hpp>
32 #include "ardour/types.h"
33 #include "ardour/export_profile_manager.h"
42 using ARDOUR::CDMarkerFormat;
44 /// Timespan Selector base
45 class ExportTimespanSelector : public Gtk::VBox {
48 ExportTimespanSelector ();
49 virtual ~ExportTimespanSelector ();
51 void set_state (ARDOUR::ExportProfileManager::TimespanStatePtr const state_, ARDOUR::Session * session_);
53 sigc::signal<void> CriticalSelectionChanged;
57 typedef std::list<ARDOUR::Location *> LocationList;
58 typedef boost::shared_ptr<ARDOUR::ExportHandler> HandlerPtr;
60 typedef boost::shared_ptr<ARDOUR::ExportTimespan> TimespanPtr;
61 typedef std::list<TimespanPtr> TimespanList;
62 typedef boost::shared_ptr<TimespanList> TimespanListPtr;
64 ARDOUR::Session * session;
65 ARDOUR::ExportProfileManager::TimespanStatePtr state;
67 virtual void fill_range_list () = 0;
69 void add_range_to_selection (ARDOUR::Location const * loc);
70 void set_time_format_from_state ();
72 void change_time_format ();
74 Glib::ustring construct_label (ARDOUR::Location const * location) const;
75 Glib::ustring bbt_str (nframes_t frames) const;
76 Glib::ustring smpte_str (nframes_t frames) const;
77 Glib::ustring ms_str (nframes_t frames) const;
79 void update_range_name (Glib::ustring const & path, Glib::ustring const & new_text);
81 /*** GUI components ***/
83 Gtk::HBox option_hbox;
84 Gtk::Label time_format_label;
88 typedef ARDOUR::ExportProfileManager::TimeFormat TimeFormat;
90 struct TimeFormatCols : public Gtk::TreeModelColumnRecord
93 Gtk::TreeModelColumn<TimeFormat> format;
94 Gtk::TreeModelColumn<Glib::ustring> label;
96 TimeFormatCols () { add(format); add(label); }
98 TimeFormatCols time_format_cols;
99 Glib::RefPtr<Gtk::ListStore> time_format_list;
100 Gtk::ComboBox time_format_combo;
104 struct RangeCols : public Gtk::TreeModelColumnRecord
107 Gtk::TreeModelColumn<ARDOUR::Location *> location;
108 Gtk::TreeModelColumn<Glib::ustring> label;
109 Gtk::TreeModelColumn<bool> selected;
110 Gtk::TreeModelColumn<Glib::ustring> name;
112 RangeCols () { add (location); add(label); add(selected); add(name); }
114 RangeCols range_cols;
116 Glib::RefPtr<Gtk::ListStore> range_list;
117 Gtk::TreeView range_view;
119 Gtk::ScrolledWindow range_scroller;
122 /// Allows seleting multiple timespans
123 class ExportTimespanSelectorMultiple : public ExportTimespanSelector
126 ExportTimespanSelectorMultiple ();
130 virtual void fill_range_list ();
132 void set_selection_from_state ();
133 void update_selection ();
134 void update_timespans ();
137 /// Displays one timespan
138 class ExportTimespanSelectorSingle : public ExportTimespanSelector
141 ExportTimespanSelectorSingle (Glib::ustring range_id);
145 virtual void fill_range_list ();
147 Glib::ustring range_id;
151 #endif /* __export_timespan_selector_h__ */