mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 20:56:28 +01:00
NO-OP: whitespace
* distinguish comments and commented-out-code * add space after function, before bracket
This commit is contained in:
parent
8b925fc395
commit
9777baae00
1 changed files with 73 additions and 81 deletions
|
|
@ -184,10 +184,9 @@ Editor::do_ptimport (std::string ptpath,
|
|||
for (vector<ptflookup_t>::iterator p = ptfwavpair.begin ();
|
||||
p != ptfwavpair.end (); ++p) {
|
||||
if ((p->index1 == a->wave.index) && (strcmp (a->wave.filename.c_str (), "") != 0)) {
|
||||
for (SourceList::iterator x = imported.begin();
|
||||
x != imported.end(); ++x) {
|
||||
for (SourceList::iterator x = imported.begin (); x != imported.end (); ++x) {
|
||||
if ((*x)->id () == p->id) {
|
||||
// Matched an uncreated ptf region to ardour region
|
||||
/* Matched an uncreated ptf region to ardour region */
|
||||
ptflookup_t rp;
|
||||
PropertyList plist;
|
||||
|
||||
|
|
@ -219,13 +218,12 @@ Editor::do_ptimport (std::string ptpath,
|
|||
vector<ptflookup_t> usedtracks;
|
||||
ptflookup_t utr;
|
||||
|
||||
for (vector<PTFFormat::track_t>::iterator a = ptf.tracks.begin();
|
||||
a != ptf.tracks.end(); ++a) {
|
||||
for (vector<PTFFormat::track_t>::iterator a = ptf.tracks.begin (); a != ptf.tracks.end (); ++a) {
|
||||
for (vector<ptflookup_t>::iterator p = ptfregpair.begin ();
|
||||
p != ptfregpair.end (); ++p) {
|
||||
|
||||
if (p->index1 == a->reg.index) {
|
||||
// Matched a ptf active region to an ardour region
|
||||
/* Matched a ptf active region to an ardour region */
|
||||
utr.index1 = a->index;
|
||||
utr.index2 = nth;
|
||||
utr.id = p->id;
|
||||
|
|
@ -235,16 +233,16 @@ Editor::do_ptimport (std::string ptpath,
|
|||
if ((found = std::find (lookuptr, usedtracks.end (), utr)) != usedtracks.end ()) {
|
||||
DEBUG_TRACE (DEBUG::FileUtils, string_compose ("\twav(%1) reg(%2) ptf_tr(%3) ard_tr(%4)\n", a->reg.wave.filename.c_str (), a->reg.index, found->index1, found->index2));
|
||||
existing_track = get_nth_selected_audio_track (found->index2);
|
||||
// Put on existing track
|
||||
/* Put on existing track */
|
||||
boost::shared_ptr<Playlist> playlist = existing_track->playlist ();
|
||||
boost::shared_ptr<Region> copy (RegionFactory::create (r, true));
|
||||
playlist->clear_changes ();
|
||||
playlist->add_region (copy, a->reg.startpos);
|
||||
//_session->add_command (new StatefulDiffCommand (playlist));
|
||||
} else {
|
||||
// Put on a new track
|
||||
/* Put on a new track */
|
||||
DEBUG_TRACE (DEBUG::FileUtils, string_compose ("\twav(%1) reg(%2) new_tr(%3)\n", a->reg.wave.filename.c_str (), a->reg.index, nth));
|
||||
list<boost::shared_ptr<AudioTrack> > at (_session->new_audio_track (1, 2, 0, 1, string(), PresentationInfo::max_order, Normal));
|
||||
list<boost::shared_ptr<AudioTrack> > at (_session->new_audio_track (1, 2, 0, 1, "", PresentationInfo::max_order, Normal));
|
||||
if (at.empty ()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -255,8 +253,8 @@ Editor::do_ptimport (std::string ptpath,
|
|||
} catch (Glib::ConvertError& err) {
|
||||
trackname = string_compose ("Invalid %1", a->index);
|
||||
}
|
||||
// TODO legalize track name (no slashes, no colons)
|
||||
#if 0 // TODO -- "find_route_name" is currently private
|
||||
/* TODO legalize track name (no slashes, no colons) */
|
||||
#if 0 /* TODO -- "find_route_name" is currently private */
|
||||
/* generate a unique name by adding a number if needed */
|
||||
uint32_t id = 0;
|
||||
if (!_session->find_route_name (trackname.c_str (), id, trackname, false)) {
|
||||
|
|
@ -277,7 +275,7 @@ Editor::do_ptimport (std::string ptpath,
|
|||
}
|
||||
}
|
||||
|
||||
// MIDI - Find list of unique midi tracks first
|
||||
/* MIDI - Find list of unique midi tracks first */
|
||||
typedef struct midipair {
|
||||
uint16_t ptfindex;
|
||||
string trname;
|
||||
|
|
@ -287,11 +285,9 @@ Editor::do_ptimport (std::string ptpath,
|
|||
uint16_t ith = 0;
|
||||
bool found;
|
||||
|
||||
for (vector<PTFFormat::track_t>::iterator a = ptf.miditracks.begin();
|
||||
a != ptf.miditracks.end(); ++a) {
|
||||
for (vector<PTFFormat::track_t>::iterator a = ptf.miditracks.begin (); a != ptf.miditracks.end (); ++a) {
|
||||
found = false;
|
||||
for (vector<midipair_t>::iterator b = uniquetr.begin();
|
||||
b != uniquetr.end(); ++b) {
|
||||
for (vector<midipair_t>::iterator b = uniquetr.begin (); b != uniquetr.end (); ++b) {
|
||||
if (b->trname == a->name) {
|
||||
found = true;
|
||||
break;
|
||||
|
|
@ -304,7 +300,7 @@ Editor::do_ptimport (std::string ptpath,
|
|||
}
|
||||
}
|
||||
|
||||
// MIDI - Create unique midi tracks and a lookup table for used tracks
|
||||
/* MIDI - Create unique midi tracks and a lookup table for used tracks */
|
||||
for (vector<midipair_t>::iterator a = uniquetr.begin ();
|
||||
a != uniquetr.end (); ++a) {
|
||||
ptflookup_t miditr;
|
||||
|
|
@ -320,7 +316,7 @@ Editor::do_ptimport (std::string ptpath,
|
|||
Normal));
|
||||
}
|
||||
|
||||
// Select all MIDI tracks by selecting all tracks then subsetting to midi
|
||||
/* Select all MIDI tracks by selecting all tracks then subsetting to midi */
|
||||
select_all_tracks ();
|
||||
|
||||
TrackViewList miditracks;
|
||||
|
|
@ -340,9 +336,8 @@ Editor::do_ptimport (std::string ptpath,
|
|||
|
||||
selection->set (miditracks);
|
||||
|
||||
// MIDI - Add midi regions one-by-one to corresponding midi tracks
|
||||
for (vector<PTFFormat::track_t>::iterator a = ptf.miditracks.begin();
|
||||
a != ptf.miditracks.end(); ++a) {
|
||||
/* MIDI - Add midi regions one-by-one to corresponding midi tracks */
|
||||
for (vector<PTFFormat::track_t>::iterator a = ptf.miditracks.begin (); a != ptf.miditracks.end (); ++a) {
|
||||
|
||||
boost::shared_ptr<MidiTrack> midi_track = get_nth_selected_midi_track (a->index);
|
||||
boost::shared_ptr<Playlist> playlist = midi_track->playlist ();
|
||||
|
|
@ -356,7 +351,7 @@ Editor::do_ptimport (std::string ptpath,
|
|||
plist.add (ARDOUR::Properties::name, PBD::basename_nosuffix (src->name ()));
|
||||
//printf(" : %d - trackname: (%s)\n", a->index, src->name ().c_str ());
|
||||
boost::shared_ptr<Region> region = (RegionFactory::create (src, plist));
|
||||
// sets beat position
|
||||
/* sets beat position */
|
||||
region->set_position (pos.sample, pos.division);
|
||||
midi_track->playlist ()->add_region (region, pos.sample, 1.0, false, pos.division);
|
||||
|
||||
|
|
@ -365,15 +360,12 @@ Editor::do_ptimport (std::string ptpath,
|
|||
MidiModel::NoteDiffCommand *midicmd;
|
||||
midicmd = mm->new_note_diff_command ("Import ProTools MIDI");
|
||||
|
||||
for (vector<PTFFormat::midi_ev_t>::iterator
|
||||
j = a->reg.midi.begin();
|
||||
j != a->reg.midi.end(); ++j) {
|
||||
for (vector<PTFFormat::midi_ev_t>::iterator j = a->reg.midi.begin (); j != a->reg.midi.end (); ++j) {
|
||||
//printf(" : MIDI : pos=%f len=%f\n", (float)j->pos / 960000., (float)j->length / 960000.);
|
||||
Temporal::Beats start = (Temporal::Beats)(j->pos / 960000.);
|
||||
Temporal::Beats len = (Temporal::Beats)(j->length / 960000.);
|
||||
// PT C-2 = 0, Ardour C-1 = 0, subtract twelve to convert ?
|
||||
midicmd->add(boost::shared_ptr<Evoral::Note<Temporal::Beats> >
|
||||
(new Evoral::Note<Temporal::Beats>( (uint8_t)1, start, len, j->note, j->velocity )));
|
||||
/* PT C-2 = 0, Ardour C-1 = 0, subtract twelve to convert ? */
|
||||
midicmd->add (boost::shared_ptr<Evoral::Note<Temporal::Beats> > (new Evoral::Note<Temporal::Beats> ((uint8_t)1, start, len, j->note, j->velocity)));
|
||||
}
|
||||
mm->apply_command (_session, midicmd);
|
||||
boost::shared_ptr<Region> copy (RegionFactory::create (mr, true));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue