Skip to content

Commit

Permalink
Added note-info tooltips.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Aug 21, 2024
1 parent 20499bc commit 5071ea0
Show file tree
Hide file tree
Showing 11 changed files with 278 additions and 46 deletions.
6 changes: 4 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEWS for Seq66 0.99.14
Chris Ahlstrom
2015-07-10 to 2024-08-18
2015-07-10 to 2024-08-21

# Changelog

Expand All @@ -14,7 +14,8 @@ Chris Ahlstrom
if not playing and not in adding mode. Similar to the fix made to
the pattern editor for issue #117.
- Added the elliptical progress-box option to Preferences / Display.
- Replaced the --session-tag option with --session.
- In the pattern editor, a tiny unlabelled button toggles the
showing of note information when the mouse hovers over a note.

### Fixed

Expand All @@ -31,6 +32,7 @@ Chris Ahlstrom
- Standardized on "Overdub" for the pattern-window merge functionality.
See issue #128.
- Updating the PDF documentation based on issue fixes and other fixes.
- Replaced the --session-tag option with --session.

## [0.99.13] - 2024-08-05

Expand Down
49 changes: 23 additions & 26 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
TO DO for Seq66 0.99.14
Chris Ahlstrom
2019-04-13 to 2024-08-15

Priority:

- Fix and test new record/quantize handling, and verify that
MIDI automation of these displays in the pattern editor.
- Make sure metronome buttons etc. still work. Recorded measures
not saved.
- Make sure meta events are never sent via MIDI. What we see is
that is_ex_data() events are skipped. We now allow SysEx to be
sent, but we need a test file for it. Can improve this slightly.
- Add "make install" support to qbuild.sh. In progress.
- When zooming, try to keep the same viewport in view. Got this working
for horizontal seqroll and perfroll, but not for vertical (refactoring
needed). Try to center vertically on notes in the viewport.
- Make it center on notes if not visible.
- Can we distinguish note-insertion from movement snap, to avoid the
"L"-then-snap-then-move samba?
- #97 Seq24 differences
- #102 How can I use mutes?
- #103 One-shot (repetitions != 0) patterns do not play
- #111 Time signature changes does not get saved on .midi file
- #112 Send midi-control-out message when New Pattern is created in GUI
- #115 Accessing Non-Registered Parameter Numbers (NRPNs) possible?
2019-04-13 to 2024-08-21

Mutes:

Expand All @@ -40,13 +17,14 @@ Playlists:

From Testing:

- Add an option fix notes by shortening them a few ticks.
- File errors (fixed!), but odd issues (w/qsynth):
'/usr/local/share/seq66-0.99/midi/FM/judyblue.mid' plays, but some
notes are blipped out. Try with another player.
'/usr/local/share/seq66-0.99/midi/FM/longhair.mid' plays just fine
mostly, some glitches.
- The 'usr' time-color settings do not seem to work. Actually, it does
work, but not with the Qt gtk styling.
work, but not with the Qt gtk styling. Document this issue.
- The Carpet song has PPQN = 120 and displays weirdly in pattern editor.
Too difficult to fix at this time; converted it to 192.
In the calculations module, rigorize default_pulses_per_measure()
Expand All @@ -56,14 +34,33 @@ From Testing:
that the user convert to 192 PPQN or one of the other supported
settings, then save, and reopen. Test alternate time signatures.


Ongoing efforts:

- Verify setmapper/setmaster for odd set sizes.
- Why does velocity change in data pane not work when starting from the
left in barrage.midi? The Kepler34 "relative change" feature. This
feature is macroed out for now. Perhaps should make it a Ctrl-Click or
something to start it in addition to "would select".
- Fix and test new record/quantize handling, and verify that
MIDI automation of these displays in the pattern editor.
- Make sure metronome buttons etc. still work. Recorded measures
not saved.
- Make sure meta events are never sent via MIDI. What we see is
that is_ex_data() events are skipped. We now allow SysEx to be
sent, but we need a test file for it. Can improve this slightly.
- Add "make install" support to qbuild.sh. In progress.
- When zooming, try to keep the same viewport in view. Got this working
for horizontal seqroll and perfroll, but not for vertical (refactoring
needed). Try to center vertically on notes in the viewport.
- Make it center on notes if not visible.
- Can we distinguish note-insertion from movement snap, to avoid the
"L"-then-snap-then-move samba?
- #97 Seq24 differences
- #102 How can I use mutes?
- #103 One-shot (repetitions != 0) patterns do not play
- #111 Time signature changes does not get saved on .midi file
- #112 Send midi-control-out message when New Pattern is created in GUI
- #115 Accessing Non-Registered Parameter Numbers (NRPNs) possible?

ISSUES:

Expand Down
13 changes: 11 additions & 2 deletions libseq66/include/play/sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-07-30
* \updates 2024-01-04
* \updates 2024-08-20
* \license GNU GPLv2 or above
*
* The functions add_list_var() and add_long_list() have been replaced by
Expand Down Expand Up @@ -210,6 +210,9 @@ class sequence
/**
* A structure that holds note information, used, for example, in
* sequence::get_next_note().
*
* If the note is invalid (as might happen in searches), then the
* note value is (-1).
*/

class note_info
Expand All @@ -229,7 +232,7 @@ class sequence
note_info () :
ni_tick_start (0),
ni_tick_finish (0),
ni_note (0),
ni_note (0), /* we could initialize this to (-1) */
ni_velocity (0),
ni_selected (false)
{
Expand All @@ -256,6 +259,11 @@ class sequence
return ni_note;
}

