Added an "advanced" option to allow resuming playback automatically on app start.

This commit is contained in:
casey langen 2021-04-11 22:41:12 -07:00
parent e35d117156
commit 6fd0c537b4
4 changed files with 7 additions and 0 deletions

View File

@ -109,6 +109,10 @@ namespace musik {
playback.Prepare(index, time);
playback.QueueEdited(); /* hack to get the play queue view to scroll
to the track we just prepared. */
if (Settings()->GetBool(keys::ResumePlaybackOnStartup, false)) {
playback.GetTransport().Resume();
}
}
});
}

View File

@ -46,6 +46,7 @@ namespace musik { namespace core { namespace prefs {
const std::string keys::AutoSyncIntervalMillis = "AutoSyncIntervalMillis";
const std::string keys::RemoveMissingFiles = "RemoveMissingFiles";
const std::string keys::SyncOnStartup = "SyncOnStartup";
const std::string keys::ResumePlaybackOnStartup = "ResumePlaybackOnStartup";
const std::string keys::Volume = "Volume";
const std::string keys::RepeatMode = "RepeatMode";
const std::string keys::TimeChangeMode = "TimeChangeMode";

View File

@ -50,6 +50,7 @@ namespace musik { namespace core { namespace prefs {
extern const std::string AutoSyncIntervalMillis;
extern const std::string RemoveMissingFiles;
extern const std::string SyncOnStartup;
extern const std::string ResumePlaybackOnStartup;
extern const std::string Volume;
extern const std::string RepeatMode;
extern const std::string TimeChangeMode;

View File

@ -126,6 +126,7 @@ static inline std::shared_ptr<ISchema> AdvancedSettingsSchema() {
schema->AddInt(core::prefs::keys::IndexerThreadCount, DEFAULT_MAX_INDEXER_THREADS);
schema->AddInt(core::prefs::keys::IndexerTransactionInterval, 300);
schema->AddString(core::prefs::keys::AuddioApiToken, "");
schema->AddBool(core::prefs::keys::ResumePlaybackOnStartup, false);
return schema;
}