Config.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. This file is part of QTau
  3. Copyright (C) 2013-2018 Tobias "Tomoko" Platen <tplaten@posteo.de>
  4. Copyright (C) 2013 digited <https://github.com/digited>
  5. Copyright (C) 2010-2013 HAL@ShurabaP <https://github.com/haruneko>
  6. QTau is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. SPDX-License-Identifier: GPL-3.0+
  17. */
  18. #ifndef QTAUCONFIG_H
  19. #define QTAUCONFIG_H
  20. #include <QMap>
  21. #include <QPoint>
  22. #include <QRect>
  23. #include <QSize>
  24. #include <QString>
  25. #include <QVector>
  26. // default config for custom ui widgets
  27. const unsigned int cdef_color_black_key_bg = 0xff666666;
  28. const unsigned int cdef_color_black_noteline_bg = 0xffb8b8b8; // aarrggbb
  29. const unsigned int cdef_color_inner_line = 0xffbcbcbc;
  30. const unsigned int cdef_color_outer_line = 0xff0095c6;
  31. const unsigned int cdef_color_note_border = 0xff000000;
  32. const unsigned int cdef_color_note_bg = 0xffffffff;
  33. const unsigned int cdef_color_note_bg_green = 0xff55ff55;
  34. const unsigned int cdef_color_note_bg_red = 0xffff5555;
  35. const unsigned int cdef_color_note_sel = 0xff0095c6;
  36. const unsigned int cdef_color_note_sel_bg = 0xffe3eeff;
  37. const unsigned int cdef_color_note_sel_bg_green = 0xff55ffff;
  38. const unsigned int cdef_color_note_sel_bg_red = 0xffff55ff;
  39. const unsigned int cdef_color_selrect = 0xff00857d;
  40. const unsigned int cdef_color_selrect_bg = 0x2200857d;
  41. const unsigned int cdef_color_snap_line = 0xaa3effab;
  42. const unsigned int cdef_color_selection_grey = 100;
  43. const unsigned int cdef_color_selection_alpha = 80;
  44. const unsigned int cdef_color_selection_bg_grey = 128;
  45. const unsigned int cdef_color_selection_bg_alpha = 50;
  46. const unsigned int cdef_color_piano_lbl_wh =
  47. 0xff000000; // colors for white and black key lablels
  48. const unsigned int cdef_color_piano_lbl_wh_on = 0xff00857d;
  49. const unsigned int cdef_color_piano_lbl_bl = 0xffffffff;
  50. const unsigned int cdef_color_piano_lbl_bl_on = 0xffeafffe;
  51. const unsigned int cdef_color_logtab_err = 0xffff0000;
  52. const QString cdef_color_dynbtn_off = "#b7b7b7"; // CSS color
  53. const QString cdef_color_dynbtn_bg =
  54. "#77ded8"; // background graph button color
  55. const QString cdef_color_dynbtn_on =
  56. "#00857d"; // foreground graph button color
  57. const QString cdef_color_dynbtn_on_bg = "#eafffe";
  58. const QPoint c_slideclick_limit = QPoint(3, 3);
  59. // editor config
  60. namespace qne {
  61. typedef struct _editorNote {
  62. quint64 id;
  63. int keyNumber;
  64. int velocity;
  65. int pulseLength;
  66. int pulseOffset;
  67. QString txt;
  68. EColor color;
  69. bool cached;
  70. bool selected;
  71. QRect r; // rectangle in pixels
  72. QPoint
  73. dragSt; // used to store start topleft pos in pixels at start of dragging
  74. // settings
  75. // effects
  76. _editorNote()
  77. : id(0),
  78. keyNumber(0),
  79. pulseLength(0),
  80. pulseOffset(0),
  81. txt("TEXT_HERE"),
  82. cached(false),
  83. selected(false),
  84. r(0, 0, 0, 0) {}
  85. } editorNote;
  86. typedef struct _editorNotes {
  87. QMap<quint64, editorNote> idMap;
  88. QVector<QVector<quint64> > grid;
  89. QVector<quint64> selected;
  90. } editorNotes;
  91. typedef struct _editorState {
  92. QRect viewport;
  93. bool rmbScrollEnabled;
  94. bool editingEnabled;
  95. bool gridSnapEnabled;
  96. QRect selectionRect;
  97. int snapLine;
  98. _editorState()
  99. : rmbScrollEnabled(true),
  100. editingEnabled(false),
  101. gridSnapEnabled(true),
  102. snapLine(-1) {}
  103. } editorState;
  104. } // namespace qne
  105. #endif // QTAUCONFIG_H