Config.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 <QPoint>
  21. #include <QSize>
  22. #include <QRect>
  23. #include <QVector>
  24. #include <QMap>
  25. #include <QString>
  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 = 0xff000000; // colors for white and black key lablels
  47. const unsigned int cdef_color_piano_lbl_wh_on = 0xff00857d;
  48. const unsigned int cdef_color_piano_lbl_bl = 0xffffffff;
  49. const unsigned int cdef_color_piano_lbl_bl_on = 0xffeafffe;
  50. const unsigned int cdef_color_logtab_err = 0xffff0000;
  51. const QString cdef_color_dynbtn_off = "#b7b7b7"; // CSS color
  52. const QString cdef_color_dynbtn_bg = "#77ded8"; // background graph button color
  53. const QString cdef_color_dynbtn_on = "#00857d"; // foreground graph button color
  54. const QString cdef_color_dynbtn_on_bg = "#eafffe";
  55. const QPoint c_slideclick_limit = QPoint(3, 3);
  56. // editor config
  57. namespace qne {
  58. typedef struct _editorNote {
  59. quint64 id;
  60. int keyNumber;
  61. int velocity;
  62. int pulseLength;
  63. int pulseOffset;
  64. QString txt;
  65. EColor color;
  66. bool cached;
  67. bool selected;
  68. QRect r; // rectangle in pixels
  69. QPoint dragSt; // used to store start topleft pos in pixels at start of dragging
  70. // settings
  71. // effects
  72. _editorNote() : id(0), keyNumber(0), pulseLength(0), pulseOffset(0), txt("TEXT_HERE"),
  73. cached(false), selected(false), r(0,0,0,0) {}
  74. } editorNote;
  75. typedef struct _editorNotes {
  76. QMap<quint64, editorNote> idMap;
  77. QVector<QVector<quint64> > grid;
  78. QVector<quint64> selected;
  79. } editorNotes;
  80. typedef struct _editorState {
  81. QRect viewport;
  82. bool rmbScrollEnabled;
  83. bool editingEnabled;
  84. bool gridSnapEnabled;
  85. QRect selectionRect;
  86. int snapLine;
  87. _editorState() : rmbScrollEnabled(true), editingEnabled(false), gridSnapEnabled(true), snapLine(-1) {}
  88. } editorState;
  89. }
  90. #endif // QTAUCONFIG_H