bool valid () const
{
return note() >= 0;
}

int velocity () const
{
return ni_velocity;
Expand Down Expand Up @@ -1642,6 +1650,7 @@ class sequence
bool append_event (const event & er);
void sort_events ();
event find_event (const event & e, bool nextmatch = false);
note_info find_note (midipulse tick, int note);
bool remove_duplicate_events (midipulse tick, int note = (-1));
void notify_change (bool userchange = true);
void notify_trigger ();
Expand Down
25 changes: 24 additions & 1 deletion libseq66/src/play/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2015-07-24
* \updates 2024-01-04
* \updates 2024-08-20
* \license GNU GPLv2 or above
*
* The functionality of this class also includes handling some of the
Expand Down Expand Up @@ -3946,6 +3946,29 @@ sequence::find_event (const event & e, bool nextmatch)
return evi != m_events.end() ? *evi : s_null_result ;
}

sequence::note_info
sequence::find_note (midipulse tick, int note)
{
bool found = false;
note_info result;
for (auto cev = cbegin(); ! cend(cev); ++cev)
{
draw status = get_note_info(result, cev);
if (status == draw::linked || status == draw::note_on)
{
found = tick >= result.start() &&
tick < result.finish() && result.note() == note;

if (found || result.start() > tick)
break;
}
}
if (! found)
result.ni_note = (-1);

return result;
}

bool
sequence::remove_duplicate_events (midipulse tick, int note)
{
Expand Down
11 changes: 9 additions & 2 deletions seq_qt5/forms/qseqeditframe64.ui
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="spacer_button_0">
<widget class="QPushButton" name="tooltip_button">
<property name="minimumSize">
<size>
<width>48</width>
Expand All @@ -121,11 +121,14 @@
<height>10</height>
</size>
</property>
<property name="toolTip">
<string>Toggle the display of note tool-tips.</string>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
Expand Down Expand Up @@ -442,6 +445,7 @@ to note events. [ c for selected notes ]</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -528,6 +532,7 @@ to note events. [ c for selected notes ]</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
Expand Down Expand Up @@ -1448,6 +1453,7 @@ or a velocity to force upon input.</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -1490,6 +1496,7 @@ or a velocity to force upon input.</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
Expand Down
18 changes: 15 additions & 3 deletions seq_qt5/include/qseqeditframe64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-06-15
* \updates 2023-11-23
* \updates 2024-08-21
* \license GNU GPLv2 or above
*
*/
Expand Down Expand Up @@ -143,6 +143,8 @@ class qseqeditframe64 final :
);
virtual ~qseqeditframe64 ();

void get_position (int & x, int & y);

void initialize_panels ();
void set_editor_mode (sequence::editmode mode);
void follow_progress (bool expand = false);
Expand Down Expand Up @@ -303,6 +305,7 @@ private slots:
void transpose_notes ();
void transpose_harmonic ();
void remap_notes ();
void tooltip_mode (bool ischecked);
void note_entry (bool ischecked);

/*
Expand Down Expand Up @@ -395,12 +398,21 @@ private slots:
Ui::qseqeditframe64 * ui;

/**
* In progress, wanting modify the parent's title bar if the parent
* is a qseqeditex object.
* We want to support holding this frame in a qseqeditex window, to
* be able modify the parent's title bar and get position information.
* is a qseqeditex object. If null, then this frame is embedded in the
* main window.
*/

qseqeditex * m_qseqeditex_frame;

/**
* This item is not null if this frame is embedded in the main window.
* It is actually the Edit tab widget.
*/

QWidget * m_edit_tab_widget;

/**
* Indicates to compress this window vertically, for use in the Edit tab.
*/
Expand Down
22 changes: 21 additions & 1 deletion seq_qt5/include/qseqroll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2018-01-01
* \updates 2023-12-07
* \updates 2024-08-21
* \license GNU GPLv2 or above
*
* We are currently moving toward making this class a base class.
Expand All @@ -47,6 +47,7 @@
* Forward references
*/

class QLabel;
class QMessageBox;
class QTimer;

Expand Down Expand Up @@ -138,6 +139,7 @@ class qseqroll final : public QWidget, public qseqbase
void set_scale (int scale);
void set_background_sequence (bool state, int seq);
void analyze_seq_notes ();
void show_note_tooltip (int mx, int my);
int note_off_length () const;
bool add_painted_note (midipulse tick, int note);
bool zoom_key_press (bool shifted, int key);
Expand All @@ -161,6 +163,11 @@ class qseqroll final : public QWidget, public qseqbase
void grow_selected_notes (int dx);
#endif

void set_tooltip_mode (bool ischecked)
{
m_show_note_info = ischecked;
}

void move_selected_notes (int dx, int dy);
void snap_y (int & y);
void start_paste();
Expand Down Expand Up @@ -234,6 +241,19 @@ class qseqroll final : public QWidget, public qseqbase

int m_key;

/**
* If true (the default is false), this will allow hovering to show
* the values for a note in a tooltip.
*/

bool m_show_note_info;

/**
* The label that serves as a tooltip.
*/

QLabel * m_note_tooltip;

/**
* Holds the note length in force for this sequence. Used in the
* seq66seqroll module only.
Expand Down
Loading

0 comments on commit 5071ea0

Please sign in to comment.