summaryrefslogtreecommitdiff
path: root/muse2/muse/dialogs.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-04 17:43:39 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-04 17:43:39 +0000
commit5669de5d2d1b978bd34c80964d299688282d7027 (patch)
treed049caa2e608865a0381a7096d0f0b97a30a6474 /muse2/muse/dialogs.cpp
parent46369b4c33d841aa1ece363c3deb3775658165ad (diff)
added paste dialog plus minor fixes:
- moved and changed muse.pro file - added update_pro.sh and update_translations.sh - updated translations - moved stuff from functions.cpp out to dialogs.cpp - fixed behaviour of movePartsTotheRight(): parts which begin at "start of move" aren't expanded, but moved now
Diffstat (limited to 'muse2/muse/dialogs.cpp')
-rw-r--r--muse2/muse/dialogs.cpp126
1 files changed, 126 insertions, 0 deletions
diff --git a/muse2/muse/dialogs.cpp b/muse2/muse/dialogs.cpp
new file mode 100644
index 00000000..674aa232
--- /dev/null
+++ b/muse2/muse/dialogs.cpp
@@ -0,0 +1,126 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: functions.cpp,v 1.20.2.19 2011/05/05 20:10 flo93 Exp $
+// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//=========================================================
+
+#include "dialogs.h"
+#include "widgets/function_dialogs/velocity.h"
+#include "widgets/function_dialogs/quantize.h"
+#include "widgets/function_dialogs/crescendo.h"
+#include "widgets/function_dialogs/gatetime.h"
+#include "widgets/function_dialogs/remove.h"
+#include "widgets/function_dialogs/transpose.h"
+#include "widgets/function_dialogs/setlen.h"
+#include "widgets/function_dialogs/move.h"
+#include "widgets/function_dialogs/deloverlaps.h"
+#include "widgets/function_dialogs/legato.h"
+#include "widgets/pastedialog.h"
+
+#include "xml.h"
+
+#include <iostream>
+
+using namespace std;
+
+GateTime* gatetime_dialog=NULL;
+Velocity* velocity_dialog=NULL;
+Quantize* quantize_dialog=NULL;
+Remove* erase_dialog=NULL;
+DelOverlaps* del_overlaps_dialog=NULL;
+Setlen* set_notelen_dialog=NULL;
+Move* move_notes_dialog=NULL;
+Transpose* transpose_dialog=NULL;
+Crescendo* crescendo_dialog=NULL;
+Legato* legato_dialog=NULL;
+PasteDialog* paste_dialog=NULL;
+
+void init_function_dialogs(QWidget* parent)
+{
+ gatetime_dialog = new GateTime(parent);
+ velocity_dialog = new Velocity(parent);
+ quantize_dialog = new Quantize(parent);
+ erase_dialog = new Remove(parent);
+ del_overlaps_dialog = new DelOverlaps(parent);
+ set_notelen_dialog = new Setlen(parent);
+ move_notes_dialog = new Move(parent);
+ transpose_dialog = new Transpose(parent);
+ crescendo_dialog = new Crescendo(parent);
+ legato_dialog = new Legato(parent);
+ paste_dialog = new PasteDialog(parent);
+}
+
+void read_function_dialog_config(Xml& xml)
+{
+ if (erase_dialog==NULL)
+ {
+ cout << "ERROR: THIS SHOULD NEVER HAPPEN: read_function_dialog_config() called, but\n"
+ " dialogs are still uninitalized (NULL)!"<<endl;
+ return;
+ }
+
+ for (;;)
+ {
+ Xml::Token token = xml.parse();
+ if (token == Xml::Error || token == Xml::End)
+ break;
+
+ const QString& tag = xml.s1();
+ switch (token)
+ {
+ case Xml::TagStart:
+ if (tag == "mod_len")
+ gatetime_dialog->read_configuration(xml);
+ else if (tag == "mod_velo")
+ velocity_dialog->read_configuration(xml);
+ else if (tag == "quantize")
+ quantize_dialog->read_configuration(xml);
+ else if (tag == "erase")
+ erase_dialog->read_configuration(xml);
+ else if (tag == "del_overlaps")
+ del_overlaps_dialog->read_configuration(xml);
+ else if (tag == "setlen")
+ set_notelen_dialog->read_configuration(xml);
+ else if (tag == "move")
+ move_notes_dialog->read_configuration(xml);
+ else if (tag == "transpose")
+ transpose_dialog->read_configuration(xml);
+ else if (tag == "crescendo")
+ crescendo_dialog->read_configuration(xml);
+ else if (tag == "legato")
+ legato_dialog->read_configuration(xml);
+ else if (tag == "pastedialog")
+ paste_dialog->read_configuration(xml);
+ else
+ xml.unknown("dialogs");
+ break;
+
+ case Xml::TagEnd:
+ if (tag == "dialogs")
+ return;
+
+ default:
+ break;
+ }
+ }
+}
+
+void write_function_dialog_config(int level, Xml& xml)
+{
+ xml.tag(level++, "dialogs");
+
+ gatetime_dialog->write_configuration(level, xml);
+ velocity_dialog->write_configuration(level, xml);
+ quantize_dialog->write_configuration(level, xml);
+ erase_dialog->write_configuration(level, xml);
+ del_overlaps_dialog->write_configuration(level, xml);
+ set_notelen_dialog->write_configuration(level, xml);
+ move_notes_dialog->write_configuration(level, xml);
+ transpose_dialog->write_configuration(level, xml);
+ crescendo_dialog->write_configuration(level, xml);
+ legato_dialog->write_configuration(level, xml);
+ paste_dialog->write_configuration(level, xml);
+
+ xml.tag(level, "/dialogs");
+}