//========================================================= // 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 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)!"<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"); }