along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <samplerate.h>
#include <pbd/convert.h>
-#include <pbd/dirname.h>
#include <pbd/xml++.h>
#include <gtkmm2ext/utils.h>
using namespace std;
using namespace ARDOUR;
+using namespace PBD;
using namespace sigc;
using namespace Gtk;
-using PBD::internationalize;
-
static const gchar *sample_rates[] = {
N_("22.05kHz"),
N_("44.1kHz"),
export_cd_markers_allowed = true;
set_title (_("ardour: export"));
- set_wmclass (_("ardour_export"), "Ardour");
+ set_wmclass (X_("ardour_export"), "Ardour");
set_name ("ExportWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
takes a reference.
*/
- vector<string> pop_strings = internationalize(sample_rates);
+ vector<string> pop_strings = I18N (sample_rates);
Gtkmm2ext::set_popdown_strings (sample_rate_combo, pop_strings);
sample_rate_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize(src_quality);
+ pop_strings = I18N (src_quality);
Gtkmm2ext::set_popdown_strings (src_quality_combo, pop_strings);
src_quality_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize(dither_types);
+ pop_strings = I18N (dither_types);
Gtkmm2ext::set_popdown_strings (dither_type_combo, pop_strings);
dither_type_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize(channel_strings);
+ pop_strings = I18N (channel_strings);
Gtkmm2ext::set_popdown_strings (channel_count_combo, pop_strings);
channel_count_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize((const char **) sndfile_header_formats_strings);
+ pop_strings = I18N ((const char **) sndfile_header_formats_strings);
Gtkmm2ext::set_popdown_strings (header_format_combo, pop_strings);
header_format_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize((const char **) sndfile_bitdepth_formats_strings);
+ pop_strings = I18N ((const char **) sndfile_bitdepth_formats_strings);
Gtkmm2ext::set_popdown_strings (bitdepth_format_combo, pop_strings);
bitdepth_format_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize((const char **) sndfile_endian_formats_strings);
+ pop_strings = I18N ((const char **) sndfile_endian_formats_strings);
Gtkmm2ext::set_popdown_strings (endian_format_combo, pop_strings);
endian_format_combo.set_active_text (pop_strings.front());
- pop_strings = internationalize(cue_file_types);
+ pop_strings = I18N (cue_file_types);
Gtkmm2ext::set_popdown_strings (cue_file_combo, pop_strings);
cue_file_combo.set_active_text (pop_strings.front());
ExportDialog::connect_to_session (Session *s)
{
session = s;
- session->going_away.connect (mem_fun(*this, &Window::hide_all));
+ session->GoingAway.connect (mem_fun(*this, &Window::hide_all));
switch (session->frame_rate()) {
case 22050:
row = *ri;
track->add_property(X_("channel1"), row[exp_cols.left] ? X_("on") : X_("off"));
- track->add_property(X_("channel1"), row[exp_cols.right] ? X_("on") : X_("off"));
+ track->add_property(X_("channel2"), row[exp_cols.right] ? X_("on") : X_("off"));
tracks->add_child_nocopy(*track);
}
}
void
-ExportDialog::set_range (jack_nframes_t start, jack_nframes_t end)
+ExportDialog::set_range (nframes_t start, nframes_t end)
{
spec.start_frame = start;
spec.end_frame = end;
}
void
-frames_to_cd_frames_string (char* buf, jack_nframes_t when, jack_nframes_t fr)
+frames_to_cd_frames_string (char* buf, nframes_t when, nframes_t fr)
{
long unsigned int remainder;
end_dialog ();
}
-
void
ExportDialog::end_dialog ()
{
}
/* If the filename hasn't been set before, use the
- directory above the current session as a default
+ current session's export directory as a default
location for the export.
*/
if (file_entry.get_text().length() == 0) {
- string dir = session->path();
+ string dir = session->export_dir();
string::size_type last_slash;
- if ((last_slash = dir.find_last_of ('/')) != string::npos) {
+ if ((last_slash = dir.find_last_of ('/')) != string::npos && last_slash != 0) {
dir = dir.substr (0, last_slash+1);
}
- dir = dir + "export.wav";
+ if (!wants_dir()) {
+ dir = dir + "export.wav";
+ }
file_entry.set_text (dir);
}
ExportDialog::sample_rate_chosen ()
{
string sr_str = sample_rate_combo.get_active_text();
- jack_nframes_t rate;
+ nframes_t rate;
if (sr_str == N_("22.05kHz")) {
rate = 22050;
track_list->clear();
master_list->clear();
- Session::RouteList routes = session->get_routes ();
+ boost::shared_ptr<Session::RouteList> routes = session->get_routes ();
- for (Session::RouteList::iterator ri = routes.begin(); ri != routes.end(); ++ri) {
-
- Route* route = (*ri);
+ for (Session::RouteList::iterator ri = routes->begin(); ri != routes->end(); ++ri) {
+
+ boost::shared_ptr<Route> route = (*ri);
if (route->hidden()) {
continue;
// directory needs to exist and be writable
- string dirpath = PBD::dirname (filepath);
+ string dirpath = Glib::path_get_dirname (filepath);
if (::access (dirpath.c_str(), W_OK) != 0) {
string txt = _("Cannot write file in: ") + dirpath;
MessageDialog msg (*this, txt, false, MESSAGE_ERROR, BUTTONS_OK, true);