From cea0fdb5f411c7af11f588191bccf4b643536594 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 26 Apr 2011 15:35:33 +0000 Subject: debugging output is only displayed with the -D option added heavyDebugMsg, which is enabled with specifying -D twice beautified usage hint cleaned up the code a bit --- muse2/muse/globals.cpp | 1 + muse2/muse/globals.h | 1 + muse2/muse/main.cpp | 15 +- muse2/muse/midiedit/scoreedit.cpp | 336 ++++++++++++++++++++------------------ muse2/muse/midiedit/scoreedit.h | 1 - 5 files changed, 186 insertions(+), 168 deletions(-) diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp index 80990f0e..6c0bbbc6 100644 --- a/muse2/muse/globals.cpp +++ b/muse2/muse/globals.cpp @@ -87,6 +87,7 @@ QString lastMidiPath("."); bool debugMode = false; bool debugMsg = false; +bool heavyDebugMsg = false; bool midiInputTrace = false; bool midiOutputTrace = false; bool realTimeScheduling = false; diff --git a/muse2/muse/globals.h b/muse2/muse/globals.h index 151e7800..894f1baf 100644 --- a/muse2/muse/globals.h +++ b/muse2/muse/globals.h @@ -59,6 +59,7 @@ extern bool debugMode; extern bool midiInputTrace; extern bool midiOutputTrace; extern bool debugMsg; +extern bool heavyDebugMsg; extern bool debugSync; extern bool loadPlugins; extern bool loadVST; diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp index e1b30d0c..53f8961b 100644 --- a/muse2/muse/main.cpp +++ b/muse2/muse/main.cpp @@ -190,12 +190,14 @@ static void usage(const char* prog, const char* txt) fprintf(stderr, " -v print version\n"); fprintf(stderr, " -d debug mode: no threads, no RT\n"); fprintf(stderr, " -D debug mode: enable some debug messages\n"); + fprintf(stderr, " specify twice for lots of debug messages\n"); + fprintf(stderr, " this may slow down MusE massively!\n"); fprintf(stderr, " -m debug mode: trace midi Input\n"); fprintf(stderr, " -M debug mode: trace midi Output\n"); fprintf(stderr, " -s debug mode: trace sync\n"); fprintf(stderr, " -a no audio\n"); - //fprintf(stderr, " -P n set real time priority to n (default: 50)\n"); - fprintf(stderr, " -P n set audio driver real time priority to n (Dummy only, default 40. Else fixed by Jack.)\n"); + fprintf(stderr, " -P n set audio driver real time priority to n\n"); + fprintf(stderr, " (Dummy only, default 40. Else fixed by Jack.)\n"); fprintf(stderr, " -Y n force midi real time priority to n (default: audio driver prio +2)\n"); fprintf(stderr, " -p don't load LADSPA plugins\n"); #ifdef ENABLE_PYTHON @@ -210,7 +212,8 @@ static void usage(const char* prog, const char* txt) #ifdef HAVE_LASH fprintf(stderr, " -L don't use LASH\n"); #endif - fprintf(stderr, " -l xx force locale to the given language/country code (xx = %s)\n", localeList().toLatin1().constData()); + fprintf(stderr, " -l xx force locale to the given language/country code\n"); + fprintf(stderr, " (xx = %s)\n", localeList().toLatin1().constData()); } //--------------------------------------------------------- @@ -303,7 +306,11 @@ int main(int argc, char* argv[]) case 'a': noAudio = true; break; - case 'D': debugMsg = true; break; + case 'D': + if (!debugMsg) + debugMsg=true; + else + heavyDebugMsg=true; case 'm': midiInputTrace = true; break; case 'M': midiOutputTrace = true; break; case 's': debugSync = true; break; diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 3e144189..98568325 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -71,7 +71,7 @@ QString IntToQStr(int i); #define SPLIT_NOTE 60 -//TODO: let the user specify that somehow? + @@ -332,13 +332,6 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) -/* FINDMICHJETZT - addToolBarBreak(); - info = new NoteInfo(this); - addToolBar(info); -*/ - - score_canvas->song_changed(SC_EVENT_INSERTED); @@ -473,7 +466,7 @@ void ScoreCanvas::add_staves(PartList* pl, bool all_in_one) staff.split_note=SPLIT_NOTE; - staff.type=GRAND_TOP; //FINDMICH + staff.type=GRAND_TOP; //FINDME_INITCLEF staff.clef=VIOLIN; staves.push_back(staff); @@ -498,7 +491,7 @@ void ScoreCanvas::add_staves(PartList* pl, bool all_in_one) staff.split_note=SPLIT_NOTE; - staff.type=GRAND_TOP; //FINDMICH + staff.type=GRAND_TOP; //FINDME_INITCLEF staff.clef=VIOLIN; staves.push_back(staff); @@ -606,7 +599,7 @@ void ScoreCanvas::set_staffmode(list::iterator it, staff_mode_t mode) { it--; if (it->type!=GRAND_TOP) - cout << "THIS SHOULD NEVER HAPPEN: grand_bottom without top!"<type==GRAND_TOP) @@ -614,7 +607,7 @@ void ScoreCanvas::set_staffmode(list::iterator it, staff_mode_t mode) list::iterator tmp=it; tmp++; if (tmp->type!=GRAND_BOTTOM) - cout << "THIS SHOULD NEVER HAPPEN: grand_top without bottom!"<::iterator it, staff_mode_t mode) break; default: - cout << "ILLEGAL FUNCTION CALL: invalid mode in set_staffmode" << endl; + cerr << "ERROR: ILLEGAL FUNCTION CALL: invalid mode in set_staffmode" << endl; } recalc_staff_pos(); @@ -652,7 +645,7 @@ void ScoreCanvas::remove_staff(list::iterator it) { it--; if (it->type!=GRAND_TOP) - cout << "THIS SHOULD NEVER HAPPEN: grand_bottom without top!"<type == NORMAL) @@ -663,7 +656,7 @@ void ScoreCanvas::remove_staff(list::iterator it) { staves.erase(it++); if (it->type!=GRAND_BOTTOM) - cout << "THIS SHOULD NEVER HAPPEN: grand_top without bottom!"<::iterator dest, list::iter { dest--; if (dest->type!=GRAND_TOP) - cout << "THIS SHOULD NEVER HAPPEN: grand_bottom without top!"<type == GRAND_BOTTOM) { src--; if (src->type!=GRAND_TOP) - cout << "THIS SHOULD NEVER HAPPEN: grand_bottom without top!"<::iterator dest, list::iter { dest++; if (dest->type != GRAND_BOTTOM) - cout << "THIS SHOULD NEVER HAPPEN: grand_top without bottom!"<parts.insert(src->parts.begin(), src->parts.end()); } @@ -810,6 +803,8 @@ void ScoreCanvas::init_pixmaps() { if (!pixmaps_initalized) { + if (debugMsg) cout << "initalizing colors..." << endl; + mycolors=new QColor[NUM_MYCOLORS]; mycolors[0]=Qt::black; @@ -823,7 +818,8 @@ void ScoreCanvas::init_pixmaps() for (int i=64; i<128; i++) mycolors[i+VELO_PIXMAP_BEGIN]=QColor(0xff,0,(127-i)*4); - cout << "loading pixmaps..." << endl; + + if (debugMsg) cout << "loading pixmaps..." << endl; pix_whole=new QPixmap[NUM_MYCOLORS]; pix_half=new QPixmap[NUM_MYCOLORS]; @@ -878,6 +874,8 @@ void ScoreCanvas::init_pixmaps() pix_num[i].load(museGlobalShare + "/scoreglyphs/"+IntToQStr(i)+".png"); pixmaps_initalized=true; + + if (debugMsg) cout << "done" << endl; } } @@ -889,11 +887,11 @@ int modulo(int a, int b) // similar to a % b } int divide_floor(int a, int b) // similar to a / b -{ //TODO can be done better :/ +{ return int(floor(float(a)/float(b))); } -#define DEFAULT_REST_HEIGHT 6 // TODO +#define DEFAULT_REST_HEIGHT 6 bool operator< (const note_pos_t& a, const note_pos_t& b) @@ -957,7 +955,7 @@ void staff_t::create_appropriate_eventlist() unsigned begin, end; begin=flo_quantize(event.tick()+part->tick(), parent->quant_ticks()); end=flo_quantize(event.endTick()+part->tick(), parent->quant_ticks()); - cout <<"inserting note on at "<second->sig.z<<"/"<second->sig.n<<"; ticks per measure = "<second->sig.z<<"/"<second->sig.n<<"; ticks per measure = "<(from, FloEvent(from, FloEvent::TIME_SIG, it->second->sig.z, it->second->sig.n) ) ); for (unsigned t=from; t(t, FloEvent(t,0,0,ticks_per_measure,FloEvent::BAR) ) ); @@ -1042,7 +1037,7 @@ note_pos_t note_pos_(int note, key_enum key) int foo[12]={0,-1, 1,-1, 2,3,-1, 4,-1, 5, -1,6}; if ((note<0) || (note>=12)) - cout << "WARNING: ILLEGAL FUNCTION CALL (note_pos, note out of range)" << endl; + cerr << "ERROR: ILLEGAL FUNCTION CALL (note_pos, note out of range)" << endl; if (foo[note]!=-1) { @@ -1141,14 +1136,6 @@ int calc_len(int l, int d) return tmp; } -bool operator< (const note_len_t& a,const note_len_t& b) //TODO sane sorting order -{ - if (a.len& nums, int denom) { @@ -1162,10 +1149,13 @@ int calc_measure_len(const list& nums, int denom) vector create_emphasize_list(const list& nums, int denom) { - cout << "creating emphasize list for "; - for (list::const_iterator it=nums.begin(); it!=nums.end(); it++) - cout << *it << " "; - cout << "/ "<::const_iterator it=nums.begin(); it!=nums.end(); it++) + cout << *it << " "; + cout << "/ "< create_emphasize_list(const list& nums, int denom) result[0]=0; - for (int i=0;i parse_note_len(int len_ticks, int begin_tick, vector& foo, list retval; if (len_ticks<0) - cout << "WARNING: ILLEGAL FUNCTION CALL in parse_note_len: len_ticks < 0" << endl; + cerr << "ERROR: ILLEGAL FUNCTION CALL in parse_note_len: len_ticks < 0" << endl; if (begin_tick<0) - cout << "WARNING: ILLEGAL FUNCTION CALL in parse_note_len: begin_tick < 0" << endl; + cerr << "ERROR: ILLEGAL FUNCTION CALL in parse_note_len: begin_tick < 0" << endl; if (allow_normal) { @@ -1266,7 +1259,7 @@ list parse_note_len(int len_ticks, int begin_tick, vector& foo, len_now=len_now*TICKS_PER_WHOLE/64; - cout << "add " << len_now << " ticks" << endl; + if (heavyDebugMsg) cout << "add " << len_now << " ticks" << endl; if (allow_dots) { for (int i=0;i<=quant_power2;i++) @@ -1293,7 +1286,7 @@ list parse_note_len(int len_ticks, int begin_tick, vector& foo, } if (len_now!=0) - cout << "WARNING: THIS SHOULD NEVER HAPPEN. wasn't able to split note len properly; len_now="<first, it->second.type, it->second.pitch, it->second.vel, it->second.len); - cout << "\tline="<first, it->second.type, it->second.pitch, it->second.vel, it->second.len); + cout << "\tline="<quant_ticks())/2; - cout << "\tend-of-measure: this was an empty measure. inserting rest in between at t="< lens=parse_note_len(rest,lastevent-last_measure,emphasize_list,parent->quant_power2(),DOTTED_RESTS,UNSPLIT_RESTS); unsigned tmppos=lastevent; for (list::iterator x=lens.begin(); x!=lens.end(); x++) { - cout << "\t\tpartial rest with len="<len<<", dots="<dots<::iterator x=lens.begin(); x!=lens.end(); x++) { - cout << "\t\tpartial rest with len="<len<<", dots="<dots<(next_measure, FloEvent(actual_tick,pitch, velo,0,FloEvent::NOTE_OFF, it->second.source_part, it->second.source_event))); eventlist.insert(pair(next_measure, FloEvent(actual_tick,pitch, velo,newlen,FloEvent::NOTE_ON, it->second.source_part, it->second.source_event))); - cout << "\t\tnote was split to length "<(t+len, FloEvent(t+len,pitch, velo,0,FloEvent::NOTE_OFF,it->second.source_part, it->second.source_event))); } @@ -1507,7 +1502,7 @@ void staff_t::create_itemlist() int count=0; for (list::iterator x=lens.begin(); x!=lens.end(); x++) { - cout << "\t\tpartial note with len="<len<<", dots="<dots<second.num<<"/"<second.denom<<" at "<second.num<<"/"<second.denom<<" at "<second.num, it->second.denom) ); emphasize_list=create_emphasize_list(it->second.num, it->second.denom); } else if (type==FloEvent::KEY_CHANGE) { - cout << "inserting KEY CHANGE ("<second.key<<") at "<second.key<<") at "<second.key) ); tmp_key=it->second.key; } @@ -1553,7 +1548,7 @@ void staff_t::process_itemlist() { set& curr_items=it2->second; - cout << "at t="<first<::iterator i=occupied.begin(); i!=occupied.end(); i++) - if (i->second) cout << i->first << "("<second<<") "; - cout << endl; + if (heavyDebugMsg) + { + cout << "occupied: "; + for (map::iterator i=occupied.begin(); i!=occupied.end(); i++) + if (i->second) cout << i->first << "("<second<<") "; + cout << endl; + } @@ -1593,7 +1591,7 @@ void staff_t::process_itemlist() //(can be seen on already_grouped) if ((it->type==FloItem::REST) && (it->already_grouped==false)) { - cout << "trying to group" << endl; + if (heavyDebugMsg) cout << "trying to group" << endl; int lastheight; int height_cumulative=0; @@ -1604,12 +1602,12 @@ void staff_t::process_itemlist() set::iterator tmp; for (tmp=it; tmp!=curr_items.end();) { - cout << "checking if we can proceed with an item at height="<pos.height<::iterator it=curr_items.begin(); it!=curr_items.end(); it++) if ( (it->type==FloItem::NOTE) || (it->type==FloItem::REST) ) { @@ -1761,24 +1759,27 @@ group_them_again: if (it->type==FloItem::NOTE) lengths[it->len].add(it->pos.height); - cout << "note lengths at that time are:"; - for (map::iterator it=lengths.begin(); it!=lengths.end(); it++) - cout << it->first << "("<< it->second.mean() <<") "; - cout << endl; + if (heavyDebugMsg) + { + cout << "note lengths at that time are:"; + for (map::iterator it=lengths.begin(); it!=lengths.end(); it++) + cout << it->first << "("<< it->second.mean() <<") "; + cout << endl; + } if (lengths.erase(0)) // in case "0" is in the set, erase it has_whole=true; // but remember there were whole notes if (lengths.size()==0) { - cout << "no notes other than wholes, or no notes at all. we can relax" << endl; + if (heavyDebugMsg) cout << "no notes other than wholes, or no notes at all. we can relax" << endl; } else if (lengths.size()==1) { pair& group=*(lengths.begin()); stem_t stem; int shift=0; - cout << "only one non-whole note group (len="<::iterator it=curr_items.begin(); it!=curr_items.end();) if (it->type==FloItem::NOTE) { //if *it belongs to group1 and has not already its destination length - cout << "\tprocessing note-item with len="<len<::iterator x=lens.begin(); x!=lens.end(); x++) { - cout << "\t\twhile regrouping: partial note with len="<len<<", dots="<dots<::iterator x=lens.begin(); x!=lens.end(); x++) { - cout << "\t\twhile regrouping: partial note with len="<len<<", dots="<dots<type==FloItem::REST) @@ -2186,7 +2187,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte for (ScoreItemList::iterator it2=from_it; it2!=to_it; it2++) { - cout << "at t="<first << endl; + if (heavyDebugMsg) cout << "at t="<first << endl; int upstem_y1 = -1, upstem_y2=-1, upstem_x=-1, upflag=-1; int downstem_y1 = -1, downstem_y2=-1, downstem_x=-1, downflag=-1; @@ -2195,17 +2196,20 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte { if (it->type==FloItem::NOTE) { - cout << "\tNOTE at line"<pos.height<<" with acc.="<pos.vorzeichen<<", len="<len); - for (int i=0;idots;i++) cout << "."; - cout << " , stem="; - if (it->stem==UPWARDS) - cout << "UPWARDS"; - else - cout << "DOWNWARDS"; - - cout << " , shift="<shift<<", ausweich="<ausweich<<", "; - if (!it->tied) cout << "un"; - cout << "tied, is_tie_dest="<is_tie_dest<pos.height<<" with acc.="<pos.vorzeichen<<", len="<len); + for (int i=0;idots;i++) cout << "."; + cout << " , stem="; + if (it->stem==UPWARDS) + cout << "UPWARDS"; + else + cout << "DOWNWARDS"; + + cout << " , shift="<shift<<", ausweich="<ausweich<<", "; + if (!it->tied) cout << "un"; + cout << "tied, is_tie_dest="<is_tie_dest<len!=0) //only for non-whole notes the stems are relevant! { @@ -2218,11 +2222,11 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte if ((upflag!=-1) && (upflag!=it->len)) - cout << "WARNING: THIS SHOULD NEVER HAPPEN: upflag != this->flag" << endl; + cerr << "ERROR: THIS SHOULD NEVER HAPPEN: upflag != this->flag" << endl; upflag=it->len; if ((upstem_x!=-1) && (upstem_x!=it->stem_x )) - cout << "WARNING: THIS SHOULD NEVER HAPPEN: upstem_x != x_result" << endl; + cerr << "ERROR: THIS SHOULD NEVER HAPPEN: upstem_x != x_result" << endl; upstem_x=it->stem_x; } else @@ -2234,11 +2238,11 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte if ((downflag!=-1) && (downflag!=it->len)) - cout << "WARNING: THIS SHOULD NEVER HAPPEN: downflag != this->flag" << endl; + cerr << "ERROR: THIS SHOULD NEVER HAPPEN: downflag != this->flag" << endl; downflag=it->len; if ((downstem_x!=-1) && (downstem_x!=it->stem_x)) - cout << "WARNING: THIS SHOULD NEVER HAPPEN: downstem_x != x_result" << endl; + cerr << "ERROR: THIS SHOULD NEVER HAPPEN: downstem_x != x_result" << endl; downstem_x=it->stem_x; //important: before the below calculation! } } @@ -2280,8 +2284,6 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte color_index=HIGHLIGHTED_PIXMAP; draw_pixmap(p,it->x -x_pos+x_left,y_offset + it->y,it->pix[color_index]); - //TODO FINDMICH maybe draw a margin around bright colors? - //maybe draw the default color in black? //draw dots @@ -2323,7 +2325,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte //if needed, draw tie if (it->is_tie_dest) { - cout << "drawing tie" << endl; + if (heavyDebugMsg) cout << "drawing tie" << endl; draw_tie(p,it->tie_from_x-x_pos+x_left,it->x -x_pos+x_left,y_offset + it->y, (it->len==0) ? true : (it->stem==DOWNWARDS) , mycolors[color_index]); // in english: "if it's a whole note, tie is upwards (true). if not, tie is upwards if // stem is downwards and vice versa" @@ -2331,9 +2333,12 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte } else if (it->type==FloItem::REST) { - cout << "\tREST at line"<pos.height<<" with len="<len); - for (int i=0;idots;i++) cout << "."; - cout << " , ausweich="<ausweich<pos.height<<" with len="<len); + for (int i=0;idots;i++) cout << "."; + cout << " , ausweich="<ausweich<x -x_pos+x_left,y_offset + it->y,*it->pix); @@ -2358,7 +2363,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte } else if (it->type==FloItem::BAR) { - cout << "\tBAR" << endl; + if (heavyDebugMsg) cout << "\tBAR" << endl; p.setPen(Qt::black); p.drawLine(it->x -x_pos+x_left,y_offset -2*YLEN,it->x -x_pos+x_left,y_offset +2*YLEN); @@ -2368,14 +2373,14 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte } else if (it->type==FloItem::TIME_SIG) { - cout << "\tTIME SIGNATURE: "<num<<"/"<denom<num<<"/"<denom<x - x_pos+x_left, y_offset, it->num, it->denom); } else if (it->type==FloItem::KEY_CHANGE) { key_enum new_key=it->key; - cout << "\tKEY CHANGE: from "< aufloes_list=calc_accidentials(curr_key, staff.clef, new_key); list new_acc_list=calc_accidentials(new_key, staff.clef); @@ -2478,7 +2483,7 @@ int clef_height(clef_t clef) case VIOLIN: return 4; case BASS: return 8; default: - cout << "WARNING: ILLEGAL FUNCTION CALL in clef_height()" << endl; + cerr << "ERROR: ILLEGAL FUNCTION CALL in clef_height()" << endl; return 6; } } @@ -2583,7 +2588,7 @@ void ScoreCanvas::draw_number(QPainter& p, int x, int y, int n) void ScoreCanvas::draw(QPainter& p, const QRect&) { - cout <<"now in ScoreCanvas::draw"<y_draw - y_pos, *it); p.setClipping(false); } + + if (debugMsg) cout << "drawing done." << endl; } @@ -2664,11 +2671,8 @@ int ScoreCanvas::x_to_tick(int x) int t=TICKS_PER_WHOLE * x/pixels_per_whole(); int min_t=0; - cout << "t="<::iterator it=pos_add_list.begin(); it!=pos_add_list.end() && it->firstitemlist; - cout << "mousePressEvent at "<begin_tick<<" and end at "<source_part; - if (set_it->source_part == NULL) cout << " (WARNING! THIS SHOULD NEVER HAPPEN!)"; - cout << endl; + if (debugMsg) + cout << "you clicked at a note with begin at "<begin_tick<<" and end at "<source_part << endl; + + if (set_it->source_part == NULL) cerr << "ERROR: THIS SHOULD NEVER HAPPEN: set_it->source_part is NULL!" << endl; + + dragged_event=*set_it->source_event; dragged_event_part=set_it->source_part; @@ -2861,7 +2868,7 @@ void ScoreCanvas::mousePressEvent (QMouseEvent* event) { signed int relative_tick=(signed) tick - curr_part->tick(); if (relative_tick<0) - cout << "THIS SHOULD NEVER HAPPEN: relative_tick is negative!" << endl; + cerr << "ERROR: THIS SHOULD NEVER HAPPEN: relative_tick is negative!" << endl; song->startUndo(); //stopping undo at the end of this function is unneccessary //because we'll begin a drag right after it. finishing @@ -2877,13 +2884,13 @@ void ScoreCanvas::mousePressEvent (QMouseEvent* event) if (flo_quantize(newevent.lenTick(), quant_ticks()) <= 0) { newevent.setLenTick(quant_ticks()); - cout << "DEBUG: inserted note's length would be invisible after quantisation (too short)." << endl << - " setting it to " << newevent.lenTick() << endl; + if (debugMsg) cout << "inserted note's length would be invisible after quantisation (too short)." << endl << + " setting it to " << newevent.lenTick() << endl; } if (newevent.endTick() > curr_part->lenTick()) { - cout << "DEBUG: clipping inserted note from len="<msgDeleteEvent(dragged_event, dragged_event_part, false, false, false); } else @@ -2963,12 +2970,12 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event) { if ((abs(dx)>DRAG_INIT_DISTANCE) && (mouse_x_drag_operation!=NO_OP)) { - cout << "mouse-operation is now "<DRAG_INIT_DISTANCE) { - cout << "mouse-operation is now PITCH" << endl; + if (debugMsg) cout << "mouse-operation is now PITCH" << endl; mouse_operation=PITCH; } } @@ -2981,7 +2988,7 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event) break; case PITCH: - cout << "changing pitch, delta="< dragged_event_part->lenTick()) @@ -3017,12 +3024,12 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event) if (new_len>=0) { tmp.setLenTick(dragged_event_part->lenTick() - tmp.tick()); - cout << "DEBUG: moved note would exceed its part; clipping length to " << tmp.lenTick() << endl; + if (debugMsg) cout << "moved note would exceed its part; clipping length to " << tmp.lenTick() << endl; } else { tmp.setLenTick(0); - cout << "DEBUG: moved note would exceed its part; clipping length to 0 (actually negative)" << endl; + if (debugMsg) cout << "moved note would exceed its part; clipping length to 0 (actually negative)" << endl; } } @@ -3047,13 +3054,13 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event) else { tmp.setLenTick(0); - cout << "DEBUG: not setting len to a negative value. using 0 instead" << endl; + if (debugMsg) cout << "not setting len to a negative value. using 0 instead" << endl; } if (tmp.endTick() > dragged_event_part->lenTick()) { tmp.setLenTick(dragged_event_part->lenTick() - tmp.tick()); - cout << "DEBUG: resized note would exceed its part; limiting length to " << tmp.lenTick() << endl; + if (debugMsg) cout << "resized note would exceed its part; limiting length to " << tmp.lenTick() << endl; } audio->msgChangeEvent(dragged_event, tmp, dragged_event_part, false, false, false); @@ -3149,14 +3156,14 @@ void ScoreCanvas::heartbeat_timer_event() void ScoreCanvas::x_scroll_event(int x) { - cout << "SCROLL EVENT: x="<y_bottom; } @@ -3286,7 +3293,7 @@ void ScoreCanvas::set_tool(int tool) case RubberTool: mouse_erases_notes=true; mouse_inserts_notes=false; break; case PencilTool: mouse_erases_notes=false; mouse_inserts_notes=true; break; default: - cout << "THIS SHOULD NEVER HAPPEN: set_tool called with unknown tool ("<::iterator it=staves.begin(); it!=staves.end(); it++) @@ -3371,7 +3378,7 @@ void ScoreCanvas::maybe_close_if_empty() if (staves.empty()) { if (!parent->close()) - cout << "THIS SHOULD NEVER HAPPEN: tried to close, but event hasn't been accepted!" << endl; + cerr << "ERROR: THIS SHOULD NEVER HAPPEN: tried to close, but event hasn't been accepted!" << endl; } } @@ -3456,28 +3463,31 @@ set staff_t::parts_at_tick(unsigned tick) * between, for example, when a cis is tied to a des * * CURRENT TODO - * x nothing atm + * o clean up code (find TODOs) * * IMPORTANT TODO * x nothing atm * * less important stuff + * o use the proper quantisation functions instead of + * flo_quantize() and flo_quantize_floor() + * o let the user set up SPLIT_NOTE + * o let the user decide about the initial clef (search for FINDME_INITCLEF) + * o deal with expanding parts or clip (expanding is better) + * o offer functions like in the pianoroll: quantize etc. * o support selections - * o more fine-grained redrawing in song_changed: sometimes, - * only a redraw and not a recalc is needed * o do all the song_changed(SC_EVENT_INSERTED) properly + * o add tracks in correct order to score + * o draw measure numbers + * o use timesig_t in all timesig-stuff + * o use bars instead of flags over groups of 8ths / 16ths etc * o support different keys in different tracks at the same time * calc_pos_add_list and calc_item_pos will be affected by this * calc_pos_add_list must be called before calc_item_pos then, * and calc_item_pos must respect the pos_add_list instead of * keeping its own pos_add variable (which is only an optimisation) - * o draw measure numbers - * o use timesig_t in all timesig-stuff * o draw a margin around notes which are in a bright color - * o use bars instead of flags over groups of 8ths / 16ths etc - * o deal with expanding parts or clip (expanding is better) * o refuse to resize so that width gets smaller or equal than x_left - * o add tracks in correct order to score * * stuff for the other muse developers * o process accurate timesignatures from muse's list (has to be implemented first in muse) diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h index cf46443c..255e09d5 100644 --- a/muse2/muse/midiedit/scoreedit.h +++ b/muse2/muse/midiedit/scoreedit.h @@ -377,7 +377,6 @@ struct note_len_t } }; -bool operator< (const note_len_t& a,const note_len_t& b); struct cumulative_t { -- cgit v1.2.3