Commit Graph

1030 Commits

Author SHA1 Message Date
Lukas Prediger bb618efc5d Transcoder now accepts URLs for sources. 2022-01-10 16:39:58 +00:00
Lukas Prediger 6b03b8f5d1 CddaSongLoader now emits a Finished signal if no further updates will follow for the same disc read. 2021-09-21 10:53:43 +01:00
Lukas Prediger b0704331d7 Integrate file name format options into RipCDDialog
for consistency with OrganiseDialog and reducing code duplication
2021-08-31 10:19:32 +01:00
Lukas Prediger a6fef97cac Separating out filename formatting options into separate widget.
First step towards unifying filename formatting over different dialogs.
2021-08-31 10:19:32 +01:00
Jonas Kvinge f379ad84d4 Fix use of emit
Adds missing emits.

QTreeView::collapse and QTreeView::expand are slots, not signals. So
remove emit.
2021-07-14 10:18:47 +01:00
Jonas Kvinge 0c1b6a2a44 Fix setting task blocking library scans
TaskManager::SetTaskBlocksLibraryScans() takes the ID of the task.
2021-07-14 10:18:01 +01:00
Jonas Kvinge 598e660aeb Unref bus in SongLoader::LoadRemote()
See: https://developer.gnome.org/gstreamer/stable/GstPipeline.html#gst-pipeline-get-bus
2021-07-14 10:17:50 +01:00
Jim Broadus 6240fd3d0a player: Fix crash on UrlHandler error.
In a case where a playlist is composed entirely of unresolvable
internet service URLs and the playlist is set to repeat, playing an
item will result in an infinite (until crash) recursive condition.
HandleLoadResult is called with a NoMoreTracks result. It then calls
NextItem, which calls PlayAt for the next item, which, again, calls
HandleLoadResult.

This can be reproduced by logging into a subsonic server, adding items
to an empty playlist, then signing out.

To solve this, separate the error condition from the NoMoreTracks
result. Handle URL resolution errors the same way that media playback
errors are handled, where an error count is incremented and the player
stops if a limit is reached. The common code also notifies the playlist
of the error and provides user feedback by graying out the item.
2021-06-21 12:52:25 +01:00
Robin Ekman 0dbefa3064 Add a shortcut to go to next album 2021-06-03 17:06:48 +01:00
Jim Broadus 776bd3b022 settings: Add option to guess song metadata
Add "Try to guess missing metadata" option to the Song Metadata page
that controls the setting in SongPathParser.
2021-05-24 15:23:05 +01:00
Jim Broadus 1309c76bec tagreader: Relocate artist/album/title guessing code
Move the code that attempts to fill missing song metadata out of the
tagreader worker. In the main process, it will be controllable using
settings and calling context.

The methods were moved into a new SongPathParser class that checks new
settings to determine if action should be taken.
2021-05-17 13:20:34 +01:00
diracsbracket 8c1bdc1a45 Changed to const reference 2021-04-28 21:51:12 +01:00
diracsbracket 1646ab2221 Corrected comments + Added reference to Song& + use non-default
constructor for QFileInfo.

