diff options
author | Florian Jung <flo@windfisch.org> | 2011-05-28 12:08:21 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-05-28 12:08:21 +0000 |
commit | 55a6fa75d70dbcd38e4b434420c970475448d1a7 (patch) | |
tree | 9f3d7c7f8c81c59e7c91ee9fa4cb904ad900ce52 /muse2/muse | |
parent | c05ce86388943e66db1aa39ace54f040000e49ac (diff) |
fixed buggy bugfix in score editor
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/helper.cpp | 11 | ||||
-rw-r--r-- | muse2/muse/helper.h | 3 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 10 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.h | 2 |
4 files changed, 11 insertions, 15 deletions
diff --git a/muse2/muse/helper.cpp b/muse2/muse/helper.cpp index d4a237ea..be45e048 100644 --- a/muse2/muse/helper.cpp +++ b/muse2/muse/helper.cpp @@ -43,12 +43,7 @@ QString pitch2string(int v) -int partToIndex(Part* p) -{ - return p->track()->parts()->index(p); -} - -Part* partFromIndex(int index) +Part* partFromSerialNumber(int serial) { TrackList* tl = song->tracks(); for (iTrack it = tl->begin(); it != tl->end(); ++it) @@ -56,10 +51,10 @@ Part* partFromIndex(int index) PartList* pl = (*it)->parts(); iPart ip; for (ip = pl->begin(); ip != pl->end(); ++ip) - if (ip->second->sn() == index) + if (ip->second->sn() == serial) return ip->second; } - printf("ERROR: partFromIndex(%i) wasn't able to find an appropriate part!\n",index); + printf("ERROR: partFromSerialNumber(%i) wasn't able to find an appropriate part!\n",serial); return NULL; } diff --git a/muse2/muse/helper.h b/muse2/muse/helper.h index d88dcb94..109ecbee 100644 --- a/muse2/muse/helper.h +++ b/muse2/muse/helper.h @@ -14,8 +14,7 @@ class Part; extern QString pitch2string(int v); -int partToIndex(Part* p); -Part* partFromIndex(int index); +Part* partFromSerialNumber(int serial); #endif diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index b000dc5f..c2e901ad 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4328,7 +4328,7 @@ void ScoreCanvas::midi_note(int pitch, int velo) void ScoreCanvas::update_parts() { if (selected_part!=NULL) //if it's null, let it be null - selected_part=partFromIndex(selected_part_index); + selected_part=partFromSerialNumber(selected_part_index); for (list<staff_t>::iterator it=staves.begin(); it!=staves.end(); it++) it->update_parts(); @@ -4339,7 +4339,7 @@ void staff_t::update_parts() parts.clear(); for (set<int>::iterator it=part_indices.begin(); it!=part_indices.end(); it++) - parts.insert(partFromIndex(*it)); + parts.insert(partFromSerialNumber(*it)); } void staff_t::update_part_indices() @@ -4347,7 +4347,7 @@ void staff_t::update_part_indices() part_indices.clear(); for (set<Part*>::iterator it=parts.begin(); it!=parts.end(); it++) - part_indices.insert(partToIndex(*it)); + part_indices.insert((*it)->sn()); } //the following assertions are made: @@ -4375,10 +4375,12 @@ void staff_t::update_part_indices() * between, for example, when a cis is tied to a des * * CURRENT TODO + * o investigate with valgrind + * ! o paste to different tick !! + * o allow batch-movements in score editor * o controller view in score editor * o deal with expanding parts * o in main win: make "Ch" column editable with a line edit - * o paste to different tick * o fix sigedit boxes * o mid-click in pianoroll: change to "delete", or initiate drag and drop between windows? * diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h index 0e61f066..3fd321b9 100644 --- a/muse2/muse/midiedit/scoreedit.h +++ b/muse2/muse/midiedit/scoreedit.h @@ -781,7 +781,7 @@ class ScoreCanvas : public View void set_last_len(int l) {last_len=l;} Part* get_selected_part() {return selected_part;} - void set_selected_part(Part* p) {selected_part=p; if (selected_part) selected_part_index=partToIndex(selected_part);} + void set_selected_part(Part* p) {selected_part=p; if (selected_part) selected_part_index=selected_part->sn();} set<Part*> get_all_parts(); |