summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-10-20 21:09:24 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-10-20 21:09:24 +0000
commitbb0f5c242c6741e3acbdbfbdb3bdb4f7dcdb37c5 (patch)
treed6f1c4e89afdb9018a947783d235f96dd7c6370c /muse2/muse
parent5e0e1aa944b64318c41db551886d95de9412677a (diff)
merged back release branch to trunk
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/functions.cpp10
-rw-r--r--muse2/muse/midiedit/drumedit.cpp5
-rw-r--r--muse2/muse/widgets/function_dialogs/quantbase.ui24
-rw-r--r--muse2/muse/widgets/function_dialogs/quantize.cpp22
-rw-r--r--muse2/muse/widgets/function_dialogs/quantize.h5
5 files changed, 53 insertions, 13 deletions
diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp
index e0f9690c..256e4ad0 100644
--- a/muse2/muse/functions.cpp
+++ b/muse2/muse/functions.cpp
@@ -177,8 +177,9 @@ bool quantize_notes(const set<Part*>& parts)
{
if (!MusEGui::quantize_dialog->exec())
return false;
-
- quantize_notes(parts, MusEGui::quantize_dialog->range, (MusEGlobal::config.division*4)/(1<<MusEGui::quantize_dialog->raster_power2),
+// (1<<MusEGui::quantize_dialog->raster_power2)
+ int raster = MusEGui::rasterVals[MusEGui::quantize_dialog->raster_index];
+ quantize_notes(parts, MusEGui::quantize_dialog->range, (MusEGlobal::config.division*4)/raster,
MusEGui::quantize_dialog->quant_len, MusEGui::quantize_dialog->strength, MusEGui::quantize_dialog->swing,
MusEGui::quantize_dialog->threshold);
@@ -306,8 +307,9 @@ bool quantize_notes()
parts=get_all_selected_parts();
else
parts=get_all_parts();
-
- quantize_notes(parts, MusEGui::quantize_dialog->range & FUNCTION_RANGE_ONLY_BETWEEN_MARKERS, (config.division*4)/(1<<MusEGui::quantize_dialog->raster_power2),
+
+ int raster = MusEGui::rasterVals[MusEGui::quantize_dialog->raster_index];
+ quantize_notes(parts, MusEGui::quantize_dialog->range & FUNCTION_RANGE_ONLY_BETWEEN_MARKERS, (config.division*4)/raster,
MusEGui::quantize_dialog->quant_len, MusEGui::quantize_dialog->strength, MusEGui::quantize_dialog->swing,
MusEGui::quantize_dialog->threshold);
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index 19700a4e..b07ebbbe 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -945,12 +945,15 @@ void DrumEdit::cmd(int cmd)
case DrumCanvas::CMD_MODIFY_VELOCITY: modify_velocity(partlist_to_set(parts())); break;
case DrumCanvas::CMD_CRESCENDO: crescendo(partlist_to_set(parts())); break;
case DrumCanvas::CMD_QUANTIZE:
+ {
+ int raster = MusEGui::rasterVals[MusEGui::quantize_dialog->raster_index];
if (quantize_dialog->exec())
quantize_notes(partlist_to_set(parts()), quantize_dialog->range,
- (MusEGlobal::config.division*4)/(1<<quantize_dialog->raster_power2),
+ (MusEGlobal::config.division*4)/raster,
/* quant_len= */false, quantize_dialog->strength,
quantize_dialog->swing, quantize_dialog->threshold);
break;
+ }
case DrumCanvas::CMD_ERASE_EVENT: erase_notes(partlist_to_set(parts())); break;
case DrumCanvas::CMD_DEL: erase_notes(partlist_to_set(parts()),1); break; //delete selected events
case DrumCanvas::CMD_DELETE_OVERLAPS: delete_overlaps(partlist_to_set(parts())); break;
diff --git a/muse2/muse/widgets/function_dialogs/quantbase.ui b/muse2/muse/widgets/function_dialogs/quantbase.ui
index 973be7b8..31173e46 100644
--- a/muse2/muse/widgets/function_dialogs/quantbase.ui
+++ b/muse2/muse/widgets/function_dialogs/quantbase.ui
@@ -157,7 +157,7 @@
<bool>false</bool>
</property>
<property name="currentIndex">
- <number>3</number>
+ <number>0</number>
</property>
<property name="frame">
<bool>true</bool>
@@ -174,7 +174,12 @@
</item>
<item>
<property name="text">
- <string>Quarter</string>
+ <string>4th</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>4th Triplet</string>
</property>
</item>
<item>
@@ -184,14 +189,29 @@
</item>
<item>
<property name="text">
+ <string>8th Triplet</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
<string>16th</string>
</property>
</item>
<item>
<property name="text">
+ <string>16th Triplet</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
<string>32th</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>32th Triplet</string>
+ </property>
+ </item>
</widget>
</item>
<item row="3" column="0">
diff --git a/muse2/muse/widgets/function_dialogs/quantize.cpp b/muse2/muse/widgets/function_dialogs/quantize.cpp
index df7c0298..7233c2b8 100644
--- a/muse2/muse/widgets/function_dialogs/quantize.cpp
+++ b/muse2/muse/widgets/function_dialogs/quantize.cpp
@@ -26,6 +26,20 @@
namespace MusEGui {
+int rasterVals[] = {
+ 1, // Whole note divisor
+ 2, // Half note divisor
+ 4, // 4th note divisor
+ 6, // 4thT divisor
+ 8, // 8th divisor
+ 12,//8thT divisor
+ 16,// ...
+ 24,
+ 32,
+ 48,
+ 64
+};
+
Quantize::Quantize(QWidget* parent)
: QDialog(parent)
{
@@ -44,7 +58,7 @@ void Quantize::pull_values()
range = range_group->checkedId();
strength = strength_spinbox->value();
threshold = threshold_spinbox->value();
- raster_power2 = raster_combobox->currentIndex();
+ raster_index = raster_combobox->currentIndex();
quant_len = len_checkbox->isChecked();
swing = swing_spinbox->value();
}
@@ -62,7 +76,7 @@ int Quantize::exec()
range_group->button(range)->setChecked(true);
strength_spinbox->setValue(strength);
threshold_spinbox->setValue(threshold);
- raster_combobox->setCurrentIndex(raster_power2);
+ raster_combobox->setCurrentIndex(raster_index);
len_checkbox->setChecked(quant_len);
swing_spinbox->setValue(swing);
@@ -88,7 +102,7 @@ void Quantize::read_configuration(MusECore::Xml& xml)
else if (tag == "threshold")
threshold=xml.parseInt();
else if (tag == "raster")
- raster_power2=xml.parseInt();
+ raster_index=xml.parseInt();
else if (tag == "swing")
swing=xml.parseInt();
else if (tag == "quant_len")
@@ -113,7 +127,7 @@ void Quantize::write_configuration(int level, MusECore::Xml& xml)
xml.intTag(level, "range", range);
xml.intTag(level, "strength", strength);
xml.intTag(level, "threshold", threshold);
- xml.intTag(level, "raster", raster_power2);
+ xml.intTag(level, "raster", raster_index);
xml.intTag(level, "swing", swing);
xml.intTag(level, "quant_len", quant_len);
xml.tag(level, "/quantize");
diff --git a/muse2/muse/widgets/function_dialogs/quantize.h b/muse2/muse/widgets/function_dialogs/quantize.h
index 6ce74215..b5229f9e 100644
--- a/muse2/muse/widgets/function_dialogs/quantize.h
+++ b/muse2/muse/widgets/function_dialogs/quantize.h
@@ -33,6 +33,7 @@ class Xml;
namespace MusEGui {
+
class Quantize : public QDialog, public Ui::QuantBase
{
Q_OBJECT
@@ -50,18 +51,18 @@ class Quantize : public QDialog, public Ui::QuantBase
int range;
int strength;
int threshold;
- int raster_power2;
+ int raster_index;
int swing;
bool quant_len;
void read_configuration(MusECore::Xml& xml);
void write_configuration(int level, MusECore::Xml& xml);
-
public slots:
int exec();
};
+extern int rasterVals[];
} // namespace MusEGui
#endif