mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 06:06:25 +01:00
limited history depth (no GUI yet); more work on import dialog and semantics
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2361 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6c2728f981
commit
f2a2e9c002
21 changed files with 355 additions and 180 deletions
|
|
@ -513,16 +513,14 @@ AudioStreamView::setup_rec_box ()
|
||||||
|
|
||||||
/* start a new rec box */
|
/* start a new rec box */
|
||||||
|
|
||||||
AudioTrack* at;
|
boost::shared_ptr<AudioTrack> at = _trackview.audio_track ();
|
||||||
|
|
||||||
at = _trackview.audio_track(); /* we know what it is already */
|
|
||||||
boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
|
boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
|
||||||
nframes_t frame_pos = ds->current_capture_start ();
|
nframes_t frame_pos = ds->current_capture_start ();
|
||||||
gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
|
gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
|
||||||
gdouble xend;
|
gdouble xend;
|
||||||
uint32_t fill_color;
|
uint32_t fill_color;
|
||||||
|
|
||||||
switch (_trackview.audio_track()->mode()) {
|
switch (at->mode()) {
|
||||||
case Normal:
|
case Normal:
|
||||||
xend = xstart;
|
xend = xstart;
|
||||||
fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,8 @@ IMPORTPOSITION(ImportAtPlayhead=2)
|
||||||
IMPORTPOSITION(ImportAtStart=3)
|
IMPORTPOSITION(ImportAtStart=3)
|
||||||
|
|
||||||
// if this is changed, remember to update the string table in sfdb_ui.cc
|
// if this is changed, remember to update the string table in sfdb_ui.cc
|
||||||
IMPORTCHANNEL(ImportThingPerFile=0)
|
IMPORTCHANNEL(ImportDistinctFiles=0)
|
||||||
IMPORTCHANNEL(ImportThingPerChannel=1)
|
IMPORTCHANNEL(ImportMergeFiles=1)
|
||||||
IMPORTCHANNEL(ImportThingForAll=2)
|
IMPORTCHANNEL(ImportSerializeFiles=2)
|
||||||
|
IMPORTCHANNEL(ImportDistinctChannels=3)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -965,17 +965,18 @@ class Editor : public PublicEditor
|
||||||
void external_audio_dialog ();
|
void external_audio_dialog ();
|
||||||
bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
|
bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
|
||||||
|
|
||||||
void bring_in_external_audio (Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t& pos);
|
void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
|
||||||
void do_import (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
|
void do_import (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, nframes64_t&);
|
||||||
|
|
||||||
void _do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
|
void _do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, nframes64_t&);
|
||||||
void do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
|
void do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, nframes64_t&);
|
||||||
bool idle_do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
|
bool idle_do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, nframes64_t&);
|
||||||
|
|
||||||
int import_sndfile (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::AudioTrack* track, nframes64_t& pos);
|
int import_sndfile (vector<Glib::ustring> paths, Editing::ImportMode mode, nframes64_t& pos);
|
||||||
int embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
|
int embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
|
||||||
ARDOUR::AudioTrack* track, nframes64_t& pos);
|
nframes64_t& pos);
|
||||||
int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, ARDOUR::AudioTrack* track, nframes64_t& pos, Editing::ImportMode mode);
|
int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
|
||||||
|
boost::shared_ptr<ARDOUR::AudioTrack>& existing_track, int nth);
|
||||||
|
|
||||||
/* generic interthread progress window */
|
/* generic interthread progress window */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,14 +97,6 @@ Editor::external_audio_dialog ()
|
||||||
|
|
||||||
/* lets do it */
|
/* lets do it */
|
||||||
|
|
||||||
AudioTrack* track = 0;
|
|
||||||
|
|
||||||
if (!selection->tracks.empty()) {
|
|
||||||
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(selection->tracks.front());
|
|
||||||
if (atv) {
|
|
||||||
track = atv->audio_track();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
paths = browser.get_paths ();
|
paths = browser.get_paths ();
|
||||||
|
|
||||||
ImportPosition pos = browser.get_position ();
|
ImportPosition pos = browser.get_position ();
|
||||||
|
|
@ -128,24 +120,24 @@ Editor::external_audio_dialog ()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.import.get_active()) {
|
if (browser.import.get_active()) {
|
||||||
do_import (paths, chns, mode, track, where);
|
do_import (paths, chns, mode, where);
|
||||||
} else {
|
} else {
|
||||||
do_embed (paths, chns, mode, track, where);
|
do_embed (paths, chns, mode, where);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::do_import (vector<ustring> paths, ImportChannel chns, ImportMode mode, AudioTrack* track, nframes64_t& pos)
|
Editor::do_import (vector<ustring> paths, ImportChannel chns, ImportMode mode, nframes64_t& pos)
|
||||||
{
|
{
|
||||||
switch (chns) {
|
switch (chns) {
|
||||||
case Editing::ImportThingPerFile:
|
case Editing::ImportDistinctChannels:
|
||||||
case Editing::ImportThingForAll:
|
import_status.multichan = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
import_status.multichan = true;
|
import_status.multichan = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Editing::ImportThingPerChannel:
|
|
||||||
import_status.multichan = false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interthread_progress_window == 0) {
|
if (interthread_progress_window == 0) {
|
||||||
|
|
@ -159,31 +151,31 @@ Editor::do_import (vector<ustring> paths, ImportChannel chns, ImportMode mode, A
|
||||||
to_import.clear ();
|
to_import.clear ();
|
||||||
to_import.push_back (*a);
|
to_import.push_back (*a);
|
||||||
|
|
||||||
import_sndfile (to_import, mode, track, pos);
|
import_sndfile (to_import, mode, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
interthread_progress_window->hide_all ();
|
interthread_progress_window->hide_all ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::idle_do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, AudioTrack* track, nframes64_t& pos)
|
Editor::idle_do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, nframes64_t& pos)
|
||||||
{
|
{
|
||||||
_do_embed (paths, chns, mode, track, pos);
|
_do_embed (paths, chns, mode, pos);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, AudioTrack* track, nframes64_t& pos)
|
Editor::do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, nframes64_t& pos)
|
||||||
{
|
{
|
||||||
#ifdef GTKOSX
|
#ifdef GTKOSX
|
||||||
Glib::signal_idle().connect (bind (mem_fun (*this, &Editor::idle_do_embed), paths, chns, mode, track, pos));
|
Glib::signal_idle().connect (bind (mem_fun (*this, &Editor::idle_do_embed), paths, chns, mode, pos));
|
||||||
#else
|
#else
|
||||||
_do_embed (paths, chns, mode, track, pos);
|
_do_embed (paths, chns, mode, pos);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::_do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, AudioTrack* track, nframes64_t& pos)
|
Editor::_do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, nframes64_t& pos)
|
||||||
{
|
{
|
||||||
bool multiple_files = paths.size() > 1;
|
bool multiple_files = paths.size() > 1;
|
||||||
bool check_sample_rate = true;
|
bool check_sample_rate = true;
|
||||||
|
|
@ -192,21 +184,22 @@ Editor::_do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, A
|
||||||
|
|
||||||
|
|
||||||
switch (chns) {
|
switch (chns) {
|
||||||
case Editing::ImportThingPerFile:
|
case Editing::ImportDistinctFiles:
|
||||||
case Editing::ImportThingPerChannel:
|
case Editing::ImportDistinctChannels:
|
||||||
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) {
|
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) {
|
||||||
|
|
||||||
to_embed.clear ();
|
to_embed.clear ();
|
||||||
to_embed.push_back (*a);
|
to_embed.push_back (*a);
|
||||||
|
|
||||||
if (embed_sndfile (to_embed, chns, multiple_files, check_sample_rate, mode, track, pos) < -1) {
|
if (embed_sndfile (to_embed, chns, multiple_files, check_sample_rate, mode, pos) < -1) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Editing::ImportThingForAll:
|
case Editing::ImportSerializeFiles:
|
||||||
if (embed_sndfile (paths, chns, multiple_files, check_sample_rate, mode, track, pos) < -1) {
|
case Editing::ImportMergeFiles:
|
||||||
|
if (embed_sndfile (paths, chns, multiple_files, check_sample_rate, mode, pos) < -1) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -221,7 +214,7 @@ Editor::_do_embed (vector<ustring> paths, ImportChannel chns, ImportMode mode, A
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Editor::import_sndfile (vector<ustring> paths, ImportMode mode, AudioTrack* track, nframes64_t& pos)
|
Editor::import_sndfile (vector<ustring> paths, ImportMode mode, nframes64_t& pos)
|
||||||
{
|
{
|
||||||
WindowTitle title = string_compose (_("importing %1"), paths.front());
|
WindowTitle title = string_compose (_("importing %1"), paths.front());
|
||||||
|
|
||||||
|
|
@ -261,10 +254,12 @@ Editor::import_sndfile (vector<ustring> paths, ImportMode mode, AudioTrack* trac
|
||||||
interthread_progress_connection.disconnect ();
|
interthread_progress_connection.disconnect ();
|
||||||
|
|
||||||
/* import thread finished - see if we should build a new track */
|
/* import thread finished - see if we should build a new track */
|
||||||
|
|
||||||
|
boost::shared_ptr<AudioTrack> track;
|
||||||
|
|
||||||
if (!import_status.new_regions.empty()) {
|
if (!import_status.new_regions.empty()) {
|
||||||
boost::shared_ptr<AudioRegion> region (import_status.new_regions.front());
|
boost::shared_ptr<AudioRegion> region (import_status.new_regions.front());
|
||||||
finish_bringing_in_audio (region, region->n_channels(), region->n_channels(), track, pos, mode);
|
finish_bringing_in_audio (region, region->n_channels(), region->n_channels(), pos, mode, track, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
track_canvas.get_window()->set_cursor (*current_canvas_cursor);
|
track_canvas.get_window()->set_cursor (*current_canvas_cursor);
|
||||||
|
|
@ -272,9 +267,9 @@ Editor::import_sndfile (vector<ustring> paths, ImportMode mode, AudioTrack* trac
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns, bool multiple_files, bool& check_sample_rate, ImportMode mode,
|
Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns, bool multiple_files, bool& check_sample_rate, ImportMode mode, nframes64_t& pos)
|
||||||
AudioTrack* track, nframes64_t& pos)
|
|
||||||
{
|
{
|
||||||
|
boost::shared_ptr<AudioTrack> track;
|
||||||
boost::shared_ptr<AudioFileSource> source;
|
boost::shared_ptr<AudioFileSource> source;
|
||||||
SourceList sources;
|
SourceList sources;
|
||||||
boost::shared_ptr<AudioRegion> region;
|
boost::shared_ptr<AudioRegion> region;
|
||||||
|
|
@ -437,7 +432,7 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chns == Editing::ImportThingPerFile || chns == Editing::ImportThingForAll) {
|
if (chns == Editing::ImportMergeFiles) {
|
||||||
|
|
||||||
/* take all the sources we have and package them up as a region */
|
/* take all the sources we have and package them up as a region */
|
||||||
|
|
||||||
|
|
@ -452,9 +447,9 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns,
|
||||||
output_chan = input_chan;
|
output_chan = input_chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_bringing_in_audio (region, input_chan, output_chan, track, pos, mode);
|
finish_bringing_in_audio (region, input_chan, output_chan, pos, mode, track, 0);
|
||||||
|
|
||||||
} else {
|
} else { // SerializeFiles, DistinctFiles, DistinctChannels
|
||||||
|
|
||||||
/* take each source and create a region for each one */
|
/* take each source and create a region for each one */
|
||||||
|
|
||||||
|
|
@ -462,8 +457,9 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns,
|
||||||
SourceList::iterator x;
|
SourceList::iterator x;
|
||||||
vector<Glib::ustring>::iterator p = paths.begin();
|
vector<Glib::ustring>::iterator p = paths.begin();
|
||||||
vector<Glib::ustring>::iterator next_path;
|
vector<Glib::ustring>::iterator next_path;
|
||||||
|
int nth;
|
||||||
for (x = sources.begin(); x != sources.end(); ++x) {
|
|
||||||
|
for (nth = 0, x = sources.begin(); x != sources.end(); ++x, ++nth) {
|
||||||
|
|
||||||
just_one.clear ();
|
just_one.clear ();
|
||||||
just_one.push_back (*x);
|
just_one.push_back (*x);
|
||||||
|
|
@ -479,7 +475,16 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns,
|
||||||
output_chan = input_chan;
|
output_chan = input_chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_bringing_in_audio (region, 1, output_chan, track, pos, mode);
|
finish_bringing_in_audio (region, 1, output_chan, pos, mode, track, nth);
|
||||||
|
|
||||||
|
if (chns == ImportSerializeFiles) {
|
||||||
|
pos += region->length();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chns == ImportDistinctChannels || chns == ImportDistinctFiles) {
|
||||||
|
/* make a new track for the next region */
|
||||||
|
track.reset ();
|
||||||
|
}
|
||||||
|
|
||||||
/* don't run out of paths */
|
/* don't run out of paths */
|
||||||
|
|
||||||
|
|
@ -499,39 +504,56 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel chns,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Editor::finish_bringing_in_audio (boost::shared_ptr<AudioRegion> region, uint32_t in_chans, uint32_t out_chans, AudioTrack* track, nframes64_t& pos, ImportMode mode)
|
Editor::finish_bringing_in_audio (boost::shared_ptr<AudioRegion> region, uint32_t in_chans, uint32_t out_chans, nframes64_t& pos,
|
||||||
|
ImportMode mode, boost::shared_ptr<AudioTrack>& existing_track, int nth)
|
||||||
{
|
{
|
||||||
|
boost::shared_ptr<AudioTrack> track;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case ImportAsRegion:
|
case ImportAsRegion:
|
||||||
/* relax, its been done */
|
/* relax, its been done */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ImportToTrack:
|
case ImportToTrack:
|
||||||
if (track) {
|
{
|
||||||
boost::shared_ptr<Playlist> playlist = track->diskstream()->playlist();
|
if (selection->tracks.empty()) {
|
||||||
|
return -1;
|
||||||
boost::shared_ptr<AudioRegion> copy (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (region)));
|
}
|
||||||
begin_reversible_command (_("insert sndfile"));
|
|
||||||
XMLNode &before = playlist->get_state();
|
|
||||||
playlist->add_region (copy, pos);
|
|
||||||
session->add_command (new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
|
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
pos += region->length();
|
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(selection->tracks.front());
|
||||||
|
|
||||||
|
if (!atv) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
track = atv->audio_track();
|
||||||
|
|
||||||
case ImportAsTrack:
|
boost::shared_ptr<Playlist> playlist = track->diskstream()->playlist();
|
||||||
{
|
boost::shared_ptr<AudioRegion> copy (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (region)));
|
||||||
list<boost::shared_ptr<AudioTrack> > at (session->new_audio_track (in_chans, out_chans, Normal, 1));
|
begin_reversible_command (_("insert sndfile"));
|
||||||
if (!at.empty()) {
|
XMLNode &before = playlist->get_state();
|
||||||
boost::shared_ptr<AudioRegion> copy (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (region)));
|
playlist->add_region (copy, pos);
|
||||||
at.front()->set_name (basename_nosuffix (copy->name()), this);
|
session->add_command (new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
|
||||||
at.front()->diskstream()->playlist()->add_region (copy, pos);
|
commit_reversible_command ();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ImportAsTrack:
|
||||||
|
{
|
||||||
|
if (!existing_track) {
|
||||||
|
list<boost::shared_ptr<AudioTrack> > at (session->new_audio_track (in_chans, out_chans, Normal, 1));
|
||||||
|
if (at.empty()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
existing_track = at.front();
|
||||||
|
existing_track->set_name (basename_nosuffix (region->name()), this);
|
||||||
|
}
|
||||||
|
boost::shared_ptr<AudioRegion> copy (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (region)));
|
||||||
|
existing_track->diskstream()->playlist()->add_region (copy, pos);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
case ImportAsTapeTrack:
|
case ImportAsTapeTrack:
|
||||||
{
|
{
|
||||||
list<boost::shared_ptr<AudioTrack> > at (session->new_audio_track (in_chans, out_chans, Destructive));
|
list<boost::shared_ptr<AudioTrack> > at (session->new_audio_track (in_chans, out_chans, Destructive));
|
||||||
|
|
|
||||||
|
|
@ -465,14 +465,15 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
|
||||||
|
|
||||||
frame = 0;
|
frame = 0;
|
||||||
|
|
||||||
do_embed (paths, Editing::ImportThingPerFile, ImportAsTrack, 0, frame);
|
do_embed (paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
|
||||||
|
|
||||||
} else if ((tv = dynamic_cast<AudioTimeAxisView*>(tvp)) != 0) {
|
} else if ((tv = dynamic_cast<AudioTimeAxisView*>(tvp)) != 0) {
|
||||||
|
|
||||||
/* check that its an audio track, not a bus */
|
/* check that its an audio track, not a bus */
|
||||||
|
|
||||||
if (tv->get_diskstream()) {
|
if (tv->get_diskstream()) {
|
||||||
do_embed (paths, Editing::ImportThingPerFile, ImportToTrack, tv->audio_track(), frame);
|
// XXX NEED A WAY TO DROP INTO THIS SPECIFIC TRACK: tv->audio_track()
|
||||||
|
do_embed (paths, Editing::ImportDistinctFiles, ImportToTrack, frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -621,7 +621,7 @@ Editor::region_list_display_drag_data_received (const RefPtr<Gdk::DragContext>&
|
||||||
|
|
||||||
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
|
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
|
||||||
nframes64_t pos = 0;
|
nframes64_t pos = 0;
|
||||||
do_embed (paths, Editing::ImportThingPerFile, ImportAsRegion, 0, pos);
|
do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos);
|
||||||
context->drag_finish (true, false, time);
|
context->drag_finish (true, false, time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt
|
||||||
|
|
||||||
rec_enable_button->set_name ("MixerRecordEnableButton");
|
rec_enable_button->set_name ("MixerRecordEnableButton");
|
||||||
|
|
||||||
AudioTrack* at = audio_track();
|
boost::shared_ptr<AudioTrack> at = audio_track();
|
||||||
|
|
||||||
at->FreezeChange.connect (mem_fun(*this, &MixerStrip::map_frozen));
|
at->FreezeChange.connect (mem_fun(*this, &MixerStrip::map_frozen));
|
||||||
|
|
||||||
|
|
@ -1130,7 +1130,7 @@ MixerStrip::map_frozen ()
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (mem_fun(*this, &MixerStrip::map_frozen));
|
ENSURE_GUI_THREAD (mem_fun(*this, &MixerStrip::map_frozen));
|
||||||
|
|
||||||
AudioTrack* at = audio_track();
|
boost::shared_ptr<AudioTrack> at = audio_track();
|
||||||
|
|
||||||
if (at) {
|
if (at) {
|
||||||
switch (at->freeze_state()) {
|
switch (at->freeze_state()) {
|
||||||
|
|
|
||||||
|
|
@ -509,7 +509,7 @@ Mixer_UI::set_all_audio_visibility (int tracks, bool yn)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioTrack* at = strip->audio_track();
|
boost::shared_ptr<AudioTrack> at = strip->audio_track();
|
||||||
|
|
||||||
switch (tracks) {
|
switch (tracks) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ PlaylistSelector::selection_changed ()
|
||||||
|
|
||||||
if ((playlist = ((*iter)[columns.playlist])) != 0) {
|
if ((playlist = ((*iter)[columns.playlist])) != 0) {
|
||||||
|
|
||||||
AudioTrack* at;
|
boost::shared_ptr<AudioTrack> at;
|
||||||
boost::shared_ptr<AudioPlaylist> apl;
|
boost::shared_ptr<AudioPlaylist> apl;
|
||||||
|
|
||||||
if ((at = rui->audio_track()) == 0) {
|
if ((at = rui->audio_track()) == 0) {
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ RouteTimeAxisView::set_track_mode (TrackMode mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::_set_track_mode (Track* track, TrackMode mode, RadioMenuItem* reset_item)
|
RouteTimeAxisView::_set_track_mode (boost::shared_ptr<Track> track, TrackMode mode, RadioMenuItem* reset_item)
|
||||||
{
|
{
|
||||||
bool needs_bounce;
|
bool needs_bounce;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ protected:
|
||||||
ArdourCanvas::SimpleRect* timestretch_rect;
|
ArdourCanvas::SimpleRect* timestretch_rect;
|
||||||
|
|
||||||
void set_track_mode (ARDOUR::TrackMode);
|
void set_track_mode (ARDOUR::TrackMode);
|
||||||
void _set_track_mode (ARDOUR::Track* track, ARDOUR::TrackMode mode, Gtk::RadioMenuItem* reset_item);
|
void _set_track_mode (boost::shared_ptr<ARDOUR::Track> track, ARDOUR::TrackMode mode, Gtk::RadioMenuItem* reset_item);
|
||||||
void track_mode_changed ();
|
void track_mode_changed ();
|
||||||
|
|
||||||
list<RedirectAutomationInfo*> redirect_automation;
|
list<RedirectAutomationInfo*> redirect_automation;
|
||||||
|
|
|
||||||
|
|
@ -968,25 +968,25 @@ RouteUI::disconnect_output ()
|
||||||
bool
|
bool
|
||||||
RouteUI::is_track () const
|
RouteUI::is_track () const
|
||||||
{
|
{
|
||||||
return dynamic_cast<Track*>(_route.get()) != 0;
|
return boost::dynamic_pointer_cast<Track>(_route) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Track*
|
boost::shared_ptr<Track>
|
||||||
RouteUI::track() const
|
RouteUI::track() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<Track*>(_route.get());
|
return boost::dynamic_pointer_cast<Track>(_route);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
RouteUI::is_audio_track () const
|
RouteUI::is_audio_track () const
|
||||||
{
|
{
|
||||||
return dynamic_cast<AudioTrack*>(_route.get()) != 0;
|
return boost::dynamic_pointer_cast<AudioTrack>(_route) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioTrack*
|
boost::shared_ptr<AudioTrack>
|
||||||
RouteUI::audio_track() const
|
RouteUI::audio_track() const
|
||||||
{
|
{
|
||||||
return dynamic_cast<AudioTrack*>(_route.get());
|
return boost::dynamic_pointer_cast<AudioTrack>(_route);
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Diskstream>
|
boost::shared_ptr<Diskstream>
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,9 @@ class RouteUI : public virtual AxisView
|
||||||
bool is_track() const;
|
bool is_track() const;
|
||||||
bool is_audio_track() const;
|
bool is_audio_track() const;
|
||||||
|
|
||||||
boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
|
boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
|
||||||
|
boost::shared_ptr<ARDOUR::Track> track() const;
|
||||||
// FIXME: make these return shared_ptr
|
boost::shared_ptr<ARDOUR::AudioTrack> audio_track() const;
|
||||||
ARDOUR::Track* track() const;
|
|
||||||
ARDOUR::AudioTrack* audio_track() const;
|
|
||||||
|
|
||||||
boost::shared_ptr<ARDOUR::Diskstream> get_diskstream() const;
|
boost::shared_ptr<ARDOUR::Diskstream> get_diskstream() const;
|
||||||
|
|
||||||
string name() const;
|
string name() const;
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,6 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
|
||||||
found_list_view (found_list),
|
found_list_view (found_list),
|
||||||
import (rgroup2, _("Copy to Ardour-native files")),
|
import (rgroup2, _("Copy to Ardour-native files")),
|
||||||
embed (rgroup2, _("Use file without copying")),
|
embed (rgroup2, _("Use file without copying")),
|
||||||
mode (ImportAsTrack),
|
|
||||||
found_search_btn (_("Search")),
|
found_search_btn (_("Search")),
|
||||||
selected_track_cnt (selected_tracks)
|
selected_track_cnt (selected_tracks)
|
||||||
{
|
{
|
||||||
|
|
@ -303,8 +302,9 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
|
||||||
VBox* vbox;
|
VBox* vbox;
|
||||||
HBox* hbox;
|
HBox* hbox;
|
||||||
HBox* hpacker;
|
HBox* hpacker;
|
||||||
|
|
||||||
set_session (s);
|
set_session (s);
|
||||||
|
resetting_ourselves = false;
|
||||||
|
|
||||||
vpacker = manage (new VBox);
|
vpacker = manage (new VBox);
|
||||||
vpacker->pack_start (preview, true, true);
|
vpacker->pack_start (preview, true, true);
|
||||||
|
|
@ -320,6 +320,25 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
|
||||||
|
|
||||||
options.set_spacing (12);
|
options.set_spacing (12);
|
||||||
|
|
||||||
|
vector<string> action_strings;
|
||||||
|
vector<string> where_strings;
|
||||||
|
|
||||||
|
action_strings.push_back (_("as new tracks"));
|
||||||
|
if (selected_track_cnt > 0) {
|
||||||
|
action_strings.push_back (_("to selected tracks"));
|
||||||
|
}
|
||||||
|
action_strings.push_back (_("to the region list"));
|
||||||
|
action_strings.push_back (_("as new tape tracks"));
|
||||||
|
set_popdown_strings (action_combo, action_strings);
|
||||||
|
action_combo.set_active_text (action_strings.front());
|
||||||
|
|
||||||
|
where_strings.push_back (_("use file timestamp"));
|
||||||
|
where_strings.push_back (_("at edit cursor"));
|
||||||
|
where_strings.push_back (_("at playhead"));
|
||||||
|
where_strings.push_back (_("at session start"));
|
||||||
|
set_popdown_strings (where_combo, where_strings);
|
||||||
|
where_combo.set_active_text (where_strings.front());
|
||||||
|
|
||||||
Label* l = manage (new Label);
|
Label* l = manage (new Label);
|
||||||
l->set_text (_("Add files:"));
|
l->set_text (_("Add files:"));
|
||||||
|
|
||||||
|
|
@ -358,6 +377,8 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
|
||||||
options.pack_start (*vbox, false, false);
|
options.pack_start (*vbox, false, false);
|
||||||
|
|
||||||
reset_options ();
|
reset_options ();
|
||||||
|
|
||||||
|
action_combo.signal_changed().connect (mem_fun (*this, &SoundFileBrowser::reset_options_noret));
|
||||||
|
|
||||||
block_four.pack_start (import, false, false);
|
block_four.pack_start (import, false, false);
|
||||||
block_four.pack_start (embed, false, false);
|
block_four.pack_start (embed, false, false);
|
||||||
|
|
@ -394,6 +415,7 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
|
||||||
chooser.add_filter (matchall_filter);
|
chooser.add_filter (matchall_filter);
|
||||||
chooser.set_select_multiple (true);
|
chooser.set_select_multiple (true);
|
||||||
chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview));
|
chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview));
|
||||||
|
chooser.signal_selection_changed().connect (mem_fun (*this, &SoundFileBrowser::file_selection_changed));
|
||||||
chooser.signal_file_activated().connect (mem_fun (*this, &SoundFileBrowser::chooser_file_activated));
|
chooser.signal_file_activated().connect (mem_fun (*this, &SoundFileBrowser::chooser_file_activated));
|
||||||
|
|
||||||
if (!persistent_folder.empty()) {
|
if (!persistent_folder.empty()) {
|
||||||
|
|
@ -405,10 +427,19 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
|
||||||
found_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
|
found_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
|
||||||
found_entry.signal_activate().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
|
found_entry.signal_activate().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked));
|
||||||
|
|
||||||
add_button (Stock::OK, RESPONSE_OK);
|
|
||||||
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
||||||
|
add_button (Stock::OK, RESPONSE_OK);
|
||||||
|
|
||||||
|
/* setup disposition map */
|
||||||
|
|
||||||
set_response_sensitive (RESPONSE_OK, false);
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("one track per file"), ImportDistinctFiles));
|
||||||
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("one track per channel"), ImportDistinctChannels));
|
||||||
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("merge files"), ImportMergeFiles));
|
||||||
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("sequence files"), ImportSerializeFiles));
|
||||||
|
|
||||||
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("one region per file"), ImportDistinctFiles));
|
||||||
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("one region per channel"), ImportDistinctChannels));
|
||||||
|
disposition_map.insert (pair<Glib::ustring,ImportChannel>(_("all files in one region"), ImportMergeFiles));
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundFileBrowser::~SoundFileBrowser ()
|
SoundFileBrowser::~SoundFileBrowser ()
|
||||||
|
|
@ -416,6 +447,24 @@ SoundFileBrowser::~SoundFileBrowser ()
|
||||||
persistent_folder = chooser.get_current_folder();
|
persistent_folder = chooser.get_current_folder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SoundFileBrowser::file_selection_changed ()
|
||||||
|
{
|
||||||
|
if (resetting_ourselves) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reset_options ()) {
|
||||||
|
set_response_sensitive (RESPONSE_OK, false);
|
||||||
|
} else {
|
||||||
|
if (chooser.get_filenames().size() > 0) {
|
||||||
|
set_response_sensitive (RESPONSE_OK, true);
|
||||||
|
} else {
|
||||||
|
set_response_sensitive (RESPONSE_OK, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SoundFileBrowser::chooser_file_activated ()
|
SoundFileBrowser::chooser_file_activated ()
|
||||||
{
|
{
|
||||||
|
|
@ -438,32 +487,36 @@ SoundFileBrowser::set_session (Session* s)
|
||||||
bool
|
bool
|
||||||
SoundFileBrowser::on_custom (const FileFilter::Info& filter_info)
|
SoundFileBrowser::on_custom (const FileFilter::Info& filter_info)
|
||||||
{
|
{
|
||||||
return AudioFileSource::safe_file_extension(filter_info.filename);
|
return AudioFileSource::safe_file_extension (filter_info.filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SoundFileBrowser::update_preview ()
|
SoundFileBrowser::update_preview ()
|
||||||
{
|
{
|
||||||
preview.setup_labels (chooser.get_filename());
|
preview.setup_labels (chooser.get_filename());
|
||||||
set_response_sensitive (RESPONSE_OK, true);
|
|
||||||
reset_options ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SoundFileBrowser::found_list_view_selected ()
|
SoundFileBrowser::found_list_view_selected ()
|
||||||
{
|
{
|
||||||
Glib::ustring file;
|
if (!reset_options ()) {
|
||||||
|
set_response_sensitive (RESPONSE_OK, false);
|
||||||
TreeView::Selection::ListHandle_Path rows = found_list_view.get_selection()->get_selected_rows ();
|
} else {
|
||||||
|
Glib::ustring file;
|
||||||
if (!rows.empty()) {
|
|
||||||
TreeIter iter = found_list->get_iter(*rows.begin());
|
TreeView::Selection::ListHandle_Path rows = found_list_view.get_selection()->get_selected_rows ();
|
||||||
file = (*iter)[found_list_columns.pathname];
|
|
||||||
chooser.set_filename (file);
|
if (!rows.empty()) {
|
||||||
|
TreeIter iter = found_list->get_iter(*rows.begin());
|
||||||
|
file = (*iter)[found_list_columns.pathname];
|
||||||
|
chooser.set_filename (file);
|
||||||
|
set_response_sensitive (RESPONSE_OK, true);
|
||||||
|
} else {
|
||||||
|
set_response_sensitive (RESPONSE_OK, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
preview.setup_labels (file);
|
||||||
}
|
}
|
||||||
preview.setup_labels (file);
|
|
||||||
set_response_sensitive (RESPONSE_OK, true);
|
|
||||||
reset_options ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -524,95 +577,155 @@ SoundFileBrowser::get_paths ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
SoundFileBrowser::reset_options_noret ()
|
||||||
|
{
|
||||||
|
(void) reset_options ();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
SoundFileBrowser::reset_options ()
|
SoundFileBrowser::reset_options ()
|
||||||
{
|
{
|
||||||
vector<Glib::ustring> paths = get_paths ();
|
vector<Glib::ustring> paths = get_paths ();
|
||||||
bool selection_includes_multichannel = check_multichannel_status (paths);
|
|
||||||
|
if (paths.empty()) {
|
||||||
|
|
||||||
|
channel_combo.set_sensitive (false);
|
||||||
|
action_combo.set_sensitive (false);
|
||||||
|
where_combo.set_sensitive (false);
|
||||||
|
import.set_sensitive (false);
|
||||||
|
embed.set_sensitive (false);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
channel_combo.set_sensitive (true);
|
||||||
|
action_combo.set_sensitive (true);
|
||||||
|
where_combo.set_sensitive (true);
|
||||||
|
import.set_sensitive (true);
|
||||||
|
embed.set_sensitive (true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool same_size;
|
||||||
|
bool err;
|
||||||
|
bool selection_includes_multichannel = check_multichannel_status (paths, same_size, err);
|
||||||
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 (err) {
|
||||||
|
Glib::signal_idle().connect (mem_fun (*this, &SoundFileBrowser::bad_file_message));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((mode = get_mode()) == ImportAsRegion) {
|
||||||
|
where_combo.set_sensitive (false);
|
||||||
|
} else {
|
||||||
|
where_combo.set_sensitive (true);
|
||||||
|
}
|
||||||
|
|
||||||
vector<string> action_strings;
|
|
||||||
vector<string> where_strings;
|
|
||||||
vector<string> channel_strings;
|
vector<string> channel_strings;
|
||||||
|
|
||||||
action_strings.push_back (_("as new tracks"));
|
|
||||||
if (selected_track_cnt > 0) {
|
|
||||||
action_strings.push_back (_("to selected tracks"));
|
|
||||||
}
|
|
||||||
action_strings.push_back (_("to the region list"));
|
|
||||||
action_strings.push_back (_("as new tape tracks"));
|
|
||||||
|
|
||||||
|
|
||||||
set_popdown_strings (action_combo, action_strings);
|
|
||||||
action_combo.set_active_text (action_strings.front());
|
|
||||||
|
|
||||||
where_strings.push_back (_("use file timestamp"));
|
|
||||||
where_strings.push_back (_("at edit cursor"));
|
|
||||||
where_strings.push_back (_("at playhead"));
|
|
||||||
where_strings.push_back (_("at session start"));
|
|
||||||
|
|
||||||
set_popdown_strings (where_combo, where_strings);
|
if (mode == ImportAsTrack || mode == ImportAsTapeTrack || mode == ImportToTrack) {
|
||||||
where_combo.set_active_text (where_strings.front());
|
channel_strings.push_back (_("one track per file"));
|
||||||
|
|
||||||
if (mode == ImportAsTrack) {
|
|
||||||
channel_strings.push_back (_("one file per track"));
|
|
||||||
|
|
||||||
if (selection_includes_multichannel) {
|
if (selection_includes_multichannel) {
|
||||||
channel_strings.push_back (_("one channel per track"));
|
channel_strings.push_back (_("one track per channel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paths.size() > 1) {
|
if (paths.size() > 1) {
|
||||||
channel_strings.push_back (_("all files in one track"));
|
/* tape tracks are a single region per track, so we cannot
|
||||||
|
sequence multiple files.
|
||||||
|
*/
|
||||||
|
if (mode != ImportAsTapeTrack) {
|
||||||
|
channel_strings.push_back (_("sequence files"));
|
||||||
|
}
|
||||||
|
if (same_size) {
|
||||||
|
channel_strings.push_back (_("all files in one track"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
channel_combo.show();
|
|
||||||
} else {
|
} else {
|
||||||
channel_combo.hide();
|
channel_strings.push_back (_("one region per file"));
|
||||||
|
|
||||||
|
if (selection_includes_multichannel) {
|
||||||
|
channel_strings.push_back (_("one region per channel"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paths.size() > 1) {
|
||||||
|
if (same_size) {
|
||||||
|
channel_strings.push_back (_("all files in one region"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_popdown_strings (channel_combo, channel_strings);
|
set_popdown_strings (channel_combo, channel_strings);
|
||||||
channel_combo.set_active_text (channel_strings.front());
|
channel_combo.set_active_text (channel_strings.front());
|
||||||
|
|
||||||
if (Profile->get_sae()) {
|
if (Profile->get_sae()) {
|
||||||
if (selection_can_be_embedded_with_links) {
|
if (selection_can_be_embedded_with_links) {
|
||||||
block_four.show ();
|
embed.set_sensitive (true);
|
||||||
} else {
|
} else {
|
||||||
block_four.hide ();
|
embed.set_sensitive (false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
block_four.show ();
|
embed.set_sensitive (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mode == ImportAsTrack || mode == ImportAsTapeTrack) && paths.size() == 2) {
|
return true;
|
||||||
merge_stereo.set_sensitive (true);
|
|
||||||
} else {
|
|
||||||
merge_stereo.set_sensitive (false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selection_includes_multichannel) {
|
|
||||||
split_files.set_sensitive (true);
|
|
||||||
} else {
|
|
||||||
split_files.set_sensitive (false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SoundFileBrowser::check_multichannel_status (const vector<Glib::ustring>& paths)
|
SoundFileBrowser::bad_file_message()
|
||||||
|
{
|
||||||
|
MessageDialog msg (*this,
|
||||||
|
_("One or more of the selected files\ncannot be used by Ardour"),
|
||||||
|
true,
|
||||||
|
Gtk::MESSAGE_INFO,
|
||||||
|
Gtk::BUTTONS_OK);
|
||||||
|
msg.run ();
|
||||||
|
resetting_ourselves = true;
|
||||||
|
chooser.unselect_uri (chooser.get_preview_uri());
|
||||||
|
resetting_ourselves = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SoundFileBrowser::check_multichannel_status (const vector<Glib::ustring>& paths, bool& same_size, bool& err)
|
||||||
{
|
{
|
||||||
SNDFILE* sf;
|
SNDFILE* sf;
|
||||||
SF_INFO info;
|
SF_INFO info;
|
||||||
|
nframes64_t sz = 0;
|
||||||
|
bool some_mult = false;
|
||||||
|
|
||||||
|
same_size = true;
|
||||||
|
err = false;
|
||||||
|
|
||||||
for (vector<Glib::ustring>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
|
for (vector<Glib::ustring>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
|
||||||
|
|
||||||
info.format = 0; // libsndfile says to clear this before sf_open().
|
info.format = 0; // libsndfile says to clear this before sf_open().
|
||||||
|
|
||||||
if ((sf = sf_open ((char*) (*i).c_str(), SFM_READ, &info)) != 0) {
|
if ((sf = sf_open ((char*) (*i).c_str(), SFM_READ, &info)) != 0) {
|
||||||
sf_close (sf);
|
sf_close (sf);
|
||||||
|
|
||||||
if (info.channels > 1) {
|
if (info.channels > 1) {
|
||||||
return true;
|
some_mult = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sz == 0) {
|
||||||
|
sz = info.frames;
|
||||||
|
} else {
|
||||||
|
if (sz != info.frames) {
|
||||||
|
same_size = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
err = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return some_mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -720,13 +833,18 @@ SoundFileBrowser::get_position() const
|
||||||
ImportChannel
|
ImportChannel
|
||||||
SoundFileBrowser::get_channel_disposition () const
|
SoundFileBrowser::get_channel_disposition () const
|
||||||
{
|
{
|
||||||
Glib::ustring str = channel_combo.get_active_text();
|
/* we use a map here because the channel combo can contain different strings
|
||||||
|
depending on the state of the other combos. the map contains all possible strings
|
||||||
|
and the ImportDisposition enum that corresponds to it.
|
||||||
|
*/
|
||||||
|
|
||||||
if (str == _("one file per track")) {
|
Glib::ustring str = channel_combo.get_active_text();
|
||||||
return ImportThingPerFile;
|
DispositionMap::const_iterator x = disposition_map.find (str);
|
||||||
} else if (str == _("one channel per track")) {
|
|
||||||
return ImportThingPerChannel;
|
if (x == disposition_map.end()) {
|
||||||
} else {
|
fatal << string_compose (_("programming error: %1"), "unknown string for import disposition") << endmsg;
|
||||||
return ImportThingForAll;
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return x->second;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
#include <glibmm/ustring.h>
|
#include <glibmm/ustring.h>
|
||||||
|
|
||||||
#include <sigc++/signal.h>
|
#include <sigc++/signal.h>
|
||||||
|
|
@ -117,9 +118,6 @@ class SoundFileBrowser : public ArdourDialog
|
||||||
Gtk::FileChooserWidget chooser;
|
Gtk::FileChooserWidget chooser;
|
||||||
Gtk::TreeView found_list_view;
|
Gtk::TreeView found_list_view;
|
||||||
|
|
||||||
Gtk::CheckButton split_files;
|
|
||||||
Gtk::CheckButton merge_stereo;
|
|
||||||
|
|
||||||
Gtk::ComboBoxText action_combo;
|
Gtk::ComboBoxText action_combo;
|
||||||
Gtk::ComboBoxText where_combo;
|
Gtk::ComboBoxText where_combo;
|
||||||
Gtk::ComboBoxText channel_combo;
|
Gtk::ComboBoxText channel_combo;
|
||||||
|
|
@ -132,7 +130,6 @@ class SoundFileBrowser : public ArdourDialog
|
||||||
Editing::ImportChannel get_channel_disposition() const;
|
Editing::ImportChannel get_channel_disposition() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Editing::ImportMode mode;
|
|
||||||
Gtk::FileFilter custom_filter;
|
Gtk::FileFilter custom_filter;
|
||||||
Gtk::FileFilter matchall_filter;
|
Gtk::FileFilter matchall_filter;
|
||||||
SoundFileBox preview;
|
SoundFileBox preview;
|
||||||
|
|
@ -151,18 +148,26 @@ class SoundFileBrowser : public ArdourDialog
|
||||||
void chooser_file_activated ();
|
void chooser_file_activated ();
|
||||||
|
|
||||||
bool on_custom (const Gtk::FileFilter::Info& filter_info);
|
bool on_custom (const Gtk::FileFilter::Info& filter_info);
|
||||||
|
void file_selection_changed ();
|
||||||
|
|
||||||
int selected_track_cnt;
|
int selected_track_cnt;
|
||||||
|
|
||||||
|
typedef std::map<Glib::ustring,Editing::ImportChannel> DispositionMap;
|
||||||
|
DispositionMap disposition_map;
|
||||||
|
|
||||||
|
bool resetting_ourselves;
|
||||||
|
|
||||||
Gtk::HBox options;
|
Gtk::HBox options;
|
||||||
Gtk::VBox block_two;
|
Gtk::VBox block_two;
|
||||||
Gtk::VBox block_three;
|
Gtk::VBox block_three;
|
||||||
Gtk::VBox block_four;
|
Gtk::VBox block_four;
|
||||||
|
|
||||||
static bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
|
static bool check_multichannel_status (const std::vector<Glib::ustring>& paths, bool& same_size, bool& err);
|
||||||
static bool check_link_status (const ARDOUR::Session&, const std::vector<Glib::ustring>& paths);
|
static bool check_link_status (const ARDOUR::Session&, const std::vector<Glib::ustring>& paths);
|
||||||
|
|
||||||
void reset_options ();
|
bool reset_options ();
|
||||||
|
void reset_options_noret ();
|
||||||
|
bool bad_file_message ();
|
||||||
};
|
};
|
||||||
|
|
||||||
class SoundFileChooser : public SoundFileBrowser
|
class SoundFileChooser : public SoundFileBrowser
|
||||||
|
|
|
||||||
|
|
@ -247,9 +247,9 @@ StreamView::playlist_changed (boost::weak_ptr<Diskstream> wptr)
|
||||||
void
|
void
|
||||||
StreamView::diskstream_changed ()
|
StreamView::diskstream_changed ()
|
||||||
{
|
{
|
||||||
Track *t;
|
boost::shared_ptr<Track> t = _trackview.track();
|
||||||
|
|
||||||
if ((t = _trackview.track()) != 0) {
|
if (t) {
|
||||||
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*this, &StreamView::display_diskstream), boost::weak_ptr<Diskstream> (t->diskstream())));
|
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*this, &StreamView::display_diskstream), boost::weak_ptr<Diskstream> (t->diskstream())));
|
||||||
} else {
|
} else {
|
||||||
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &StreamView::undisplay_diskstream));
|
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &StreamView::undisplay_diskstream));
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,8 @@ CONFIG_VARIABLE (bool, verify_remove_last_capture, "verify-remove-last-capture",
|
||||||
CONFIG_VARIABLE (bool, no_new_session_dialog, "no-new-session-dialog", false)
|
CONFIG_VARIABLE (bool, no_new_session_dialog, "no-new-session-dialog", false)
|
||||||
CONFIG_VARIABLE (bool, use_vst, "use-vst", true)
|
CONFIG_VARIABLE (bool, use_vst, "use-vst", true)
|
||||||
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
|
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
|
||||||
CONFIG_VARIABLE (uint32_t, saved_history_depth, "save-history-depth", 100)
|
CONFIG_VARIABLE (uint32_t, saved_history_depth, "save-history-depth", 20)
|
||||||
|
CONFIG_VARIABLE (uint32_t, history_depth, "history-depth", 20)
|
||||||
CONFIG_VARIABLE (bool, use_overlap_equivalency, "use-overlap-equivalency", false)
|
CONFIG_VARIABLE (bool, use_overlap_equivalency, "use-overlap-equivalency", false)
|
||||||
CONFIG_VARIABLE (bool, periodic_safety_backups, "periodic-safety-backups", true)
|
CONFIG_VARIABLE (bool, periodic_safety_backups, "periodic-safety-backups", true)
|
||||||
CONFIG_VARIABLE (uint32_t, periodic_safety_backup_interval, "periodic-safety-backup-interval", 120)
|
CONFIG_VARIABLE (uint32_t, periodic_safety_backup_interval, "periodic-safety-backup-interval", 120)
|
||||||
|
|
|
||||||
|
|
@ -1717,6 +1717,7 @@ class Session : public PBD::StatefulDestructible
|
||||||
|
|
||||||
XMLNode& get_control_protocol_state ();
|
XMLNode& get_control_protocol_state ();
|
||||||
|
|
||||||
|
void set_history_depth (uint32_t depth);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ARDOUR
|
} // namespace ARDOUR
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,9 @@ Session::first_stage_init (string fullpath, string snapshot_name)
|
||||||
_path += '/';
|
_path += '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_history_depth (Config->get_history_depth());
|
||||||
|
|
||||||
|
|
||||||
/* these two are just provisional settings. set_state()
|
/* these two are just provisional settings. set_state()
|
||||||
will likely override them.
|
will likely override them.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2979,7 +2982,6 @@ Session::add_instant_xml (XMLNode& node, const std::string& dir)
|
||||||
Config->add_instant_xml (node, get_user_ardour_path());
|
Config->add_instant_xml (node, get_user_ardour_path());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Session::save_history (string snapshot_name)
|
Session::save_history (string snapshot_name)
|
||||||
{
|
{
|
||||||
|
|
@ -3284,8 +3286,10 @@ Session::config_changed (const char* parameter_name)
|
||||||
set_slave_source (Config->get_slave_source());
|
set_slave_source (Config->get_slave_source());
|
||||||
} else if (PARAM_IS ("remote-model")) {
|
} else if (PARAM_IS ("remote-model")) {
|
||||||
set_remote_control_ids ();
|
set_remote_control_ids ();
|
||||||
} else if (PARAM_IS ("denormal-model")) {
|
} else if (PARAM_IS ("denormal-model")) {
|
||||||
setup_fpu ();
|
setup_fpu ();
|
||||||
|
} else if (PARAM_IS ("history-depth")) {
|
||||||
|
set_history_depth (Config->get_history_depth());
|
||||||
}
|
}
|
||||||
|
|
||||||
set_dirty ();
|
set_dirty ();
|
||||||
|
|
@ -3293,3 +3297,9 @@ Session::config_changed (const char* parameter_name)
|
||||||
#undef PARAM_IS
|
#undef PARAM_IS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Session::set_history_depth (uint32_t d)
|
||||||
|
{
|
||||||
|
_history.set_depth (d);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ class UndoHistory : public sigc::trackable
|
||||||
unsigned long undo_depth() const { return UndoList.size(); }
|
unsigned long undo_depth() const { return UndoList.size(); }
|
||||||
unsigned long redo_depth() const { return RedoList.size(); }
|
unsigned long redo_depth() const { return RedoList.size(); }
|
||||||
|
|
||||||
std::string next_undo() const { return (UndoList.empty() ? std::string("") : UndoList.back()->name()); }
|
std::string next_undo() const { return (UndoList.empty() ? std::string() : UndoList.back()->name()); }
|
||||||
std::string next_redo() const { return (RedoList.empty() ? std::string("") : RedoList.back()->name()); }
|
std::string next_redo() const { return (RedoList.empty() ? std::string() : RedoList.back()->name()); }
|
||||||
|
|
||||||
void clear ();
|
void clear ();
|
||||||
void clear_undo ();
|
void clear_undo ();
|
||||||
|
|
@ -96,10 +96,14 @@ class UndoHistory : public sigc::trackable
|
||||||
XMLNode &get_state(uint32_t depth = 0);
|
XMLNode &get_state(uint32_t depth = 0);
|
||||||
void save_state();
|
void save_state();
|
||||||
|
|
||||||
sigc::signal<void> Changed;
|
void set_depth (uint32_t);
|
||||||
|
uint32_t get_depth() const { return _depth; }
|
||||||
|
|
||||||
|
sigc::signal<void> Changed;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _clearing;
|
bool _clearing;
|
||||||
|
uint32_t _depth;
|
||||||
std::list<UndoTransaction*> UndoList;
|
std::list<UndoTransaction*> UndoList;
|
||||||
std::list<UndoTransaction*> RedoList;
|
std::list<UndoTransaction*> RedoList;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,12 +148,28 @@ XMLNode &UndoTransaction::get_state()
|
||||||
UndoHistory::UndoHistory ()
|
UndoHistory::UndoHistory ()
|
||||||
{
|
{
|
||||||
_clearing = false;
|
_clearing = false;
|
||||||
|
_depth = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UndoHistory::set_depth (uint32_t d)
|
||||||
|
{
|
||||||
|
_depth = d;
|
||||||
|
|
||||||
|
while (_depth > 0 && UndoList.size() > _depth) {
|
||||||
|
UndoList.pop_front ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
UndoHistory::add (UndoTransaction* const ut)
|
UndoHistory::add (UndoTransaction* const ut)
|
||||||
{
|
{
|
||||||
ut->GoingAway.connect (bind (mem_fun (*this, &UndoHistory::remove), ut));
|
ut->GoingAway.connect (bind (mem_fun (*this, &UndoHistory::remove), ut));
|
||||||
|
|
||||||
|
while (_depth > 0 && UndoList.size() > _depth) {
|
||||||
|
UndoList.pop_front ();
|
||||||
|
}
|
||||||
|
|
||||||
UndoList.push_back (ut);
|
UndoList.push_back (ut);
|
||||||
|
|
||||||
/* we are now owners of the transaction */
|
/* we are now owners of the transaction */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue