Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Playback History Qt-only plugin #138

Merged

Conversation

vedgy
Copy link
Contributor

@vedgy vedgy commented May 2, 2023

Copy and modify the playlist-manager-qt plugin code.

A similar feature was requested in #553. However, this initial version of the playback history plugin tracks and displays only album history, not individual song/track history. Playback start/stop time is not tracked or shown either.

@vedgy vedgy force-pushed the add-history-plugin branch 3 times, most recently from d3d32ed to eedc773 Compare May 4, 2023 12:28
@jlindgren90
Copy link
Member

Looks like a nice plugin, except some of the limitations seem quite significant:

tracks and displays only album history, not individual song/track history

History entries are stored only in memory and are lost on Audacious exit.

I wonder how many users actually want a plugin that remembers only album history, and forgets it on exit?

@vedgy
Copy link
Contributor Author

vedgy commented May 6, 2023

My use case is listening to music while not otherwise using computer (the display is off). Then being able to tell what was playing. Storing and loading history is useless then.

Implementing storing and loading in an ini file is relatively easy. So if someone needs it, they can jump in. But there is a complication of automatic removal of old entries to limit the growth of history.

Tracking individual songs calls for automatic history cleanup as well, because the history will grow faster. Plus plugin preferences has to be implemented to choose between album and track history.

I don't want to implement either feature, because I'm not going to use them and can't be sure what exact behavior would be desired by the users who need these features.

@vedgy
Copy link
Contributor Author

vedgy commented May 7, 2023

I wonder how many users actually want a plugin that remembers only album history, and forgets it on exit?

While it's not exactly what many people want, the feature can be somewhat useful to random-song users too. The playlist Entry Number of a first played song in an album is stored. Selecting a history entry selects this song in the playlist. Assuming the playlist is unmodified, one can follow the played songs. Except when consecutive songs happen to be picked from a common album.

@vedgy
Copy link
Contributor Author

vedgy commented May 17, 2023

Will this plugin become mergeable if I add a song history option? A group box with two radio buttons Song history and Album history or a History mode combobox with two items Song and Album?

@jlindgren90
Copy link
Member

Sorry for the delayed response, but I just haven't had time to review this so far.

@vedgy
Copy link
Contributor Author

vedgy commented Jun 17, 2023

No problem. I'll wait for a review.

@vedgy
Copy link
Contributor Author

vedgy commented Oct 3, 2024

Resolved trivial conflicts and rebased on master. Will integrate relevant changes since my last testing, if any, from the copied-and-modified plugin playlist-manager-qt. Then perhaps add the discussed song history option.

EDIT: the Playback History plugin still works well and I found no relevant changes to integrate. I'll work on the song history option now.

vedgy added 4 commits October 5, 2024 16:46
Copy and modify the playlist-manager-qt plugin code.

A similar feature was requested in #553. However, this initial version
of the playback history plugin tracks and displays only album history,
not individual song/track history. Playback start/stop time is not
tracked or shown either.
The implementation is straightforward, because audqt::TreeView already
supports removing selected rows.
The added feature allows to follow playback history in the playlist
without activating history entries, i.e. without affecting playback.
@vedgy vedgy force-pushed the add-history-plugin branch from 0702921 to 81605bb Compare October 6, 2024 13:27
@vedgy
Copy link
Contributor Author

vedgy commented Oct 6, 2024

Made a few changes that do not require retesting to the first 3 commits. Implemented the Song mode and preferences to switch between the Song and the Album modes. Tested everything again. Please review.

I hope permanent history storage is not a requirement for merging. Implementing permanent storage would require adding a history size limit option and implementing automatic history cleanup. Maybe also changing the type of m_entries from Index<HistoryEntry> to QList<HistoryEntry> and declaring HistoryEntry as Q_RELOCATABLE_TYPE in order to support efficient removal from the front (assuming Qt 6).

By the way, perhaps it makes sense to declare HistoryEntry as Q_RELOCATABLE_TYPE in the first existing commit just in case it's needed in the future? (or rather Q_MOVABLE_TYPE to support Qt 5 as well as Qt 6)

@jlindgren90
Copy link
Member

@radioactiveman can you review this? Not sure when I will be able to get to it.

@radioactiveman
Copy link
Member

@radioactiveman can you review this? Not sure when I will be able to get to it.

Yes, I will try out the plugin and review its code when finding some time.

@radioactiveman radioactiveman merged commit 92d8487 into audacious-media-player:master Jan 10, 2025
11 checks passed
@radioactiveman
Copy link
Member

Thanks @vedgy for your nice work on the new plugin.
I pushed some additional minor changes and merged it all now. Sorry that it took so long.

Happy New Year to you and Slava Ukraini. 🇺🇦

@@ -90,7 +90,7 @@ static const audqt::MenuItem main_items[] = {

static const audqt::MenuItem playback_items[] = {
audqt::MenuCommand ({N_("Song Info ..."), "dialog-information", "I"}, audqt::infowin_show_current),
audqt::MenuCommand ({N_("Playback History ..."), "view-history", "H"}, action_playback_history),
audqt::MenuCommand ({N_("Playback History ..."), nullptr, "H"}, action_playback_history),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locate view-history finds the view-history icon in 3 icon themes on my system: breeze, breeze-dark and oxygen. What happens when the icon is missing, as I assume is the case on your system?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then this icon seems to be KDE specific. When it is missing no icon is shown.

Copy link
Contributor Author

@vedgy vedgy Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no harm in case of the system icon theme that does not have the icon, then why not show the icon on systems where it is available? The standard icon name list is rarely updated. As far as I know, popular non-standard icon names are adopted by icon themes informally. That's probably how it always worked before the standard was created.

EDIT: from the link in your commit message:

Publication Date: August 9 2007, Version: Version 0.8.90

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, please check my two last commits from my fork. Can I merge them into the main repo?

Copy link
Contributor Author

@vedgy vedgy Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both commits look good, thank you. Please merge.

By the way, defining QT_NO_CAST_FROM_ASCII project-wide is considered a good Qt practice. KDE projects define it by default. One benefit is that disabling implicit conversions forces developers to consider which encoding the string is in and whether it is translatable. If the string is not translatable, QLatin1String or QStringLiteral() can be used for optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants