Skip to content

Instantly share code, notes, and snippets.

@JoshuaBonn1
JoshuaBonn1 / timelineFragment.cpp
Created December 21, 2018 03:37
Figuring out the canvas
void Timeline::updateView()
{
if (_cv && _score) {
QRectF canvas = QRectF(_cv->matrix().inverted().mapRect(_cv->geometry()));
std::set<std::pair<Measure*, int>> visible_items_set;
//Find visible measures of score
for (Measure* curr_measure = _score->firstMeasure(); curr_measure; curr_measure = curr_measure->nextMeasure()) {
System* system = curr_measure->system();
Timeline dock widget
|
|-Top Section
| |
| |-Labels
| | |
| | |-Label 1, 2, 3, etc.
| |
| |-Rows
| |
@JoshuaBonn1
JoshuaBonn1 / gist:19fbfa62850466708199db47648a98c8
Last active August 14, 2018 06:04
Joshua Bonn GSoC 2018 MuseScore Final Report
My work over GSoC 2018:
I spent my time of GSoC 2018 on two projects. The first project was an expansion of the existing workspace functionality in
MuseScore. The goal of this was to make workspaces more customizable as well as standardize some loading and saving of
workspaces. I worked on this for the first 5 weeks.
Then, I worked on adding the framework to add functionality tours to MuseScore. The goal with this was to create a simple
framework that would allow developers to create functionality tours with little to no extra code. The tours would also be used on
startup as a "Welcome Tour" to assist new MuseScore users. I worked on this until the end of GSoC.
At the end of GSoC, I have created two pull requests that hold my code for the projects. The code is ready and waiting to be
merged.
{
MsWidget::SCORE_TAB,
STATE_NORMAL,
"toggle-mmrest",
QT_TRANSLATE_NOOP("action","Toggle 'Create Multimeasure Rest'"),
QT_TRANSLATE_NOOP("action","Toggle 'Create Multimeasure Rest'"),
0,
Icons::Invalid_ICON,
Qt::WindowShortcut
},
@JoshuaBonn1
JoshuaBonn1 / gist:38eb08f4ef85f0a8b753fecedede36db
Created April 24, 2018 21:16
Action Limiting/Custom State Creation
Goal:
Add functionality to create new states by disabling different actions throughout the menu and toolbars.
Components:
Ability to disable actions
Ability to save states
Ability to access states
Ability to save/load states to/from preferences file
Further Discussion:
At the bottom of this gist is a bunch of links to all the work that I completed over the summer.
For a more comprehensive explanation, see those.
This summer, I worked on a Timeline for Musescore to assist users in navigating large scores.
It creates a grid for measures and instrument names as well as multiple helpful key values.
By interacting with the timeline, the score is moved around and creates quick navigation.
A full list of all the features of the timeline is here:
https://musescore.org/en/node/245526
Timeline Basic Functionality
More detail on my blog: https://musescore.org/en/user/1190941/blog
Week 1: https://musescore.org/en/user/1190941/blog/2017/06/03/gsoc-2017-timeline-navigation-weekly-report-1
Week 2: https://musescore.org/en/user/1190941/blog/2017/06/10/gsoc-2017-timeline-navigation-weekly-report-2
Week 3: https://musescore.org/en/user/1190941/blog/2017/06/17/gsoc-2017-timeline-navigation-weekly-report-3
Week 4: https://musescore.org/en/user/1190941/blog/2017/06/24/gsoc-2017-timeline-navigation-weekly-report-4
Week 5: https://musescore.org/en/user/1190941/blog/2017/07/01/gsoc-2017-timeline-navigation-weekly-report-5
$ git status
On branch 3-timeline-class
Your branch is ahead of 'origin/3-timeline-class' by 11 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
Joshua Bonn@DESKTOP-RPS5INU MINGW64 /a/musescore (3-timeline-class)
$ git log
commit e99d91a95d0c8cc0ee2c4a5b4ef1ef7f38a89adc (HEAD -> 3-timeline-class)
Merge: 95c360025 a33ec63ca
Author: Joshua Bonn <jebonn@comcast.net>
Date: Fri Jun 2 13:52:33 2017 -0700
Merge branch '3-debug' into 3-timeline-class
commit a33ec63ca35649a3f33c33b3c903d4d30190c8cf (3-debug)
So, i've been trying to fix a bug when first opening the timeline.
Instead of the timeline being in the topleft of the dockwidget, it is in the middle.
after looking into it, i have to set the scenerect, which i did. I set it to the width and height of the dock widget.
However, the debugger showed that those sizes were very different from the actual width and height you see visually.
I believe this is because the dock widget is not actually in place yet, so it gives me default sizes of like 480 and 640.
Is there someway i can get the proper values (AKA the values of dockwidget when it is actually displayed on the screen)?