summaryrefslogtreecommitdiff
path: root/muse2/muse/midiedit
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/midiedit')
-rw-r--r--muse2/muse/midiedit/drumedit.cpp2
-rw-r--r--muse2/muse/midiedit/ecanvas.cpp91
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp2
-rw-r--r--muse2/muse/midiedit/scoreedit.cpp181
-rw-r--r--muse2/muse/midiedit/scoreedit.h74
5 files changed, 214 insertions, 136 deletions
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index b07ebbbe..52e63da0 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -53,6 +53,7 @@
#include "vscale.h"
#include "swidget.h"
#include "globals.h"
+#include "app.h"
#include "icons.h"
#include "filedialog.h"
#include "drummap.h"
@@ -535,6 +536,7 @@ DrumEdit::DrumEdit(MusECore::PartList* pl, QWidget* parent, const char* name, un
initTopwinState();
+ MusEGlobal::muse->topwinMenuInited(this);
}
//---------------------------------------------------------
diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp
index 9189d177..80d901bb 100644
--- a/muse2/muse/midiedit/ecanvas.cpp
+++ b/muse2/muse/midiedit/ecanvas.cpp
@@ -3,6 +3,7 @@
// Linux Music Editor
// $Id: ecanvas.cpp,v 1.8.2.6 2009/05/03 04:14:00 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -325,54 +326,54 @@ void EventCanvas::keyPress(QKeyEvent* event)
}
// Select items by key (PianoRoll & DrumEditor)
else if (key == shortcuts[SHRT_SEL_RIGHT].key || key == shortcuts[SHRT_SEL_RIGHT_ADD].key) {
- iCItem i, iRightmost;
- CItem* rightmost = NULL;
- //Get the rightmost selected note (if any)
- for (i = items.begin(); i != items.end(); ++i) {
- if (i->second->isSelected()) {
- iRightmost = i; rightmost = i->second;
- }
- }
- if (rightmost) {
- iCItem temp = iRightmost; temp++;
- //If so, deselect current note and select the one to the right
- if (temp != items.end()) {
- if (key != shortcuts[SHRT_SEL_RIGHT_ADD].key)
- deselectAll();
-
- iRightmost++;
- iRightmost->second->setSelected(true);
- updateSelection();
- }
- }
- //if (rightmost && mapx(rightmost->event().tick()) > width()) for some reason this doesn't this doesnt move the event in view
- // emit followEvent(rightmost->x());
-
+ rciCItem i;
+ for (i = items.rbegin(); i != items.rend(); ++i)
+ if (i->second->isSelected())
+ break;
+
+ if(i == items.rend())
+ i = items.rbegin();
+
+ if(i != items.rbegin())
+ --i;
+ if(i->second)
+ {
+ if (key != shortcuts[SHRT_SEL_RIGHT_ADD].key)
+ deselectAll();
+ CItem* sel = i->second;
+ sel->setSelected(true);
+ updateSelection();
+ if (sel->x() + sel->width() > mapxDev(width()))
+ {
+ int mx = rmapx(sel->x());
+ int newx = mx + rmapx(sel->width()) - width();
+ // Leave a bit of room for the specially-drawn drum notes. But good for piano too.
+ emit horizontalScroll( (newx > mx ? mx - 10: newx + 10) - rmapx(xorg) );
+ }
+ }
}
//Select items by key: (PianoRoll & DrumEditor)
else if (key == shortcuts[SHRT_SEL_LEFT].key || key == shortcuts[SHRT_SEL_LEFT_ADD].key) {
- iCItem i, iLeftmost;
- CItem* leftmost = NULL;
- if (items.size() > 0 ) {
- for (i = items.end(), i--; i != items.begin(); i--) {
- if (i->second->isSelected()) {
- iLeftmost = i; leftmost = i->second;
- }
- }
- if (leftmost) {
- if (iLeftmost != items.begin()) {
- //Add item
- if (key != shortcuts[SHRT_SEL_LEFT_ADD].key)
- deselectAll();
-
- iLeftmost--;
- iLeftmost->second->setSelected(true);
- updateSelection();
- }
- }
- //if (leftmost && mapx(leftmost->event().tick())< 0 ) for some reason this doesn't this doesnt move the event in view
- // emit followEvent(leftmost->x());
- }
+ ciCItem i;
+ for (i = items.begin(); i != items.end(); ++i)
+ if (i->second->isSelected())
+ break;
+
+ if(i == items.end())
+ i = items.begin();
+
+ if(i != items.begin())
+ --i;
+ if(i->second)
+ {
+ if (key != shortcuts[SHRT_SEL_LEFT_ADD].key)
+ deselectAll();
+ CItem* sel = i->second;
+ sel->setSelected(true);
+ updateSelection();
+ if (sel->x() <= mapxDev(0))
+ emit horizontalScroll(rmapx(sel->x() - xorg) - 10); // Leave a bit of room.
+ }
}
else if (key == shortcuts[SHRT_INC_PITCH].key) {
modifySelected(NoteInfo::VAL_PITCH, 1);
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index 926f4212..8c2a7a87 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -56,6 +56,7 @@
#include "tb1.h"
#include "utils.h"
#include "globals.h"
+#include "app.h"
#include "gconfig.h"
#include "icons.h"
#include "audio.h"
@@ -532,6 +533,7 @@ PianoRoll::PianoRoll(MusECore::PartList* pl, QWidget* parent, const char* name,
}
initTopwinState();
+ MusEGlobal::muse->topwinMenuInited(this);
}
//---------------------------------------------------------
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index b06f2487..51e1cafc 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -166,6 +166,15 @@ QColor* mycolors; // array [NUM_MYCOLORS]
set<QString> ScoreEdit::names;
+int ScoreCanvas::_quant_power2_init=3;
+int ScoreCanvas::_pixels_per_whole_init=300;
+int ScoreCanvas::note_velo_init=64;
+int ScoreCanvas::note_velo_off_init=64;
+int ScoreCanvas::new_len_init=0;
+ScoreCanvas::coloring_mode_t ScoreCanvas::coloring_mode_init=COLOR_MODE_BLACK;
+bool ScoreCanvas::preamble_contains_timesig_init=true;
+bool ScoreCanvas::preamble_contains_keysig_init=true;
+
//---------------------------------------------------------
// ScoreEdit
@@ -293,8 +302,22 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
len_actions->addAction(n32_action);
len_actions->addAction(nlast_action);
- nlast_action->setChecked(true);
- menu_command(CMD_NOTELEN_LAST);
+ switch (ScoreCanvas::new_len_init)
+ {
+ case 0: nlast_action->setChecked(true); menu_command(CMD_NOTELEN_LAST); break;
+ case 1: n1_action->setChecked(true); menu_command(CMD_NOTELEN_1); break;
+ case 2: n2_action->setChecked(true); menu_command(CMD_NOTELEN_2); break;
+ case 4: n4_action->setChecked(true); menu_command(CMD_NOTELEN_4); break;
+ case 8: n8_action->setChecked(true); menu_command(CMD_NOTELEN_8); break;
+ case 16: n16_action->setChecked(true); menu_command(CMD_NOTELEN_16); break;
+ case 32: n32_action->setChecked(true); menu_command(CMD_NOTELEN_32); break;
+ default:
+ cerr << "ERROR: THIS SHOULD NEVER HAPPEN. newLen is invalid in ScoreEdit::ScoreEdit.\n" <<
+ " (newLen="<<ScoreCanvas::new_len_init<<"; the only valid values are 0,1,2,4,8,16 and 32)\n" <<
+ " however, don't worry, this is no major problem, using 0 instead" << endl;
+ nlast_action->setChecked(true);
+ menu_command(CMD_NOTELEN_LAST);
+ }
note_settings_toolbar->addSeparator();
@@ -316,7 +339,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
connect(velo_spinbox, SIGNAL(editingFinished()), SLOT(velo_box_changed()));
connect(this,SIGNAL(velo_changed(int)), score_canvas, SLOT(set_velo(int)));
note_settings_toolbar->addWidget(velo_spinbox);
- velo_spinbox->setValue(64);
+ velo_spinbox->setValue(ScoreCanvas::note_velo_init);
note_settings_toolbar->addWidget(new QLabel(tr("Off-Velocity:"), note_settings_toolbar));
velo_off_spinbox = new QSpinBox(this);
@@ -327,7 +350,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
connect(velo_off_spinbox, SIGNAL(editingFinished()), SLOT(velo_off_box_changed()));
connect(this,SIGNAL(velo_off_changed(int)), score_canvas, SLOT(set_velo_off(int)));
note_settings_toolbar->addWidget(velo_off_spinbox);
- velo_off_spinbox->setValue(64);
+ velo_off_spinbox->setValue(ScoreCanvas::note_velo_off_init);
@@ -336,13 +359,16 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
quant_toolbar->addWidget(new QLabel(tr("Quantisation:"), quant_toolbar));
quant_combobox = new QComboBox(this);
quant_combobox->addItem("2"); // if you add or remove items from
- quant_combobox->addItem("4"); // here, also change quant_mapper[]
- quant_combobox->addItem("8"); // in ScoreCanvas::set_quant()!
+ quant_combobox->addItem("4"); // here, also change all code regarding
+ quant_combobox->addItem("8"); // _quant_power2 and _quant_power2_init
quant_combobox->addItem("16"); // and MAX_QUANT_POWER (must be log2(largest_value))
quant_combobox->addItem("32");
+ quant_combobox->setCurrentIndex(score_canvas->quant_power2()-1);
+ // the above is intendedly executed BEFORE connecting. otherwise this would
+ // destroy pixels_per_whole_init!
connect(quant_combobox, SIGNAL(currentIndexChanged(int)), score_canvas, SLOT(set_quant(int)));
quant_toolbar->addWidget(quant_combobox);
- quant_combobox->setCurrentIndex(2);
+
quant_toolbar->addSeparator();
@@ -353,7 +379,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
connect(px_per_whole_spinbox, SIGNAL(valueChanged(int)), score_canvas, SLOT(set_pixels_per_whole(int)));
connect(score_canvas, SIGNAL(pixels_per_whole_changed(int)), px_per_whole_spinbox, SLOT(setValue(int)));
quant_toolbar->addWidget(px_per_whole_spinbox);
- px_per_whole_spinbox->setValue(300);
+ px_per_whole_spinbox->setValue(ScoreCanvas::_pixels_per_whole_init);
QMenu* edit_menu = menuBar()->addMenu(tr("&Edit"));
@@ -454,8 +480,18 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
menu_mapper->setMapping(color_velo_action, CMD_COLOR_VELO);
menu_mapper->setMapping(color_part_action, CMD_COLOR_PART);
- color_black_action->setChecked(true);
- menu_command(CMD_COLOR_BLACK);
+ switch (ScoreCanvas::coloring_mode_init)
+ {
+ case 0: color_black_action->setChecked(true); menu_command(CMD_COLOR_BLACK); break;
+ case 1: color_velo_action->setChecked(true); menu_command(CMD_COLOR_VELO); break;
+ case 2: color_part_action->setChecked(true); menu_command(CMD_COLOR_PART); break;
+ default:
+ cerr << "ERROR: THIS SHOULD NEVER HAPPEN. noteColor is invalid in ScoreEdit::ScoreEdit.\n" <<
+ " (noteColor="<<ScoreCanvas::coloring_mode_init<<"; the only valid values are 0,1 and 2)\n" <<
+ " however, don't worry, this is no major problem, using 0 instead" << endl;
+ color_black_action->setChecked(true);
+ menu_command(CMD_COLOR_BLACK);
+ }
QMenu* preamble_menu = settings_menu->addMenu(tr("Set up &preamble"));
preamble_keysig_action = preamble_menu->addAction(tr("Display &key signature"));
@@ -466,8 +502,8 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
preamble_keysig_action->setCheckable(true);
preamble_timesig_action->setCheckable(true);
- preamble_keysig_action->setChecked(true);
- preamble_timesig_action->setChecked(true);
+ preamble_keysig_action->setChecked(ScoreCanvas::preamble_contains_keysig_init);
+ preamble_timesig_action->setChecked(ScoreCanvas::preamble_contains_timesig_init);
QAction* set_name_action = settings_menu->addAction(tr("Set Score &name"), menu_mapper, SLOT(map()));
menu_mapper->setMapping(set_name_action, CMD_SET_NAME);
@@ -503,6 +539,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
apply_velo=true;
initTopwinState();
+ MusEGlobal::muse->topwinMenuInited(this);
}
void ScoreEdit::init_shortcuts()
@@ -587,7 +624,7 @@ bool ScoreEdit::set_name(QString newname, bool emit_signal, bool emergency_name)
ScoreEdit::~ScoreEdit()
{
-
+ names.erase(name);
}
void ScoreEdit::velo_box_changed()
@@ -602,9 +639,9 @@ void ScoreEdit::velo_off_box_changed()
void ScoreEdit::song_changed(int flags)
{
- if(_isDeleting) // Ignore while while deleting to prevent crash.
- return;
-
+ if(_isDeleting) // Ignore while while deleting to prevent crash.
+ return;
+
if (flags & (SC_SELECTION | SC_EVENT_MODIFIED | SC_EVENT_REMOVED))
{
map<MusECore::Event*, MusECore::Part*> selection=get_events(score_canvas->get_all_parts(),1);
@@ -673,8 +710,9 @@ void ScoreEdit::viewport_height_changed(int height)
void ScoreEdit::closeEvent(QCloseEvent* e)
{
- _isDeleting = true; // Set flag so certain signals like songChanged, which may cause crash during delete, can be ignored.
-
+ _isDeleting = true; // Set flag so certain signals like songChanged, which may cause crash during delete, can be ignored.
+ names.erase(name);
+
QSettings settings("MusE", "MusE-qt");
//settings.setValue("ScoreEdit/geometry", saveGeometry());
settings.setValue("ScoreEdit/windowState", saveState());
@@ -692,8 +730,8 @@ void ScoreEdit::menu_command(int cmd)
{
bool ok;
QString newname = QInputDialog::getText(this, tr("Enter the new score title"),
- tr("Enter the new score title"), QLineEdit::Normal,
- name, &ok);
+ tr("Enter the new score title"), QLineEdit::Normal,
+ name, &ok);
if (ok)
{
if (!set_name(newname))
@@ -1059,7 +1097,23 @@ void ScoreEdit::read_configuration(MusECore::Xml& xml)
switch (token)
{
case MusECore::Xml::TagStart:
- if (tag == "topwin")
+ if (tag=="quantPowerInit")
+ ScoreCanvas::_quant_power2_init=xml.parseInt();
+ else if (tag=="pxPerWholeInit")
+ ScoreCanvas::_pixels_per_whole_init=xml.parseInt();
+ else if (tag=="newNoteVeloInit")
+ ScoreCanvas::note_velo_init=xml.parseInt();
+ else if (tag=="newNoteVeloOffInit")
+ ScoreCanvas::note_velo_off_init=xml.parseInt();
+ else if (tag=="newLenInit")
+ ScoreCanvas::new_len_init=xml.parseInt();
+ else if (tag=="noteColorInit")
+ ScoreCanvas::coloring_mode_init=(ScoreCanvas::coloring_mode_t)xml.parseInt();
+ else if (tag=="preambleContainsKeysig")
+ ScoreCanvas::preamble_contains_keysig_init=xml.parseInt();
+ else if (tag=="preambleContainsTimesig")
+ ScoreCanvas::preamble_contains_timesig_init=xml.parseInt();
+ else if (tag == "topwin")
TopWin::readConfiguration(SCORE, xml);
else
xml.unknown("ScoreEdit");
@@ -1079,7 +1133,18 @@ void ScoreEdit::read_configuration(MusECore::Xml& xml)
void ScoreEdit::write_configuration(int level, MusECore::Xml& xml)
{
xml.tag(level++, "scoreedit");
+
+ xml.intTag(level, "quantPowerInit", ScoreCanvas::_quant_power2_init);
+ xml.intTag(level, "pxPerWholeInit", ScoreCanvas::_pixels_per_whole_init);
+ xml.intTag(level, "newNoteVeloInit", ScoreCanvas::note_velo_init);
+ xml.intTag(level, "newNoteVeloOffInit", ScoreCanvas::note_velo_off_init);
+ xml.intTag(level, "newLenInit", ScoreCanvas::new_len_init);
+ xml.intTag(level, "noteColorInit", ScoreCanvas::coloring_mode_init);
+ xml.intTag(level, "preambleContainsKeysig", ScoreCanvas::preamble_contains_keysig_init);
+ xml.intTag(level, "preambleContainsTimesig", ScoreCanvas::preamble_contains_timesig_init);
+
TopWin::writeConfiguration(SCORE, level, xml);
+
xml.etag(level, "scoreedit");
}
@@ -1216,22 +1281,20 @@ ScoreCanvas::ScoreCanvas(ScoreEdit* pr, QWidget* parent_widget) : View(parent_wi
dragged_event_part=NULL;
last_len=384;
- new_len=-1;
+ new_len=-1; // will be initalized with new_len_init by ScoreEdit::ScoreEdit();
- set_quant(2); //this is actually unneccessary, as while
- //initalizing the quant_combobox, this gets
- //called again. but for safety...
- set_pixels_per_whole(300); //same as above. but safety rocks
+ _quant_power2=_quant_power2_init; // ScoreEdit relies on this to be done!
+ _pixels_per_whole_init = _pixels_per_whole_init;
- set_velo(64);
- set_velo_off(64);
+ note_velo=note_velo_init;
+ note_velo_off_init=note_velo_off_init;
dragging_staff=false;
- coloring_mode=COLOR_MODE_BLACK;
- preamble_contains_keysig=true;
- preamble_contains_timesig=true;
+ coloring_mode=coloring_mode_init;
+ preamble_contains_keysig=preamble_contains_keysig_init;
+ preamble_contains_timesig=preamble_contains_timesig_init;
x_scroll_speed=0;
@@ -1455,7 +1518,7 @@ void ScoreCanvas::song_changed(int flags)
{
if(parent && parent->deleting()) // Ignore while while deleting to prevent crash.
return;
-
+
if (flags & (SC_PART_MODIFIED | SC_PART_REMOVED | SC_PART_INSERTED | SC_TRACK_REMOVED))
{
update_parts();
@@ -1534,7 +1597,7 @@ void color_image(QImage& img, const QColor& color)
{
uchar* ptr=img.bits();
//int bytes=img.byteCount();
- int bytes=img.bytesPerLine() * img.height(); // By Tim. For older Qt versions. Tested OK on Qt4.5.
+ int bytes=img.bytesPerLine() * img.height(); // By Tim. For older Qt versions. Tested OK on Qt4.5.
int r,g,b;
color.getRgb(&r,&g,&b);
@@ -4280,16 +4343,16 @@ void ScoreCanvas::menu_command(int cmd)
{
switch (cmd)
{
- case CMD_COLOR_BLACK: coloring_mode=COLOR_MODE_BLACK; redraw(); break;
- case CMD_COLOR_PART: coloring_mode=COLOR_MODE_PART; redraw(); break;
- case CMD_COLOR_VELO: coloring_mode=COLOR_MODE_VELO; redraw(); break;
- case CMD_NOTELEN_1: new_len=TICKS_PER_WHOLE/ 1; break;
- case CMD_NOTELEN_2: new_len=TICKS_PER_WHOLE/ 2; break;
- case CMD_NOTELEN_4: new_len=TICKS_PER_WHOLE/ 4; break;
- case CMD_NOTELEN_8: new_len=TICKS_PER_WHOLE/ 8; break;
- case CMD_NOTELEN_16: new_len=TICKS_PER_WHOLE/16; break;
- case CMD_NOTELEN_32: new_len=TICKS_PER_WHOLE/32; break;
- case CMD_NOTELEN_LAST: new_len=-1; break;
+ case CMD_COLOR_BLACK: coloring_mode_init=coloring_mode=COLOR_MODE_BLACK; redraw(); break;
+ case CMD_COLOR_PART: coloring_mode_init=coloring_mode=COLOR_MODE_PART; redraw(); break;
+ case CMD_COLOR_VELO: coloring_mode_init=coloring_mode=COLOR_MODE_VELO; redraw(); break;
+ case CMD_NOTELEN_1: new_len_init= 1; new_len=TICKS_PER_WHOLE/ 1; break;
+ case CMD_NOTELEN_2: new_len_init= 2; new_len=TICKS_PER_WHOLE/ 2; break;
+ case CMD_NOTELEN_4: new_len_init= 4; new_len=TICKS_PER_WHOLE/ 4; break;
+ case CMD_NOTELEN_8: new_len_init= 8; new_len=TICKS_PER_WHOLE/ 8; break;
+ case CMD_NOTELEN_16: new_len_init=16; new_len=TICKS_PER_WHOLE/16; break;
+ case CMD_NOTELEN_32: new_len_init=32; new_len=TICKS_PER_WHOLE/32; break;
+ case CMD_NOTELEN_LAST: new_len_init= 0; new_len=-1; break;
default:
cerr << "ERROR: ILLEGAL FUNCTION CALL: ScoreCanvas::menu_command called with unknown command ("<<cmd<<")"<<endl;
@@ -4299,23 +4362,24 @@ void ScoreCanvas::menu_command(int cmd)
void ScoreCanvas::preamble_keysig_slot(bool state)
{
preamble_contains_keysig=state;
+ preamble_contains_keysig_init=state;
redraw();
}
void ScoreCanvas::preamble_timesig_slot(bool state)
{
preamble_contains_timesig=state;
+ preamble_contains_timesig_init=state;
redraw();
}
void ScoreCanvas::set_quant(int val)
{
- int quant_mapper[]={1,2,3,4,5};
-
- if ((val>=0) && (val<signed(sizeof(quant_mapper)/sizeof(*quant_mapper))))
+ if ((val>=0) && (val<5))
{
int old_len=quant_len();
- _quant_power2=quant_mapper[val];
+ _quant_power2=val+1;
+ _quant_power2_init=_quant_power2;
set_pixels_per_whole(pixels_per_whole() * quant_len() / old_len );
@@ -4342,6 +4406,7 @@ void ScoreCanvas::set_pixels_per_whole(int val)
// zero!)
_pixels_per_whole=val;
+ _pixels_per_whole_init=val;
for (list<staff_t>::iterator it=staves.begin(); it!=staves.end(); it++)
it->calc_item_pos();
@@ -4383,6 +4448,7 @@ void ScoreCanvas::maybe_close_if_empty()
void ScoreCanvas::set_velo(int velo)
{
note_velo=velo;
+ note_velo_init=velo;
if (parent->get_apply_velo())
modify_velocity(get_all_parts(),1, 0,velo);
@@ -4391,6 +4457,7 @@ void ScoreCanvas::set_velo(int velo)
void ScoreCanvas::set_velo_off(int velo)
{
note_velo_off=velo;
+ note_velo_off_init=velo;
if (parent->get_apply_velo())
modify_off_velocity(get_all_parts(),1, 0,velo);
@@ -4586,24 +4653,23 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
/* BUGS and potential bugs
* o tied notes don't work properly when there's a key-change in
* between, for example, when a cis is tied to a des
- * o schedule_all_same_len_parts: if there are two clones A and B,
- * and both A and B get scheduled to be expanded (because we
- * have one event from A and one event from B), this causes a bug,
- * because after A (and B) got resized, the B-resize is invalid!
- * o when changing toolbarstate when sharing and immediately after that
+ * > o when changing toolbarstate when sharing and immediately after that
* changing "share" status, the changed state isn't stored
+ * (could be solved by storing the current window when quitting/saving whatever)
* ? pasting in editors sometimes fails oO? ( ERROR: reading eventlist
* from clipboard failed. ignoring this one... ) [ not reproducible ]
- * > o non-mdi topwin states aren't restored when launching muse2 somefile.med
* ! o using super glue while a score editor displaying the glued parts
* is open lets muse segfault. this may or may not be fixed in
* the release branch :/
*
* CURRENT TODO
* > o fix valgrind problems (the two "FINDMICHJETZT" lines in scoreedit.cpp)
- * > o newly created windows have to be focussed!
+ * > o add a songposition scrollbar-toolbar (in different sizes)
+ * this might be equivalent to "redo transport menu" (below).
+ * > o add toolbar(s) for tempo- etc spinboxes from the transport window
*
* IMPORTANT TODO
+ * o support edge-scrolling when opening a lasso
* o add "dotted quarter" quantize option (for 6/8 beat)
* o ticks-to-quarter spinboxes
* o mirror most menus to an additional right-click context menu to avoid the long mouse pointer
@@ -4628,6 +4694,7 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
* o thin out: remove unneeded ctrl messages
*
* less important stuff
+ * o allow "fixating" toolbars?
* o quantize-templates (everything is forced into a specified
* rhythm)
* o part-templates (you specify some notes and a control-chord;
@@ -4639,8 +4706,6 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
* 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 support edge-scrolling when opening a lasso
- * o save more configuration stuff (quant, color)
*
* really unimportant nice-to-haves
* o support in-song clef-changes
@@ -4653,10 +4718,6 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
*
*
* stuff for the other muse developers
- * o update translations
- * o remove ambiguous translation: "offset"="zeitversatz"
- * this is ambigous in mod. note len and WRONG in mod. velo dialogs
- *
* o process accurate timesignatures from muse's list (has to be implemented first in muse)
* ( (2+2+3)/4 or (3+2+2)/4 instead of 7/4 )
*/
diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h
index baea78e3..37765dda 100644
--- a/muse2/muse/midiedit/scoreedit.h
+++ b/muse2/muse/midiedit/scoreedit.h
@@ -668,8 +668,20 @@ class ScoreCanvas : public MusEGui::View
void move_staff_below(list<staff_t>::iterator dest, list<staff_t>::iterator src);
void cleanup_staves();
void maybe_close_if_empty();
-
+
+// defaults ----------------------------------------------------------
+ public:
+ enum coloring_mode_t {COLOR_MODE_BLACK, COLOR_MODE_PART, COLOR_MODE_VELO};
+ static int _quant_power2_init;
+ static int _pixels_per_whole_init;
+ static int note_velo_init, note_velo_off_init;
+ static int new_len_init;
+ static coloring_mode_t coloring_mode_init;
+ static bool preamble_contains_timesig_init;
+ static bool preamble_contains_keysig_init;
+
// member variables ---------------------------------------------------
+ private:
int _quant_power2;
int _pixels_per_whole;
@@ -746,7 +758,7 @@ class ScoreCanvas : public MusEGui::View
bool srec;
bool held_notes[128];
- enum {COLOR_MODE_BLACK, COLOR_MODE_PART, COLOR_MODE_VELO} coloring_mode;
+ coloring_mode_t coloring_mode;
bool preamble_contains_keysig;
bool preamble_contains_timesig;
@@ -776,38 +788,38 @@ class ScoreCanvas : public MusEGui::View
void add_new_parts(const std::map< MusECore::Part*, std::set<MusECore::Part*> >&);
- public slots:
- void x_scroll_event(int);
- void y_scroll_event(int);
- void song_changed(int);
- void fully_recalculate();
- void goto_tick(int,bool);
- void pos_changed(int i, unsigned u, bool b);
- void heartbeat_timer_event();
-
- void set_tool(int);
- void set_quant(int);
- void menu_command(int);
- void preamble_keysig_slot(bool);
- void preamble_timesig_slot(bool);
- void set_pixels_per_whole(int);
+ public slots:
+ void x_scroll_event(int);
+ void y_scroll_event(int);
+ void song_changed(int);
+ void fully_recalculate();
+ void goto_tick(int,bool);
+ void pos_changed(int i, unsigned u, bool b);
+ void heartbeat_timer_event();
- void set_velo(int);
- void set_velo_off(int);
+ void set_tool(int);
+ void set_quant(int);
+ void menu_command(int);
+ void preamble_keysig_slot(bool);
+ void preamble_timesig_slot(bool);
+ void set_pixels_per_whole(int);
- void set_steprec(bool);
-
- void update_parts(); //re-populates the set<MusECore::Part*>s from the set<int>s
+ void set_velo(int);
+ void set_velo_off(int);
+
+ void set_steprec(bool);
+
+ void update_parts(); //re-populates the set<MusECore::Part*>s from the set<int>s
signals:
- void xscroll_changed(int);
- void yscroll_changed(int);
- void viewport_width_changed(int);
- void canvas_width_changed(int);
- void preamble_width_changed(int);
- void viewport_height_changed(int);
- void canvas_height_changed(int);
- void pixels_per_whole_changed(int);
- void pos_add_changed();
+ void xscroll_changed(int);
+ void yscroll_changed(int);
+ void viewport_width_changed(int);
+ void canvas_width_changed(int);
+ void preamble_width_changed(int);
+ void viewport_height_changed(int);
+ void canvas_height_changed(int);
+ void pixels_per_whole_changed(int);
+ void pos_add_changed();
protected:
virtual void draw(QPainter& p, const QRect& rect);