*/
+#ifdef WAF_BUILD
+#include "gtk2ardour-config.h"
+#endif
+
#include <map>
#include <cerrno>
#include <sstream>
using namespace Gtkmm2ext;
using namespace Editing;
-using Glib::ustring;
+using std::string;
-ustring SoundFileBrowser::persistent_folder;
+string SoundFileBrowser::persistent_folder;
static ImportMode
string2importmode (string str)
samplerate.set_text (_("Sample rate:"));
samplerate.set_alignment (1, 0.5);
- format_text.set_max_width_chars (8);
+ preview_label.set_max_width_chars (50);
+ preview_label.set_ellipsize (Pango::ELLIPSIZE_END);
+
+ format_text.set_max_width_chars (20);
format_text.set_ellipsize (Pango::ELLIPSIZE_END);
format_text.set_alignment (0, 1);
}
bool
-SoundFileBox::setup_labels (const ustring& filename)
+SoundFileBox::setup_labels (const string& filename)
{
if (!path.empty()) {
// save existing tags
samplerate.set_name ("NewSessionSR2Label");
}
- nframes_t const nfr = _session ? _session->nominal_frame_rate() : 25;
+ framecnt_t const nfr = _session ? _session->nominal_frame_rate() : 25;
double src_coef = (double) nfr / sf_info.samplerate;
length_clock.set (sf_info.length * src_coef + 0.5, true);
return;
}
+ if (SMFSource::safe_midi_file_extension (path)) {
+ error << _("Auditioning of MIDI files is not yet supported") << endmsg;
+ return;
+ }
+
_session->cancel_audition();
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
resetting_ourselves = false;
gm = 0;
- if (ARDOUR::Profile->get_sae()) {
- chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
- chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
- }
-
#ifdef GTKOSX
+ chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
+ chooser.add_shortcut_folder_uri("file:///Library/Audio/Apple Loops");
+ chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
+
chooser.add_shortcut_folder_uri("file:///Volumes");
#endif
if (!reset_options ()) {
set_response_sensitive (RESPONSE_OK, false);
} else {
- ustring file;
+ string file;
TreeView::Selection::ListHandle_Path rows = found_list_view.get_selection()->get_selected_rows ();
if (!reset_options ()) {
set_response_sensitive (RESPONSE_OK, false);
} else {
- ustring file;
+ string file;
TreeView::Selection::ListHandle_Path rows = freesound_list_view.get_selection()->get_selected_rows ();
}
-vector<ustring>
+vector<string>
SoundFileBrowser::get_paths ()
{
- vector<ustring> results;
+ vector<string> results;
int n = notebook.get_current_page ();
if (n == 0) {
- vector<ustring> filenames = chooser.get_filenames();
- vector<ustring>::iterator i;
+ vector<string> filenames = chooser.get_filenames();
+ vector<string>::iterator i;
for (i = filenames.begin(); i != filenames.end(); ++i) {
struct stat buf;
ListPath rows = found_list_view.get_selection()->get_selected_rows ();
for (ListPath::iterator i = rows.begin() ; i != rows.end(); ++i) {
TreeIter iter = found_list->get_iter(*i);
- ustring str = (*iter)[found_list_columns.pathname];
+ string str = (*iter)[found_list_columns.pathname];
results.push_back (str);
}
ListPath rows = freesound_list_view.get_selection()->get_selected_rows ();
for (ListPath::iterator i = rows.begin() ; i != rows.end(); ++i) {
TreeIter iter = freesound_list->get_iter(*i);
- ustring str = (*iter)[freesound_list_columns.pathname];
+ string str = (*iter)[freesound_list_columns.pathname];
results.push_back (str);
}
bool
SoundFileOmega::reset_options ()
{
- vector<ustring> paths = get_paths ();
+ vector<string> paths = get_paths ();
if (paths.empty()) {
return false;
}
- ustring existing_choice;
+ string existing_choice;
vector<string> action_strings;
if (selected_track_cnt > 0) {
}
if (same_size) {
channel_strings.push_back (_("all files in one track"));
+ channel_strings.push_back (_("merge files"));
}
}
}
}
+ resetting_ourselves = true;
+
existing_choice = channel_combo.get_active_text();
set_popdown_strings (channel_combo, channel_strings);
channel_combo.set_active_text (channel_strings.front());
}
+ resetting_ourselves = false;
+
if (src_needed) {
src_combo.set_sensitive (true);
} else {
SoundFileOmega::bad_file_message()
{
MessageDialog msg (*this,
- _("One or more of the selected files\ncannot be used by Ardour"),
+ string_compose (_("One or more of the selected files\ncannot be used by %1"), PROGRAM_NAME),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
}
bool
-SoundFileOmega::check_info (const vector<ustring>& paths, bool& same_size, bool& src_needed, bool& multichannel)
+SoundFileOmega::check_info (const vector<string>& paths, bool& same_size, bool& src_needed, bool& multichannel)
{
SoundFileInfo info;
- nframes64_t sz = 0;
+ framepos_t sz = 0;
bool err = false;
string errmsg;
src_needed = false;
multichannel = false;
- for (vector<ustring>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
+ for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
if (AudioFileSource::get_soundfile_info (*i, info, errmsg)) {
if (info.channels > 1) {
}
}
- if ((nframes_t) info.samplerate != _session->frame_rate()) {
+ if (info.samplerate != _session->frame_rate()) {
src_needed = true;
}
bool
-SoundFileOmega::check_link_status (const Session* s, const vector<ustring>& paths)
+SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths)
{
sys::path path = s->session_directory().sound_path() / "linktest";
string tmpdir = path.to_string();
}
}
- for (vector<ustring>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
+ for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
char tmpc[MAXPATHLEN+1];
}
}
-ustring
+string
SoundFileChooser::get_filename ()
{
- vector<ustring> paths;
+ vector<string> paths;
paths = get_paths ();
if (paths.empty()) {
- return ustring ();
+ return string ();
}
if (!Glib::file_test (paths.front(), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
- return ustring();
+ return string();
}
return paths.front();
reset_options ();
action_combo.signal_changed().connect (sigc::mem_fun (*this, &SoundFileOmega::reset_options_noret));
+ channel_combo.signal_changed().connect (sigc::mem_fun (*this, &SoundFileOmega::reset_options_noret));
copy_files_btn.set_active (true);
/* setup disposition map */
- disposition_map.insert (pair<ustring,ImportDisposition>(_("one track per file"), ImportDistinctFiles));
- disposition_map.insert (pair<ustring,ImportDisposition>(_("one track per channel"), ImportDistinctChannels));
- disposition_map.insert (pair<ustring,ImportDisposition>(_("merge files"), ImportMergeFiles));
- disposition_map.insert (pair<ustring,ImportDisposition>(_("sequence files"), ImportSerializeFiles));
+ disposition_map.insert (pair<string,ImportDisposition>(_("one track per file"), ImportDistinctFiles));
+ disposition_map.insert (pair<string,ImportDisposition>(_("one track per channel"), ImportDistinctChannels));
+ disposition_map.insert (pair<string,ImportDisposition>(_("merge files"), ImportMergeFiles));
+ disposition_map.insert (pair<string,ImportDisposition>(_("sequence files"), ImportSerializeFiles));
- disposition_map.insert (pair<ustring,ImportDisposition>(_("one region per file"), ImportDistinctFiles));
- disposition_map.insert (pair<ustring,ImportDisposition>(_("one region per channel"), ImportDistinctChannels));
- disposition_map.insert (pair<ustring,ImportDisposition>(_("all files in one region"), ImportMergeFiles));
+ disposition_map.insert (pair<string,ImportDisposition>(_("one region per file"), ImportDistinctFiles));
+ disposition_map.insert (pair<string,ImportDisposition>(_("one region per channel"), ImportDistinctChannels));
+ disposition_map.insert (pair<string,ImportDisposition>(_("all files in one region"), ImportMergeFiles));
+ disposition_map.insert (pair<string,ImportDisposition>(_("all files in one track"), ImportMergeFiles));
chooser.signal_selection_changed().connect (sigc::mem_fun (*this, &SoundFileOmega::file_selection_changed));
ImportPosition
SoundFileOmega::get_position() const
{
- ustring str = where_combo.get_active_text();
+ string str = where_combo.get_active_text();
if (str == _("file timestamp")) {
return ImportAtTimestamp;
SrcQuality
SoundFileOmega::get_src_quality() const
{
- ustring str = where_combo.get_active_text();
+ string str = where_combo.get_active_text();
if (str == _("Best")) {
return SrcBest;
and the ImportDisposition enum that corresponds to it.
*/
- ustring str = channel_combo.get_active_text();
+ string str = channel_combo.get_active_text();
DispositionMap::const_iterator x = disposition_map.find (str);
if (x == disposition_map.end()) {