Forgot to apply clang-format so applied 2nd commit and squashed
both
2021-04-28 21:51:12 +01:00
diracsbracket 66a34a906a Removed unneeded empty arguments already provided by defaults 2021-04-28 21:51:12 +01:00
diracsbracket 444f1e2e69 clang-format correction 2021-04-28 21:51:12 +01:00
diracsbracket b7a995d223 Re-added log message for URL and mime-type. 2021-04-28 21:51:12 +01:00
diracsbracket fb391a7fbe Optimization to avoid save+delete of remote playlists to temporary file 2021-04-28 21:51:12 +01:00
Jim Broadus f04657e7e7 Replace qrand usage with QRandomGenerator
QRandomGenerator was introduced in 5.10 and qrand has since been
deprecated. QRandomGenerator::global() returns a global instance that
has been securely seeded. QRandomGenerator provides methods that
generate values within ranges, so taking a modulus of the result isn't
necessary.
2021-04-20 10:31:07 +01:00
Jim Broadus cd41f706af libclementine-common: Move timeconstants.h to common location
This header is used by code in /ext, so move it out of /src. This is the
last /ext dependency on /src.
2021-03-17 18:26:51 +00:00
Fabio Bas 6a45edaa34 Removed dirty hack in InternetModel; added "radiobrowser:" url handler; rework station play callback 2021-03-16 11:03:00 +00:00
Fabio Bas 3e31094227 Initial RadioBrowser support: implemented search, groups by category, top 100 2021-03-16 11:03:00 +00:00
Fabio Bas e7768948e0 Initial radio-browser.info support 2021-03-16 11:03:00 +00:00
Jim Broadus dfb953a78f player: Emit request URL in SongChangeRequestProcessed
Use the request URL rather than the media URL when emitting the
SongChangeRequestProcessed signal. The request URL is the URL that the
PlaylistManager, which is the only consumer of this signal, knows about.
However, in the current cases, the url is only checked by the playlist
when the two URLs should be the same.
2021-03-12 15:20:42 +00:00
Jim Broadus bde6d9cc5b player: Add original request URL to playback request 2021-03-12 15:20:42 +00:00
Jim Broadus 2339404852 player: Send request when reporting playback status
Modify the signals emitted by the engine when a url is determined to be
valid or invalid to send the entire request. This will allow additional
metadata to be added to the request, providing a mechanism to better
identify the request source.
2021-03-12 15:20:42 +00:00
Jim Broadus b989a674a4 application: Add splash during initialization
Since initialization on first startup or during a database schema update
can take several seconds, show a splash screen. In the initial
implementation, this is just a small Clementine logo.

The benefit of instantiating the splash in the Application class rather
than in main is that it could eventually show status messages during
startup. However, this implementation does not use the
QSplashScreen::finish mechanism that would synchronize the hiding of the
splash screen with the showing of the main window.
2021-02-21 14:18:54 +00:00
Jim Broadus 59864bf1b6 application: Add a Starting() slot to Application
Add a slot that is invoked when the main application loop starts. This
can be used to perform setup tasks after the initialization has
occurred. Initial use is to hide a splash.
2021-02-21 14:18:54 +00:00
Jim Broadus 1a3828e2c1 protobuf: Fix namespace conflict
Protobuf 3.15 adds a namespace alias for "pb" that conflicts with
Clementine's. Modify Clementine to use "cpb".

Patch provided by @ahesford

Reference: 5c028d6cf4/src/google/protobuf/port.h (L44)
2021-02-21 14:17:26 +00:00
Jim Broadus 57a6fe4f20 utilities: Add common method for bug report URL generation
Move code from PodcastParser::ParseItem for reuse.

Example:
Calling Utilities::MakeBugReportUrl("New bug") returns:
https://github.com/clementine-player/Clementine/issues/new?title=New%20bug
2021-02-03 00:32:00 +00:00
Jim Broadus 7ba322b10b debug: Generalize debug feature check
Move the debug console variable check to a static method in the
Application class and use environment variable CLEMENTINE_DEBUG instead
of CLEMENTINE_DEBUG_CONSOLE. This will allow debug features to be
enabled elsewhere in the code.

Example:
CLEMENTINE_DEBUG=1 clementine
2021-01-27 15:14:40 +00:00
Maarten Jacobs cb88954a3b Changed usage of boolean to enumeration
Changed the NextInternal() and NextItem() methods to use a enumerated value to track whether "next track" or "next album" is desired
2021-01-26 23:35:10 +00:00
Maarten Jacobs 8fcdbd5114 Adding a "play next album" function, in addition to "play next
track".

Changed shortcut key for Next Album from "space" to F9

Fixed indentation in player.cpp

Fixed spacing in player.cpp.

Updated player.cpp to ensure while loop takes into consideration the last
song on the playlist.

Fixed lint formatting error in player.cpp

Additional changes to player.cpp to make sure next album search reacts properly to the given repeat mode.

Updated player.cpp to address cpplint issues.

Fixing formatting issues.

Fixing formatting errors.

Finished formatting updates.

Final formatting...

Final formatting

Really final formatting...

Addressed issues from code review.

Added functionality to disable Next Album option when repeat mode is "repeat track".

Added commentary to recent changes.

