}
SoundFileBox::SoundFileBox (bool persistent)
- : _session(0),
- table (6, 2),
+ : table (6, 2),
length_clock ("sfboxLengthClock", !persistent, "EditCursorClock", false, false, true, false),
timecode_clock ("sfboxTimecodeClock", !persistent, "EditCursorClock", false, false, false, false),
main_box (false, 6),
void
SoundFileBox::set_session(Session* s)
{
- _session = s;
+ SessionHandlePtr::set_session (s);
+
+ length_clock.set_session (s);
+ timecode_clock.set_session (s);
if (!_session) {
play_btn.set_sensitive (false);
stop_btn.set_sensitive (false);
}
-
-
- length_clock.set_session (s);
- timecode_clock.set_session (s);
}
bool
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)) {
afs = boost::dynamic_pointer_cast<AudioFileSource> (srclist[0]);
string rname = region_name_from_path (afs->path(), false);
- r = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (srclist, 0,
- srclist[0]->length(srclist[0]->timeline_position()),
- rname, 0, Region::DefaultFlags, false));
+
+ PropertyList plist;
+
+ plist.add (ARDOUR::Properties::start, 0);
+ plist.add (ARDOUR::Properties::length, srclist[0]->length(srclist[0]->timeline_position()));
+ plist.add (ARDOUR::Properties::name, rname);
+ plist.add (ARDOUR::Properties::layer, 0);
+
+ r = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (srclist, plist, false));
_session->audition_region(r);
}
chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
}
+#ifdef GTKOSX
+ chooser.add_shortcut_folder_uri("file:///Volumes");
+#endif
//add the file chooser
{
chooser.set_select_multiple (true);
chooser.signal_update_preview().connect(sigc::mem_fun(*this, &SoundFileBrowser::update_preview));
chooser.signal_file_activated().connect (sigc::mem_fun (*this, &SoundFileBrowser::chooser_file_activated));
+#ifdef GTKOSX
+ /* some broken redraw behaviour - this is a bandaid */
+ chooser.signal_selection_changed().connect (mem_fun (chooser, &Widget::queue_draw));
+#endif
if (!persistent_folder.empty()) {
chooser.set_current_folder (persistent_folder);
{
ArdourDialog::set_session (s);
preview.set_session (s);
- if (s) {
+
+ if (_session) {
add_gain_meter ();
} else {
remove_gain_meter ();
{
delete gm;
- gm = new GainMeter (*session, 250);
+ gm = new GainMeter (_session, 250);
- boost::shared_ptr<Route> r = session->the_auditioner ();
+ boost::shared_ptr<Route> r = _session->the_auditioner ();
gm->set_controls (r, r->shared_peak_meter(), r->amp());
void
SoundFileBrowser::meter ()
{
- if (is_mapped () && session && gm) {
+ if (is_mapped () && _session && gm) {
gm->update_meters ();
}
}
bool same_size;
bool src_needed;
bool selection_includes_multichannel;
- bool selection_can_be_embedded_with_links = check_link_status (*session, paths);
+ bool selection_can_be_embedded_with_links = check_link_status (_session, paths);
ImportMode mode;
if (check_info (paths, same_size, src_needed, selection_includes_multichannel)) {
channel_strings.push_back (_("sequence files"));
}
if (same_size) {
- channel_strings.push_back (_("all files in one region"));
+ channel_strings.push_back (_("all files in one track"));
}
}
}
}
- if ((nframes_t) info.samplerate != session->frame_rate()) {
+ if ((nframes_t) 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<ustring>& paths)
{
- sys::path path = s.session_directory().sound_path() / "linktest";
+ sys::path path = s->session_directory().sound_path() / "linktest";
string tmpdir = path.to_string();
bool ret = false;
ArdourDialog::on_hide();
stop_metering ();
- if (session) {
- session->cancel_audition();
+ if (_session) {
+ _session->cancel_audition();
}
}
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<ustring,ImportDisposition>(_("all files in one track"), ImportMergeFiles));
chooser.signal_selection_changed().connect (sigc::mem_fun (*this, &SoundFileOmega::file_selection_changed));
SoundFileOmega::on_hide ()
{
ArdourDialog::on_hide();
- if (session) {
- session->cancel_audition();
+ if (_session) {
+ _session->cancel_audition();
}
}