Skip to content

Commit

Permalink
Added slideshow auto-start option. By default this is enabled for the…
Browse files Browse the repository at this point in the history
… kiosk profile. Also note that the kiosk profile defaults to shuffle mode (with auto-reshuffle at loop-end turned on).
  • Loading branch information
bluescan committed Aug 14, 2023
1 parent 4abfd9f commit 1fadb67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ void Config::ProfileSettings::Reset(Viewer::Profile profile, uint32 categories)

if (categories & Category_Slideshow)
{
SlideshowAutoStart = (profile == Profile::Kiosk) ? true : false;
SlideshowLooping = (profile == Profile::Basic) || (profile == Profile::Kiosk) ? true : false;
SlideshowProgressArc = true;
switch (profile)
Expand Down Expand Up @@ -482,6 +483,7 @@ void Config::ProfileSettings::Load(tExpression expr)
ReadItem(ZoomPerImage);
ReadItem(ConfirmDeletes);
ReadItem(ConfirmFileOverwrites);
ReadItem(SlideshowAutoStart);
ReadItem(SlideshowLooping);
ReadItem(SlideshowProgressArc);
ReadItem(SlideshowAutoReshuffle);
Expand Down Expand Up @@ -647,6 +649,7 @@ bool Config::ProfileSettings::Save(tExprWriter& writer) const
WriteItem(ZoomPerImage);
WriteItem(ConfirmDeletes);
WriteItem(ConfirmFileOverwrites);
WriteItem(SlideshowAutoStart);
WriteItem(SlideshowLooping);
WriteItem(SlideshowProgressArc);
WriteItem(SlideshowAutoReshuffle);
Expand Down
1 change: 1 addition & 0 deletions Src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ struct ProfileSettings

bool ConfirmDeletes;
bool ConfirmFileOverwrites;
bool SlideshowAutoStart;
bool SlideshowLooping;
bool SlideshowProgressArc;
bool SlideshowAutoReshuffle;
Expand Down
4 changes: 4 additions & 0 deletions Src/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ void Viewer::ShowPreferencesWindow(bool* popen)
ImGui::SameLine();
ShowHelpMark("Display a time remaining indicator when slideshow active.");

ImGui::Checkbox("Auto Start", &Config::Current->SlideshowAutoStart);
ImGui::SameLine();
ShowHelpMark("Should slideshow start automatically on launch.");

ImGui::Checkbox("Looping", &Config::Current->SlideshowLooping);
ImGui::SameLine();
ShowHelpMark("Should slideshow loop after completion.");
Expand Down
5 changes: 4 additions & 1 deletion Src/TacentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3932,7 +3932,7 @@ int main(int argc, char** argv)
#elif defined(PLATFORM_LINUX)
glfwShowWindow(Viewer::Window);
#endif

// I don't seem to be able to get Linux to v-sync.
// glfwSwapInterval(1);
glfwMakeContextCurrent(Viewer::Window);
Expand All @@ -3941,6 +3941,9 @@ int main(int argc, char** argv)
if (Viewer::Config::Global.FullscreenMode)
Viewer::ChangeScreenMode(true, true);

if (Viewer::Config::Current->SlideshowAutoStart)
Viewer::SlideshowPlaying = true;

// Main loop.
static double lastUpdateTime = glfwGetTime();
while (!glfwWindowShouldClose(Viewer::Window) && !Viewer::Request_Quit)
Expand Down

0 comments on commit 1fadb67

Please sign in to comment.