Disable Next Album action also when Repeat Mode is Repeat_Album

In addition to disabling this action for the Next_Track repeat mode, the same applies to the Next_Album repeat mode.
2021-01-26 23:35:10 +00:00
Jim Broadus 409c6b89d1 gstengine: Add a gstreamer debug console page
New page initially provides a button that triggers a dump of a graph of the main
pipeline.
2021-01-01 16:26:29 +00:00
Jim Broadus 0ee64a32f6 console: Add a mechanism to allow components to add pages
Add a MainWindow signal that is emitted when a debug console is created. Relay
that signal to the Application. Add an AddPage method to the Console class that
allows components to populate pages when they receive the signal.
2021-01-01 16:26:29 +00:00
Jim Broadus c999fc70e2 Fix hang during internet model reset
An old hack was notifying MergedProxyModel users that max int rows had been
removed when a submodel was reset. This caused the code that invalidates
selected items to spin for a very long time. A modelAboutToBeReset signal,
introduced in Qt 4.6, allows notification before the submodel information is
lost.

Note: there is one other case, in RemoveSubModel, where this hack is used.
This is only called when a device is removed and doesn't trigger this
condition, but it should probably be addressed in the future.
2020-12-22 20:40:05 +00:00
Matthieu Bruel 9714b0632d All changes for ClemRemote v1.0 (in one go) 2020-12-17 12:23:30 +00:00
NicolasToussaint 7b3e2dfd8c PlayPlaylist: set current and not active playlist to selection 2020-11-30 01:50:58 +00:00
NicolasToussaint b2044a5be5 apply PR recomendations 2020-11-28 20:24:56 +00:00
NicolasToussaint ee72b974bf add CLI play-playlist option, to play given playlist name. 2020-11-28 20:24:56 +00:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus 2e921c6584 organise: Add a tag override mechanism to OrganiseFormat
Add a method to set override tag values when formatting a song name.
The use case for this is transcoding where the extension will change.
2020-06-07 14:45:50 +01:00
Jim Broadus 22cfade4a4 organise: Refresh filename after transcode 2020-06-07 05:34:08 +01:00
Jim Broadus 84099f2491 Name all threads created by Application
In Application::MoveToNewThread, name the new thread after the object being
moved. Give those objects names as well.

The thread names display in gdb with "info threads".
2020-05-27 10:22:00 +01:00
Jim Broadus 32367d2d45 Add a name to the application class for debug purposes 2020-05-26 16:57:59 +01:00
Jim Broadus 8f56fbb83b Fix timer errors on exit
The NetworkRemote is moved to a new thread after creation. On that thread, its
child classes create timers. When the network remote class is deleted on the
main thread, we see "Timers cannot be stopped from another thread".

To avoid this error, use deleteLater to delete NetworkRemote and its composition
classes on its own thread.
2020-05-19 10:39:06 +01:00
Jim Broadus e338939c8b Add optional auth info to LoadResult.
Add auth_header_ to LoadResult. If it exists, populate the MediaPlaybackRequests
headers with an Authorization header with that value.
2020-03-12 18:08:14 +00:00
Jim Broadus 9ed5503ee3 Add MediaPlaybackRequest class.
Add a class to wrap the URL in the playback engines. In the future, this will
contain authentication information for the specified URL. It can also include
the start and end time as well as other data that is currently specified along
with the URL.
2020-03-11 10:57:21 +00:00
Jim Broadus 2179027a6d Prevent global shortcut crash on wayland.
The 3rd party qxt library assumes X11 on linux systems. Don't register
QxtGlobalShortcutBackend when using Wayland.
2020-02-23 16:05:57 +00:00
Jim Broadus bb736d1156 Prevent accidental usage of /usr/bin/data
Clementine detects a data directory in the same directory as the executable to
determine portable configuration. But there are some packages that create
/usr/bin/data, causing Clementine to run in portable mode.

Use a more unique data directory name, clementine-data, as the portable data
directory. For backwards compatibility, use the legacy data directory if the
already exists there.
2020-02-23 16:04:42 +00:00
Jim Broadus 9116dfde7d Remove query string that may include auth info. 2020-02-17 20:31:06 +00:00